dsp-semactic 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +8 -8
- package/dist/index.es.js +265 -265
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),al=require("vue-i18n"),Zl=["data-chart-type"],Wl={class:"dss-chart-header-titles"},ql={key:0,class:"dss-chart-title"},Ul={key:1,class:"dss-chart-subtitle"},Xl=["onClick","onMouseenter"],Yl={class:"dss-legend-text"},jl=["onClick","onMouseenter"],Kl={class:"dss-legend-text"},Gl=["title"],Ql=["src"],Jl={class:"dss-chart-area-wrapper"},ea={key:0,class:"dss-chart-z-axis-label"},ta=["width","height","data-smooth","data-animated"],na={id:"chart-clip"},oa=["x","y","width","height"],la=["id"],aa=["d"],sa=["id"],ra=["d"],ia={key:0},ca={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},da=["x1","x2","y1","y2"],ua={class:"dss-axes"},ma=["x1","x2","y1","y2"],pa=["x1","x2","y1","y2"],va={class:"dss-axis-labels"},fa=["x","y"],ga=["x","y"],ha=["x","y"],ya=["y","transform"],ka={key:1,class:"dss-flag-markers"},Ca={"clip-path":"url(#chart-clip)"},ba=["x1","x2","y1","y2","onMouseover"],wa=["x1","x2","y1","y2","onMouseover"],xa=["x1","x2","y1","y2","onMouseover"],Ea=["cx","cy","onMouseover"],Va=["cx","cy","fill","onMouseover"],Na=["x","y"],Sa={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ma={key:0},Ba=["d","onMouseover"],Ta=["x","y","width","height","fill","onMouseover"],Ha={class:"dss-line-chart"},$a=["d","stroke","stroke-width"],La=["d","stroke","stroke-width","opacity"],_a=["cx","cy","r","fill","onMouseover"],Aa={key:1},Da=["d","stroke","stroke-width"],Ra=["d","stroke","stroke-width"],Ia=["d","stroke","stroke-width","opacity"],Fa=["cx","cy","r","fill","onMouseover"],za={key:2},Pa=["id"],Oa=["x","y","width","height"],Za=["d","fill","fill-opacity","mask"],Wa=["d","stroke","stroke-width"],qa=["d","fill","onMouseover"],Ua=["x","y","width","height","onMouseover"],Xa={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ya=["x1","x2","y1","y2","stroke"],ja=["cx","cy","r","fill"],Ka={key:1,class:"dss-bubble-chart"},Ga={key:0,class:"dss-bubble-group"},Qa=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ja=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],es=["transform"],ts=["cx","cy","r"],ns=["data-chart-type","clip-path"],os=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],ls={key:1,class:"dss-radial-segment-data-labels"},as=["x","y"],ss=["x","y","font-size","fill"],rs=["x1","y1","x2","y2","stroke"],is=["x1","y1","x2","y2","stroke"],cs=["x","y","text-anchor","font-size"],ds=["transform"],us={key:0,class:"dss-spider-grid"},ms=["cx","cy","r"],ps={class:"dss-spider-grid-labels"},vs=["x","y"],fs=["x","y"],gs=["x1","x2","y1","y2"],hs={class:"dss-spider-labels"},ys=["x","y","text-anchor","dominant-baseline"],ks=["points","fill","fill-opacity","stroke","stroke-width"],Cs=["cx","cy","r","fill","onMouseover"],bs={class:"dss-chart-logos"},ws=["cx","cy","r","fill"],xs=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Es=["onClick","onMouseenter"],Vs=["src"],Ns={class:"dss-marker-tooltip-category"},Ss={key:0,class:"dss-marker-tooltip-description"},Ms={key:0,class:"dss-tooltip-section"},Bs={key:0,class:"dss-tooltip-title"},Ts={class:"dss-tooltip-series-name"},Hs={class:"dss-tooltip-series-value"},$s={key:1,class:"dss-tooltip-section"},Ls={key:0,class:"dss-tooltip-title"},_s={class:"dss-bubble-tooltip-data"},As={key:2,class:"dss-tooltip-section"},Ds={class:"dss-tooltip-title"},Rs={class:"dss-tooltip-value"},Is={key:0,class:"dss-tooltip-section"},Fs={class:"dss-tooltip-section-title"},zs={class:"dss-tooltip-group-header"},Ps={class:"dss-tooltip-item-content"},Os={class:"dss-tooltip-item-text"},Zs={key:1,class:"dss-tooltip-section"},Ws={class:"dss-tooltip-section-title"},qs={class:"dss-tooltip-item-content"},Us={class:"dss-tooltip-item-title"},Xs={key:0,class:"dss-tooltip-item-description"},Ys={class:"dss-tooltip-section"},js={class:"dss-tooltip-title"},Ks={key:0,class:"dss-bubble-tooltip-data"},Gs={class:"dss-tooltip-series-name"},Qs={class:"dss-tooltip-series-value"},Js={key:0,class:"dss-tooltip-section"},er={class:"dss-tooltip-section-title"},tr={class:"dss-tooltip-group-header"},nr={class:"dss-tooltip-item-content"},or={class:"dss-tooltip-item-text"},lr={key:1,class:"dss-tooltip-section"},ar={class:"dss-tooltip-section-title"},sr={class:"dss-tooltip-item-content"},rr={class:"dss-tooltip-item-title"},ir={key:0,class:"dss-tooltip-item-description"},cr={key:1,class:"dss-context-menu-separator"},dr={key:0,class:"dss-context-menu-separator"},ur={key:0,class:"dss-context-menu-separator"},mr=["onClick"],pr=["innerHTML"],vr={key:0,class:"dss-context-menu-icon"},fr={class:"dss-marker-modal-header"},gr={class:"dss-marker-modal-body"},hr={class:"dss-form-group"},yr={key:0},kr={key:1},Cr=["disabled"],br=["value"],wr={class:"dss-form-group"},xr={for:"dss-marker-description"},Er={key:0,class:"dss-form-text-display"},Vr=["placeholder"],Nr={class:"dss-form-group"},Sr={class:"icon-preview"},Mr=["src"],Br={class:"dss-marker-modal-footer"},Tr={class:"modal-footer-left"},Hr={class:"dss-modal-footer-right"},$r=["disabled"],Lr={name:"DSSChart"},_r=Object.assign(Lr,{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:Z=>typeof Z=="object"&&Z!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(Z,{emit:jt}){const{t:P,locale:D}=al.useI18n(),Ie=jt,V=e.ref(null),Ce=e.ref(null),Ge=e.ref(null),gt=e.ref(0),v=e.ref(0);let be=null;const Le=20,Ne=e.computed(()=>{if(!V.value||!Ce.value)return 0;try{const t=V.value.getBoundingClientRect();return Ce.value.getBoundingClientRect().top-t.top}catch{return 0}}),I=Z,re={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}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:"25%",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:!0,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function $e(t,s){const o=Object.assign({},t);return Pt(t)&&Pt(s)&&Object.keys(s).forEach(c=>{Pt(s[c])?c in t?o[c]=$e(t[c],s[c]):Object.assign(o,{[c]:s[c]}):Object.assign(o,{[c]:s[c]})}),o}const qe=()=>{let t=20,s=0,o=0;if(Q.value&&(t+=30),Ee.value&&(t+=25),_e.value&&I.series.length>0){const c=I.series.filter((g,h)=>!st.value.has(h)).length;if(Ze.value==="top"||Ze.value==="bottom"){if(on.value==="horizontal"){const h=Math.floor(Ue.value/100);s=Math.ceil(c/h)*25+10}else s=c*25+10;t+=s}else o=150}return{height:t,legendHeight:s,legendWidth:o}};function Pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>$e(re,I.options)),ht=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Dt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Ue=e.computed(()=>{const t=O.value;return ht.value?gt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ae=e.ref(Le),Qe=e.computed(()=>{const t=O.value;return Dt.value?Math.max(0,(v.value||400)-Ae.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),fe=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),kn=e.computed(()=>{const t=I.series.map(s=>s.type||fe.value);return new Set(t).size>1}),Q=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),Ee=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),_n=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ot=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),yt=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),pn=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Wn;const s=t.yAxis.min;return typeof s=="number"||s===Wn?s:Wn}),Kt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Wn;const s=t.yAxis.max;return typeof s=="number"||s===Wn?s:Wn}),Bn=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),nt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Fe=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),_e=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Ze=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),on=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Cn=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),He=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),bn=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Bt=e.computed(()=>{const t=O.value;return t&&t.zoom&&t.zoom.enabled!==!1}),ln=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),vo=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ye=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),je=e.computed(()=>{if(!gn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),kt=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Lt=e.computed(()=>{const{maxX:t}=tt.value;return t===0}),_t=(t,s)=>Lt.value&&s===0?5:s,Ct=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Et=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),me=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),he=e.computed(()=>{const t=O.value;return Et.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ct=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),bt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),Gt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dt=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),ze=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Ke=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),ge=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Xe=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Vt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Te=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ot=e.computed(()=>O.value?.spider?.gridSteps||5),Ht=e.computed(()=>{const t=[],s=ot.value;for(let o=1;o<=s;o++)t.push(Pe.value/s*o);return t}),We=t=>{const s=ut.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const o=Ht.value[t];return Math.round(o/Pe.value*100)+"%"},ut=e.computed(()=>O.value?.spider?.gridLabels||null),lt=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),at=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),an=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Nt=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:we.value}),Rt=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),vn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),wn=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),sn=t=>{const s=wn.value;if(t==null)return"";const o=String(t);return s?o+s:o},io=e.computed(()=>!F.value.isZooming);e.computed(()=>rt.value.map(t=>{if(t.categoryIndex!==void 0&&(Yt.value||wt.value)){const s=Mt(t.categoryIndex),o=Ne.value+B.value.bottom-vn.value/2;return{...t,x:s,y:o}}return t}));function It(t,s){const o=new Date(t);let c=0,g=1/0;return s.forEach((h,w)=>{const[C,S,H]=h.split("-"),L=new Date(`20${H}`,S-1,C),_=Math.abs(L-o);_<g&&(g=_,c=w)}),c}const An=e.computed(()=>{const t=I.markers.map(o=>{const c=It(o.marker_date,I.categories),g=Mt(c),h=Ne.value+B.value.bottom-vn.value/2;return{...o,x:g,y:h,categoryIndex:c,source:"props"}}),s=rt.value.map(o=>{if(o.categoryIndex!==void 0&&(Yt.value||wt.value)){const c=Mt(o.categoryIndex),g=Ne.value+B.value.bottom-vn.value/2;return{...o,x:c,y:g,source:"internal"}}return{...o,source:"internal"}});return[...t,...s]}),xn=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),Dn=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),M=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),A=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),T=e.computed(()=>{const t={left:B.value.left,top:B.value.top,width:B.value.width,height:B.value.height};let s,o;const c=String(M.value);if(c.includes("%")){const g=parseFloat(c)/100;s=t.width*g,o=s*(96/499)}else{const g=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(g/25),o=s*(96/499)}return{width:s,height:o,area:t}}),W=e.computed(()=>{const{width:t,height:s}=T.value,o=A.value;let c,g;const h=B.value.left,w=B.value.right,C=B.value.top,S=B.value.bottom,H=B.value.width,L=B.value.height;switch(o){case"center":c=h+(H-t)/2,g=C+(L-s)/2;break;case"top-left":c=h+15,g=C+90;break;case"top-right":c=w-t-15,g=C+90;break;case"bottom-left":c=h+15,g=S-s+75;break;case"bottom-right":default:c=w-t-15,g=S-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:g+"px",backgroundSize:`${t}px ${s}px`}}),te=t=>!I.flags||!I.flags.length?[]:I.flags.filter(s=>s.categoryIndex===t),de=t=>{const s=te(t),o=Ut(t),c=s.filter(w=>w.manual),g=s.filter(w=>!w.manual),h=[];return c.length>0&&h.push({type:P("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(w=>({text:w.text,color:"#047395"}))}),g.length>0&&h.push({type:P("chart.tooltip.autoFlags"),color:"#0dbf89",flags:g.map(w=>({text:w.text,color:"#0dbf89"}))}),{flagGroups:h,markers:o.map(w=>({title:w.title,description:w.description,type:P("chart.tooltip.markers"),color:w.color||"#FF6B6B"}))}},we=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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"),al=require("vue-i18n"),Zl=["data-chart-type"],Wl={class:"dss-chart-header-titles"},ql={key:0,class:"dss-chart-title"},Ul={key:1,class:"dss-chart-subtitle"},Xl=["onClick","onMouseenter"],Yl={class:"dss-legend-text"},jl=["onClick","onMouseenter"],Kl={class:"dss-legend-text"},Gl=["title"],Ql=["src"],Jl={class:"dss-chart-area-wrapper"},ea={key:0,class:"dss-chart-z-axis-label"},ta=["width","height","data-smooth","data-animated"],na={id:"chart-clip"},oa=["x","y","width","height"],la=["id"],aa=["d"],sa=["id"],ra=["d"],ia={key:0},ca={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},da=["x1","x2","y1","y2"],ua={class:"dss-axes"},ma=["x1","x2","y1","y2"],pa=["x1","x2","y1","y2"],va={class:"dss-axis-labels"},fa=["x","y"],ga=["x","y"],ha=["x","y"],ya=["y","transform"],ka={key:1,class:"dss-flag-markers"},Ca={"clip-path":"url(#chart-clip)"},ba=["x1","x2","y1","y2","onMouseover"],wa=["x1","x2","y1","y2","onMouseover"],xa=["x1","x2","y1","y2","onMouseover"],Ea=["cx","cy","onMouseover"],Va=["cx","cy","fill","onMouseover"],Na=["x","y"],Sa={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ma={key:0},Ba=["d","onMouseover"],Ta=["x","y","width","height","fill","onMouseover"],Ha={class:"dss-line-chart"},$a=["d","stroke","stroke-width"],La=["d","stroke","stroke-width","opacity"],_a=["cx","cy","r","fill","onMouseover"],Aa={key:1},Da=["d","stroke","stroke-width"],Ra=["d","stroke","stroke-width"],Ia=["d","stroke","stroke-width","opacity"],Fa=["cx","cy","r","fill","onMouseover"],za={key:2},Pa=["id"],Oa=["x","y","width","height"],Za=["d","fill","fill-opacity","mask"],Wa=["d","stroke","stroke-width"],qa=["d","fill","onMouseover"],Ua=["x","y","width","height","onMouseover"],Xa={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ya=["x1","x2","y1","y2","stroke"],ja=["cx","cy","r","fill"],Ka={key:1,class:"dss-bubble-chart"},Ga={key:0,class:"dss-bubble-group"},Qa=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ja=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],es=["transform"],ts=["cx","cy","r"],ns=["data-chart-type","clip-path"],os=["d","fill","fill-opacity","stroke","stroke-width","onMouseover"],ls={key:1,class:"dss-radial-segment-data-labels"},as=["x","y"],ss=["x","y","font-size","fill"],rs=["x1","y1","x2","y2","stroke"],is=["x1","y1","x2","y2","stroke"],cs=["x","y","text-anchor","font-size"],ds=["transform"],us={key:0,class:"dss-spider-grid"},ms=["cx","cy","r"],ps={class:"dss-spider-grid-labels"},vs=["x","y"],fs=["x","y"],gs=["x1","x2","y1","y2"],hs={class:"dss-spider-labels"},ys=["x","y","text-anchor","dominant-baseline"],ks=["points","fill","fill-opacity","stroke","stroke-width"],Cs=["cx","cy","r","fill","onMouseover"],bs={class:"dss-chart-logos"},ws=["cx","cy","r","fill"],xs=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Es=["onClick","onMouseenter"],Vs=["src"],Ns={class:"dss-marker-tooltip-category"},Ss={key:0,class:"dss-marker-tooltip-description"},Ms={key:0,class:"dss-tooltip-section"},Bs={key:0,class:"dss-tooltip-title"},Ts={class:"dss-tooltip-series-name"},Hs={class:"dss-tooltip-series-value"},$s={key:1,class:"dss-tooltip-section"},Ls={key:0,class:"dss-tooltip-title"},_s={class:"dss-bubble-tooltip-data"},As={key:2,class:"dss-tooltip-section"},Ds={class:"dss-tooltip-title"},Rs={class:"dss-tooltip-value"},Is={key:0,class:"dss-tooltip-section"},Fs={class:"dss-tooltip-section-title"},zs={class:"dss-tooltip-group-header"},Ps={class:"dss-tooltip-item-content"},Os={class:"dss-tooltip-item-text"},Zs={key:1,class:"dss-tooltip-section"},Ws={class:"dss-tooltip-section-title"},qs={class:"dss-tooltip-item-content"},Us={class:"dss-tooltip-item-title"},Xs={key:0,class:"dss-tooltip-item-description"},Ys={class:"dss-tooltip-section"},js={class:"dss-tooltip-title"},Ks={key:0,class:"dss-bubble-tooltip-data"},Gs={class:"dss-tooltip-series-name"},Qs={class:"dss-tooltip-series-value"},Js={key:0,class:"dss-tooltip-section"},er={class:"dss-tooltip-section-title"},tr={class:"dss-tooltip-group-header"},nr={class:"dss-tooltip-item-content"},or={class:"dss-tooltip-item-text"},lr={key:1,class:"dss-tooltip-section"},ar={class:"dss-tooltip-section-title"},sr={class:"dss-tooltip-item-content"},rr={class:"dss-tooltip-item-title"},ir={key:0,class:"dss-tooltip-item-description"},cr={key:1,class:"dss-context-menu-separator"},dr={key:0,class:"dss-context-menu-separator"},ur={key:0,class:"dss-context-menu-separator"},mr=["onClick"],pr=["innerHTML"],vr={key:0,class:"dss-context-menu-icon"},fr={class:"dss-marker-modal-header"},gr={class:"dss-marker-modal-body"},hr={class:"dss-form-group"},yr={key:0},kr={key:1},Cr=["disabled"],br=["value"],wr={class:"dss-form-group"},xr={for:"dss-marker-description"},Er={key:0,class:"dss-form-text-display"},Vr=["placeholder"],Nr={class:"dss-form-group"},Sr={class:"icon-preview"},Mr=["src"],Br={class:"dss-marker-modal-footer"},Tr={class:"modal-footer-left"},Hr={class:"dss-modal-footer-right"},$r=["disabled"],Lr={name:"DSSChart"},_r=Object.assign(Lr,{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:Z=>typeof Z=="object"&&Z!==null},innerSize:{type:Number,default:null}},emits:["add-marker","update-marker","delete-marker"],setup(Z,{emit:jt}){const{t:P,locale:D}=al.useI18n(),Ie=jt,V=e.ref(null),Ce=e.ref(null),Ge=e.ref(null),gt=e.ref(0),v=e.ref(0);let be=null;const Le=20,Ne=e.computed(()=>{if(!V.value||!Ce.value)return 0;try{const t=V.value.getBoundingClientRect();return Ce.value.getBoundingClientRect().top-t.top}catch{return 0}}),I=Z,re={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}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:"25%",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:!0,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function $e(t,s){const o=Object.assign({},t);return Pt(t)&&Pt(s)&&Object.keys(s).forEach(c=>{Pt(s[c])?c in t?o[c]=$e(t[c],s[c]):Object.assign(o,{[c]:s[c]}):Object.assign(o,{[c]:s[c]})}),o}const qe=()=>{let t=20,s=0,o=0;if(Q.value&&(t+=30),Ee.value&&(t+=25),_e.value&&I.series.length>0){const c=I.series.filter((g,h)=>!st.value.has(h)).length;if(Ze.value==="top"||Ze.value==="bottom"){if(nn.value==="horizontal"){const h=Math.floor(Ue.value/100);s=Math.ceil(c/h)*25+10}else s=c*25+10;t+=s}else o=150}return{height:t,legendHeight:s,legendWidth:o}};function Pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>$e(re,I.options)),ht=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Dt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Ue=e.computed(()=>{const t=O.value;return ht.value?gt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ae=e.ref(Le),Qe=e.computed(()=>{const t=O.value;return Dt.value?Math.max(0,(v.value||400)-Ae.value):t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),fe=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),kn=e.computed(()=>{const t=I.series.map(s=>s.type||fe.value);return new Set(t).size>1}),Q=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),Ee=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),_n=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ot=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),yt=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),pn=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Wn;const s=t.yAxis.min;return typeof s=="number"||s===Wn?s:Wn}),Kt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Wn;const s=t.yAxis.max;return typeof s=="number"||s===Wn?s:Wn}),Bn=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),nt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Fe=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),_e=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Ze=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),nn=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Cn=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),He=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),bn=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Bt=e.computed(()=>{const t=O.value;return t&&t.zoom&&t.zoom.enabled!==!1}),on=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),vo=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ye=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),je=e.computed(()=>{if(!gn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),kt=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Lt=e.computed(()=>{const{maxX:t}=tt.value;return t===0}),_t=(t,s)=>Lt.value&&s===0?5:s,Ct=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Et=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),me=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),he=e.computed(()=>{const t=O.value;return Et.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ct=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),bt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),Gt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),dt=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),ze=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Ke=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),ge=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Xe=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Vt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Te=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ot=e.computed(()=>O.value?.spider?.gridSteps||5),Ht=e.computed(()=>{const t=[],s=ot.value;for(let o=1;o<=s;o++)t.push(Pe.value/s*o);return t}),We=t=>{const s=ut.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const o=Ht.value[t];return Math.round(o/Pe.value*100)+"%"},ut=e.computed(()=>O.value?.spider?.gridLabels||null),lt=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),at=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),ln=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Nt=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:we.value}),Rt=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),vn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),wn=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),an=t=>{const s=wn.value;if(t==null)return"";const o=String(t);return s?o+s:o},io=e.computed(()=>!F.value.isZooming);e.computed(()=>rt.value.map(t=>{if(t.categoryIndex!==void 0&&(Yt.value||wt.value)){const s=Mt(t.categoryIndex),o=Ne.value+B.value.bottom-vn.value/2;return{...t,x:s,y:o}}return t}));function It(t,s){const o=new Date(t);let c=0,g=1/0;return s.forEach((h,w)=>{const[C,S,H]=h.split("-"),L=new Date(`20${H}`,S-1,C),_=Math.abs(L-o);_<g&&(g=_,c=w)}),c}const An=e.computed(()=>{const t=I.markers.map(o=>{const c=It(o.marker_date,I.categories),g=Mt(c),h=Ne.value+B.value.bottom-vn.value/2;return{...o,x:g,y:h,categoryIndex:c,source:"props"}}),s=rt.value.map(o=>{if(o.categoryIndex!==void 0&&(Yt.value||wt.value)){const c=Mt(o.categoryIndex),g=Ne.value+B.value.bottom-vn.value/2;return{...o,x:c,y:g,source:"internal"}}return{...o,source:"internal"}});return[...t,...s]}),xn=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),Dn=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),M=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:"25%"}),A=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),T=e.computed(()=>{const t={left:B.value.left,top:B.value.top,width:B.value.width,height:B.value.height};let s,o;const c=String(M.value);if(c.includes("%")){const g=parseFloat(c)/100;s=t.width*g,o=s*(96/499)}else{const g=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(g/25),o=s*(96/499)}return{width:s,height:o,area:t}}),W=e.computed(()=>{const{width:t,height:s}=T.value,o=A.value;let c,g;const h=B.value.left,w=B.value.right,C=B.value.top,S=B.value.bottom,H=B.value.width,L=B.value.height;switch(o){case"center":c=h+(H-t)/2,g=C+(L-s)/2;break;case"top-left":c=h+15,g=C+90;break;case"top-right":c=w-t-15,g=C+90;break;case"bottom-left":c=h+15,g=S-s+75;break;case"bottom-right":default:c=w-t-15,g=S-s+75;break}return{backgroundPositionX:c+"px",backgroundPositionY:g+"px",backgroundSize:`${t}px ${s}px`}}),te=t=>!I.flags||!I.flags.length?[]:I.flags.filter(s=>s.categoryIndex===t),de=t=>{const s=te(t),o=Ut(t),c=s.filter(w=>w.manual),g=s.filter(w=>!w.manual),h=[];return c.length>0&&h.push({type:P("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(w=>({text:w.text,color:"#047395"}))}),g.length>0&&h.push({type:P("chart.tooltip.autoFlags"),color:"#0dbf89",flags:g.map(w=>({text:w.text,color:"#0dbf89"}))}),{flagGroups:h,markers:o.map(w=>({title:w.title,description:w.description,type:P("chart.tooltip.markers"),color:w.color||"#FF6B6B"}))}},we=e.computed(()=>`data:image/svg+xml;base64,${btoa(`<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="#fafafa"/>
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
<path d="M67.37 43.9C74.0582 43.9 79.48 38.4782 79.48 31.79C79.48 25.1018 74.0582 19.68 67.37 19.68C60.6818 19.68 55.26 25.1018 55.26 31.79C55.26 38.4782 60.6818 43.9 67.37 43.9Z" fill="#fafafa"/>
|
|
19
19
|
<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"/>
|
|
20
20
|
<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"/>
|
|
21
|
-
</svg>`)}`),Ve=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Se=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const $t=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Zt=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),
|
|
22
|
-
`)}})}),
|
|
21
|
+
</svg>`)}`),Ve=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Se=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const $t=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Zt=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),sn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Un=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),ko=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),co=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return no.value&&s&&(s.show===!0||s.enabled===!0)}),Rn=e.computed(()=>{if(!co.value||!yo.value.length)return"";const t=yo.value.reduce((s,o)=>s+(o.value??0),0);return an(t)}),Wt=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),To=e.computed(()=>({x:Je.value,y:et.value-Wt.value/2})),Ho=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),En=e.computed(()=>{if(!Un.value||!gn.value||!yo.value.length)return[];const t=ko.value*Math.PI/180,s=(un.value+Pe.value)/2;return yo.value.map(o=>{const g=o.endAngle-o.startAngle>=t&&!o.isHidden,h=Je.value+Math.cos(o.midAngle)*s,w=et.value+Math.sin(o.midAngle)*s;return{value:an(o.value),x:h,y:w,show:g,color:o.color}})}),$o=e.computed(()=>{if(!I.flags||!I.flags.length)return[];const t=new Map;return I.flags.forEach(s=>{const o=s.categoryIndex;t.has(o)||t.set(o,[]),t.get(o).push(s)}),Array.from(t.entries()).map(([s,o])=>{const c=Mt(s),g=o.filter(w=>w.manual),h=o.filter(w=>!w.manual);return{categoryIndex:parseInt(s),x:c,flags:o,manualCount:g.length,autoCount:h.length,totalCount:o.length,hasManual:g.length>0,hasAuto:h.length>0,texts:o.map(w=>w.text).join(`
|
|
22
|
+
`)}})}),rn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Co=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),uo=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),bo=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),st=e.ref(new Set),K=e.ref(null),In=e.ref(!1),Me=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),fn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),pe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ae=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),F=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),rt=e.ref([]),f=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1});e.computed(()=>{const t=["default"];return Rt.value&&t.push(...Object.keys(Rt.value)),t});const k=e.computed(()=>{if(!I.categories||I.categories.length===0){const{maxX:t}=tt.value;return Array.from({length:t+1},(s,o)=>P("chart.fallback.item",{number:o+1}))}return I.categories}),E=e.computed(()=>f.value.editingMarkerId!==null),$=e.computed(()=>f.value.readonly),U=t=>{st.value.has(t)||(Tt.value=!0,K.value=t)},ye=()=>{Tt.value=!1,K.value=null},Be=t=>{if(vt.value||xt.value){pe.value.show=!1;return}const o=t.currentTarget.getBoundingClientRect(),c=t.clientX-o.left,g=t.clientY-o.top,h=wt.value?c>=B.value.left-50&&c<=B.value.right+50&&g>=B.value.top-50&&g<=B.value.bottom+100:c>=B.value.left&&c<=B.value.right&&g>=B.value.top&&g<=B.value.bottom;if(In.value=h,wt.value){if(!He.value||!h||F.value.isDragging||F.value.isZooming){pe.value.show=!1;return}if(Mo.value.find(q=>!q||q.isHidden?!1:Math.sqrt(Math.pow(q.x-c,2)+Math.pow(q.y-g,2))<=q.radius+3))pe.value.show=!1;else{const q=Mo.value.filter(ne=>!ne||ne.isHidden?!1:Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2))<=250);if(q.length>0){let ne=q[0],G=Math.sqrt(Math.pow(ne.x-c,2)+Math.pow(ne.y-g,2));q.forEach(ee=>{const oe=Math.sqrt(Math.pow(ee.x-c,2)+Math.pow(ee.y-g,2));oe<G&&(G=oe,ne=ee)});const X=30,ke=Mo.value.filter(ee=>!ee||ee.isHidden?!1:Math.abs(ee.x-ne.x)<=X).sort((ee,oe)=>ee.y-oe.y);pe.value={show:!0,x:ne.x,categoryIndex:Math.round(ne.originalX),data:(()=>{const ee=Co.value,oe=uo.value,ce=[];return ke.forEach(ue=>{ee.forEach(Re=>{const Oe=oe[Re]||Re,yn=ol(Re,ue);yn&&ce.push({seriesName:ue.seriesName,label:ue.label,value:`${Oe}: ${yn}`,color:ue.color,y:ue.y})})}),ce})()}}else pe.value.show=!1}return}if(F.value.isDragging&&F.value.scale>1&&Yt.value&&Bt.value){pe.value.show=!1;const se=t.clientX-F.value.lastMouseX,{minX:q,maxX:ne}=tt.value,G=ne-q||1,ke=se*.8;F.value.offsetX+=ke;const ee=G/F.value.scale,oe=G-ee,ce=0,ue=-oe/G*B.value.width,Re=ce;F.value.offsetX=Math.max(ue,Math.min(Re,F.value.offsetX)),F.value.lastMouseX=t.clientX,F.value.lastMouseY=t.clientY;return}if(!He.value||!Yt.value||F.value.isDragging||F.value.isZooming||!h){pe.value.show=!1;return}const{minX:w,maxX:C}=tt.value,S=C-w||1,H=S/F.value.scale,L=w-F.value.offsetX/B.value.width*S,_=(c-B.value.left)/B.value.width,Y=L+_*H,le=Math.round(Y);if(le>=0&&le<=C){const se=Mt(le),q=Sn.value.map((ne,G)=>{const X=I.series.findIndex(ee=>ee===ne),ke=ne.data[le];return{seriesName:ne.name,value:ke!==void 0?ke:null,color:pt(X),y:ke!==void 0?Ft(ke):null}}).filter(ne=>ne.value!==null);pe.value={show:!0,x:se,categoryIndex:le,data:q}}},qt=()=>{pe.value.show=!1,In.value=!1,xt.value=!1,vt.value||(rn.value.show=!1),F.value.isDragging&&(F.value.isDragging=!1),F.value.zoomTimeout&&(clearTimeout(F.value.zoomTimeout),F.value.zoomTimeout=null),F.value.isZooming=!1,setTimeout(()=>{K.value=null,Me.value.show=!1},150)},Tn=t=>{if(t.preventDefault(),t.stopPropagation(),!lt.value)return;const s=t.currentTarget.getBoundingClientRect(),o=t.clientX-s.left,c=t.clientY-s.top;if(gn.value){ae.value.show=!1,e.nextTick(()=>{ae.value.show=!0,ae.value.x=t.clientX,ae.value.y=t.clientY,ae.value.categoryIndex=null});return}const g=Math.max(0,B.value.left-20),h=B.value.right,w=B.value.top,C=B.value.bottom+80;o>=g&&o<=h&&c>=w&&c<=C&&(ae.value.show=!1,e.nextTick(()=>{ae.value.show=!0,ae.value.x=t.clientX,ae.value.y=t.clientY,ae.value.categoryIndex=null;const S=Math.max(B.value.left,Math.min(o,B.value.right))-B.value.left,L=B.value.width/No.value.length,_=Math.floor(S/L);_>=0&&_<No.value.length&&(ae.value.categoryIndex=_)}))},mt=t=>{if(!(t&&t.button===2)){if(ae.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ae.value.show=!1}},Zo=t=>{if(typeof t.template=="function"){const s={series:I.series,categories:I.categories,markers:rt.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:ae.value.categoryIndex};return t.template(s,o)}return t.template||t.label||""},Wo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Xn=t=>t.style||{},Qt=t=>t.type&&Rt.value[t.type]?Rt.value[t.type]:t.customIcon?t.customIcon:Nt.value,qo=t=>t==null?"":I.categories&&I.categories[t]?I.categories[t]:"",Ut=t=>rt.value.length?rt.value.filter(s=>s.categoryIndex===t):[],Yn=t=>{if(!Yt.value&&!wt.value)return{x:0,y:0};const s=Mt(t),o=Ne.value+B.value.bottom-vn.value/2;return{x:s,y:o}},cl=()=>{rt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Yt.value||wt.value)){const s=Yn(t.categoryIndex);t.x=s.x,t.y=s.y}})},dl=()=>{if(f.value.description&&f.value.description.length){if(E.value){const t=rt.value.findIndex(s=>s.id===f.value.editingMarkerId);t!==-1?(rt.value[t].description=f.value.description||"",rt.value[t].color=f.value.color||"",rt.value[t].type=f.value.type||"default",Ie("update-marker",rt.value[t])):Ie("update-marker",{id:f.value.editingMarkerId,description:f.value.description||"",color:f.value.color||"",type:f.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Math.max(0,f.value.categoryIndex);if(wt.value){const{maxX:w}=tt.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else Yt.value&&(s=Math.max(0,Math.min(s,tt.value.maxX)));const o=Mt(s),c=Ne.value+B.value.bottom-vn.value/2,g=Array.isArray(I.categories)?I.categories[s]:null,h={id:t,title:"",description:f.value.description||"",color:f.value.color||"",type:f.value.type||"default",categoryIndex:s,x:o,y:c,marker_date:g||null};f.value.categoryIndex=s,rt.value.push(h),Ie("add-marker",h)}jn(),Uo()}},jn=()=>{f.value.show=!1,f.value.title="",f.value.description="",f.value.color="#FF6B6B",f.value.type="default",f.value.editingMarkerId=null,f.value.readonly=!1,f.value.categoryIndex=null,f.value.fromButton=!1},cn=()=>{E.value&&(ul(f.value.editingMarkerId),jn())},ul=t=>{const s=rt.value.findIndex(o=>o.id===t);s!==-1&&(rt.value.splice(s,1),Uo()),Ie("delete-marker",t)},ml=t=>{f.value.show=!0,f.value.title=t?.title??t?.comment??"",f.value.description=t?.description??t?.comment??"",f.value.color=t?.color??"",f.value.type=t?.type??"default",f.value.editingMarkerId=t?.id??t?.marker_id??null,f.value.readonly=t?.readonly??!1,f.value.categoryIndex=t?.categoryIndex??null},Uo=()=>{try{const t=`dss-chart-markers-${I.chartId}`;localStorage.setItem(t,JSON.stringify(rt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},pl=()=>{try{const t=`dss-chart-markers-${I.chartId}`,s=localStorage.getItem(t);if(s){const o=JSON.parse(s);Array.isArray(o)&&(rt.value=o.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),rt.value=[]}},wo=t=>{const s=Q.value||"Chart",o=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${o}.${t}`},dn=()=>{const t=pe.value.show,s=Me.value.show;return pe.value.show=!1,Me.value.show=!1,{originalCrosshair:t,originalTooltip:s}},Kn=t=>{pe.value.show=t.originalCrosshair,Me.value.show=t.originalTooltip},Vl=async(t,s=32,o=32)=>new Promise((c,g)=>{if(t.startsWith("data:")){c(t);return}const h=new Image;h.crossOrigin="anonymous";const w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);h.onload=()=>{clearTimeout(w);try{const C=document.createElement("canvas"),S=C.getContext("2d");C.width=s,C.height=o,S.fillStyle="#fafafa",S.fillRect(0,0,s,o),S.drawImage(h,0,0,s,o);const H=C.toDataURL("image/png");c(H)}catch(C){console.warn("Canvas conversion failed:",C),c(t)}},h.onerror=C=>{clearTimeout(w),console.warn("Failed to load image:",t,C),c(t)},h.src=t}),Xt=async()=>{try{const t=dn();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),Kn(t);return}const o=qe(),c=Ue.value,g=Qe.value+o.height,h=s.cloneNode(!0);h.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(X=>X.remove());const C=h.querySelectorAll("image"),S=Array.from(C).map(async X=>{const ke=X.getAttribute("xlink:href")||X.getAttribute("href");if(ke&&!ke.startsWith("data:"))try{const ee=await Vl(ke,32,32);X.setAttribute("xlink:href",ee),X.setAttribute("href",ee)}catch(ee){console.warn("Failed to convert logo to base64:",ee)}});await Promise.all(S);const L=new XMLSerializer().serializeToString(h).replace(/<svg[^>]*>/,"").replace("</svg>","");let _="",Y=30;if(Q.value&&(_+=`
|
|
23
23
|
<text x="24" y="${Y}"
|
|
24
24
|
font-family="Arial, sans-serif"
|
|
25
25
|
font-size="18"
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
${L}
|
|
67
67
|
${le}
|
|
68
68
|
</g>
|
|
69
|
-
</svg>`,q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),G=document.createElement("a");G.href=ne,G.download=wo("svg"),document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(ne),Kn(t),mt()}catch(s){console.error("Error downloading SVG:",s),Kn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Gn=async()=>{try{const t=
|
|
69
|
+
</svg>`,q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),G=document.createElement("a");G.href=ne,G.download=wo("svg"),document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(ne),Kn(t),mt()}catch(s){console.error("Error downloading SVG:",s),Kn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Gn=async()=>{try{const t=dn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(X=>setTimeout(X,300));const s=qe(),o=Ue.value,c=Qe.value+s.height,g=document.createElement("canvas"),h=g.getContext("2d"),w=2;g.width=o*w,g.height=c*w,g.style.width=o+"px",g.style.height=c+"px",h.scale(w,w),h.fillStyle="#fafafa",h.fillRect(0,0,o,c);let C=30;if(Q.value&&(h.fillStyle="#333",h.font="bold 18px Arial, sans-serif",h.fillText(Q.value,24,C),C+=30),Ee.value&&(h.fillStyle="#666",h.font="14px Arial, sans-serif",h.fillText(Ee.value,24,C),C+=25),_e.value&&I.series.length>0){let X=o-200,ke=Q.value||Ee.value?35:25;const ee=Math.floor((o-250)/120);let oe=0;h.font="12px Arial, sans-serif",I.series.forEach((ce,ue)=>{if(!st.value.has(ue)){const Re=pt(ue);h.beginPath(),h.arc(X+6,ke-4,6,0,2*Math.PI),h.fillStyle=Re,h.fill(),h.fillStyle="#333",h.fillText(ce.name,X+18,ke),oe++,oe%ee===0?(X=o-200,ke+=20):X+=Math.min(120,ce.name.length*8+35)}})}const H=document.querySelector(".dss-chart-svg").cloneNode(!0),L=H.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),_=H.querySelectorAll(".dss-crosshair"),Y=H.querySelectorAll('[class*="tooltip"]');L.forEach(X=>X.remove()),_.forEach(X=>X.remove()),Y.forEach(X=>X.remove()),H.querySelectorAll("image").forEach((X,ke)=>{const ee=X.getAttribute("xlink:href")||X.getAttribute("href");if(ee&&!ee.startsWith("data:")){const oe=b.value[ke],ce=oe?pt(oe.seriesIndex):"#3B82F6",ue=X.getAttribute("x")||0,Re=X.getAttribute("y")||0,Oe=X.getAttribute("width")||32,yn=X.getAttribute("height")||32,zt=document.createElementNS("http://www.w3.org/2000/svg","circle");zt.setAttribute("cx",parseFloat(ue)+parseFloat(Oe)/2),zt.setAttribute("cy",parseFloat(Re)+parseFloat(yn)/2),zt.setAttribute("r",Math.min(parseFloat(Oe),parseFloat(yn))/2-1),zt.setAttribute("fill",ce),zt.setAttribute("stroke","#fafafa"),zt.setAttribute("stroke-width","2"),X.parentNode.replaceChild(zt,X)}});const se=new XMLSerializer().serializeToString(H),q=new Blob([se],{type:"image/svg+xml;charset=utf-8"}),ne=URL.createObjectURL(q),G=new Image;return new Promise((X,ke)=>{G.onload=async()=>{try{if(h.drawImage(G,0,s.height),b.value.forEach(ee=>{const oe=ee.x,ce=ee.y+s.height,ue=(ee.width||32)/2,Re=pt(ee.seriesIndex);h.save(),h.beginPath(),h.arc(oe,ce,ue-1,0,2*Math.PI),h.fillStyle=Re,h.fill(),h.strokeStyle="#fafafa",h.lineWidth=2,h.stroke(),h.restore()}),xn.value){const ee=new Image,oe=()=>{const{width:ue,height:Re}=T.value,Oe=A.value,yn=B.value.left,zt=B.value.right,ro=B.value.top,Fl=B.value.bottom,Pl=B.value.width,Ol=B.value.height;let Po,Oo;switch(Oe){case"center":Po=yn+(Pl-ue)/2,Oo=ro+s.height+(Ol-Re)/2;break;case"top-left":Po=yn+15,Oo=ro+s.height+10;break;case"top-right":Po=zt-ue-5,Oo=ro+s.height+10;break;case"bottom-left":Po=yn+15,Oo=Fl+s.height-Re-5;break;case"bottom-right":default:Po=zt-ue-5,Oo=Fl+s.height-Re-5;break}h.globalAlpha=Dn.value,h.drawImage(ee,Po,Oo,ue,Re),h.globalAlpha=1,ce()},ce=()=>{g.toBlob(ue=>{const Re=URL.createObjectURL(ue),Oe=document.createElement("a");Oe.href=Re,Oe.download=wo("png"),document.body.appendChild(Oe),Oe.click(),document.body.removeChild(Oe),URL.revokeObjectURL(Re),URL.revokeObjectURL(ne),Kn(t),mt(),X()},"image/png")};ee.onload=oe,ee.onerror=ce,ee.src=ie.value}else g.toBlob(ee=>{const oe=URL.createObjectURL(ee),ce=document.createElement("a");ce.href=oe,ce.download=wo("png"),document.body.appendChild(ce),ce.click(),document.body.removeChild(ce),URL.revokeObjectURL(oe),URL.revokeObjectURL(ne),Kn(t),mt(),X()},"image/png")}catch(ee){URL.revokeObjectURL(ne),Kn(t),ke(ee)}},G.onerror=()=>{URL.revokeObjectURL(ne),Kn(t),ke(new Error("Failed to load SVG image"))},G.src=ne})}catch(t){console.error("Error downloading PNG:",t)}},fo=()=>{try{let t="";Q.value&&(t+=`# ${P("chart.csv.chartTitle")}: ${Q.value}
|
|
70
70
|
`),Ee.value&&(t+=`# ${P("chart.csv.chartSubtitle")}: ${Ee.value}
|
|
71
71
|
`),t+=`# ${P("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
72
72
|
|
|
73
73
|
`,t+="Category",I.series.forEach(h=>{const w=h.name.replace(/"/g,'""');t+=',"'+w+'"'}),t+=`
|
|
74
74
|
`;const s=Math.max(...I.series.map(h=>h.data?.length||0));for(let h=0;h<s;h++){let S='"'+(I.categories[h]||P("chart.fallback.item",{number:h+1})).toString().replace(/"/g,'""')+'"';I.series.forEach(H=>{const L=H.data&&H.data[h]!==void 0?H.data[h]:"";S+=","+L}),t+=S+`
|
|
75
|
-
`}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(o),g=document.createElement("a");g.href=c,g.download=wo("csv"),document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(c),mt()}catch(t){console.error("Error downloading CSV:",t)}},Fn=t=>{if(typeof t.action=="function"){const s={series:I.series,categories:I.categories,markers:rt.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:clampedCategoryIndex||ae.value.categoryIndex};t.action(s,o)}mt()},zn=()=>{jn(),f.value.show=!0,f.value.categoryIndex=ae.value.categoryIndex,f.value.fromButton=!1,mt()},Qn=()=>{jn(),f.value.show=!0,f.value.categoryIndex=0,f.value.fromButton=!0},Pn=t=>{if(ae.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ae.value.show=!1)}},Jt=t=>{ae.value.show&&!t.target.closest(".context-menu")&&(ae.value.show=!1)},$o=t=>{if(!Yt.value||!Bt.value)return;t.preventDefault(),t.stopPropagation(),F.value.isZooming=!0,pe.value.show=!1,F.value.zoomTimeout&&clearTimeout(F.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),c=t.clientX-o.left,g=t.clientY-o.top;if(c<B.value.left-50||c>B.value.right+50||g<B.value.top-50||g>B.value.bottom+100){F.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,w=Math.max(F.value.minScale,Math.min(F.value.maxScale,F.value.scale*h));if(w!==F.value.scale){const{minX:C,maxX:S}=tt.value,H=S-C||1,L=H/F.value.scale,_=C-F.value.offsetX/B.value.width*H,Y=(c-B.value.left)/B.value.width,le=_+Y*L;F.value.scale=w;const se=H/F.value.scale,q=le-Y*se;F.value.offsetX=-(q-C)/H*B.value.width,F.value.scale<=1.01&&(F.value.scale=1,F.value.offsetX=0)}F.value.zoomTimeout=setTimeout(()=>{F.value.isZooming=!1,F.value.zoomTimeout=null},300)},xo=t=>{if(!Yt.value||!Bt.value||F.value.scale<=1)return;pe.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,F.value.isDragging=!0,F.value.lastMouseX=t.clientX,F.value.lastMouseY=t.clientY,t.preventDefault()},Nl=()=>{F.value.isDragging=!1},Lo=()=>{!Yt.value||!Bt.value||(F.value.scale=1,F.value.offsetX=0,F.value.isDragging=!1,F.value.zoomTimeout&&(clearTimeout(F.value.zoomTimeout),F.value.zoomTimeout=null),F.value.isZooming=!1)},vl=()=>!Yt.value||!In.value||!Bt.value?"default":F.value.isDragging?"grabbing":F.value.scale>1?"grab":"dss-crosshair",Xo=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 s=`M ${t[0].x} ${t[0].y}`;for(let o=0;o<t.length-1;o++){const c=t[Math.max(o-1,0)],g=t[o],h=t[o+1],w=t[Math.min(o+2,t.length-1)],C=g.x+(h.x-c.x)/6*me.value,S=g.y+(h.y-c.y)/6*me.value,H=h.x-(w.x-g.x)/6*me.value,L=h.y-(w.y-g.y)/6*me.value;s+=` C ${C} ${S} ${H} ${L} ${h.x} ${h.y}`}return s},Jn=e.computed(()=>{let s=50+(Ot.value?30:0)+60;if(Nn.value)return{left:90,top:90,right:90,bottom:90};if(gn.value){let w=0;Q.value&&(w+=15),Ee.value&&(w+=10);const C=qe();let S=66,H=50;return _e.value&&Ze.value==="left"?S+=C.legendWidth||150:_e.value&&Ze.value==="right"&&(H+=C.legendWidth||150),{left:S,top:50+w,right:H,bottom:130}}let o=0;Q.value&&(o+=15),Ee.value&&(o+=10);const c=qe();let g=66,h=50;return _e.value&&Ze.value==="left"?g+=c.legendWidth||150:_e.value&&Ze.value==="right"&&(h+=c.legendWidth||150),_e.value&&Ze.value==="bottom"&&(s+=c.legendHeight||0),{left:g,top:50+o,right:h,bottom:s}}),B=e.computed(()=>({left:Jn.value.left,top:Jn.value.top,right:Ue.value-Jn.value.right,bottom:Qe.value-Jn.value.bottom,width:Ue.value-(Jn.value.left+Jn.value.right),height:Qe.value-(Jn.value.top+Jn.value.bottom)})),Yt=e.computed(()=>["line","area","bar"].includes(fe.value)||kn.value),Vn=e.computed(()=>kn.value),gn=e.computed(()=>["radial","semi-radial"].includes(fe.value)),Nn=e.computed(()=>fe.value==="spider"),wt=e.computed(()=>fe.value==="bubble"),At=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(fe.value==="bar"||Vn.value)),eo=t=>{const{minY:s,maxY:o}=tt.value,c=o-s||1;return B.value.left+(t-s)/c*B.value.width},to=t=>{const{maxX:s}=tt.value,o=s+1,g=B.value.height/o;return B.value.top+(t+.5)*g},Je=e.computed(()=>Ue.value/2),et=e.computed(()=>Nn.value?Qe.value/2-40:Qe.value/2),Pe=e.computed(()=>{if(Nn.value){const t=B.value.width-80,s=B.value.height-80;return Math.min(t,s)/2}return Math.min(B.value.width,B.value.height)/2}),en=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,o=typeof s=="number"&&s>=0&&s<=1?s:.45;return Pe.value*o}),fl=e.computed(()=>{const t=O.value,s=typeof I.innerSize=="number"?I.innerSize:t?.innerSize;return typeof s!="number"||s<=0||!(gn.value||Nn.value)?1:1+s/100}),Yo=e.computed(()=>{if(fl.value<=1)return;const t=Je.value,s=et.value,o=fl.value;return`translate(${t}, ${s}) scale(${o}) translate(${-t}, ${-s})`}),Hn=e.ref(0),Eo=e.computed(()=>`semi-radial-fill-clip-${I.chartId}`),no=e.computed(()=>fe.value==="semi-radial"),jo=e.computed(()=>no.value&&bt.value&&!nn.value),Sl=e.computed(()=>{const t=jo.value?Hn.value:1,s=Je.value,o=et.value,c=en.value,g=Pe.value,h=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;const C=s+g*Math.cos(h),S=o+g*Math.sin(h),H=s+g*Math.cos(w),L=o+g*Math.sin(w),_=s+c*Math.cos(w),Y=o+c*Math.sin(w),le=s+c*Math.cos(h),se=o+c*Math.sin(h),q=t>.5?1:0;return`M ${s} ${o} L ${C} ${S} A ${g} ${g} 0 ${q} 1 ${H} ${L} L ${_} ${Y} A ${c} ${c} 0 ${q} 1 ${le} ${se} Z`}),Ko=e.computed(()=>no.value&&jo.value?`url(#${Eo.value})`:void 0),mn=e.ref(0),On=e.computed(()=>`radial-reveal-clip-${I.chartId}`),tn=e.computed(()=>fe.value==="radial"),Vo=e.computed(()=>{const t=tn.value?mn.value:1,s=Je.value,o=et.value,c=Math.max(Pe.value*1.5,Ue.value,Qe.value);if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;if(t>=1){const _=s-c,Y=s+c;return`M ${_} ${o} A ${c} ${c} 0 0 1 ${Y} ${o} A ${c} ${c} 0 0 1 ${_} ${o} Z`}const g=-Math.PI/2,h=g+t*Math.PI*2,w=s+c*Math.cos(g),C=o+c*Math.sin(g),S=s+c*Math.cos(h),H=o+c*Math.sin(h),L=t>=.5?1:0;return`M ${s} ${o} L ${w} ${C} A ${c} ${c} 0 ${L} 1 ${S} ${H} Z`}),St=e.computed(()=>{if(Ko.value)return Ko.value;if(tn.value)return`url(#${On.value})`});let go=null;const gl=()=>{if(!jo.value)return;Hn.value=0;const t=dt.value,s=performance.now(),o=c=>{const g=c-s,h=Math.min(1,g/t);Hn.value=$n(Ke.value,h),h<1&&(go=requestAnimationFrame(o))};go=requestAnimationFrame(o)},oo=e.computed(()=>O.value?.bubbles?.minSize||8),mo=e.computed(()=>O.value?.bubbles?.maxSize||50),po=e.computed(()=>O.value?.bubbles?.opacity||.7),lo=(t,s)=>{const o=[15,20,25,18,22],c=o[t%o.length]||20,g=1+Math.sin(s*.5)*.2;return Math.max(5,c*g)},ho=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Ml=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Zn=e.computed(()=>I.series),Sn=e.computed(()=>I.series.filter((t,s)=>!st.value.has(s))),Wn="auto",tt=e.computed(()=>{if(wt.value)return hl();if(!Sn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,o=0;Sn.value.forEach(C=>{C.data&&C.data.length&&(o=Math.max(o,C.data.length-1),C.data.forEach(S=>{typeof S=="number"&&(t=Math.min(t,S),s=Math.max(s,S))}))}),I.categories.length>0&&(o=Math.max(o,I.categories.length-1)),t===1/0&&(t=0,s=100);const c=pn.value,g=Kt.value;let h,w;if(c===Wn){const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}else if(typeof c=="number")h=c;else{const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}if(g===Wn){const C=s-t,S=C>0?C*.1:2;w=s+S}else if(typeof g=="number")w=g;else{const C=s-t,S=C>0?C*.1:2;w=s+S}return{minX:0,maxX:o,minY:h,maxY:w}}),hl=()=>{if(!Sn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,o=1/0,c=-1/0,g=1/0,h=-1/0,w=!1;if(Sn.value.forEach((le,se)=>{le?.data?.length&&le.data.forEach((q,ne)=>{let G,X,ke;if(typeof q=="object"&&q!==null&&!Array.isArray(q))G=typeof q.x=="number"?q.x:ne,X=typeof q.y=="number"?q.y:0,ke=typeof q.size=="number"?q.size:20;else if(Array.isArray(q)&&q.length>=3)G=typeof q[0]=="number"?q[0]:ne,X=typeof q[1]=="number"?q[1]:0,ke=typeof q[2]=="number"?q[2]:20;else if(typeof q=="number")G=ne,X=q,ke=lo(se,ne);else return;isFinite(G)&&isFinite(X)&&isFinite(ke)&&(t=Math.min(t,G),s=Math.max(s,G),o=Math.min(o,X),c=Math.max(c,X),g=Math.min(g,ke),h=Math.max(h,ke),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,I.categories?.length-1||8)),o===c&&(o=Math.max(0,o-10),c=o+20);const C=s-t,S=c-o;let H,L,_,Y;return Bn.value!==null?H=Bn.value:H=t-C*.1,nt.value!==null?L=nt.value:L=s+C*.1,pn.value!==null&&typeof pn.value=="number"?_=pn.value:_=Math.max(0,o-S*.1),Kt.value!==null&&typeof Kt.value=="number"?Y=Kt.value:Y=c+S*.1,{minX:H,maxX:L,minY:_,maxY:Y,minSize:g,maxSize:h}},Mt=t=>{if(wt.value){const{minX:C,maxX:S}=tt.value,H=S-C||1;return B.value.left+(t-C)/H*B.value.width}const{minX:s,maxX:o}=tt.value,c=o-s;if(o===0||c===0)return B.value.left+B.value.width/2;const g=c/F.value.scale,h=s-F.value.offsetX/B.value.width*c,w=(t-h)/g;return B.value.left+w*B.value.width},Ft=t=>{const{minY:s,maxY:o}=tt.value,c=o-s||1;return B.value.bottom-(t-s)/c*B.value.height},_o=t=>{if(!wt.value)return kt.value||4;const{maxSize:s}=tt.value,o=Math.max(1,s),c=Math.min(1,Math.max(0,t/o));return oo.value+c*(mo.value-oo.value)},Go=e.computed(()=>Qo.value.map(t=>({y:t.y}))),No=e.computed(()=>{if(wt.value)return Bl();if(fe.value==="bar"){if(At.value){const ee=[],{minY:oe,maxY:ce}=tt.value,ue=5,Re=ce-oe||1;for(let Oe=0;Oe<=ue;Oe++){const yn=oe+Re*(Oe/ue),zt=eo(yn);ee.push({x:zt,y:B.value.bottom+20,text:sn(Math.round(yn))})}return ee}const se=[],{maxX:q}=tt.value,ne=q+1,G=5,ke=(B.value.width-G*2)/ne;for(let ee=0;ee<=q;ee++){const oe=B.value.left+G+(ee+.5)*ke;se.push({x:oe,y:B.value.bottom+20,text:I.categories[ee]||P("chart.fallback.item",{number:ee+1})})}return se}const t=[],{minX:s,maxX:o}=tt.value,c=o-s||1,g=c/F.value.scale,h=s-F.value.offsetX/B.value.width*c,w=h+g,C=Math.max(0,Math.floor(h-2)),S=Math.min(o,Math.ceil(w+2)),H=S-C,L=B.value.width,Y=Math.floor(L/60);let le=1;H>Y&&(le=Math.ceil(H/Y));for(let se=C;se<=S;se+=le)if(se>=0&&se<=o){const q=Mt(se);q>=B.value.left-100&&q<=B.value.right+100&&t.push({x:q,y:B.value.bottom+20,text:I.categories[se]||`Item ${se+1}`})}return t}),Bl=()=>{const t=[],{minX:s,maxX:o}=tt.value,c=o-s||1,g=Math.min(8,Math.max(4,Math.floor(B.value.width/80)));for(let h=0;h<=g;h++){const w=s+c*h/g,C=Mt(w);if(C>=B.value.left-10&&C<=B.value.right+10){const S=Math.round(w),H=I.categories?.[S];t.push({x:C,y:B.value.bottom+20,text:H||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},Qo=e.computed(()=>{if(At.value){const g=[],{maxX:h}=tt.value;for(let w=0;w<=h;w++)g.push({x:B.value.left-10,y:to(w),text:I.categories[w]||`Item ${w+1}`});return g}const t=[],{minY:s,maxY:o}=tt.value,c=5;for(let g=0;g<=c;g++){const h=s+(o-s)*(g/c),w=Math.round(h);t.push({x:B.value.left-10,y:Ft(h),text:sn(w)})}return t}),pt=t=>{const s=ct.value;if(!s||s.length===0){const o=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return o[t%o.length]}return s[t%s.length]},Ao=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),o=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(o){const h=Math.max(0,Math.floor(Number(o[1])*.65)),w=Math.max(0,Math.floor(Number(o[2])*.65)),C=Math.max(0,Math.floor(Number(o[3])*.65));return`rgb(${h}, ${w}, ${C})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const h=Math.max(0,Math.floor(Number(c[1])*.65)),w=Math.max(0,Math.floor(Number(c[2])*.65)),C=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${h}, ${w}, ${C}, ${c[4]})`}const g=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(g){let h=g[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[w,C,S].map(H=>H.toString(16).padStart(2,"0")).join("")}`}return s},yl=(t,s)=>{const c=O.value?.stroke?.color;return c==null?Ao(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Ao(s):Ao(s)},Do=t=>{let s=0;for(let o=1;o<t.length;o++){const c=t[o].x-t[o-1].x,g=t[o].y-t[o-1].y;s+=Math.sqrt(c*c+g*g)}return s},Jo=e.computed(()=>fe.value==="line"||Vn.value?(Vn.value?I.series.filter(s=>(s.type||fe.value)==="line"):Zn.value).map((s,o)=>{const c=I.series.findIndex(_=>_===s),g=[];let h=[];s.data.forEach((_,Y)=>{_==null?h.length>0&&(g.push([...h]),h=[]):h.push({x:At.value?eo(_):Mt(Y),y:At.value?to(Y):Ft(_),index:Y})}),h.length>0&&g.push(h);let w="";g.forEach(_=>{if(_.length>0){let Y="";Et.value?Y=Xo(_):Y=`M ${_[0].x} ${_[0].y}`+_.slice(1).map(le=>` L ${le.x} ${le.y}`).join(""),w+=(w?" ":"")+Y}});const C=g.reduce((_,Y)=>_+Do(Y),0),S=st.value.has(c),H=K.value===c,L=K.value!==null&&K.value!==c;return{path:w,color:pt(c),pathLength:C,seriesIndex:c,animationDelay:o*ge.value,isHighlighted:H,isDimmed:L,isHidden:S}}):[]),kl=e.computed(()=>{if(!(fe.value==="line"||Vn.value))return[];const t=Vn.value?I.series.filter(o=>(o.type||fe.value)==="line"):Zn.value,s=[];return t.forEach((o,c)=>{const g=I.series.findIndex(h=>h===o);for(let h=0;h<o.data.length-1;h++){const w=o.data[h];if(w!=null){let C=-1,S=0;for(let H=h+1;H<o.data.length;H++){const L=o.data[H];if(L==null)S++;else{C=H;break}}if(S>0&&C!==-1){const H=o.data[C],L=At.value?eo(w):Mt(h),_=At.value?to(h):Ft(w),Y=At.value?eo(H):Mt(C),le=At.value?to(C):Ft(H),se=st.value.has(g),q=K.value===g,ne=K.value!==null&&K.value!==g;s.push({path:`M ${L} ${_} L ${Y} ${le}`,color:pt(g),seriesIndex:g,animationDelay:c*ge.value,isHighlighted:q,isDimmed:ne,isHidden:se,gapSize:S}),h=C-1}}}}),s}),So=e.computed(()=>fe.value==="line"||Vn.value?!bt.value||nn.value||xe.value.hasAnimated?[]:(Vn.value?I.series.filter(s=>(s.type||fe.value)==="line"):Zn.value).map((s,o)=>{const c=I.series.findIndex(S=>S===s);let g="",h=null;s.data.forEach((S,H)=>{if(S!=null){const L={x:At.value?eo(S):Mt(H),y:At.value?to(H):Ft(S)};h===null?g+=`M ${L.x} ${L.y}`:g+=` L ${L.x} ${L.y}`,h=L}else if(h!==null){const L=s.data.findIndex((_,Y)=>Y>H&&_!==null&&_!==void 0);if(L!==-1){const _={x:At.value?eo(s.data[L]):Mt(L),y:At.value?to(L):Ft(s.data[L])};g+=` L ${_.x} ${_.y}`,h=_}}});const w=s.data.map((S,H)=>S==null?null:{x:At.value?eo(S):Mt(H),y:At.value?to(H):Ft(S)}).filter(S=>S!==null),C=Do(w);return{path:g,pathLength:C,color:pt(c),animationDelay:o*ge.value,seriesIndex:c}}):[]),ao=e.computed(()=>{if(fe.value!=="line")return[];const t=[];return Zn.value.forEach((s,o)=>{const c=K.value===o,g=K.value!==null&&K.value!==o,h=st.value.has(o);s.data.forEach((w,C)=>{w!=null&&t.push({x:Mt(C),y:Ft(w),color:pt(o),value:w,label:I.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(o*s.data.length+C)*(ge.value/8),isHighlighted:c,isDimmed:g,isHidden:h})})}),t}),el=e.computed(()=>{if(!Vn.value)return[];const t=[];return I.series.filter(o=>(o.type||fe.value)==="line").forEach((o,c)=>{const g=I.series.findIndex(S=>S===o),h=K.value===g,w=K.value!==null&&K.value!==g,C=st.value.has(g);o.data.forEach((S,H)=>{S!=null&&t.push({x:Mt(H),y:Ft(S),color:pt(g),value:S,label:I.categories[H]||H.toString(),seriesName:o.name,categoryIndex:H,dataIndex:H,animationDelay:(c*o.data.length+H)*(ge.value/8),isHighlighted:h,isDimmed:w,isHidden:C})})}),t}),Mo=e.computed(()=>{if(!wt.value)return[];const t=[];return Zn.value.forEach((s,o)=>{if(!s?.data?.length)return;const c=K.value,g=c!==null&&c===o,h=c!==null&&c!==o,w=st.value.has(o);s.data.forEach((C,S)=>{let H,L,_,Y,le;if(typeof C=="object"&&C!==null&&!Array.isArray(C))H=typeof C.x=="number"?C.x:S,L=typeof C.y=="number"?C.y:0,_=typeof C.size=="number"?C.size:20,Y=C.label||I.categories?.[S]||`Point ${S+1}`,le=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)H=typeof C[0]=="number"?C[0]:S,L=typeof C[1]=="number"?C[1]:0,_=typeof C[2]=="number"?C[2]:20,Y=C[3]||I.categories?.[S]||`Point ${S+1}`,le=C[4];else if(typeof C=="number")H=S,L=C,_=lo(o,S),Y=I.categories?.[S]||`Point ${S+1}`;else return;!isFinite(H)||!isFinite(L)||!isFinite(_)||t.push({x:Mt(H),y:Ft(L),radius:_o(_),originalX:H,originalY:L,originalSize:_,color:pt(o),seriesName:s.name||`Series ${o+1}`,label:Y,imageUrl:le,seriesIndex:o,dataIndex:S,categoryIndex:Math.round(H),isHighlighted:g,isDimmed:h,isHidden:w,opacity:po.value})})}),t}),tl=e.computed(()=>fe.value!=="area"?[]:Zn.value.map((t,s)=>{const o=[];let c=[];if(t.data.forEach((_,Y)=>{_==null?c.length>0&&(o.push([...c]),c=[]):c.push({x:Mt(Y),y:Ft(_),index:Y})}),c.length>0&&o.push(c),o.length===0)return{linePath:"",areaPath:"",color:pt(s),isHidden:st.value.has(s)};const g=B.value.bottom+1;let h="",w="";o.forEach((_,Y)=>{if(_.length===0)return;let le=`M ${_[0].x} ${_[0].y}`;Et.value&&_.length>1?le=Xo(_):_.slice(1).forEach(q=>{le+=` L ${q.x} ${q.y}`}),h+=(h?" ":"")+le;let se=`M ${_[0].x} ${g}`;if(se+=` L ${_[0].x} ${_[0].y}`,Et.value&&_.length>1){const q=Xo(_),ne=q.substring(q.indexOf("C")||q.indexOf("Q")||q.indexOf("L"));ne?se+=" "+ne:_.slice(1).forEach(G=>{se+=` L ${G.x} ${G.y}`})}else _.slice(1).forEach(q=>{se+=` L ${q.x} ${q.y}`});se+=` L ${_[_.length-1].x} ${g} Z`,w+=(w?" ":"")+se});const C=K.value===s,S=K.value!==null&&K.value!==s,H=st.value.has(s),L=o.reduce((_,Y)=>_+Do(Y),0);return{linePath:h,areaPath:w,color:pt(s),pathLength:L,isHighlighted:C,isDimmed:S,isHidden:H}})),Cl=e.computed(()=>{if(!(["bar"].includes(fe.value)||Vn.value))return[];const t=[],{maxX:s}=tt.value,o=Vn.value?I.series.filter(g=>(g.type||fe.value)==="bar"):Zn.value,c=o.length;if(At.value){const g=s+1,w=B.value.height/g,C=w*(2/3),S=Math.min(4,C/c*.15),H=C-(c-1)*S,L=Math.max(4,H/c);o.forEach((_,Y)=>{const le=I.series.findIndex(G=>G===_),se=K.value===le,q=K.value!==null&&K.value!==le,ne=st.value.has(le);_.data.forEach((G,X)=>{if(G==null||typeof G!="number"||!isFinite(G))return;const oe=B.value.top+(X+.5)*w-C/2+Y*(L+S),ce=B.value.left,ue=Math.abs(eo(G)-B.value.left);let Re="";if(Et.value&&ue>0){const Oe=Math.min(he.value,L/2,ue/2);Re=[`M ${ce} ${oe}`,`L ${ce+ue-Oe} ${oe}`,`Q ${ce+ue} ${oe} ${ce+ue} ${oe+Oe}`,`L ${ce+ue} ${oe+L-Oe}`,`Q ${ce+ue} ${oe+L} ${ce+ue-Oe} ${oe+L}`,`L ${ce} ${oe+L}`,"Z"].join(" ")}t.push({x:ce,y:oe,width:ue,height:L,color:pt(c===1?X:le),value:G,label:I.categories[X]||X.toString(),seriesName:_.name,animationDelay:(Y*o.length+X)*(ge.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:Et.value&&ue>0})})})}else{const g=s+1,w=B.value.width/g,C=w*.8,S=C/c,H=S*.05,L=S-H;o.forEach((_,Y)=>{const le=I.series.findIndex(G=>G===_),se=K.value===le,q=K.value!==null&&K.value!==le,ne=st.value.has(le);_.data.forEach((G,X)=>{if(G==null||typeof G!="number"||!isFinite(G))return;const oe=B.value.left+(X+.5)*w-C/2+Y*S+H/2,ce=Ft(Math.max(0,G)),ue=Math.abs(Ft(0)-Ft(G));let Re="";if(Et.value&&ue>0){const Oe=Math.min(he.value,L/2,ue/2);Re=[`M ${oe} ${ce+ue}`,`L ${oe} ${ce+Oe}`,`Q ${oe} ${ce} ${oe+Oe} ${ce}`,`L ${oe+L-Oe} ${ce}`,`Q ${oe+L} ${ce} ${oe+L} ${ce+Oe}`,`L ${oe+L} ${ce+ue}`,"Z"].join(" ")}t.push({x:oe,y:ce,width:L,height:ue,color:pt(c===1?X:le),value:G,label:I.categories[X]||X.toString(),seriesName:_.name,animationDelay:(Y*o.length+X)*(ge.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:Et.value&&ue>0})})})}return t}),yo=e.computed(()=>{if(!gn.value)return[];const t=Zn.value.map((h,w)=>({series:h,originalIndex:w})).filter(({originalIndex:h})=>!st.value.has(h));if(t.length===0)return[];let s=fe.value==="semi-radial"?Math.PI:-Math.PI/2;const o=fe.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:h,originalIndex:w}=t[0],C=h.data[0]||0,S=s,H=s+o-.001,L=S+o/2,_=Je.value+Math.cos(S)*en.value,Y=et.value+Math.sin(S)*en.value,le=Je.value+Math.cos(H)*en.value,se=et.value+Math.sin(H)*en.value,q=Je.value+Math.cos(H)*Pe.value,ne=et.value+Math.sin(H)*Pe.value,G=Je.value+Math.cos(S)*Pe.value,X=et.value+Math.sin(S)*Pe.value,ke=1,ee=[`M ${_} ${Y}`,`A ${en.value} ${en.value} 0 ${ke} 1 ${le} ${se}`,`L ${q} ${ne}`,`A ${Pe.value} ${Pe.value} 0 ${ke} 0 ${G} ${X}`,"Z"].join(" "),oe=pt(w);return c.push({path:ee,color:oe,strokeWidth:je.value,strokeColor:yl(0,oe),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:!1,isHidden:!1,startAngle:S,endAngle:H,midAngle:L}),c}const g=t.reduce((h,{series:w})=>h+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:h,originalIndex:w})=>{const C=h.data[0]||0,S=C/g*o,H=s,L=s+S,_=H+S/2,Y=Je.value+Math.cos(H)*en.value,le=et.value+Math.sin(H)*en.value,se=Je.value+Math.cos(L)*en.value,q=et.value+Math.sin(L)*en.value,ne=Je.value+Math.cos(L)*Pe.value,G=et.value+Math.sin(L)*Pe.value,X=Je.value+Math.cos(H)*Pe.value,ke=et.value+Math.sin(H)*Pe.value,ee=S>Math.PI?1:0,oe=[`M ${Y} ${le}`,`A ${en.value} ${en.value} 0 ${ee} 1 ${se} ${q}`,`L ${ne} ${G}`,`A ${Pe.value} ${Pe.value} 0 ${ee} 0 ${X} ${ke}`,"Z"].join(" "),ce=pt(w);c.push({path:oe,color:ce,strokeWidth:je.value,strokeColor:yl(c.length,ce),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:K.value!==null&&K.value!==w,isHidden:!1,startAngle:H,endAngle:L,midAngle:_}),s=L}),c)}),Ro=e.computed(()=>!Ve.value||!gn.value?[]:yo.value.map((t,s)=>{if(t.isHidden)return null;const o=$t.value,c=Zt.value,g=rn.value,h=Je.value+Math.cos(t.midAngle)*Pe.value,w=et.value+Math.sin(t.midAngle)*Pe.value,C=Je.value+Math.cos(t.midAngle)*(Pe.value+o),S=et.value+Math.sin(t.midAngle)*(Pe.value+o),H=Math.cos(t.midAngle)>=0,_=C+c*(H?1:-1),Y=S,le=H?C+15:C-15,se=Y-g,q=H?"start":"end",ne=Math.hypot(C-h,S-w),G=Math.hypot(_-C,Y-S);return{pointerStartX:h,pointerStartY:w,pointerEndX:C,pointerEndY:S,horizontalEndX:_,horizontalEndY:Y,textX:le,textY:se,text:`${t.seriesName}: ${sn(t.value)}`,color:t.color,textAnchor:q,isRightSide:H,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:ne,horizontalLineLength:G}}).filter(Boolean)),Mn=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||po.value||.7;return K.value===null||K.value===void 0?s:K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},Tl=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):s*.7:s},so=(t,s)=>{if(t)try{if(K.value===t.seriesIndex?K.value=null:K.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:I.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},nl=(t,s)=>{const o=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&o.push("dss-bubble-highlighted"),t.isDimmed&&o.push("dss-bubble-dimmed"),t.isHidden&&o.push("dss-bubble-hidden"),o.push(`dss-bubble-series-${t.seriesIndex}`),o.join(" ")},bl=(t,s)=>{if(!t||(s.stopPropagation(),xt.value=!0,K.value=t.seriesIndex,pe.value.show=!1,!Cn.value))return;const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120;g+w>Ue.value&&(g=s.clientX-c.left-w-10),h+C>c.height&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);const S=Co.value,H=uo.value,L=S.map(_=>{const Y=H[_]||_,le=ol(_,t);return le?{seriesName:t.seriesName,label:t.label,value:`${Y}: ${le}`,color:t.color}:null}).filter(Boolean);Me.value={show:!0,x:g,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderSeries:[]}},ol=(t,s)=>{let o;switch(t){case"x":o=s.originalX;break;case"y":o=s.originalY;break;case"size":o=s.originalSize;break;case"label":o=s.label;break;case"seriesName":o=s.seriesName;break;default:o=s[t]||""}const c=bo.value[t];if(typeof c=="function")return c(o,s);if(typeof o=="number"){const g=o.toFixed(1);return wn.value?g+wn.value:g}return o?.toString()||""},wl=()=>{if(!wt.value||!pe.value.data||pe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return pe.value.data.forEach(o=>{if(o.seriesName&&o.label){const c=`${o.seriesName} - ${o.label}`;s.has(c)||(t.push(c),s.add(c))}else o.seriesName&&(s.has(o.seriesName)||(t.push(o.seriesName),s.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},l=(t,s)=>{t&&(xt.value=!1,K.value=null,Me.value.show=!1,Me.value.bubbleData=[])},n=(t,s)=>{const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect(),g=qo(t.categoryIndex),h=t.description||t.comment||"";let w=s.clientX-c.left+15,C=s.clientY-c.top-10;const S=200,H=h?80:50;w+S>Ue.value&&(w=s.clientX-c.left-S-15),C+H>Qe.value&&(C=s.clientY-c.top-H-10),w<0&&(w=10),C<0&&(C=10),fn.value={show:!0,x:w,y:C,categoryValue:g,description:h}},a=()=>{fn.value.show=!1},r=e.computed(()=>I.categories.length||Math.max(...Sn.value.map(t=>t.data.length))),i=e.computed(()=>{let t=0;return Sn.value.forEach(s=>{s.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),u=e.computed(()=>{const t=[],s=r.value;for(let o=0;o<s;o++){const c=o*2*Math.PI/s-Math.PI/2,g=Je.value+Math.cos(c)*Pe.value,h=et.value+Math.sin(c)*Pe.value;t.push({x:g,y:h,angle:c,index:o})}return t}),d=e.computed(()=>{const t=[],s=r.value;return u.value.forEach((o,c)=>{const g=Pe.value+15,h=c*2*Math.PI/s-Math.PI/2,w=Je.value+Math.cos(h)*g,C=et.value+Math.sin(h)*g+5;let S="middle",H="middle";Math.abs(Math.cos(h))>.5&&(S=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(H=Math.sin(h)>0?"hanging":"auto"),t.push({x:w,y:C,text:I.categories[c]||`Axis ${c+1}`,anchor:S,baseline:H})}),t}),m=e.ref(new Set),p=(t,s,o)=>{const c=`current-${o}`,g=m.value.has(c);return!g&&K.value===null?s.fillOpacity||Te.value:s.isHighlighted||g?(s.fillOpacity||Te.value)+.15:s.isDimmed?(s.fillOpacity||Te.value)*.3:s.fillOpacity||Te.value},y=e.computed(()=>{if(!Nn.value)return[];const t=[],s=r.value;return Zn.value.forEach((o,c)=>{const g=[],h=[],w=[],C=K.value===c,S=K.value!==null&&K.value!==c,H=st.value.has(c);for(let L=0;L<s;L++){const _=o.data[L]||0,le=_/i.value*Pe.value,se=L*2*Math.PI/s-Math.PI/2,q=Je.value+Math.cos(se)*le,ne=et.value+Math.sin(se)*le;g.push(`${q},${ne}`),h.push({x:q,y:ne}),w.push({x:q,y:ne,value:_,label:I.categories[L]||`Axis ${L+1}`,seriesName:o.name})}t.push({points:g.join(" "),polygonPoints:h,dataPoints:w,color:pt(c),fillOpacity:Te.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:C,isDimmed:S,isHidden:H,seriesIndex:c})}),t}),x=(t,s)=>{if(!s||s.length<3)return!1;let o=!1;for(let c=0,g=s.length-1;c<s.length;g=c++){const h=s[c].x,w=s[c].y,C=s[g].x,S=s[g].y;w>t.y!=S>t.y&&t.x<(C-h)*(t.y-w)/(S-w)+h&&(o=!o)}return o},N=t=>{if(!Nn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const o=s.getBoundingClientRect(),c=Ce.value?.getBoundingClientRect();if(!c)return;const g=t.clientX-c.left,h=t.clientY-c.top,w=y.value.filter(C=>C.isHidden?!1:x({x:g,y:h},C.polygonPoints));if(w.length>0){w.length,K.value=w[0].seriesIndex;const C=t.clientX-o.left+10,S=t.clientY-o.top-10,H=200,L=50+w.length*25;let _=C,Y=S;_+H>Ue.value&&(_=t.clientX-o.left-H-10),Y+L>Qe.value&&(Y=t.clientY-o.top-L-10),_<0&&(_=10),Y<0&&(Y=10);const le=w.map(se=>{let q=se.dataPoints[0],ne=1/0;return se.dataPoints.forEach(G=>{const X=Math.sqrt(Math.pow(G.x-g,2)+Math.pow(G.y-h,2));X<ne&&(ne=X,q=G)}),{seriesName:se.seriesName,color:se.color,value:sn(q.value!==void 0?q.value:se.value)}});Me.value={show:!0,x:_,y:Y,title:w.length===1?w[0].seriesName:"",value:"",bubbleData:[],spiderSeries:le}}else De()},b=e.computed(()=>{const t=O.value;return t.logos.map((s,o)=>{const c=I.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||st.value.has(s.seriesIndex))return null;let g,h;if(Yt.value){let C=-1,S=null;for(let L=c.data.length-1;L>=0;L--)if(c.data[L]!==null&&c.data[L]!==void 0){C=L,S=c.data[L];break}if(C===-1||S===null)return null;const H=c.data.map((L,_)=>L==null?null:{x:Mt(_),y:Ft(L),index:_}).filter(L=>L!==null);if(t.animations.enabled&&!nn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(xe.value.isAnimating||!xe.value.hasAnimated))if(xe.value.isAnimating){const L=xe.value.currentFrame/xe.value.totalFrames,_=$n(t.animations.easing,Math.min(L,1)),Y=Il(H,_);g=Y.x+(s.offsetX||0),h=Y.y+(s.offsetY||0)}else g=H[0].x+(s.offsetX||0),h=H[0].y+(s.offsetY||0);else g=Mt(C)+(s.offsetX||0),h=Ft(S)+(s.offsetY||0)}else if(gn.value||Nn.value){const C=Math.PI*2/t.logos.length*o;g=Je.value+Math.cos(C)*(Pe.value+30)+(s.offsetX||0),h=et.value+Math.sin(C)*(Pe.value+30)+(s.offsetY||0)}return{...s,x:g,y:h,seriesIndex:s.seriesIndex}}).filter(Boolean)}),z=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),o=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),o&&(o.style.opacity="1")},R=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},J=t=>{st.value.has(t)?st.value.delete(t):st.value.add(t)},j=e.computed(()=>{if(!Me.value.show&&!(He.value&&pe.value.show&&!F.value.isZooming))return{display:"none"};let t,s;if(He.value&&pe.value.show&&!F.value.isZooming){t=pe.value.x+15,s=B.value.top;const o=wt.value?200:150;t+o>Ue.value&&(t=pe.value.x-o-15),t<0&&(t=10),s<10&&(s=10)}else t=Me.value.x,s=Me.value.y;return{left:t+"px",top:s+"px"}}),ve=(t,s)=>{if(!Cn.value||vt.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120,S=Ue.value,H=Qe.value;g+w>S&&(g=s.clientX-c.left-w-10),h+C>H&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&I.categories.includes(t.label)&&(L=I.categories.indexOf(t.label));const _=(At.value||fe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Me.value={show:!0,x:g,y:h,title:_,value:sn(t.value)||"",categoryIndex:L,spiderSeries:[]}},Tt=e.ref(!1),xt=e.ref(!1),De=()=>{Me.value.show=!1,Me.value.spiderSeries=[],Me.value.bubbleData=[],pe.value.show=!1,Tt.value||(K.value=null)},vt=e.ref(!1),ft=(t,s)=>{vt.value=!0,Me.value.show=!1,pe.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+15,h=s.clientY-c.top-10;const w=250;g+w>Ue.value&&(g=s.clientX-c.left-w-15),g<0&&(g=10),h<0&&(h=10),cn.value={show:!0,x:g,y:h,content:t.texts,count:t.totalCount}},it=()=>{vt.value=!1,cn.value.show=!1},xe=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),$n=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},nn=e.computed(()=>Vt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),ll=()=>{if(!bt.value||nn.value){xe.value.hasAnimated=!0,tn.value&&(mn.value=1);return}tn.value&&(mn.value=0),xe.value.isAnimating=!0,xe.value.currentFrame=0,xe.value.totalFrames=Math.ceil(dt.value/16.67);const t=()=>{const s=xe.value.currentFrame/xe.value.totalFrames,o=$n(Ke.value,Math.min(s,1));xl(o),tn.value&&(mn.value=o),s<1?(xe.value.currentFrame++,xe.value.animationId=requestAnimationFrame(t)):Hl()};xe.value.animationId=requestAnimationFrame(t)},xl=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},Hl=()=>{xe.value.isAnimating=!1,xe.value.hasAnimated=!0,tn.value&&(mn.value=1),xe.value.animationId&&(cancelAnimationFrame(xe.value.animationId),xe.value.animationId=null)},Io=e.computed(()=>!gn.value||xe.value.hasAnimated?!0:tn.value?mn.value>=1:no.value?Hn.value>=1:!0),$l=e.computed(()=>Ve.value&&Io.value),Bo=e.ref(!1);e.watch($l,t=>{t?(Bo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Bo.value=!0})})):Bo.value=!1},{immediate:!0});const Fo=e.computed(()=>{if(!bt.value||nn.value||xe.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dt.value}ms`,t["--dss-animation-easing"]=El(Ke.value),t["--dss-stagger-delay"]=`${ge.value}ms`,t}),El=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",qn=()=>{if(!bt.value||nn.value)return"";const t=["dss-chart-animated"];return xe.value.hasAnimated||t.push(`dss-animate-${Gt.value}`),xe.value.hasAnimated||(gn.value&&fe.value!=="semi-radial"?t.push("dss-animate-fill"):gn.value||t.push(`dss-animate-${Gt.value}`)),xe.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>I.series,(t,s)=>{Xe.value&&s&&xe.value.hasAnimated&&(xe.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>ll(),ze.value)}))},{deep:!0}),e.watch(()=>F.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{cl()},50)}),e.watch(()=>[F.value.scale,F.value.offsetX],()=>{!F.value.isZooming&&!F.value.isDragging&&cl()},{flush:"post"}),e.watch([ln,vo],([t,s])=>{F.value.minScale=t,F.value.maxScale=s,(F.value.scale<t||F.value.scale>s)&&Lo()},{immediate:!0}),e.watch(()=>I.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>ae.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Jt)}):document.removeEventListener("click",Jt)}),e.onMounted(()=>{K.value=null,tn.value&&(!bt.value||nn.value)&&(mn.value=1),pl(),V.value&&typeof ResizeObserver<"u"&&(be=new ResizeObserver(t=>{const s=t[0];if(!s||!s.contentRect)return;const{width:o,height:c}=s.contentRect;gt.value=Math.round(o),v.value=Math.round(c),Ge.value&&(Ae.value=Ge.value.offsetHeight||Le)}),be.observe(V.value)),bt.value&&!nn.value?fe.value==="semi-radial"?setTimeout(()=>gl(),ze.value):setTimeout(()=>ll(),ze.value):(xe.value.hasAnimated=!0,fe.value==="semi-radial"&&(Hn.value=1)),document.addEventListener("mousemove",Ln),document.addEventListener("mouseup",hn),document.addEventListener("click",Pn)}),e.onUnmounted(()=>{be&&V.value&&(be.unobserve(V.value),be.disconnect(),be=null),xe.value.animationId&&cancelAnimationFrame(xe.value.animationId),go&&(cancelAnimationFrame(go),go=null),F.value.zoomTimeout&&clearTimeout(F.value.zoomTimeout),document.removeEventListener("mousemove",Ln),document.removeEventListener("mouseup",hn),document.removeEventListener("click",Pn),document.removeEventListener("click",Jt)});const Ln=t=>{if(F.value.isDragging&&F.value.scale>1&&Yt.value){pe.value.show=!1;const s=t.clientX-F.value.lastMouseX,{minX:o,maxX:c}=tt.value,g=c-o||1,w=s*.8;F.value.offsetX+=w;const C=g/F.value.scale,S=g-C,H=0,L=-S/g*B.value.width,_=H;F.value.offsetX=Math.max(L,Math.min(_,F.value.offsetX)),F.value.lastMouseX=t.clientX,F.value.lastMouseY=t.clientY}},hn=()=>{F.value.isDragging&&(F.value.isDragging=!1,setTimeout(()=>{!F.value.isDragging&&F.value.isZooming},100))},Il=(t,s)=>{const o=t.filter(C=>C!=null);if(!o||o.length===0)return{x:0,y:0};if(o.length===1||s<=0)return o[0];if(s>=1)return o[o.length-1];let c=0;const g=[];for(let C=1;C<o.length;C++){const S=o[C].x-o[C-1].x,H=o[C].y-o[C-1].y,L=Math.sqrt(S*S+H*H);g.push(L),c+=L}const h=c*s;let w=0;for(let C=0;C<g.length;C++){const S=w+g[C];if(h<=S){const H=(h-w)/g[C],L=o[C],_=o[C+1];return{x:L.x+(_.x-L.x)*H,y:L.y+(_.y-L.y)*H}}w=S}return o[o.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[qn(),{"dss-chart-fill-width":ht.value,"dss-chart-fill-height":Dt.value}]]),style:e.normalizeStyle({width:ht.value?"100%":Ue.value+"px",height:Dt.value?"100%":Qe.value+20+"px",...Fo.value,cursor:vl()}),"data-chart-type":fe.value,ref_key:"containerEl",ref:V,onWheel:$o,onMousedown:xo,onMousemove:Be,onMouseup:Nl,onMouseleave:qt,onDblclick:Lo,onContextmenu:e.withModifiers(Tn,["prevent"]),onClick:e.withModifiers(mt,["left"]),onWheelCapture:$o},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:Ge},[e.createElementVNode("div",Wl,[Q.value?(e.openBlock(),e.createElementBlock("div",ql,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0),Ee.value?(e.openBlock(),e.createElementBlock("div",Ul,e.toDisplayString(Ee.value),1)):e.createCommentVNode("",!0)]),_e.value&&(Ze.value==="top"||Ze.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":on.value==="horizontal","dss-legend-vertical":on.value==="vertical","dss-legend-top":Ze.value==="top","dss-legend-bottom":Ze.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>J(c),onMouseenter:g=>U(c),onMouseleave:ye,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:pt(c)})},null,4),e.createElementVNode("span",Yl,e.toDisplayString(o.name),1)],46,Xl))),128))],2)):e.createCommentVNode("",!0),_e.value&&(Ze.value==="left"||Ze.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ze.value==="left","dss-legend-right":Ze.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>J(c),onMouseenter:g=>U(c),onMouseleave:ye,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:pt(c)})},null,4),e.createElementVNode("span",Kl,e.toDisplayString(o.name),1)],46,jl))),128))],2)):e.createCommentVNode("",!0)],512),Z.showAddMarkerButton&&at.value.addMarker&&(Yt.value||wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qn,title:e.unref(P)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Nt.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,Ql),s[5]||(s[5]=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,Gl)):e.createCommentVNode("",!0),e.createElementVNode("div",Jl,[wt.value&&_n.value?(e.openBlock(),e.createElementBlock("div",ea,"Bubble size: "+e.toDisplayString(_n.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ue.value,height:Qe.value,class:"dss-chart-svg","data-smooth":Et.value,"data-animated":bt.value,ref_key:"svgEl",ref:Ce},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",na,[e.createElementVNode("rect",{x:B.value.left,y:B.value.top,width:B.value.width,height:B.value.height*4},null,8,oa)]),no.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Eo.value},[e.createElementVNode("path",{d:Sl.value},null,8,aa)],8,la)):e.createCommentVNode("",!0),tn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:On.value},[e.createElementVNode("path",{d:Vo.value},null,8,ra)],8,sa)):e.createCommentVNode("",!0)]),Yt.value||wt.value?(e.openBlock(),e.createElementBlock("g",ia,[Fe.value?(e.openBlock(),e.createElementBlock("g",ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:B.value.left,x2:B.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,da))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ua,[e.createElementVNode("line",{x1:B.value.left,x2:B.value.right,y1:B.value.bottom,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ma),e.createElementVNode("line",{x1:B.value.left,x2:B.value.left,y1:B.value.top,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,pa)]),e.createElementVNode("g",va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(No.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(o.text),13,fa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qo.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(o.text),13,ga))),128)),Ot.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:B.value.left+B.value.width/2,y:B.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ot.value),9,ha)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:B.value.top+12+B.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${B.value.top+B.value.height/2})`},e.toDisplayString(yt.value),9,ya)):e.createCommentVNode("",!0)]),Ho.value.length>0?(e.openBlock(),e.createElementBlock("g",ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",Ca,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,ba)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,wa)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,xa)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,B.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,Ea)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,B.value.top-10),r:"14",fill:o.hasManual&&o.hasAuto||o.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,Va),e.createElementVNode("text",{x:o.x,y:Math.max(15,B.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(o.totalCount),9,Na)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Sa,[Vn.value?(e.openBlock(),e.createElementBlock("g",Ma,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":At.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ba)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ta))],64))),128))],2),e.createElementVNode("g",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,$a))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,La))),128)),kt.value>0||Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(el.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?_t(o,kt.value)+2:_t(o,kt.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,_a))),128)):e.createCommentVNode("",!0)])])):fe.value==="line"?(e.openBlock(),e.createElementBlock("g",Aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:o.path,stroke:o.color,"stroke-width":Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":xe.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Da))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Ra))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ia))),128)),kt.value>0||Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ao.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?_t(o,kt.value)+2:_t(o,kt.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Fa))),128)):e.createCommentVNode("",!0)])):fe.value==="area"?(e.openBlock(),e.createElementBlock("g",za,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${Z.chartId}`},[e.createElementVNode("rect",{x:B.value.left-10,y:B.value.top-10,width:B.value.width+20,height:B.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${B.value.width+20}px`})},null,12,Oa)],8,Pa))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?Ct.value+.2:Ct.value,mask:`url(#area-mask-${c}-${Z.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden})},null,10,Za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+1:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${c*ge.value}ms`})},null,14,Wa))),128))])):fe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":At.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,qa)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ua))],64))),128))],2)):e.createCommentVNode("",!0)]),He.value&&pe.value.show&&!F.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xa,[e.createElementVNode("line",{x1:pe.value.x,x2:pe.value.x,y1:B.value.top,y2:B.value.bottom,stroke:bn.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ya),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:pe.value.x,cy:o.y,r:kt.value+2,fill:o.color,stroke:"none",opacity:"0.9"},null,8,ja))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("g",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[o?(e.openBlock(),e.createElementBlock("g",Ga,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":Mn(o),stroke:o.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(nl(o,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:g=>bl(o,g),onMouseleave:g=>l(o),onClick:g=>so(o,g)},null,42,Qa),o.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:o.x-o.radius*.65,y:o.y-o.radius*.65,width:o.radius*1.3,height:o.radius*1.3,"xlink:href":o.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${o.isHighlighted?"dss-bubble-highlighted":""} ${o.isDimmed?"dss-bubble-dimmed":""} ${o.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${o.radius*.65}px at ${o.radius*.65}px ${o.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Tl(o)}),onLoad:g=>ho(c),onError:g=>Ml(c),onMouseenter:g=>bl(o,g),onMouseleave:g=>l(o),onClick:g=>so(o,g)},null,46,Ja)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),gn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Yo.value},[fe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Je.value,cy:et.value,r:Pe.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ts)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":fe.value,"clip-path":St.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:o.path,fill:o.color,"fill-opacity":o.isHighlighted?(o.opacity||.8)+.2:o.opacity||.8,stroke:o.strokeWidth?o.strokeColor||o.color:"none","stroke-width":o.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),onMouseover:g=>ve(o,g),onMouseleave:De},null,42,os))),128))],8,ns),Un.value&&Io.value?(e.openBlock(),e.createElementBlock("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:o.x,y:o.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(o.value),9,as)),[[e.vShow,o.show]])),128))])):e.createCommentVNode("",!0),co.value&&Io.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:Wt.value.x,y:Wt.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Oo.value,fill:To.value,class:"dss-radial-data-center"},e.toDisplayString(Rn.value),9,ss)):e.createCommentVNode("",!0),$l.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Bo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":o.isHighlighted,"dss-label-dimmed":o.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:o.pointerStartX,y1:o.pointerStartY,x2:o.pointerEndX,y2:o.pointerEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.pointerLineLength})},null,12,rs),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:o.pointerEndX,y1:o.pointerEndY,x2:o.horizontalEndX,y2:o.horizontalEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.horizontalLineLength})},null,12,is),e.createElementVNode("text",{class:"dss-radial-label-text",x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":Se.value,"dominant-baseline":"middle"},e.toDisplayString(o.text),9,cs)],6))),128))],2)):e.createCommentVNode("",!0)],8,es)):e.createCommentVNode("",!0),Nn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Yo.value},[Fe.value?(e.openBlock(),e.createElementBlock("g",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Je.value,cy:et.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ms))),128)),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Je.value-16,y:et.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,vs),e.createElementVNode("text",{x:Je.value,y:et.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(We(c)),9,fs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Je.value,x2:o.x,y1:et.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,gs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:o.x+Math.cos(c*2*Math.PI/r.value-Math.PI/2)*16,y:o.y+Math.sin(c*2*Math.PI/r.value-Math.PI/2)*16,"text-anchor":o.anchor,"dominant-baseline":o.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,ys))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:N,onMouseleave:De},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":p("current",o,c),stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+1:Ye.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*ge.value}ms`,transition:"all 0.2s ease"})},null,14,ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(g,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${h}`,cx:g.x,cy:g.y,r:o.isHighlighted?kt.value+1:kt.value>0?kt.value:0,fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*ge.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>ve(g,w),onMouseleave:De},null,46,Cs))),128))]))),128))],32)],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:o.x,cy:o.y,r:o.width/2,fill:pt(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,ws))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:g=>z(c),onError:g=>R(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,xs))),128))])],8,ta))]),xn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ue.value+"px",height:Qe.value+"px",backgroundImage:`url('${ie.value}')`,backgroundRepeat:"no-repeat",...W.value,opacity:Dn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+o.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:o.x+"px",top:o.y+"px",width:vn.value+"px",height:vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(g=>ml(o),["stop"]),onMouseenter:g=>n(o,g),onMouseleave:a},[e.createElementVNode("img",{src:Qt(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vs)],44,Es)),[[e.vShow,io.value]])),128)),fn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:fn.value.x+"px",top:fn.value.y+"px"})},[e.createElementVNode("div",Ns,e.toDisplayString(fn.value.categoryValue),1),fn.value.description?(e.openBlock(),e.createElementBlock("div",Ss,e.toDisplayString(fn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Cn.value&&(Me.value.show||He.value&&pe.value.show&&!F.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":He.value&&pe.value.show&&!F.value.isZooming}]),style:e.normalizeStyle(j.value)},[!He.value||!pe.value.show||F.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nn.value&&Me.value.spiderSeries&&Me.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ms,[Me.value.title?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(Me.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value.spiderSeries,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Ts,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Hs,e.toDisplayString(o.value),1)]))),128))])):wt.value&&Me.value.bubbleData&&Me.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",$s,[Me.value.title?(e.openBlock(),e.createElementBlock("div",Ls,e.toDisplayString(Me.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value.bubbleData,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",Ds,e.toDisplayString(Me.value.title),1),e.createElementVNode("div",Rs,e.toDisplayString(Me.value.value),1)])),Me.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[de(Me.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Is,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Fs,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(Me.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",zs,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ps,[e.createElementVNode("div",Os,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),de(Me.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zs,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ws,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(Me.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",qs,[e.createElementVNode("div",Us,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Xs,e.toDisplayString(o.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",Ys,[e.createElementVNode("div",js,e.toDisplayString(wt.value?wl():Z.categories[pe.value.categoryIndex]||`Category ${pe.value.categoryIndex+1}`),1),wt.value?(e.openBlock(),e.createElementBlock("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Gs,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Qs,e.toDisplayString(sn(o.value)),1)]))),128))]),de(pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Js,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",er,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(pe.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",tr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",nr,[e.createElementVNode("div",or,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),de(pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",lr,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ar,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(pe.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",sr,[e.createElementVNode("div",rr,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",ir,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Yt.value&&Bt.value&&F.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Lo},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(F.value.scale*100))+"% "+e.toDisplayString(e.unref(P)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Zl),ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[at.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref(P)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),at.value.addMarker&&(at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv||an.value.length>0)?(e.openBlock(),e.createElementBlock("div",cr)):e.createCommentVNode("",!0),at.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Xt},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),at.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Gn},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),an.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",dr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[o.separator?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Wo(o)),style:e.normalizeStyle(Xn(o)),onClick:g=>Fn(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Zo(o),class:"dss-custom-menu-content"},null,8,pr)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",vr,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,mr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:jn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",fr,[e.createElementVNode("h3",null,e.toDisplayString($.value?e.unref(P)("chart.modalMarker.viewMarker"):E.value?e.unref(P)("chart.modalMarker.editMarker"):e.unref(P)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:jn},"×")]),e.createElementVNode("div",gr,[e.createElementVNode("div",hr,[f.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",yr,e.toDisplayString(qo(f.value.categoryIndex)||""),1)),f.value.fromButton?(e.openBlock(),e.createElementBlock("div",kr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=o=>f.value.categoryIndex=o),class:"dss-form-select",disabled:$.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(o,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(o),9,br))),128))],8,Cr),[[e.vModelSelect,f.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wr,[e.createElementVNode("label",xr,e.toDisplayString(e.unref(P)("chart.modalMarker.description")),1),$.value?(e.openBlock(),e.createElementBlock("div",Er,e.toDisplayString(f.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=o=>f.value.description=o),placeholder:e.unref(P)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Vr)),[[e.vModelText,f.value.description]])]),e.createElementVNode("div",Nr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(P)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Sr,[e.createElementVNode("img",{src:Qt({type:f.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=o=>o.target.style.display="none")},null,40,Mr)])])]),e.createElementVNode("div",Br,[e.createElementVNode("div",Tr,[E.value&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:dn},e.toDisplayString(e.unref(P)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:jn},e.toDisplayString($.value?e.unref(P)("chart.modalMarker.close"):e.unref(P)("chart.modalMarker.cancel")),1),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:dl,disabled:!(f.value.description&&f.value.description.length)},e.toDisplayString(E.value?e.unref(P)("chart.modalMarker.save"):e.unref(P)("chart.contextMenu.addMarker")),9,$r))])])])])):e.createCommentVNode("",!0)],64))}}),Ar={class:"dss-modal-title"},Dr={class:"dss-modal-actions"},Ll={__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(Z,{emit:jt}){const P=Z,D=jt,Ie=e.ref(null),V=e.ref(null),Ce=e.computed(()=>{const re={"max-width":P.width};return P.height!=="auto"&&(re.height=P.height,re["min-height"]="0"),re}),Ge=e.computed(()=>({}));function gt(){D("close-modal")}function v(){P.backDrop&&!Ie.value&&D("close-modal")}function be(re){re.target.tagName==="INPUT"&&(Ie.value=re.target.tagName)}function Le(){setTimeout(()=>{Ie.value=null},300)}function Ne(){const re=document.body,$e=document.documentElement;V.value={bodyOverflow:re.style.overflow,bodyPosition:re.style.position,bodyTop:re.style.top,bodyWidth:re.style.width,htmlOverflow:$e.style.overflow,scrollY:window.scrollY},re.style.overflow="hidden",re.style.position="fixed",re.style.top=`-${V.value.scrollY}px`,re.style.width="100%",re.style.left="0",$e.style.overflow="hidden"}function I(){if(!V.value)return;const re=document.body,$e=document.documentElement,{bodyOverflow:qe,bodyPosition:Pt,bodyTop:O,bodyWidth:ht,htmlOverflow:Dt,scrollY:Ue}=V.value;re.style.overflow=qe||"",re.style.position=Pt||"",re.style.top=O||"",re.style.width=ht||"",re.style.left="",$e.style.overflow=Dt||"",window.scrollTo(0,Ue||0)}return e.watch(()=>P.showModal,re=>{if(re)Ne(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const $e=document.getElementById("dss-modal-backdrop");$e&&($e.addEventListener("focusin",be),$e.addEventListener("focusout",Le))},100);else{I(),document.body.classList.remove("dss-modal-open");const $e=document.getElementById("dss-modal-backdrop");$e&&($e.removeEventListener("focusin",be),$e.removeEventListener("focusout",Le))}},{immediate:!0}),e.onUnmounted(()=>{P.showModal&&I()}),(re,$e)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ce.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:$e[0]||($e[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":Z.headerType,"font-size":Z.titleSize})},[e.createElementVNode("h1",Ar,[e.renderSlot(re.$slots,"title",{},()=>[$e[1]||($e[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(re.$slots,"title-data"),Z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:gt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Ge.value)},[e.renderSlot(re.$slots,"content",{},()=>[$e[2]||($e[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Dr,[e.renderSlot(re.$slots,"actions")])])],4),[[e.vShow,Z.showModal]])])):e.createCommentVNode("",!0)]))}},Rr={key:0,class:"dss-table-toolbar"},Ir={class:"dss-table-toolbar-left"},Fr=["aria-expanded"],zr={class:"dss-pagination-select-dropdown",role:"listbox"},Pr={class:"dss-table-column-visibility-label"},Or={class:"dss-table-checkbox-wrapper"},Zr=["checked","onChange"],Wr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},qr={class:"dss-table-column-visibility-text"},Ur={class:"dss-table-toolbar-right"},Xr=["placeholder"],Yr=["aria-expanded"],jr={key:1,class:"dss-table-toolbar-extra"},Kr={class:"dss-table-thead"},Gr={key:0,class:"dss-table-th dss-table-selection-column"},Qr={key:0,class:"dss-table-checkbox-wrapper"},Jr=["checked","indeterminate"],ei={key:0,class:"dss-table-checkbox__indeterminate"},ti={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ni={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},oi=["onClick"],li={class:"dss-table-th-content"},ai={class:"dss-table-th-text"},si={key:0},ri={key:1},ii={key:2},ci=["aria-expanded","onClick"],di={class:"dss-table-tbody"},ui=["onClick"],mi={class:"dss-table-checkbox-wrapper"},pi=["type","name","checked","onChange"],vi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fi={key:1,class:"dss-table-checkbox__dot"},gi=["onClick"],hi=["aria-expanded","aria-label"],yi={key:0,class:"dss-table-expansion-row"},ki=["colspan"],Ci=["colspan"],bi={key:1,class:"dss-table-pagination"},wi={class:"dss-pagination-center"},xi={class:"dss-pagination-controls"},Ei=["disabled","title"],Vi=["disabled","title"],Ni={class:"dss-pagination-pages"},Si=["onClick"],Mi={key:1,class:"dss-pagination-ellipsis"},Bi=["disabled","title"],Ti=["disabled","title"],Hi=["aria-expanded"],$i={class:"dss-pagination-select-dropdown",role:"listbox"},Li=["aria-selected","onClick"],_i={key:0,class:"dss-table-filter-row"},Ai=["value","placeholder"],Di=["min","max","value"],Ri=["min","max","value"],Ii={class:"dss-table-filter-double-range-values"},Fi={key:2,class:"dss-table-filter-daterange"},zi={class:"dss-table-filter-daterange-row"},Pi={class:"dss-table-filter-daterange-label"},Oi=["value"],Zi={class:"dss-table-filter-daterange-row"},Wi={class:"dss-table-filter-daterange-label"},qi=["value"],Ui=["value","placeholder"],Xi={class:"dss-table-filter-list"},Yi=["checked","onChange"],ji={class:"dss-table-filter-actions"},Ki={name:"DSSTable"},Gi=Object.assign(Ki,{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:Z=>typeof Z=="object"&&Z!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(Z,{emit:jt}){const{t:P,locale:D}=al.useI18n(),Ie=Z,V=jt,Ce={table:{width:"auto",height:null,rowHeight:"auto",expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function Ge(f,k){const E=Object.assign({},f);return gt(f)&>(k)&&Object.keys(k).forEach($=>{gt(k[$])?$ in f?E[$]=Ge(f[$],k[$]):Object.assign(E,{[$]:k[$]}):Object.assign(E,{[$]:k[$]})}),E}function gt(f){return f&&typeof f=="object"&&!Array.isArray(f)}const v=e.computed(()=>Ge(Ce,Ie.options)),be=e.computed(()=>{const f=v.value.table.width;return f==="auto"?null:typeof f=="number"?f:null}),Le=e.computed(()=>v.value.table.height),Ne=e.computed(()=>v.value.table.rowHeight??"auto"),I=e.computed(()=>({height:Ne.value})),re=e.computed(()=>v.value.table.expandable===!0),$e=e.computed(()=>v.value.table.striped),qe=e.computed(()=>v.value.table.bordered),Pt=e.computed(()=>v.value.table.hoverable),O=e.computed(()=>v.value.table.size),ht=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const Dt=e.computed(()=>v.value.selection.enabled),Ue=e.computed(()=>v.value.selection.mode),Ae=e.computed(()=>v.value.sorting.enabled),Qe=e.computed(()=>v.value.sorting.mode),fe=e.computed(()=>v.value.pagination.enabled),kn=e.computed(()=>v.value.pagination.rows),Q=e.computed(()=>v.value.pagination.rowsPerPageOptions),Ee=e.computed(()=>v.value.scrollable),_n=e.computed(()=>v.value.emptyMessage),Ot=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),yt=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),pn=e.computed(()=>v.value.toolbar?.search!==!1),Kt=e.computed(()=>Ot.value||yt.value||pn.value||Bn.value),Bn=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),nt=e.ref(""),Fe=e.ref(!1),_e=e.ref(null);let Ze=null;function on(){Fe.value?(Ze&&(clearTimeout(Ze),Ze=null),Fe.value=!1,nt.value="",V("search",""),_e.value?.blur()):(Fe.value=!0,Ze=setTimeout(()=>{Ze=null,_e.value?.focus()},80))}function Cn(){nt.value||(Fe.value=!1)}function He(){nt.value="",V("search",""),_e.value?.focus()}const bn=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":qe.value,"dss-table-hoverable":Pt.value,[`dss-table-${O.value}`]:O.value!=="default"})),Bt=(f,k)=>f?.field??f?.key??k,ln=e.ref(new Set);function vo(){const f=new Set;Ie.columns.forEach((k,E)=>{k?.hidden!==!0&&f.add(Bt(k,E))}),ln.value=f}const Ye=e.computed(()=>Ie.columns.filter((f,k)=>ln.value.has(Bt(f,k)))),je=f=>{const k=Ie.columns.findIndex(E=>E===f);return Bt(f,k>=0?k:0)},kt=(f,k)=>ln.value.has(Bt(f,k));function Lt(f,k){const E=Bt(f,k),$=new Set(ln.value);$.has(E)?$.delete(E):$.add(E),ln.value=$}const _t=e.ref(null),Ct=e.ref(!1);function Et(f){_t.value&&!_t.value.contains(f.target)&&(Ct.value=!1)}const me=e.computed(()=>Ye.value.length+(Dt.value?1:0)+(re.value?1:0)),he=(f,k)=>f?.id??f?.key??k,ct=e.ref(new Set),bt=(f,k)=>ct.value.has(he(f,k)),Gt=(f,k,E)=>{E&&E.stopPropagation();const $=he(f,k),U=new Set(ct.value);U.has($)?(U.delete($),V("row-collapse",{data:f,index:k})):(U.add($),V("row-expand",{data:f,index:k})),ct.value=U},dt=e.ref(null),ze=e.ref(0),Ke=e.ref([]),ge=f=>{if(Qe.value==="single")return dt.value===f.field?ze.value:0;{const k=Ke.value.find(E=>E.field===f.field);return k?k.order:0}},Xe=f=>{const k=ge(f);return{"dss-sort-active":k!==0,"dss-sort-asc":k===1,"dss-sort-desc":k===-1}},Vt=e.ref({}),Te=e.ref(null),ot=e.ref(null),Ht=220,We=e.computed(()=>Ye.value.find(f=>je(f)===Te.value)??null),ut=e.computed(()=>{if(!We.value||We.value.filter!=="range")return null;const f=We.value,k=Te.value,{min:E,max:$}=xn(f),U=f.filterMin??E,ye=f.filterMax??$,Be=Nt(k),qt=Be.min??U,Tn=Be.max??ye,mt=ye-U,Zo=mt===0?0:(qt-U)/mt*100,Wo=mt===0?100:(Tn-U)/mt*100;return{rangeMin:U,rangeMax:ye,currentMin:qt,currentMax:Tn,minPct:Zo,maxPct:Wo}}),lt=e.ref(null),at=e.ref("max");function an(f){const k=lt.value,E=ut.value;if(!k||!E)return;const $=k.getBoundingClientRect(),ye=(f.clientX-$.left)/$.width*100,Be=(E.minPct+E.maxPct)/2;at.value=ye<Be?"min":"max"}function Nt(f){return Vt.value[f]??{}}function Rt(f,k){Vt.value={...Vt.value,[f]:k}}function vn(f){const k=Vt.value[f];return k?k.type==="string"?!!k.value?.trim():k.type==="range"?k.min!=null||k.max!=null:k.type==="dateRange"?!!(k.from||k.to):k.type==="list"?k.selected?.length>0:!1:!1}function wn(f){const k={...Vt.value};delete k[f],Vt.value=k,Te.value=null,ot.value=null}const sn=e.computed(()=>{let f=[...Ie.data];return Ye.value.forEach(k=>{const E=je(k),$=Vt.value[E];if(!$)return;const U=k.field;if(U){if($.type==="string"&&$.value?.trim()){const ye=$.value.trim().toLowerCase();f=f.filter(Be=>{const qt=pe(Be,k);return String(qt??"").toLowerCase().includes(ye)})}else if($.type==="range")f=f.filter(ye=>{const Be=ae(ye,U),qt=Number(Be);return!(Number.isNaN(qt)||$.min!=null&&qt<$.min||$.max!=null&&qt>$.max)});else if($.type==="dateRange"){const ye=$.from?new Date($.from).getTime():null,Be=$.to?new Date($.to).getTime():null;f=f.filter(qt=>{const Tn=ae(qt,U),mt=Tn?new Date(Tn).getTime():NaN;return!(Number.isNaN(mt)||ye!=null&&mt<ye||Be!=null&&mt>Be)})}else if($.type==="list"&&$.selected?.length){const ye=new Set($.selected);f=f.filter(Be=>{const qt=pe(Be,k);return ye.has(qt!=null?String(qt):"")})}}}),f});function io(f){const k=new Set;return Ie.data.forEach(E=>{const $=pe(E,f);k.add($!=null?String($):"")}),Array.from(k).sort((E,$)=>String(E).localeCompare(String($)))}function It(f,k){if(Te.value===f){Te.value=null,ot.value=null;return}if(k?.currentTarget){const E=k.currentTarget.getBoundingClientRect();ot.value={top:E.bottom+6,left:Math.max(8,E.right-Ht)}}Te.value=f}function An(f,k){Rt(f,{type:"string",value:k})}function xn(f){const k=f.field;if(!k)return{min:0,max:100};let E=1/0,$=-1/0;return Ie.data.forEach(U=>{const ye=ae(U,k),Be=Number(ye);Number.isNaN(Be)||(E=Math.min(E,Be),$=Math.max($,Be))}),{min:E===1/0?0:E,max:$===-1/0?100:$}}function Dn(f,k,E){const $={...Nt(f),type:"range"},U=E===""?null:Number(E),ye=U===null||Number.isNaN(U)?null:U;$[k]=ye,ye!=null&&(k==="min"&&$.max!=null&&ye>$.max&&($.max=ye),k==="max"&&$.min!=null&&ye<$.min&&($.min=ye)),Rt(f,$)}function M(f,k,E){const $={...Nt(f),type:"dateRange"};$[k]=E||"",Rt(f,$)}const A=e.reactive({});function T(f,k){A[f]=k}function W(f){const k=je(f),E=(A[k]??"").trim().toLowerCase(),$=io(f);return E?$.filter(U=>String(U).toLowerCase().includes(E)):$}function te(f,k){return(Nt(f).selected??[]).includes(k!=null?String(k):"")}function de(f,k){const $=[...Nt(f).selected??[]],U=k!=null?String(k):"",ye=$.indexOf(U);ye>=0?$.splice(ye,1):$.push(U),Rt(f,{type:"list",selected:$})}function we(f){Te.value&&!f.target.closest(".dss-table-filter-wrap")&&!f.target.closest(".dss-table-filter-dropdown")&&(Te.value=null,ot.value=null)}const ie=f=>{if(!(f.sortable===!1||!Ae.value))if(Qe.value==="single")dt.value===f.field?ze.value=ze.value===1?-1:ze.value===-1?0:1:(dt.value=f.field,ze.value=1),ze.value===0&&(dt.value=null),V("sort",{field:dt.value,order:ze.value});else{const k=Ke.value.findIndex(E=>E.field===f.field);k>=0?Ke.value[k].order===1?Ke.value[k].order=-1:Ke.value.splice(k,1):Ke.value.push({field:f.field,order:1}),V("sort",{multiSortMeta:Ke.value})}},Ve=e.computed(()=>{if(!Ae.value)return sn.value;let f=[...sn.value];return Qe.value==="single"&&dt.value&&ze.value!==0?f.sort((k,E)=>{const $=ae(k,dt.value),U=ae(E,dt.value);return $===U?0:$==null?1:U==null?-1:($<U?-1:$>U?1:0)*ze.value}):Qe.value==="multiple"&&Ke.value.length>0&&f.sort((k,E)=>{for(const $ of Ke.value){const U=ae(k,$.field),ye=ae(E,$.field);if(U===ye)continue;if(U==null)return 1;if(ye==null)return-1;const Be=U<ye?-1:U>ye?1:0;if(Be!==0)return Be*$.order}return 0}),f}),Se=e.ref(0),$t=e.ref(kn.value),Zt=e.ref(!1),rn=e.ref(null),Un=f=>{$t.value=f,Zt.value=!1,Se.value=0,V("page",{page:0,rows:$t.value})};function ko(f){rn.value&&!rn.value.contains(f.target)&&(Zt.value=!1)}const co=e.computed(()=>Ve.value.length),Rn=e.computed(()=>Math.ceil(co.value/$t.value)),Wt=e.computed(()=>fe.value?Se.value*$t.value:0),Oo=e.computed(()=>fe.value?Math.min((Se.value+1)*$t.value,co.value):co.value),To=e.computed(()=>{if(!fe.value)return Ve.value;const f=Wt.value,k=Oo.value;return Ve.value.slice(f,k)}),En=e.ref(new Set),Ho=e.computed(()=>Ve.value.filter((f,k)=>En.value.has(he(f,k)))),cn=e.computed(()=>{const f=Ve.value.length;return f>0&&En.value.size===f}),Co=e.computed(()=>{const f=Ve.value.length,k=En.value.size;return k>0&&k<f}),uo=(f,k)=>En.value.has(he(f,k)),bo=()=>{if(cn.value)En.value=new Set,V("unselect-all");else{const f=new Set;Ve.value.forEach((k,E)=>f.add(he(k,E))),En.value=f,V("select-all",Ho.value)}},st=(f,k)=>{const E=he(f,k),$=new Set(En.value),U=$.has(E);Ue.value==="single"?U?($.delete(E),V("row-unselect",f)):($.clear(),$.add(E),V("row-select",f)):U?($.delete(E),V("row-unselect",f)):($.add(E),V("row-select",f)),En.value=$},K=e.computed(()=>{const f=Rn.value,k=Se.value+1,E=2,$=[],U=[];let ye;for(let Be=1;Be<=f;Be++)(Be===1||Be===f||Be>=k-E&&Be<=k+E)&&$.push(Be);for(const Be of $)ye&&(Be-ye===2?U.push(ye+1):Be-ye!==1&&U.push("...")),U.push(Be),ye=Be;return U}),In=f=>{f<0||f>=Rn.value||(Se.value=f,V("page",{page:f,rows:$t.value}))},Me=(f,k,E)=>{V("row-click",{data:f,index:k,originalEvent:E})},fn=(f,k)=>({"dss-table-row-selected":uo(f,Wt.value+k),"dss-table-row-even":k%2===0,"dss-table-row-odd":k%2!==0}),pe=(f,k)=>k.field?ae(f,k.field):"",ae=(f,k)=>k.split(".").reduce((E,$)=>E&&E[$],f),F=f=>{const k=f.align??ht.value;return{"dss-table-sortable":f.sortable!==!1&&Ae.value,"dss-table-align-left":k==="left","dss-table-align-center":k==="center","dss-table-align-right":k==="right",[f.className]:f.className}},rt=f=>{const k={};return f.width&&(k.width=typeof f.width=="number"?`${f.width}px`:f.width),f.minWidth&&(k.minWidth=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth),f.maxWidth&&(k.maxWidth=typeof f.maxWidth=="number"?`${f.maxWidth}px`:f.maxWidth),k};return e.watch(()=>Ie.locale,f=>{f&&f!==D.value&&(D.value=f)},{immediate:!0}),e.watch(kn,f=>{$t.value=f,Se.value=0}),e.watch(nt,f=>{V("search",f??"")}),e.watch(()=>Ie.columns,()=>{vo()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ko),document.addEventListener("click",Et),document.addEventListener("click",we)}),e.onUnmounted(()=>{document.removeEventListener("click",ko),document.removeEventListener("click",Et),document.removeEventListener("click",we)}),(f,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",style:e.normalizeStyle({width:be.value+"px",height:Le.value?Le.value+"px":"auto"})},[Kt.value?(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Ir,[Ot.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:k[0]||(k[0]=E=>V("download-pdf"))},[k[21]||(k[21]=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(P)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:k[1]||(k[1]=E=>V("download-excel"))},[k[22]||(k[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_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(P)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Bn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:_t},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ct.value}]),onClick:k[2]||(k[2]=E=>Ct.value=!Ct.value),"aria-expanded":Ct.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(P)("table.columnVisibility"))+" ",1),k[23]||(k[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Fr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.columns,(E,$)=>(e.openBlock(),e.createElementBlock("li",{key:Bt(E,$),role:"option",class:"dss-table-column-visibility-option",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Pr,[e.createElementVNode("span",Or,[e.createElementVNode("input",{type:"checkbox",checked:kt(E,$),onChange:U=>Lt(E,$),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Zr),kt(E,$)?(e.openBlock(),e.createElementBlock("span",Wr,[...k[24]||(k[24]=[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",qr,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,Ct.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ur,[pn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Fe.value||nt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:_e,"onUpdate:modelValue":k[4]||(k[4]=E=>nt.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(P)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:k[5]||(k[5]=E=>Fe.value=!0),onBlur:Cn},null,40,Xr),[[e.vModelText,nt.value]]),nt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:He},[...k[25]||(k[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":Fe.value||!!nt.value,onMousedown:e.withModifiers(on,["prevent"])},[...k[26]||(k[26]=[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,Yr)],2)):e.createCommentVNode("",!0),f.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",jr,[e.renderSlot(f.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ee.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",bn.value])},[e.createElementVNode("thead",Kr,[e.createElementVNode("tr",null,[Dt.value?(e.openBlock(),e.createElementBlock("th",Gr,[Ue.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Qr,[e.createElementVNode("input",{type:"checkbox",checked:cn.value,indeterminate:Co.value,onChange:bo,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Jr),Co.value?(e.openBlock(),e.createElementBlock("span",ei)):cn.value?(e.openBlock(),e.createElementBlock("span",ti,[...k[27]||(k[27]=[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),re.value?(e.openBlock(),e.createElementBlock("th",ni)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(E,$)=>(e.openBlock(),e.createElementBlock("th",{key:je(E),class:e.normalizeClass(["dss-table-th",F(E)]),style:e.normalizeStyle(rt(E)),onClick:U=>ie(E)},[e.createElementVNode("div",li,[e.createElementVNode("span",ai,e.toDisplayString(E.header),1),E.sortable!==!1&&Ae.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Xe(E)])},[ge(E)===0?(e.openBlock(),e.createElementBlock("span",si,[...k[28]||(k[28]=[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)])])):ge(E)===1?(e.openBlock(),e.createElementBlock("span",ri,[...k[29]||(k[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:"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)])])):ge(E)===-1?(e.openBlock(),e.createElementBlock("span",ii,[...k[30]||(k[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 -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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Te.value===je(E)}]),onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":vn(je(E))}]),"aria-expanded":Te.value===je(E),"aria-label":"Filter column",onClick:U=>It(je(E),U)},[...k[31]||(k[31]=[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,ci)],2)):e.createCommentVNode("",!0)])],14,oi))),128))])]),e.createElementVNode("tbody",di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(E,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:he(E,Wt.value+$)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",fn(E,$)]),style:e.normalizeStyle(I.value),onClick:U=>Me(E,$,U)},[Dt.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:k[7]||(k[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",mi,[e.createElementVNode("input",{type:Ue.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${Z.tableId}`,checked:uo(E,Wt.value+$),onChange:U=>st(E,Wt.value+$),class:e.normalizeClass(["dss-table-checkbox",Ue.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,pi),Ue.value==="multiple"&&uo(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("span",vi,[...k[32]||(k[32]=[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)])])):Ue.value==="single"&&uo(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("span",fi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(U=>Gt(E,Wt.value+$,U),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":bt(E,Wt.value+$),"aria-label":bt(E,Wt.value+$)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":bt(E,Wt.value+$)}]),"aria-hidden":"true"},[...k[33]||(k[33]=[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,hi)],8,gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(U,ye)=>(e.openBlock(),e.createElementBlock("td",{key:je(U),class:e.normalizeClass(["dss-table-td",F(U)]),style:e.normalizeStyle(rt(U))},[e.renderSlot(f.$slots,`cell-${U.field}`,{data:E,column:U,rowIndex:$},()=>[e.createTextVNode(e.toDisplayString(pe(E,U)),1)])],6))),128))],14,ui),re.value&&bt(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("tr",yi,[e.createElementVNode("td",{colspan:me.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(f.$slots,"expansion",{data:E,rowIndex:$})],8,ki)])):e.createCommentVNode("",!0)],64))),128)),To.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(I.value)},[e.createElementVNode("td",{colspan:me.value,class:"dss-table-empty-cell"},[e.renderSlot(f.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(_n.value),1)])],8,Ci)],4))])],2)],2),fe.value?(e.openBlock(),e.createElementBlock("div",bi,[e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:k[8]||(k[8]=E=>In(0)),title:e.unref(P)("table.firstPage")},[...k[34]||(k[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Ei),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:k[9]||(k[9]=E=>In(Se.value-1)),title:e.unref(P)("table.previousPage")}," ‹ ",8,Vi),e.createElementVNode("span",Ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===Se.value+1}]),onClick:$=>In(E-1)},e.toDisplayString(E),11,Si)):(e.openBlock(),e.createElementBlock("span",Mi,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Rn.value-1,onClick:k[10]||(k[10]=E=>In(Se.value+1)),title:e.unref(P)("table.nextPage")}," › ",8,Bi),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Rn.value-1,onClick:k[11]||(k[11]=E=>In(Rn.value-1)),title:e.unref(P)("table.lastPage")},[...k[35]||(k[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ti)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:rn},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Zt.value}]),onClick:k[12]||(k[12]=E=>Zt.value=!Zt.value),"aria-expanded":Zt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString($t.value)+" ",1),k[36]||(k[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Hi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===$t.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===$t.value}]),onClick:$=>Un(E)},e.toDisplayString(E),11,Li))),128))],512),[[e.vShow,Zt.value]])]),_:1})],512)])])):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(ot.value?{top:ot.value.top+"px",left:ot.value.left+"px",width:Ht+"px"}:void 0),onClick:k[20]||(k[20]=e.withModifiers(()=>{},["stop"]))},[We.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[We.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("input",{type:"text",value:Nt(Te.value).value??"",onInput:k[13]||(k[13]=E=>An(Te.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Ai)])):We.value.filter==="range"&&ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ut.value.minPct+"%","--range-max-pct":ut.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:lt,class:"dss-table-filter-double-range-track",onMousemove:an,onMouseenter:an},[e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMin,onInput:k[14]||(k[14]=E=>Dn(Te.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:at.value==="min"?2:1})},null,44,Di),e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMax,onInput:k[15]||(k[15]=E=>Dn(Te.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:at.value==="max"?2:1})},null,44,Ri)],544),e.createElementVNode("div",Ii,e.toDisplayString(ut.value.currentMin)+" – "+e.toDisplayString(ut.value.currentMax),1)],4)):We.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Fi,[e.createElementVNode("div",zi,[e.createElementVNode("label",Pi,e.toDisplayString(e.unref(P)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Nt(Te.value).from??"",onInput:k[16]||(k[16]=E=>M(Te.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Oi)]),e.createElementVNode("div",Zi,[e.createElementVNode("label",Wi,e.toDisplayString(e.unref(P)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Nt(Te.value).to??"",onInput:k[17]||(k[17]=E=>M(Te.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,qi)])])):We.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:A[Te.value]??"",onInput:k[18]||(k[18]=E=>T(Te.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Ui),e.createElementVNode("div",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W(We.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:te(Te.value,E),onChange:$=>de(Te.value,E)},null,40,Yi),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",ji,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:k[19]||(k[19]=E=>wn(Te.value))},e.toDisplayString(e.unref(P)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Te.value&&We.value&&ot.value]])]),_:1})]))],64))}}),Qi={class:"dss-toolbar-left"},Ji=["title"],ec=["title"],tc={class:"dss-toolbar-dropdown-wrapper"},nc=["title"],oc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ac={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rc={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ic={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},dc=["title"],uc=["title"],mc=["title"],pc=["title"],vc=["title"],fc=["title"],gc=["title"],hc=["title"],yc=["title"],kc={key:2,class:"dss-toolbar-separator"},Cc=["title"],bc={key:4,class:"dss-toolbar-separator"},wc={key:5,class:"dss-toolbar-dropdown-wrapper"},xc=["title"],Ec={class:"dss-toolbar-dropdown-ai"},Vc={class:"dss-toolbar-right"},Nc={key:0,class:"dss-toolbar-custom-group"},Sc={key:1,class:"dss-toolbar-separator"},Mc={class:"dss-link-modal-content"},Bc={class:"dss-link-modal-field"},Tc={class:"dss-link-modal-label"},Hc=["placeholder"],$c={class:"dss-link-modal-field"},Lc={class:"dss-link-modal-label"},_c=["placeholder"],Ac={class:"dss-image-modal-tabs"},Dc={key:0,class:"dss-image-tab-content"},Rc={class:"dss-link-modal-content"},Ic={class:"dss-link-modal-field"},Fc={key:0,class:"dss-link-modal-label"},zc=["src"],Pc={class:"dss-link-modal-field"},Oc={class:"dss-link-modal-label"},Zc=["placeholder"],Wc={class:"dss-link-modal-field"},qc={class:"dss-link-modal-label"},Uc=["placeholder"],Xc={class:"dss-link-modal-field"},Yc={class:"dss-link-modal-label"},jc=["placeholder"],Kc={key:1,class:"dss-image-tab-content"},Gc={class:"dss-link-modal-content"},Qc={class:"dss-link-modal-field"},Jc={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},od=["placeholder"],ld={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-link-modal-field"},id={class:"dss-link-modal-label"},cd=["placeholder"],dd={class:"dss-text-editor-title-input-container"},ud={key:0,class:"dss-text-editor-title-preview"},md={key:0},pd={key:1,class:"dss-text-editor-preview-placeholder"},vd=["value","placeholder","disabled"],fd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},gd={class:"dss-text-editor-description-input-container"},hd={key:0,class:"dss-text-editor-description-preview"},yd={key:0},kd={key:1,class:"dss-text-editor-preview-placeholder"},Cd=["value","placeholder","disabled"],bd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},wd=["data-comment-id","onMouseenter"],xd=["onClick"],Ed=["src","alt"],Vd={key:1},Nd=["onClick"],Sd=["src","alt"],Md={key:1},Bd=["data-has-second-user","onClick"],Td={class:"editor-comment-marker-count"},Hd={key:4,class:"dss-text-editor-textarea-wrapper"},$d=["value","placeholder","rows","disabled"],Ld={class:"dss-text-editor-footer"},_d={class:"dss-text-editor-footer-content"},Ad={class:"dss-text-editor-footer-stat"},Dd={class:"dss-text-editor-footer-stat"},Rd={key:5,class:"dss-text-editor-content-wrapper"},Id={key:0,class:"dss-comment-overlay-body"},Fd={class:"dss-comment-selection-wrapper"},zd=["innerHTML"],Pd={class:"dss-comment-messages-wrapper"},Od={key:0,class:"dss-comment-avatar-wrapper"},Zd={class:"dss-comment-avatar"},Wd=["src","alt"],qd={key:1},Ud={class:"dss-comment-header"},Xd={class:"dss-comment-header-text"},Yd={class:"dss-comment-author"},jd={key:0,class:"dss-comment-date"},Kd=["onClick","title"],Gd={class:"dss-comment-overlay-inner"},Qd=["placeholder","onKeydown"],Jd={class:"dss-text-editor-footer"},eu={class:"dss-text-editor-footer-content"},tu={class:"dss-text-editor-footer-stat"},nu={class:"dss-text-editor-footer-stat"},ou=["title"],lu=["title"],au={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:""},su={class:"dss-image-popup-content"},ru={key:0,class:"dss-image-popup-no-alt-icon"},iu=["title"],cu=["title"],du={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:""},uu={class:"dss-toolbar-left"},mu=["title"],pu=["title"],vu={class:"dss-toolbar-dropdown-wrapper"},fu=["title"],gu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},hu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ku={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Cu={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},bu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},xu=["title"],Eu=["title"],Vu=["title"],Nu=["title"],Su=["title"],Mu=["title"],Bu=["title"],Tu=["title"],Hu=["title"],$u=["title"],Lu={key:2,class:"dss-toolbar-separator"},_u={key:3,class:"dss-toolbar-dropdown-wrapper"},Au=["title"],Du={class:"dss-toolbar-dropdown-ai"},Ru={key:0,class:"dss-toolbar-right"},Iu={key:0,class:"dss-toolbar-separator"},Fu={key:0,class:"dss-toolbar-custom-group"},zu={key:1,class:"dss-toolbar-separator"},Pu={name:"DSSTextEditor"},Ou=Object.assign(Pu,{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:Z=>typeof Z=="object"&&Z!==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:Z=>typeof Z=="object"&&Z!==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(Z,{expose:jt,emit:P}){const{t:D,locale:Ie}=al.useI18n(),V=Z,Ce=P,Ge=e.useSlots(),gt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
|
+
`}const o=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(o),g=document.createElement("a");g.href=c,g.download=wo("csv"),document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(c),mt()}catch(t){console.error("Error downloading CSV:",t)}},Fn=t=>{if(typeof t.action=="function"){const s={series:I.series,categories:I.categories,markers:rt.value},o={chartX:ae.value.chartX,chartY:ae.value.chartY,dataX:ae.value.mouseDataX,dataY:ae.value.mouseDataY,categoryIndex:clampedCategoryIndex||ae.value.categoryIndex};t.action(s,o)}mt()},zn=()=>{jn(),f.value.show=!0,f.value.categoryIndex=ae.value.categoryIndex,f.value.fromButton=!1,mt()},Qn=()=>{jn(),f.value.show=!0,f.value.categoryIndex=0,f.value.fromButton=!0},Pn=t=>{if(ae.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ae.value.show=!1)}},Jt=t=>{ae.value.show&&!t.target.closest(".context-menu")&&(ae.value.show=!1)},Lo=t=>{if(!Yt.value||!Bt.value)return;t.preventDefault(),t.stopPropagation(),F.value.isZooming=!0,pe.value.show=!1,F.value.zoomTimeout&&clearTimeout(F.value.zoomTimeout);const o=t.currentTarget.getBoundingClientRect(),c=t.clientX-o.left,g=t.clientY-o.top;if(c<B.value.left-50||c>B.value.right+50||g<B.value.top-50||g>B.value.bottom+100){F.value.isZooming=!1;return}const h=t.deltaY>0?.9:1.1,w=Math.max(F.value.minScale,Math.min(F.value.maxScale,F.value.scale*h));if(w!==F.value.scale){const{minX:C,maxX:S}=tt.value,H=S-C||1,L=H/F.value.scale,_=C-F.value.offsetX/B.value.width*H,Y=(c-B.value.left)/B.value.width,le=_+Y*L;F.value.scale=w;const se=H/F.value.scale,q=le-Y*se;F.value.offsetX=-(q-C)/H*B.value.width,F.value.scale<=1.01&&(F.value.scale=1,F.value.offsetX=0)}F.value.zoomTimeout=setTimeout(()=>{F.value.isZooming=!1,F.value.zoomTimeout=null},300)},xo=t=>{if(!Yt.value||!Bt.value||F.value.scale<=1)return;pe.value.show=!1;const o=t.currentTarget.getBoundingClientRect();t.clientX-o.left,t.clientY-o.top,F.value.isDragging=!0,F.value.lastMouseX=t.clientX,F.value.lastMouseY=t.clientY,t.preventDefault()},Nl=()=>{F.value.isDragging=!1},_o=()=>{!Yt.value||!Bt.value||(F.value.scale=1,F.value.offsetX=0,F.value.isDragging=!1,F.value.zoomTimeout&&(clearTimeout(F.value.zoomTimeout),F.value.zoomTimeout=null),F.value.isZooming=!1)},vl=()=>!Yt.value||!In.value||!Bt.value?"default":F.value.isDragging?"grabbing":F.value.scale>1?"grab":"dss-crosshair",Xo=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 s=`M ${t[0].x} ${t[0].y}`;for(let o=0;o<t.length-1;o++){const c=t[Math.max(o-1,0)],g=t[o],h=t[o+1],w=t[Math.min(o+2,t.length-1)],C=g.x+(h.x-c.x)/6*me.value,S=g.y+(h.y-c.y)/6*me.value,H=h.x-(w.x-g.x)/6*me.value,L=h.y-(w.y-g.y)/6*me.value;s+=` C ${C} ${S} ${H} ${L} ${h.x} ${h.y}`}return s},Jn=e.computed(()=>{let s=50+(Ot.value?30:0)+60;if(Nn.value)return{left:90,top:90,right:90,bottom:90};if(gn.value){let w=0;Q.value&&(w+=15),Ee.value&&(w+=10);const C=qe();let S=66,H=50;return _e.value&&Ze.value==="left"?S+=C.legendWidth||150:_e.value&&Ze.value==="right"&&(H+=C.legendWidth||150),{left:S,top:50+w,right:H,bottom:130}}let o=0;Q.value&&(o+=15),Ee.value&&(o+=10);const c=qe();let g=66,h=50;return _e.value&&Ze.value==="left"?g+=c.legendWidth||150:_e.value&&Ze.value==="right"&&(h+=c.legendWidth||150),_e.value&&Ze.value==="bottom"&&(s+=c.legendHeight||0),{left:g,top:50+o,right:h,bottom:s}}),B=e.computed(()=>({left:Jn.value.left,top:Jn.value.top,right:Ue.value-Jn.value.right,bottom:Qe.value-Jn.value.bottom,width:Ue.value-(Jn.value.left+Jn.value.right),height:Qe.value-(Jn.value.top+Jn.value.bottom)})),Yt=e.computed(()=>["line","area","bar"].includes(fe.value)||kn.value),Vn=e.computed(()=>kn.value),gn=e.computed(()=>["radial","semi-radial"].includes(fe.value)),Nn=e.computed(()=>fe.value==="spider"),wt=e.computed(()=>fe.value==="bubble"),At=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(fe.value==="bar"||Vn.value)),eo=t=>{const{minY:s,maxY:o}=tt.value,c=o-s||1;return B.value.left+(t-s)/c*B.value.width},to=t=>{const{maxX:s}=tt.value,o=s+1,g=B.value.height/o;return B.value.top+(t+.5)*g},Je=e.computed(()=>Ue.value/2),et=e.computed(()=>Nn.value?Qe.value/2-40:Qe.value/2),Pe=e.computed(()=>{if(Nn.value){const t=B.value.width-80,s=B.value.height-80;return Math.min(t,s)/2}return Math.min(B.value.width,B.value.height)/2}),un=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,o=typeof s=="number"&&s>=0&&s<=1?s:.45;return Pe.value*o}),fl=e.computed(()=>{const t=O.value,s=typeof I.innerSize=="number"?I.innerSize:t?.innerSize;return typeof s!="number"||s<=0||!(gn.value||Nn.value)?1:1+s/100}),Yo=e.computed(()=>{if(fl.value<=1)return;const t=Je.value,s=et.value,o=fl.value;return`translate(${t}, ${s}) scale(${o}) translate(${-t}, ${-s})`}),Hn=e.ref(0),Eo=e.computed(()=>`semi-radial-fill-clip-${I.chartId}`),no=e.computed(()=>fe.value==="semi-radial"),jo=e.computed(()=>no.value&&bt.value&&!tn.value),Sl=e.computed(()=>{const t=jo.value?Hn.value:1,s=Je.value,o=et.value,c=un.value,g=Pe.value,h=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;const C=s+g*Math.cos(h),S=o+g*Math.sin(h),H=s+g*Math.cos(w),L=o+g*Math.sin(w),_=s+c*Math.cos(w),Y=o+c*Math.sin(w),le=s+c*Math.cos(h),se=o+c*Math.sin(h),q=t>.5?1:0;return`M ${s} ${o} L ${C} ${S} A ${g} ${g} 0 ${q} 1 ${H} ${L} L ${_} ${Y} A ${c} ${c} 0 ${q} 1 ${le} ${se} Z`}),Ko=e.computed(()=>no.value&&jo.value?`url(#${Eo.value})`:void 0),mn=e.ref(0),On=e.computed(()=>`radial-reveal-clip-${I.chartId}`),en=e.computed(()=>fe.value==="radial"),Vo=e.computed(()=>{const t=en.value?mn.value:1,s=Je.value,o=et.value,c=Math.max(Pe.value*1.5,Ue.value,Qe.value);if(t<=0)return`M ${s} ${o} L ${s} ${o} Z`;if(t>=1){const _=s-c,Y=s+c;return`M ${_} ${o} A ${c} ${c} 0 0 1 ${Y} ${o} A ${c} ${c} 0 0 1 ${_} ${o} Z`}const g=-Math.PI/2,h=g+t*Math.PI*2,w=s+c*Math.cos(g),C=o+c*Math.sin(g),S=s+c*Math.cos(h),H=o+c*Math.sin(h),L=t>=.5?1:0;return`M ${s} ${o} L ${w} ${C} A ${c} ${c} 0 ${L} 1 ${S} ${H} Z`}),St=e.computed(()=>{if(Ko.value)return Ko.value;if(en.value)return`url(#${On.value})`});let go=null;const gl=()=>{if(!jo.value)return;Hn.value=0;const t=dt.value,s=performance.now(),o=c=>{const g=c-s,h=Math.min(1,g/t);Hn.value=$n(Ke.value,h),h<1&&(go=requestAnimationFrame(o))};go=requestAnimationFrame(o)},oo=e.computed(()=>O.value?.bubbles?.minSize||8),mo=e.computed(()=>O.value?.bubbles?.maxSize||50),po=e.computed(()=>O.value?.bubbles?.opacity||.7),lo=(t,s)=>{const o=[15,20,25,18,22],c=o[t%o.length]||20,g=1+Math.sin(s*.5)*.2;return Math.max(5,c*g)},ho=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Ml=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Zn=e.computed(()=>I.series),Sn=e.computed(()=>I.series.filter((t,s)=>!st.value.has(s))),Wn="auto",tt=e.computed(()=>{if(wt.value)return hl();if(!Sn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,o=0;Sn.value.forEach(C=>{C.data&&C.data.length&&(o=Math.max(o,C.data.length-1),C.data.forEach(S=>{typeof S=="number"&&(t=Math.min(t,S),s=Math.max(s,S))}))}),I.categories.length>0&&(o=Math.max(o,I.categories.length-1)),t===1/0&&(t=0,s=100);const c=pn.value,g=Kt.value;let h,w;if(c===Wn){const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}else if(typeof c=="number")h=c;else{const C=s-t,S=C>0?C*.1:1;h=Math.max(0,t-S)}if(g===Wn){const C=s-t,S=C>0?C*.1:2;w=s+S}else if(typeof g=="number")w=g;else{const C=s-t,S=C>0?C*.1:2;w=s+S}return{minX:0,maxX:o,minY:h,maxY:w}}),hl=()=>{if(!Sn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,o=1/0,c=-1/0,g=1/0,h=-1/0,w=!1;if(Sn.value.forEach((le,se)=>{le?.data?.length&&le.data.forEach((q,ne)=>{let G,X,ke;if(typeof q=="object"&&q!==null&&!Array.isArray(q))G=typeof q.x=="number"?q.x:ne,X=typeof q.y=="number"?q.y:0,ke=typeof q.size=="number"?q.size:20;else if(Array.isArray(q)&&q.length>=3)G=typeof q[0]=="number"?q[0]:ne,X=typeof q[1]=="number"?q[1]:0,ke=typeof q[2]=="number"?q[2]:20;else if(typeof q=="number")G=ne,X=q,ke=lo(se,ne);else return;isFinite(G)&&isFinite(X)&&isFinite(ke)&&(t=Math.min(t,G),s=Math.max(s,G),o=Math.min(o,X),c=Math.max(c,X),g=Math.min(g,ke),h=Math.max(h,ke),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,I.categories?.length-1||8)),o===c&&(o=Math.max(0,o-10),c=o+20);const C=s-t,S=c-o;let H,L,_,Y;return Bn.value!==null?H=Bn.value:H=t-C*.1,nt.value!==null?L=nt.value:L=s+C*.1,pn.value!==null&&typeof pn.value=="number"?_=pn.value:_=Math.max(0,o-S*.1),Kt.value!==null&&typeof Kt.value=="number"?Y=Kt.value:Y=c+S*.1,{minX:H,maxX:L,minY:_,maxY:Y,minSize:g,maxSize:h}},Mt=t=>{if(wt.value){const{minX:C,maxX:S}=tt.value,H=S-C||1;return B.value.left+(t-C)/H*B.value.width}const{minX:s,maxX:o}=tt.value,c=o-s;if(o===0||c===0)return B.value.left+B.value.width/2;const g=c/F.value.scale,h=s-F.value.offsetX/B.value.width*c,w=(t-h)/g;return B.value.left+w*B.value.width},Ft=t=>{const{minY:s,maxY:o}=tt.value,c=o-s||1;return B.value.bottom-(t-s)/c*B.value.height},Ao=t=>{if(!wt.value)return kt.value||4;const{maxSize:s}=tt.value,o=Math.max(1,s),c=Math.min(1,Math.max(0,t/o));return oo.value+c*(mo.value-oo.value)},Go=e.computed(()=>Qo.value.map(t=>({y:t.y}))),No=e.computed(()=>{if(wt.value)return Bl();if(fe.value==="bar"){if(At.value){const ee=[],{minY:oe,maxY:ce}=tt.value,ue=5,Re=ce-oe||1;for(let Oe=0;Oe<=ue;Oe++){const yn=oe+Re*(Oe/ue),zt=eo(yn);ee.push({x:zt,y:B.value.bottom+20,text:an(Math.round(yn))})}return ee}const se=[],{maxX:q}=tt.value,ne=q+1,G=5,ke=(B.value.width-G*2)/ne;for(let ee=0;ee<=q;ee++){const oe=B.value.left+G+(ee+.5)*ke;se.push({x:oe,y:B.value.bottom+20,text:I.categories[ee]||P("chart.fallback.item",{number:ee+1})})}return se}const t=[],{minX:s,maxX:o}=tt.value,c=o-s||1,g=c/F.value.scale,h=s-F.value.offsetX/B.value.width*c,w=h+g,C=Math.max(0,Math.floor(h-2)),S=Math.min(o,Math.ceil(w+2)),H=S-C,L=B.value.width,Y=Math.floor(L/60);let le=1;H>Y&&(le=Math.ceil(H/Y));for(let se=C;se<=S;se+=le)if(se>=0&&se<=o){const q=Mt(se);q>=B.value.left-100&&q<=B.value.right+100&&t.push({x:q,y:B.value.bottom+20,text:I.categories[se]||`Item ${se+1}`})}return t}),Bl=()=>{const t=[],{minX:s,maxX:o}=tt.value,c=o-s||1,g=Math.min(8,Math.max(4,Math.floor(B.value.width/80)));for(let h=0;h<=g;h++){const w=s+c*h/g,C=Mt(w);if(C>=B.value.left-10&&C<=B.value.right+10){const S=Math.round(w),H=I.categories?.[S];t.push({x:C,y:B.value.bottom+20,text:H||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},Qo=e.computed(()=>{if(At.value){const g=[],{maxX:h}=tt.value;for(let w=0;w<=h;w++)g.push({x:B.value.left-10,y:to(w),text:I.categories[w]||`Item ${w+1}`});return g}const t=[],{minY:s,maxY:o}=tt.value,c=5;for(let g=0;g<=c;g++){const h=s+(o-s)*(g/c),w=Math.round(h);t.push({x:B.value.left-10,y:Ft(h),text:an(w)})}return t}),pt=t=>{const s=ct.value;if(!s||s.length===0){const o=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return o[t%o.length]}return s[t%s.length]},Do=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),o=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(o){const h=Math.max(0,Math.floor(Number(o[1])*.65)),w=Math.max(0,Math.floor(Number(o[2])*.65)),C=Math.max(0,Math.floor(Number(o[3])*.65));return`rgb(${h}, ${w}, ${C})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const h=Math.max(0,Math.floor(Number(c[1])*.65)),w=Math.max(0,Math.floor(Number(c[2])*.65)),C=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${h}, ${w}, ${C}, ${c[4]})`}const g=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(g){let h=g[1];h.length===3&&(h=h[0]+h[0]+h[1]+h[1]+h[2]+h[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(2,4),16)*.65))),S=Math.max(0,Math.min(255,Math.floor(parseInt(h.slice(4,6),16)*.65)));return`#${[w,C,S].map(H=>H.toString(16).padStart(2,"0")).join("")}`}return s},yl=(t,s)=>{const c=O.value?.stroke?.color;return c==null?Do(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Do(s):Do(s)},Ro=t=>{let s=0;for(let o=1;o<t.length;o++){const c=t[o].x-t[o-1].x,g=t[o].y-t[o-1].y;s+=Math.sqrt(c*c+g*g)}return s},Jo=e.computed(()=>fe.value==="line"||Vn.value?(Vn.value?I.series.filter(s=>(s.type||fe.value)==="line"):Zn.value).map((s,o)=>{const c=I.series.findIndex(_=>_===s),g=[];let h=[];s.data.forEach((_,Y)=>{_==null?h.length>0&&(g.push([...h]),h=[]):h.push({x:At.value?eo(_):Mt(Y),y:At.value?to(Y):Ft(_),index:Y})}),h.length>0&&g.push(h);let w="";g.forEach(_=>{if(_.length>0){let Y="";Et.value?Y=Xo(_):Y=`M ${_[0].x} ${_[0].y}`+_.slice(1).map(le=>` L ${le.x} ${le.y}`).join(""),w+=(w?" ":"")+Y}});const C=g.reduce((_,Y)=>_+Ro(Y),0),S=st.value.has(c),H=K.value===c,L=K.value!==null&&K.value!==c;return{path:w,color:pt(c),pathLength:C,seriesIndex:c,animationDelay:o*ge.value,isHighlighted:H,isDimmed:L,isHidden:S}}):[]),kl=e.computed(()=>{if(!(fe.value==="line"||Vn.value))return[];const t=Vn.value?I.series.filter(o=>(o.type||fe.value)==="line"):Zn.value,s=[];return t.forEach((o,c)=>{const g=I.series.findIndex(h=>h===o);for(let h=0;h<o.data.length-1;h++){const w=o.data[h];if(w!=null){let C=-1,S=0;for(let H=h+1;H<o.data.length;H++){const L=o.data[H];if(L==null)S++;else{C=H;break}}if(S>0&&C!==-1){const H=o.data[C],L=At.value?eo(w):Mt(h),_=At.value?to(h):Ft(w),Y=At.value?eo(H):Mt(C),le=At.value?to(C):Ft(H),se=st.value.has(g),q=K.value===g,ne=K.value!==null&&K.value!==g;s.push({path:`M ${L} ${_} L ${Y} ${le}`,color:pt(g),seriesIndex:g,animationDelay:c*ge.value,isHighlighted:q,isDimmed:ne,isHidden:se,gapSize:S}),h=C-1}}}}),s}),So=e.computed(()=>fe.value==="line"||Vn.value?!bt.value||tn.value||xe.value.hasAnimated?[]:(Vn.value?I.series.filter(s=>(s.type||fe.value)==="line"):Zn.value).map((s,o)=>{const c=I.series.findIndex(S=>S===s);let g="",h=null;s.data.forEach((S,H)=>{if(S!=null){const L={x:At.value?eo(S):Mt(H),y:At.value?to(H):Ft(S)};h===null?g+=`M ${L.x} ${L.y}`:g+=` L ${L.x} ${L.y}`,h=L}else if(h!==null){const L=s.data.findIndex((_,Y)=>Y>H&&_!==null&&_!==void 0);if(L!==-1){const _={x:At.value?eo(s.data[L]):Mt(L),y:At.value?to(L):Ft(s.data[L])};g+=` L ${_.x} ${_.y}`,h=_}}});const w=s.data.map((S,H)=>S==null?null:{x:At.value?eo(S):Mt(H),y:At.value?to(H):Ft(S)}).filter(S=>S!==null),C=Ro(w);return{path:g,pathLength:C,color:pt(c),animationDelay:o*ge.value,seriesIndex:c}}):[]),ao=e.computed(()=>{if(fe.value!=="line")return[];const t=[];return Zn.value.forEach((s,o)=>{const c=K.value===o,g=K.value!==null&&K.value!==o,h=st.value.has(o);s.data.forEach((w,C)=>{w!=null&&t.push({x:Mt(C),y:Ft(w),color:pt(o),value:w,label:I.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(o*s.data.length+C)*(ge.value/8),isHighlighted:c,isDimmed:g,isHidden:h})})}),t}),el=e.computed(()=>{if(!Vn.value)return[];const t=[];return I.series.filter(o=>(o.type||fe.value)==="line").forEach((o,c)=>{const g=I.series.findIndex(S=>S===o),h=K.value===g,w=K.value!==null&&K.value!==g,C=st.value.has(g);o.data.forEach((S,H)=>{S!=null&&t.push({x:Mt(H),y:Ft(S),color:pt(g),value:S,label:I.categories[H]||H.toString(),seriesName:o.name,categoryIndex:H,dataIndex:H,animationDelay:(c*o.data.length+H)*(ge.value/8),isHighlighted:h,isDimmed:w,isHidden:C})})}),t}),Mo=e.computed(()=>{if(!wt.value)return[];const t=[];return Zn.value.forEach((s,o)=>{if(!s?.data?.length)return;const c=K.value,g=c!==null&&c===o,h=c!==null&&c!==o,w=st.value.has(o);s.data.forEach((C,S)=>{let H,L,_,Y,le;if(typeof C=="object"&&C!==null&&!Array.isArray(C))H=typeof C.x=="number"?C.x:S,L=typeof C.y=="number"?C.y:0,_=typeof C.size=="number"?C.size:20,Y=C.label||I.categories?.[S]||`Point ${S+1}`,le=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)H=typeof C[0]=="number"?C[0]:S,L=typeof C[1]=="number"?C[1]:0,_=typeof C[2]=="number"?C[2]:20,Y=C[3]||I.categories?.[S]||`Point ${S+1}`,le=C[4];else if(typeof C=="number")H=S,L=C,_=lo(o,S),Y=I.categories?.[S]||`Point ${S+1}`;else return;!isFinite(H)||!isFinite(L)||!isFinite(_)||t.push({x:Mt(H),y:Ft(L),radius:Ao(_),originalX:H,originalY:L,originalSize:_,color:pt(o),seriesName:s.name||`Series ${o+1}`,label:Y,imageUrl:le,seriesIndex:o,dataIndex:S,categoryIndex:Math.round(H),isHighlighted:g,isDimmed:h,isHidden:w,opacity:po.value})})}),t}),tl=e.computed(()=>fe.value!=="area"?[]:Zn.value.map((t,s)=>{const o=[];let c=[];if(t.data.forEach((_,Y)=>{_==null?c.length>0&&(o.push([...c]),c=[]):c.push({x:Mt(Y),y:Ft(_),index:Y})}),c.length>0&&o.push(c),o.length===0)return{linePath:"",areaPath:"",color:pt(s),isHidden:st.value.has(s)};const g=B.value.bottom+1;let h="",w="";o.forEach((_,Y)=>{if(_.length===0)return;let le=`M ${_[0].x} ${_[0].y}`;Et.value&&_.length>1?le=Xo(_):_.slice(1).forEach(q=>{le+=` L ${q.x} ${q.y}`}),h+=(h?" ":"")+le;let se=`M ${_[0].x} ${g}`;if(se+=` L ${_[0].x} ${_[0].y}`,Et.value&&_.length>1){const q=Xo(_),ne=q.substring(q.indexOf("C")||q.indexOf("Q")||q.indexOf("L"));ne?se+=" "+ne:_.slice(1).forEach(G=>{se+=` L ${G.x} ${G.y}`})}else _.slice(1).forEach(q=>{se+=` L ${q.x} ${q.y}`});se+=` L ${_[_.length-1].x} ${g} Z`,w+=(w?" ":"")+se});const C=K.value===s,S=K.value!==null&&K.value!==s,H=st.value.has(s),L=o.reduce((_,Y)=>_+Ro(Y),0);return{linePath:h,areaPath:w,color:pt(s),pathLength:L,isHighlighted:C,isDimmed:S,isHidden:H}})),Cl=e.computed(()=>{if(!(["bar"].includes(fe.value)||Vn.value))return[];const t=[],{maxX:s}=tt.value,o=Vn.value?I.series.filter(g=>(g.type||fe.value)==="bar"):Zn.value,c=o.length;if(At.value){const g=s+1,w=B.value.height/g,C=w*(2/3),S=Math.min(4,C/c*.15),H=C-(c-1)*S,L=Math.max(4,H/c);o.forEach((_,Y)=>{const le=I.series.findIndex(G=>G===_),se=K.value===le,q=K.value!==null&&K.value!==le,ne=st.value.has(le);_.data.forEach((G,X)=>{if(G==null||typeof G!="number"||!isFinite(G))return;const oe=B.value.top+(X+.5)*w-C/2+Y*(L+S),ce=B.value.left,ue=Math.abs(eo(G)-B.value.left);let Re="";if(Et.value&&ue>0){const Oe=Math.min(he.value,L/2,ue/2);Re=[`M ${ce} ${oe}`,`L ${ce+ue-Oe} ${oe}`,`Q ${ce+ue} ${oe} ${ce+ue} ${oe+Oe}`,`L ${ce+ue} ${oe+L-Oe}`,`Q ${ce+ue} ${oe+L} ${ce+ue-Oe} ${oe+L}`,`L ${ce} ${oe+L}`,"Z"].join(" ")}t.push({x:ce,y:oe,width:ue,height:L,color:pt(c===1?X:le),value:G,label:I.categories[X]||X.toString(),seriesName:_.name,animationDelay:(Y*o.length+X)*(ge.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:Et.value&&ue>0})})})}else{const g=s+1,w=B.value.width/g,C=w*.8,S=C/c,H=S*.05,L=S-H;o.forEach((_,Y)=>{const le=I.series.findIndex(G=>G===_),se=K.value===le,q=K.value!==null&&K.value!==le,ne=st.value.has(le);_.data.forEach((G,X)=>{if(G==null||typeof G!="number"||!isFinite(G))return;const oe=B.value.left+(X+.5)*w-C/2+Y*S+H/2,ce=Ft(Math.max(0,G)),ue=Math.abs(Ft(0)-Ft(G));let Re="";if(Et.value&&ue>0){const Oe=Math.min(he.value,L/2,ue/2);Re=[`M ${oe} ${ce+ue}`,`L ${oe} ${ce+Oe}`,`Q ${oe} ${ce} ${oe+Oe} ${ce}`,`L ${oe+L-Oe} ${ce}`,`Q ${oe+L} ${ce} ${oe+L} ${ce+Oe}`,`L ${oe+L} ${ce+ue}`,"Z"].join(" ")}t.push({x:oe,y:ce,width:L,height:ue,color:pt(c===1?X:le),value:G,label:I.categories[X]||X.toString(),seriesName:_.name,animationDelay:(Y*o.length+X)*(ge.value/4),isHighlighted:se,isDimmed:q,isHidden:ne,barPath:Re,isSmooth:Et.value&&ue>0})})})}return t}),yo=e.computed(()=>{if(!gn.value)return[];const t=Zn.value.map((h,w)=>({series:h,originalIndex:w})).filter(({originalIndex:h})=>!st.value.has(h));if(t.length===0)return[];let s=fe.value==="semi-radial"?Math.PI:-Math.PI/2;const o=fe.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:h,originalIndex:w}=t[0],C=h.data[0]||0,S=s,H=s+o-.001,L=S+o/2,_=Je.value+Math.cos(S)*un.value,Y=et.value+Math.sin(S)*un.value,le=Je.value+Math.cos(H)*un.value,se=et.value+Math.sin(H)*un.value,q=Je.value+Math.cos(H)*Pe.value,ne=et.value+Math.sin(H)*Pe.value,G=Je.value+Math.cos(S)*Pe.value,X=et.value+Math.sin(S)*Pe.value,ke=1,ee=[`M ${_} ${Y}`,`A ${un.value} ${un.value} 0 ${ke} 1 ${le} ${se}`,`L ${q} ${ne}`,`A ${Pe.value} ${Pe.value} 0 ${ke} 0 ${G} ${X}`,"Z"].join(" "),oe=pt(w);return c.push({path:ee,color:oe,strokeWidth:je.value,strokeColor:yl(0,oe),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:!1,isHidden:!1,startAngle:S,endAngle:H,midAngle:L}),c}const g=t.reduce((h,{series:w})=>h+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:h,originalIndex:w})=>{const C=h.data[0]||0,S=C/g*o,H=s,L=s+S,_=H+S/2,Y=Je.value+Math.cos(H)*un.value,le=et.value+Math.sin(H)*un.value,se=Je.value+Math.cos(L)*un.value,q=et.value+Math.sin(L)*un.value,ne=Je.value+Math.cos(L)*Pe.value,G=et.value+Math.sin(L)*Pe.value,X=Je.value+Math.cos(H)*Pe.value,ke=et.value+Math.sin(H)*Pe.value,ee=S>Math.PI?1:0,oe=[`M ${Y} ${le}`,`A ${un.value} ${un.value} 0 ${ee} 1 ${se} ${q}`,`L ${ne} ${G}`,`A ${Pe.value} ${Pe.value} 0 ${ee} 0 ${X} ${ke}`,"Z"].join(" "),ce=pt(w);c.push({path:oe,color:ce,strokeWidth:je.value,strokeColor:yl(c.length,ce),value:C,seriesName:h.name,opacity:.8,isHighlighted:K.value===w,isDimmed:K.value!==null&&K.value!==w,isHidden:!1,startAngle:H,endAngle:L,midAngle:_}),s=L}),c)}),Io=e.computed(()=>!Ve.value||!gn.value?[]:yo.value.map((t,s)=>{if(t.isHidden)return null;const o=$t.value,c=Zt.value,g=sn.value,h=Je.value+Math.cos(t.midAngle)*Pe.value,w=et.value+Math.sin(t.midAngle)*Pe.value,C=Je.value+Math.cos(t.midAngle)*(Pe.value+o),S=et.value+Math.sin(t.midAngle)*(Pe.value+o),H=Math.cos(t.midAngle)>=0,_=C+c*(H?1:-1),Y=S,le=H?C+15:C-15,se=Y-g,q=H?"start":"end",ne=Math.hypot(C-h,S-w),G=Math.hypot(_-C,Y-S);return{pointerStartX:h,pointerStartY:w,pointerEndX:C,pointerEndY:S,horizontalEndX:_,horizontalEndY:Y,textX:le,textY:se,text:`${t.seriesName}: ${an(t.value)}`,color:t.color,textAnchor:q,isRightSide:H,isHighlighted:t.isHighlighted,isDimmed:t.isDimmed,pointerLineLength:ne,horizontalLineLength:G}}).filter(Boolean)),Mn=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||po.value||.7;return K.value===null||K.value===void 0?s:K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},Tl=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return K.value!==null?t.seriesIndex===K.value?Math.min(1,s+.1):s*.7:s},so=(t,s)=>{if(t)try{if(K.value===t.seriesIndex?K.value=null:K.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const o=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:I.chartId}});window.dispatchEvent(o)}}catch(o){console.error("Error in onBubbleClick:",o)}},nl=(t,s)=>{const o=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&o.push("dss-bubble-highlighted"),t.isDimmed&&o.push("dss-bubble-dimmed"),t.isHidden&&o.push("dss-bubble-hidden"),o.push(`dss-bubble-series-${t.seriesIndex}`),o.join(" ")},bl=(t,s)=>{if(!t||(s.stopPropagation(),xt.value=!0,K.value=t.seriesIndex,pe.value.show=!1,!Cn.value))return;const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120;g+w>Ue.value&&(g=s.clientX-c.left-w-10),h+C>c.height&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);const S=Co.value,H=uo.value,L=S.map(_=>{const Y=H[_]||_,le=ol(_,t);return le?{seriesName:t.seriesName,label:t.label,value:`${Y}: ${le}`,color:t.color}:null}).filter(Boolean);Me.value={show:!0,x:g,y:h,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderSeries:[]}},ol=(t,s)=>{let o;switch(t){case"x":o=s.originalX;break;case"y":o=s.originalY;break;case"size":o=s.originalSize;break;case"label":o=s.label;break;case"seriesName":o=s.seriesName;break;default:o=s[t]||""}const c=bo.value[t];if(typeof c=="function")return c(o,s);if(typeof o=="number"){const g=o.toFixed(1);return wn.value?g+wn.value:g}return o?.toString()||""},wl=()=>{if(!wt.value||!pe.value.data||pe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return pe.value.data.forEach(o=>{if(o.seriesName&&o.label){const c=`${o.seriesName} - ${o.label}`;s.has(c)||(t.push(c),s.add(c))}else o.seriesName&&(s.has(o.seriesName)||(t.push(o.seriesName),s.add(o.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},l=(t,s)=>{t&&(xt.value=!1,K.value=null,Me.value.show=!1,Me.value.bubbleData=[])},n=(t,s)=>{const o=s.target.closest(".dss-custom-chart-container");if(!o)return;const c=o.getBoundingClientRect(),g=qo(t.categoryIndex),h=t.description||t.comment||"";let w=s.clientX-c.left+15,C=s.clientY-c.top-10;const S=200,H=h?80:50;w+S>Ue.value&&(w=s.clientX-c.left-S-15),C+H>Qe.value&&(C=s.clientY-c.top-H-10),w<0&&(w=10),C<0&&(C=10),fn.value={show:!0,x:w,y:C,categoryValue:g,description:h}},a=()=>{fn.value.show=!1},r=e.computed(()=>I.categories.length||Math.max(...Sn.value.map(t=>t.data.length))),i=e.computed(()=>{let t=0;return Sn.value.forEach(s=>{s.data.forEach(o=>{typeof o=="number"&&(t=Math.max(t,o))})}),t||100}),u=e.computed(()=>{const t=[],s=r.value;for(let o=0;o<s;o++){const c=o*2*Math.PI/s-Math.PI/2,g=Je.value+Math.cos(c)*Pe.value,h=et.value+Math.sin(c)*Pe.value;t.push({x:g,y:h,angle:c,index:o})}return t}),d=e.computed(()=>{const t=[],s=r.value;return u.value.forEach((o,c)=>{const g=Pe.value+15,h=c*2*Math.PI/s-Math.PI/2,w=Je.value+Math.cos(h)*g,C=et.value+Math.sin(h)*g+5;let S="middle",H="middle";Math.abs(Math.cos(h))>.5&&(S=Math.cos(h)>0?"start":"end"),Math.abs(Math.sin(h))>.5&&(H=Math.sin(h)>0?"hanging":"auto"),t.push({x:w,y:C,text:I.categories[c]||`Axis ${c+1}`,anchor:S,baseline:H})}),t}),m=e.ref(new Set),p=(t,s,o)=>{const c=`current-${o}`,g=m.value.has(c);return!g&&K.value===null?s.fillOpacity||Te.value:s.isHighlighted||g?(s.fillOpacity||Te.value)+.15:s.isDimmed?(s.fillOpacity||Te.value)*.3:s.fillOpacity||Te.value},y=e.computed(()=>{if(!Nn.value)return[];const t=[],s=r.value;return Zn.value.forEach((o,c)=>{const g=[],h=[],w=[],C=K.value===c,S=K.value!==null&&K.value!==c,H=st.value.has(c);for(let L=0;L<s;L++){const _=o.data[L]||0,le=_/i.value*Pe.value,se=L*2*Math.PI/s-Math.PI/2,q=Je.value+Math.cos(se)*le,ne=et.value+Math.sin(se)*le;g.push(`${q},${ne}`),h.push({x:q,y:ne}),w.push({x:q,y:ne,value:_,label:I.categories[L]||`Axis ${L+1}`,seriesName:o.name})}t.push({points:g.join(" "),polygonPoints:h,dataPoints:w,color:pt(c),fillOpacity:Te.value,seriesName:o.name,value:`${o.name}: ${o.data.join(", ")}`,isHighlighted:C,isDimmed:S,isHidden:H,seriesIndex:c})}),t}),x=(t,s)=>{if(!s||s.length<3)return!1;let o=!1;for(let c=0,g=s.length-1;c<s.length;g=c++){const h=s[c].x,w=s[c].y,C=s[g].x,S=s[g].y;w>t.y!=S>t.y&&t.x<(C-h)*(t.y-w)/(S-w)+h&&(o=!o)}return o},N=t=>{if(!Nn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const o=s.getBoundingClientRect(),c=Ce.value?.getBoundingClientRect();if(!c)return;const g=t.clientX-c.left,h=t.clientY-c.top,w=y.value.filter(C=>C.isHidden?!1:x({x:g,y:h},C.polygonPoints));if(w.length>0){w.length,K.value=w[0].seriesIndex;const C=t.clientX-o.left+10,S=t.clientY-o.top-10,H=200,L=50+w.length*25;let _=C,Y=S;_+H>Ue.value&&(_=t.clientX-o.left-H-10),Y+L>Qe.value&&(Y=t.clientY-o.top-L-10),_<0&&(_=10),Y<0&&(Y=10);const le=w.map(se=>{let q=se.dataPoints[0],ne=1/0;return se.dataPoints.forEach(G=>{const X=Math.sqrt(Math.pow(G.x-g,2)+Math.pow(G.y-h,2));X<ne&&(ne=X,q=G)}),{seriesName:se.seriesName,color:se.color,value:an(q.value!==void 0?q.value:se.value)}});Me.value={show:!0,x:_,y:Y,title:w.length===1?w[0].seriesName:"",value:"",bubbleData:[],spiderSeries:le}}else De()},b=e.computed(()=>{const t=O.value;return t.logos.map((s,o)=>{const c=I.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||st.value.has(s.seriesIndex))return null;let g,h;if(Yt.value){let C=-1,S=null;for(let L=c.data.length-1;L>=0;L--)if(c.data[L]!==null&&c.data[L]!==void 0){C=L,S=c.data[L];break}if(C===-1||S===null)return null;const H=c.data.map((L,_)=>L==null?null:{x:Mt(_),y:Ft(L),index:_}).filter(L=>L!==null);if(t.animations.enabled&&!tn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(xe.value.isAnimating||!xe.value.hasAnimated))if(xe.value.isAnimating){const L=xe.value.currentFrame/xe.value.totalFrames,_=$n(t.animations.easing,Math.min(L,1)),Y=Il(H,_);g=Y.x+(s.offsetX||0),h=Y.y+(s.offsetY||0)}else g=H[0].x+(s.offsetX||0),h=H[0].y+(s.offsetY||0);else g=Mt(C)+(s.offsetX||0),h=Ft(S)+(s.offsetY||0)}else if(gn.value||Nn.value){const C=Math.PI*2/t.logos.length*o;g=Je.value+Math.cos(C)*(Pe.value+30)+(s.offsetX||0),h=et.value+Math.sin(C)*(Pe.value+30)+(s.offsetY||0)}return{...s,x:g,y:h,seriesIndex:s.seriesIndex}}).filter(Boolean)}),z=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),o=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),o&&(o.style.opacity="1")},R=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},J=t=>{st.value.has(t)?st.value.delete(t):st.value.add(t)},j=e.computed(()=>{if(!Me.value.show&&!(He.value&&pe.value.show&&!F.value.isZooming))return{display:"none"};let t,s;if(He.value&&pe.value.show&&!F.value.isZooming){t=pe.value.x+15,s=B.value.top;const o=wt.value?200:150;t+o>Ue.value&&(t=pe.value.x-o-15),t<0&&(t=10),s<10&&(s=10)}else t=Me.value.x,s=Me.value.y;return{left:t+"px",top:s+"px"}}),ve=(t,s)=>{if(!Cn.value||vt.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+10,h=s.clientY-c.top-10;const w=200,C=120,S=Ue.value,H=Qe.value;g+w>S&&(g=s.clientX-c.left-w-10),h+C>H&&(h=s.clientY-c.top-C-10),g<0&&(g=10),h<0&&(h=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&I.categories.includes(t.label)&&(L=I.categories.indexOf(t.label));const _=(At.value||fe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Me.value={show:!0,x:g,y:h,title:_,value:an(t.value)||"",categoryIndex:L,spiderSeries:[]}},Tt=e.ref(!1),xt=e.ref(!1),De=()=>{Me.value.show=!1,Me.value.spiderSeries=[],Me.value.bubbleData=[],pe.value.show=!1,Tt.value||(K.value=null)},vt=e.ref(!1),ft=(t,s)=>{vt.value=!0,Me.value.show=!1,pe.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let g=s.clientX-c.left+15,h=s.clientY-c.top-10;const w=250;g+w>Ue.value&&(g=s.clientX-c.left-w-15),g<0&&(g=10),h<0&&(h=10),rn.value={show:!0,x:g,y:h,content:t.texts,count:t.totalCount}},it=()=>{vt.value=!1,rn.value.show=!1},xe=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),$n=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},tn=e.computed(()=>Vt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),ll=()=>{if(!bt.value||tn.value){xe.value.hasAnimated=!0,en.value&&(mn.value=1);return}en.value&&(mn.value=0),xe.value.isAnimating=!0,xe.value.currentFrame=0,xe.value.totalFrames=Math.ceil(dt.value/16.67);const t=()=>{const s=xe.value.currentFrame/xe.value.totalFrames,o=$n(Ke.value,Math.min(s,1));xl(o),en.value&&(mn.value=o),s<1?(xe.value.currentFrame++,xe.value.animationId=requestAnimationFrame(t)):Hl()};xe.value.animationId=requestAnimationFrame(t)},xl=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},Hl=()=>{xe.value.isAnimating=!1,xe.value.hasAnimated=!0,en.value&&(mn.value=1),xe.value.animationId&&(cancelAnimationFrame(xe.value.animationId),xe.value.animationId=null)},Fo=e.computed(()=>!gn.value||xe.value.hasAnimated?!0:en.value?mn.value>=1:no.value?Hn.value>=1:!0),$l=e.computed(()=>Ve.value&&Fo.value),Bo=e.ref(!1);e.watch($l,t=>{t?(Bo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Bo.value=!0})})):Bo.value=!1},{immediate:!0});const zo=e.computed(()=>{if(!bt.value||tn.value||xe.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${dt.value}ms`,t["--dss-animation-easing"]=El(Ke.value),t["--dss-stagger-delay"]=`${ge.value}ms`,t}),El=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",qn=()=>{if(!bt.value||tn.value)return"";const t=["dss-chart-animated"];return xe.value.hasAnimated||t.push(`dss-animate-${Gt.value}`),xe.value.hasAnimated||(gn.value&&fe.value!=="semi-radial"?t.push("dss-animate-fill"):gn.value||t.push(`dss-animate-${Gt.value}`)),xe.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>I.series,(t,s)=>{Xe.value&&s&&xe.value.hasAnimated&&(xe.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>ll(),ze.value)}))},{deep:!0}),e.watch(()=>F.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{cl()},50)}),e.watch(()=>[F.value.scale,F.value.offsetX],()=>{!F.value.isZooming&&!F.value.isDragging&&cl()},{flush:"post"}),e.watch([on,vo],([t,s])=>{F.value.minScale=t,F.value.maxScale=s,(F.value.scale<t||F.value.scale>s)&&_o()},{immediate:!0}),e.watch(()=>I.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>ae.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Jt)}):document.removeEventListener("click",Jt)}),e.onMounted(()=>{K.value=null,en.value&&(!bt.value||tn.value)&&(mn.value=1),pl(),V.value&&typeof ResizeObserver<"u"&&(be=new ResizeObserver(t=>{const s=t[0];if(!s||!s.contentRect)return;const{width:o,height:c}=s.contentRect;gt.value=Math.round(o),v.value=Math.round(c),Ge.value&&(Ae.value=Ge.value.offsetHeight||Le)}),be.observe(V.value)),bt.value&&!tn.value?fe.value==="semi-radial"?setTimeout(()=>gl(),ze.value):setTimeout(()=>ll(),ze.value):(xe.value.hasAnimated=!0,fe.value==="semi-radial"&&(Hn.value=1)),document.addEventListener("mousemove",Ln),document.addEventListener("mouseup",hn),document.addEventListener("click",Pn)}),e.onUnmounted(()=>{be&&V.value&&(be.unobserve(V.value),be.disconnect(),be=null),xe.value.animationId&&cancelAnimationFrame(xe.value.animationId),go&&(cancelAnimationFrame(go),go=null),F.value.zoomTimeout&&clearTimeout(F.value.zoomTimeout),document.removeEventListener("mousemove",Ln),document.removeEventListener("mouseup",hn),document.removeEventListener("click",Pn),document.removeEventListener("click",Jt)});const Ln=t=>{if(F.value.isDragging&&F.value.scale>1&&Yt.value){pe.value.show=!1;const s=t.clientX-F.value.lastMouseX,{minX:o,maxX:c}=tt.value,g=c-o||1,w=s*.8;F.value.offsetX+=w;const C=g/F.value.scale,S=g-C,H=0,L=-S/g*B.value.width,_=H;F.value.offsetX=Math.max(L,Math.min(_,F.value.offsetX)),F.value.lastMouseX=t.clientX,F.value.lastMouseY=t.clientY}},hn=()=>{F.value.isDragging&&(F.value.isDragging=!1,setTimeout(()=>{!F.value.isDragging&&F.value.isZooming},100))},Il=(t,s)=>{const o=t.filter(C=>C!=null);if(!o||o.length===0)return{x:0,y:0};if(o.length===1||s<=0)return o[0];if(s>=1)return o[o.length-1];let c=0;const g=[];for(let C=1;C<o.length;C++){const S=o[C].x-o[C-1].x,H=o[C].y-o[C-1].y,L=Math.sqrt(S*S+H*H);g.push(L),c+=L}const h=c*s;let w=0;for(let C=0;C<g.length;C++){const S=w+g[C];if(h<=S){const H=(h-w)/g[C],L=o[C],_=o[C+1];return{x:L.x+(_.x-L.x)*H,y:L.y+(_.y-L.y)*H}}w=S}return o[o.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[qn(),{"dss-chart-fill-width":ht.value,"dss-chart-fill-height":Dt.value}]]),style:e.normalizeStyle({width:ht.value?"100%":Ue.value+"px",height:Dt.value?"100%":Qe.value+20+"px",...zo.value,cursor:vl()}),"data-chart-type":fe.value,ref_key:"containerEl",ref:V,onWheel:Lo,onMousedown:xo,onMousemove:Be,onMouseup:Nl,onMouseleave:qt,onDblclick:_o,onContextmenu:e.withModifiers(Tn,["prevent"]),onClick:e.withModifiers(mt,["left"]),onWheelCapture:Lo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:Ge},[e.createElementVNode("div",Wl,[Q.value?(e.openBlock(),e.createElementBlock("div",ql,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0),Ee.value?(e.openBlock(),e.createElementBlock("div",Ul,e.toDisplayString(Ee.value),1)):e.createCommentVNode("",!0)]),_e.value&&(Ze.value==="top"||Ze.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":nn.value==="horizontal","dss-legend-vertical":nn.value==="vertical","dss-legend-top":Ze.value==="top","dss-legend-bottom":Ze.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>J(c),onMouseenter:g=>U(c),onMouseleave:ye,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:pt(c)})},null,4),e.createElementVNode("span",Yl,e.toDisplayString(o.name),1)],46,Xl))),128))],2)):e.createCommentVNode("",!0),_e.value&&(Ze.value==="left"||Ze.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ze.value==="left","dss-legend-right":Ze.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.series,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(c),"dss-legend-hovered":K.value===c,"dss-legend-dimmed":K.value!==null&&K.value!==c}]),onClick:g=>J(c),onMouseenter:g=>U(c),onMouseleave:ye,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:pt(c)})},null,4),e.createElementVNode("span",Kl,e.toDisplayString(o.name),1)],46,jl))),128))],2)):e.createCommentVNode("",!0)],512),Z.showAddMarkerButton&&at.value.addMarker&&(Yt.value||wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qn,title:e.unref(P)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Nt.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,Ql),s[5]||(s[5]=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,Gl)):e.createCommentVNode("",!0),e.createElementVNode("div",Jl,[wt.value&&_n.value?(e.openBlock(),e.createElementBlock("div",ea,"Bubble size: "+e.toDisplayString(_n.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ue.value,height:Qe.value,class:"dss-chart-svg","data-smooth":Et.value,"data-animated":bt.value,ref_key:"svgEl",ref:Ce},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",na,[e.createElementVNode("rect",{x:B.value.left,y:B.value.top,width:B.value.width,height:B.value.height*4},null,8,oa)]),no.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Eo.value},[e.createElementVNode("path",{d:Sl.value},null,8,aa)],8,la)):e.createCommentVNode("",!0),en.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:On.value},[e.createElementVNode("path",{d:Vo.value},null,8,ra)],8,sa)):e.createCommentVNode("",!0)]),Yt.value||wt.value?(e.openBlock(),e.createElementBlock("g",ia,[Fe.value?(e.openBlock(),e.createElementBlock("g",ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:B.value.left,x2:B.value.right,y1:o.y,y2:o.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,da))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ua,[e.createElementVNode("line",{x1:B.value.left,x2:B.value.right,y1:B.value.bottom,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ma),e.createElementVNode("line",{x1:B.value.left,x2:B.value.left,y1:B.value.top,y2:B.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,pa)]),e.createElementVNode("g",va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(No.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:o.x,y:o.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(o.text),13,fa))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qo.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:o.x,y:o.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(o.text),13,ga))),128)),Ot.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:B.value.left+B.value.width/2,y:B.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ot.value),9,ha)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:B.value.top+12+B.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${B.value.top+B.value.height/2})`},e.toDisplayString(yt.value),9,ya)):e.createCommentVNode("",!0)]),$o.value.length>0?(e.openBlock(),e.createElementBlock("g",ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,o=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${o.categoryIndex}`},[e.createElementVNode("g",Ca,[o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,ba)):e.createCommentVNode("",!0),o.hasAuto&&!o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,wa)):e.createCommentVNode("",!0),o.hasAuto&&o.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x,y1:B.value.bottom,y2:B.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,xa)):e.createCommentVNode("",!0)]),o.hasManual&&o.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:o.x+8,cy:Math.max(15,B.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,Ea)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:o.x,cy:Math.max(15,B.value.top-10),r:"14",fill:o.hasManual&&o.hasAuto||o.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>ft(o,c),onMouseleave:it},null,40,Va),e.createElementVNode("text",{x:o.x,y:Math.max(15,B.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(o.totalCount),9,Na)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Sa,[Vn.value?(e.openBlock(),e.createElementBlock("g",Ma,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":At.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ba)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ta))],64))),128))],2),e.createElementVNode("g",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,$a))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,La))),128)),kt.value>0||Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(el.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?_t(o,kt.value)+2:_t(o,kt.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,_a))),128)):e.createCommentVNode("",!0)])])):fe.value==="line"?(e.openBlock(),e.createElementBlock("g",Aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:o.path,stroke:o.color,"stroke-width":Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":xe.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Da))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${o.animationDelay}ms`})},null,14,Ra))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:o.path,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+2:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:o.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ia))),128)),kt.value>0||Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ao.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:o.x,cy:o.y,r:o.isHighlighted?_t(o,kt.value)+2:_t(o,kt.value),fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Fa))),128)):e.createCommentVNode("",!0)])):fe.value==="area"?(e.openBlock(),e.createElementBlock("g",za,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${Z.chartId}`},[e.createElementVNode("rect",{x:B.value.left-10,y:B.value.top-10,width:B.value.width+20,height:B.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${B.value.width+20}px`})},null,12,Oa)],8,Pa))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:o.areaPath,fill:o.color,"fill-opacity":o.isHighlighted?Ct.value+.2:Ct.value,mask:`url(#area-mask-${c}-${Z.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden})},null,10,Za))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:o.linePath,stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+1:Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({"--dss-path-length":o.pathLength,animationDelay:`${c*ge.value}ms`})},null,14,Wa))),128))])):fe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":At.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[o.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.barPath,fill:o.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,qa)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:o.x,y:o.y,width:o.width,height:o.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":o.isHighlighted,"dss-bar-dimmed":o.isDimmed,"dss-bar-hidden":o.isHidden}),style:e.normalizeStyle({fill:o.color,fillOpacity:o.isDimmed?.4:1,animationDelay:`${o.animationDelay}ms`}),onMouseover:g=>ve(o,g),onMouseleave:De},null,46,Ua))],64))),128))],2)):e.createCommentVNode("",!0)]),He.value&&pe.value.show&&!F.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xa,[e.createElementVNode("line",{x1:pe.value.x,x2:pe.value.x,y1:B.value.top,y2:B.value.bottom,stroke:bn.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ya),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:pe.value.x,cy:o.y,r:kt.value+2,fill:o.color,stroke:"none",opacity:"0.9"},null,8,ja))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("g",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[o?(e.openBlock(),e.createElementBlock("g",Ga,[e.createElementVNode("circle",{cx:o.x,cy:o.y,r:o.radius,fill:o.color,"fill-opacity":Mn(o),stroke:o.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(nl(o,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:g=>bl(o,g),onMouseleave:g=>l(o),onClick:g=>so(o,g)},null,42,Qa),o.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:o.x-o.radius*.65,y:o.y-o.radius*.65,width:o.radius*1.3,height:o.radius*1.3,"xlink:href":o.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${o.isHighlighted?"dss-bubble-highlighted":""} ${o.isDimmed?"dss-bubble-dimmed":""} ${o.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${o.radius*.65}px at ${o.radius*.65}px ${o.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Tl(o)}),onLoad:g=>ho(c),onError:g=>Ml(c),onMouseenter:g=>bl(o,g),onMouseleave:g=>l(o),onClick:g=>so(o,g)},null,46,Ja)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),gn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Yo.value},[fe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Je.value,cy:et.value,r:Pe.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ts)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":fe.value,"clip-path":St.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(o,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${c}`,d:o.path,fill:o.color,"fill-opacity":o.isHighlighted?(o.opacity||.8)+.2:o.opacity||.8,stroke:o.strokeWidth?o.strokeColor||o.color:"none","stroke-width":o.strokeWidth||0,class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),onMouseover:g=>ve(o,g),onMouseleave:De},null,42,os))),128))],8,ns),Un.value&&Fo.value?(e.openBlock(),e.createElementBlock("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(En.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:o.x,y:o.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label"},e.toDisplayString(o.value),9,as)),[[e.vShow,o.show]])),128))])):e.createCommentVNode("",!0),co.value&&Fo.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:To.value.x,y:To.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Wt.value,fill:Ho.value,class:"dss-radial-data-center"},e.toDisplayString(Rn.value),9,ss)):e.createCommentVNode("",!0),$l.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Bo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":o.isHighlighted,"dss-label-dimmed":o.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:o.pointerStartX,y1:o.pointerStartY,x2:o.pointerEndX,y2:o.pointerEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.pointerLineLength})},null,12,rs),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:o.pointerEndX,y1:o.pointerEndY,x2:o.horizontalEndX,y2:o.horizontalEndY,stroke:o.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":o.horizontalLineLength})},null,12,is),e.createElementVNode("text",{class:"dss-radial-label-text",x:o.textX,y:o.textY,"text-anchor":o.textAnchor,"font-size":Se.value,"dominant-baseline":"middle"},e.toDisplayString(o.text),9,cs)],6))),128))],2)):e.createCommentVNode("",!0)],8,es)):e.createCommentVNode("",!0),Nn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Yo.value},[Fe.value?(e.openBlock(),e.createElementBlock("g",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Je.value,cy:et.value,r:o,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,ms))),128)),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Je.value-16,y:et.value-o-7,width:"32",height:"16",fill:"#fafafa",stroke:"none"},null,8,vs),e.createElementVNode("text",{x:Je.value,y:et.value-o+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(We(c)),9,fs)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(o,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Je.value,x2:o.x,y1:et.value,y2:o.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,gs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(o,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:o.x+Math.cos(c*2*Math.PI/r.value-Math.PI/2)*16,y:o.y+Math.sin(c*2*Math.PI/r.value-Math.PI/2)*16,"text-anchor":o.anchor,"dominant-baseline":o.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(o.text.charAt(0).toUpperCase()+o.text.slice(1)),13,ys))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:N,onMouseleave:De},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:o.points,fill:o.color,"fill-opacity":p("current",o,c),stroke:o.color,"stroke-width":o.isHighlighted?Ye.value+1:Ye.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":o.isHighlighted,"dss-series-dimmed":o.isDimmed,"dss-series-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*ge.value}ms`,transition:"all 0.2s ease"})},null,14,ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataPoints,(g,h)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${h}`,cx:g.x,cy:g.y,r:o.isHighlighted?kt.value+1:kt.value>0?kt.value:0,fill:o.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":o.isHighlighted,"dss-point-dimmed":o.isDimmed,"dss-point-hidden":o.isHidden}),style:e.normalizeStyle({animationDelay:`${c*ge.value+h*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>ve(g,w),onMouseleave:De},null,46,Cs))),128))]))),128))],32)],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:o.x,cy:o.y,r:o.width/2,fill:pt(o.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,ws))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:o.x-o.width/2,y:o.y-o.height/2,width:o.width,height:o.height,"xlink:href":o.url,onLoad:g=>z(c),onError:g=>R(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${o.width/2}px at ${o.width/2}px ${o.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,xs))),128))])],8,ta))]),xn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ue.value+"px",height:Qe.value+"px",backgroundImage:`url('${ie.value}')`,backgroundRepeat:"no-repeat",...W.value,opacity:Dn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An.value,(o,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+o.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:o.x+"px",top:o.y+"px",width:vn.value+"px",height:vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(g=>ml(o),["stop"]),onMouseenter:g=>n(o,g),onMouseleave:a},[e.createElementVNode("img",{src:Qt(o),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vs)],44,Es)),[[e.vShow,io.value]])),128)),fn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:fn.value.x+"px",top:fn.value.y+"px"})},[e.createElementVNode("div",Ns,e.toDisplayString(fn.value.categoryValue),1),fn.value.description?(e.openBlock(),e.createElementBlock("div",Ss,e.toDisplayString(fn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Cn.value&&(Me.value.show||He.value&&pe.value.show&&!F.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":He.value&&pe.value.show&&!F.value.isZooming}]),style:e.normalizeStyle(j.value)},[!He.value||!pe.value.show||F.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nn.value&&Me.value.spiderSeries&&Me.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Ms,[Me.value.title?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(Me.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value.spiderSeries,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Ts,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Hs,e.toDisplayString(o.value),1)]))),128))])):wt.value&&Me.value.bubbleData&&Me.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",$s,[Me.value.title?(e.openBlock(),e.createElementBlock("div",Ls,e.toDisplayString(Me.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value.bubbleData,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",Ds,e.toDisplayString(Me.value.title),1),e.createElementVNode("div",Rs,e.toDisplayString(Me.value.value),1)])),Me.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[de(Me.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Is,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Fs,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(Me.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",zs,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ps,[e.createElementVNode("div",Os,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),de(Me.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zs,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ws,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(Me.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",qs,[e.createElementVNode("div",Us,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",Xs,e.toDisplayString(o.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",Ys,[e.createElementVNode("div",js,e.toDisplayString(wt.value?wl():Z.categories[pe.value.categoryIndex]||`Category ${pe.value.categoryIndex+1}`),1),wt.value?(e.openBlock(),e.createElementBlock("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(o.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(pe.value.data,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",Gs,e.toDisplayString(o.seriesName)+":",1),e.createElementVNode("span",Qs,e.toDisplayString(an(o.value)),1)]))),128))]),de(pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Js,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",er,e.toDisplayString(e.unref(P)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(pe.value.categoryIndex).flagGroups,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",tr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(o.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.flags,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${h}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",nr,[e.createElementVNode("div",or,e.toDisplayString(g.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),de(pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",lr,[s[9]||(s[9]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ar,e.toDisplayString(e.unref(P)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de(pe.value.categoryIndex).markers,(o,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:o.color})},null,4),e.createElementVNode("div",sr,[e.createElementVNode("div",rr,e.toDisplayString(o.title),1),o.description?(e.openBlock(),e.createElementBlock("div",ir,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Yt.value&&Bt.value&&F.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:_o},[s[10]||(s[10]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(F.value.scale*100))+"% "+e.toDisplayString(e.unref(P)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Zl),ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ae.value.x+"px",top:ae.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[at.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref(P)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),at.value.addMarker&&(at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv||ln.value.length>0)?(e.openBlock(),e.createElementBlock("div",cr)):e.createCommentVNode("",!0),at.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Xt},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),at.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Gn},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref(P)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),ln.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",dr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[o.separator?(e.openBlock(),e.createElementBlock("div",ur)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Wo(o)),style:e.normalizeStyle(Xn(o)),onClick:g=>Fn(o)},[o.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Zo(o),class:"dss-custom-menu-content"},null,8,pr)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.icon?(e.openBlock(),e.createElementBlock("span",vr,e.toDisplayString(o.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(o.label),1)],64))],14,mr)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:jn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",fr,[e.createElementVNode("h3",null,e.toDisplayString($.value?e.unref(P)("chart.modalMarker.viewMarker"):E.value?e.unref(P)("chart.modalMarker.editMarker"):e.unref(P)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:jn},"×")]),e.createElementVNode("div",gr,[e.createElementVNode("div",hr,[f.value.fromButton?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",yr,e.toDisplayString(qo(f.value.categoryIndex)||""),1)),f.value.fromButton?(e.openBlock(),e.createElementBlock("div",kr,[e.withDirectives(e.createElementVNode("select",{id:"dss-marker-category","onUpdate:modelValue":s[1]||(s[1]=o=>f.value.categoryIndex=o),class:"dss-form-select",disabled:$.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(o,c)=>(e.openBlock(),e.createElementBlock("option",{key:`category-option-${c}`,value:c},e.toDisplayString(o),9,br))),128))],8,Cr),[[e.vModelSelect,f.value.categoryIndex]])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wr,[e.createElementVNode("label",xr,e.toDisplayString(e.unref(P)("chart.modalMarker.description")),1),$.value?(e.openBlock(),e.createElementBlock("div",Er,e.toDisplayString(f.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=o=>f.value.description=o),placeholder:e.unref(P)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"3"},null,8,Vr)),[[e.vModelText,f.value.description]])]),e.createElementVNode("div",Nr,[e.createElementVNode("label",null,e.toDisplayString(e.unref(P)("chart.modalMarker.iconPreview")),1),e.createElementVNode("div",Sr,[e.createElementVNode("img",{src:Qt({type:f.value.type}),alt:"Marker Icon Preview",class:"preview-icon",style:{width:"32px",height:"32px","border-radius":"50%",border:"2px solid #ddd"},onError:s[3]||(s[3]=o=>o.target.style.display="none")},null,40,Mr)])])]),e.createElementVNode("div",Br,[e.createElementVNode("div",Tr,[E.value&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:cn},e.toDisplayString(e.unref(P)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hr,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:jn},e.toDisplayString($.value?e.unref(P)("chart.modalMarker.close"):e.unref(P)("chart.modalMarker.cancel")),1),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:dl,disabled:!(f.value.description&&f.value.description.length)},e.toDisplayString(E.value?e.unref(P)("chart.modalMarker.save"):e.unref(P)("chart.contextMenu.addMarker")),9,$r))])])])])):e.createCommentVNode("",!0)],64))}}),Ar={class:"dss-modal-title"},Dr={class:"dss-modal-actions"},Ll={__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(Z,{emit:jt}){const P=Z,D=jt,Ie=e.ref(null),V=e.ref(null),Ce=e.computed(()=>{const re={"max-width":P.width};return P.height!=="auto"&&(re.height=P.height,re["min-height"]="0"),re}),Ge=e.computed(()=>({}));function gt(){D("close-modal")}function v(){P.backDrop&&!Ie.value&&D("close-modal")}function be(re){re.target.tagName==="INPUT"&&(Ie.value=re.target.tagName)}function Le(){setTimeout(()=>{Ie.value=null},300)}function Ne(){const re=document.body,$e=document.documentElement;V.value={bodyOverflow:re.style.overflow,bodyPosition:re.style.position,bodyTop:re.style.top,bodyWidth:re.style.width,htmlOverflow:$e.style.overflow,scrollY:window.scrollY},re.style.overflow="hidden",re.style.position="fixed",re.style.top=`-${V.value.scrollY}px`,re.style.width="100%",re.style.left="0",$e.style.overflow="hidden"}function I(){if(!V.value)return;const re=document.body,$e=document.documentElement,{bodyOverflow:qe,bodyPosition:Pt,bodyTop:O,bodyWidth:ht,htmlOverflow:Dt,scrollY:Ue}=V.value;re.style.overflow=qe||"",re.style.position=Pt||"",re.style.top=O||"",re.style.width=ht||"",re.style.left="",$e.style.overflow=Dt||"",window.scrollTo(0,Ue||0)}return e.watch(()=>P.showModal,re=>{if(re)Ne(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const $e=document.getElementById("dss-modal-backdrop");$e&&($e.addEventListener("focusin",be),$e.addEventListener("focusout",Le))},100);else{I(),document.body.classList.remove("dss-modal-open");const $e=document.getElementById("dss-modal-backdrop");$e&&($e.removeEventListener("focusin",be),$e.removeEventListener("focusout",Le))}},{immediate:!0}),e.onUnmounted(()=>{P.showModal&&I()}),(re,$e)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ce.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:$e[0]||($e[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":Z.headerType,"font-size":Z.titleSize})},[e.createElementVNode("h1",Ar,[e.renderSlot(re.$slots,"title",{},()=>[$e[1]||($e[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(re.$slots,"title-data"),Z.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:gt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(Ge.value)},[e.renderSlot(re.$slots,"content",{},()=>[$e[2]||($e[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Dr,[e.renderSlot(re.$slots,"actions")])])],4),[[e.vShow,Z.showModal]])])):e.createCommentVNode("",!0)]))}},Rr={key:0,class:"dss-table-toolbar"},Ir={class:"dss-table-toolbar-left"},Fr=["aria-expanded"],zr={class:"dss-pagination-select-dropdown",role:"listbox"},Pr={class:"dss-table-column-visibility-label"},Or={class:"dss-table-checkbox-wrapper"},Zr=["checked","onChange"],Wr={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},qr={class:"dss-table-column-visibility-text"},Ur={class:"dss-table-toolbar-right"},Xr=["placeholder"],Yr=["aria-expanded"],jr={key:1,class:"dss-table-toolbar-extra"},Kr={class:"dss-table-thead"},Gr={key:0,class:"dss-table-th dss-table-selection-column"},Qr={key:0,class:"dss-table-checkbox-wrapper"},Jr=["checked","indeterminate"],ei={key:0,class:"dss-table-checkbox__indeterminate"},ti={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ni={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},oi=["onClick"],li={class:"dss-table-th-content"},ai={class:"dss-table-th-text"},si={key:0},ri={key:1},ii={key:2},ci=["aria-expanded","onClick"],di={class:"dss-table-tbody"},ui=["onClick"],mi={class:"dss-table-checkbox-wrapper"},pi=["type","name","checked","onChange"],vi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fi={key:1,class:"dss-table-checkbox__dot"},gi=["onClick"],hi=["aria-expanded","aria-label"],yi={key:0,class:"dss-table-expansion-row"},ki=["colspan"],Ci=["colspan"],bi={key:1,class:"dss-table-pagination"},wi={class:"dss-pagination-center"},xi={class:"dss-pagination-controls"},Ei=["disabled","title"],Vi=["disabled","title"],Ni={class:"dss-pagination-pages"},Si=["onClick"],Mi={key:1,class:"dss-pagination-ellipsis"},Bi=["disabled","title"],Ti=["disabled","title"],Hi=["aria-expanded"],$i={class:"dss-pagination-select-dropdown",role:"listbox"},Li=["aria-selected","onClick"],_i={key:0,class:"dss-table-filter-row"},Ai=["value","placeholder"],Di=["min","max","value"],Ri=["min","max","value"],Ii={class:"dss-table-filter-double-range-values"},Fi={key:2,class:"dss-table-filter-daterange"},zi={class:"dss-table-filter-daterange-row"},Pi={class:"dss-table-filter-daterange-label"},Oi=["value"],Zi={class:"dss-table-filter-daterange-row"},Wi={class:"dss-table-filter-daterange-label"},qi=["value"],Ui=["value","placeholder"],Xi={class:"dss-table-filter-list"},Yi=["checked","onChange"],ji={class:"dss-table-filter-actions"},Ki={name:"DSSTable"},Gi=Object.assign(Ki,{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:Z=>typeof Z=="object"&&Z!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(Z,{emit:jt}){const{t:P,locale:D}=al.useI18n(),Ie=Z,V=jt,Ce={table:{width:"auto",height:null,rowHeight:"auto",expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function Ge(f,k){const E=Object.assign({},f);return gt(f)&>(k)&&Object.keys(k).forEach($=>{gt(k[$])?$ in f?E[$]=Ge(f[$],k[$]):Object.assign(E,{[$]:k[$]}):Object.assign(E,{[$]:k[$]})}),E}function gt(f){return f&&typeof f=="object"&&!Array.isArray(f)}const v=e.computed(()=>Ge(Ce,Ie.options)),be=e.computed(()=>{const f=v.value.table.width;return f==="auto"?null:typeof f=="number"?f:null}),Le=e.computed(()=>v.value.table.height),Ne=e.computed(()=>v.value.table.rowHeight??"auto"),I=e.computed(()=>({height:Ne.value})),re=e.computed(()=>v.value.table.expandable===!0),$e=e.computed(()=>v.value.table.striped),qe=e.computed(()=>v.value.table.bordered),Pt=e.computed(()=>v.value.table.hoverable),O=e.computed(()=>v.value.table.size),ht=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const Dt=e.computed(()=>v.value.selection.enabled),Ue=e.computed(()=>v.value.selection.mode),Ae=e.computed(()=>v.value.sorting.enabled),Qe=e.computed(()=>v.value.sorting.mode),fe=e.computed(()=>v.value.pagination.enabled),kn=e.computed(()=>v.value.pagination.rows),Q=e.computed(()=>v.value.pagination.rowsPerPageOptions),Ee=e.computed(()=>v.value.scrollable),_n=e.computed(()=>v.value.emptyMessage),Ot=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),yt=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),pn=e.computed(()=>v.value.toolbar?.search!==!1),Kt=e.computed(()=>Ot.value||yt.value||pn.value||Bn.value),Bn=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),nt=e.ref(""),Fe=e.ref(!1),_e=e.ref(null);let Ze=null;function nn(){Fe.value?(Ze&&(clearTimeout(Ze),Ze=null),Fe.value=!1,nt.value="",V("search",""),_e.value?.blur()):(Fe.value=!0,Ze=setTimeout(()=>{Ze=null,_e.value?.focus()},80))}function Cn(){nt.value||(Fe.value=!1)}function He(){nt.value="",V("search",""),_e.value?.focus()}const bn=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":qe.value,"dss-table-hoverable":Pt.value,[`dss-table-${O.value}`]:O.value!=="default"})),Bt=(f,k)=>f?.field??f?.key??k,on=e.ref(new Set);function vo(){const f=new Set;Ie.columns.forEach((k,E)=>{k?.hidden!==!0&&f.add(Bt(k,E))}),on.value=f}const Ye=e.computed(()=>Ie.columns.filter((f,k)=>on.value.has(Bt(f,k)))),je=f=>{const k=Ie.columns.findIndex(E=>E===f);return Bt(f,k>=0?k:0)},kt=(f,k)=>on.value.has(Bt(f,k));function Lt(f,k){const E=Bt(f,k),$=new Set(on.value);$.has(E)?$.delete(E):$.add(E),on.value=$}const _t=e.ref(null),Ct=e.ref(!1);function Et(f){_t.value&&!_t.value.contains(f.target)&&(Ct.value=!1)}const me=e.computed(()=>Ye.value.length+(Dt.value?1:0)+(re.value?1:0)),he=(f,k)=>f?.id??f?.key??k,ct=e.ref(new Set),bt=(f,k)=>ct.value.has(he(f,k)),Gt=(f,k,E)=>{E&&E.stopPropagation();const $=he(f,k),U=new Set(ct.value);U.has($)?(U.delete($),V("row-collapse",{data:f,index:k})):(U.add($),V("row-expand",{data:f,index:k})),ct.value=U},dt=e.ref(null),ze=e.ref(0),Ke=e.ref([]),ge=f=>{if(Qe.value==="single")return dt.value===f.field?ze.value:0;{const k=Ke.value.find(E=>E.field===f.field);return k?k.order:0}},Xe=f=>{const k=ge(f);return{"dss-sort-active":k!==0,"dss-sort-asc":k===1,"dss-sort-desc":k===-1}},Vt=e.ref({}),Te=e.ref(null),ot=e.ref(null),Ht=220,We=e.computed(()=>Ye.value.find(f=>je(f)===Te.value)??null),ut=e.computed(()=>{if(!We.value||We.value.filter!=="range")return null;const f=We.value,k=Te.value,{min:E,max:$}=xn(f),U=f.filterMin??E,ye=f.filterMax??$,Be=Nt(k),qt=Be.min??U,Tn=Be.max??ye,mt=ye-U,Zo=mt===0?0:(qt-U)/mt*100,Wo=mt===0?100:(Tn-U)/mt*100;return{rangeMin:U,rangeMax:ye,currentMin:qt,currentMax:Tn,minPct:Zo,maxPct:Wo}}),lt=e.ref(null),at=e.ref("max");function ln(f){const k=lt.value,E=ut.value;if(!k||!E)return;const $=k.getBoundingClientRect(),ye=(f.clientX-$.left)/$.width*100,Be=(E.minPct+E.maxPct)/2;at.value=ye<Be?"min":"max"}function Nt(f){return Vt.value[f]??{}}function Rt(f,k){Vt.value={...Vt.value,[f]:k}}function vn(f){const k=Vt.value[f];return k?k.type==="string"?!!k.value?.trim():k.type==="range"?k.min!=null||k.max!=null:k.type==="dateRange"?!!(k.from||k.to):k.type==="list"?k.selected?.length>0:!1:!1}function wn(f){const k={...Vt.value};delete k[f],Vt.value=k,Te.value=null,ot.value=null}const an=e.computed(()=>{let f=[...Ie.data];return Ye.value.forEach(k=>{const E=je(k),$=Vt.value[E];if(!$)return;const U=k.field;if(U){if($.type==="string"&&$.value?.trim()){const ye=$.value.trim().toLowerCase();f=f.filter(Be=>{const qt=pe(Be,k);return String(qt??"").toLowerCase().includes(ye)})}else if($.type==="range")f=f.filter(ye=>{const Be=ae(ye,U),qt=Number(Be);return!(Number.isNaN(qt)||$.min!=null&&qt<$.min||$.max!=null&&qt>$.max)});else if($.type==="dateRange"){const ye=$.from?new Date($.from).getTime():null,Be=$.to?new Date($.to).getTime():null;f=f.filter(qt=>{const Tn=ae(qt,U),mt=Tn?new Date(Tn).getTime():NaN;return!(Number.isNaN(mt)||ye!=null&&mt<ye||Be!=null&&mt>Be)})}else if($.type==="list"&&$.selected?.length){const ye=new Set($.selected);f=f.filter(Be=>{const qt=pe(Be,k);return ye.has(qt!=null?String(qt):"")})}}}),f});function io(f){const k=new Set;return Ie.data.forEach(E=>{const $=pe(E,f);k.add($!=null?String($):"")}),Array.from(k).sort((E,$)=>String(E).localeCompare(String($)))}function It(f,k){if(Te.value===f){Te.value=null,ot.value=null;return}if(k?.currentTarget){const E=k.currentTarget.getBoundingClientRect();ot.value={top:E.bottom+6,left:Math.max(8,E.right-Ht)}}Te.value=f}function An(f,k){Rt(f,{type:"string",value:k})}function xn(f){const k=f.field;if(!k)return{min:0,max:100};let E=1/0,$=-1/0;return Ie.data.forEach(U=>{const ye=ae(U,k),Be=Number(ye);Number.isNaN(Be)||(E=Math.min(E,Be),$=Math.max($,Be))}),{min:E===1/0?0:E,max:$===-1/0?100:$}}function Dn(f,k,E){const $={...Nt(f),type:"range"},U=E===""?null:Number(E),ye=U===null||Number.isNaN(U)?null:U;$[k]=ye,ye!=null&&(k==="min"&&$.max!=null&&ye>$.max&&($.max=ye),k==="max"&&$.min!=null&&ye<$.min&&($.min=ye)),Rt(f,$)}function M(f,k,E){const $={...Nt(f),type:"dateRange"};$[k]=E||"",Rt(f,$)}const A=e.reactive({});function T(f,k){A[f]=k}function W(f){const k=je(f),E=(A[k]??"").trim().toLowerCase(),$=io(f);return E?$.filter(U=>String(U).toLowerCase().includes(E)):$}function te(f,k){return(Nt(f).selected??[]).includes(k!=null?String(k):"")}function de(f,k){const $=[...Nt(f).selected??[]],U=k!=null?String(k):"",ye=$.indexOf(U);ye>=0?$.splice(ye,1):$.push(U),Rt(f,{type:"list",selected:$})}function we(f){Te.value&&!f.target.closest(".dss-table-filter-wrap")&&!f.target.closest(".dss-table-filter-dropdown")&&(Te.value=null,ot.value=null)}const ie=f=>{if(!(f.sortable===!1||!Ae.value))if(Qe.value==="single")dt.value===f.field?ze.value=ze.value===1?-1:ze.value===-1?0:1:(dt.value=f.field,ze.value=1),ze.value===0&&(dt.value=null),V("sort",{field:dt.value,order:ze.value});else{const k=Ke.value.findIndex(E=>E.field===f.field);k>=0?Ke.value[k].order===1?Ke.value[k].order=-1:Ke.value.splice(k,1):Ke.value.push({field:f.field,order:1}),V("sort",{multiSortMeta:Ke.value})}},Ve=e.computed(()=>{if(!Ae.value)return an.value;let f=[...an.value];return Qe.value==="single"&&dt.value&&ze.value!==0?f.sort((k,E)=>{const $=ae(k,dt.value),U=ae(E,dt.value);return $===U?0:$==null?1:U==null?-1:($<U?-1:$>U?1:0)*ze.value}):Qe.value==="multiple"&&Ke.value.length>0&&f.sort((k,E)=>{for(const $ of Ke.value){const U=ae(k,$.field),ye=ae(E,$.field);if(U===ye)continue;if(U==null)return 1;if(ye==null)return-1;const Be=U<ye?-1:U>ye?1:0;if(Be!==0)return Be*$.order}return 0}),f}),Se=e.ref(0),$t=e.ref(kn.value),Zt=e.ref(!1),sn=e.ref(null),Un=f=>{$t.value=f,Zt.value=!1,Se.value=0,V("page",{page:0,rows:$t.value})};function ko(f){sn.value&&!sn.value.contains(f.target)&&(Zt.value=!1)}const co=e.computed(()=>Ve.value.length),Rn=e.computed(()=>Math.ceil(co.value/$t.value)),Wt=e.computed(()=>fe.value?Se.value*$t.value:0),To=e.computed(()=>fe.value?Math.min((Se.value+1)*$t.value,co.value):co.value),Ho=e.computed(()=>{if(!fe.value)return Ve.value;const f=Wt.value,k=To.value;return Ve.value.slice(f,k)}),En=e.ref(new Set),$o=e.computed(()=>Ve.value.filter((f,k)=>En.value.has(he(f,k)))),rn=e.computed(()=>{const f=Ve.value.length;return f>0&&En.value.size===f}),Co=e.computed(()=>{const f=Ve.value.length,k=En.value.size;return k>0&&k<f}),uo=(f,k)=>En.value.has(he(f,k)),bo=()=>{if(rn.value)En.value=new Set,V("unselect-all");else{const f=new Set;Ve.value.forEach((k,E)=>f.add(he(k,E))),En.value=f,V("select-all",$o.value)}},st=(f,k)=>{const E=he(f,k),$=new Set(En.value),U=$.has(E);Ue.value==="single"?U?($.delete(E),V("row-unselect",f)):($.clear(),$.add(E),V("row-select",f)):U?($.delete(E),V("row-unselect",f)):($.add(E),V("row-select",f)),En.value=$},K=e.computed(()=>{const f=Rn.value,k=Se.value+1,E=2,$=[],U=[];let ye;for(let Be=1;Be<=f;Be++)(Be===1||Be===f||Be>=k-E&&Be<=k+E)&&$.push(Be);for(const Be of $)ye&&(Be-ye===2?U.push(ye+1):Be-ye!==1&&U.push("...")),U.push(Be),ye=Be;return U}),In=f=>{f<0||f>=Rn.value||(Se.value=f,V("page",{page:f,rows:$t.value}))},Me=(f,k,E)=>{V("row-click",{data:f,index:k,originalEvent:E})},fn=(f,k)=>({"dss-table-row-selected":uo(f,Wt.value+k),"dss-table-row-even":k%2===0,"dss-table-row-odd":k%2!==0}),pe=(f,k)=>k.field?ae(f,k.field):"",ae=(f,k)=>k.split(".").reduce((E,$)=>E&&E[$],f),F=f=>{const k=f.align??ht.value;return{"dss-table-sortable":f.sortable!==!1&&Ae.value,"dss-table-align-left":k==="left","dss-table-align-center":k==="center","dss-table-align-right":k==="right",[f.className]:f.className}},rt=f=>{const k={};return f.width&&(k.width=typeof f.width=="number"?`${f.width}px`:f.width),f.minWidth&&(k.minWidth=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth),f.maxWidth&&(k.maxWidth=typeof f.maxWidth=="number"?`${f.maxWidth}px`:f.maxWidth),k};return e.watch(()=>Ie.locale,f=>{f&&f!==D.value&&(D.value=f)},{immediate:!0}),e.watch(kn,f=>{$t.value=f,Se.value=0}),e.watch(nt,f=>{V("search",f??"")}),e.watch(()=>Ie.columns,()=>{vo()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ko),document.addEventListener("click",Et),document.addEventListener("click",we)}),e.onUnmounted(()=>{document.removeEventListener("click",ko),document.removeEventListener("click",Et),document.removeEventListener("click",we)}),(f,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",style:e.normalizeStyle({width:be.value+"px",height:Le.value?Le.value+"px":"auto"})},[Kt.value?(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Ir,[Ot.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:k[0]||(k[0]=E=>V("download-pdf"))},[k[21]||(k[21]=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(P)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:k[1]||(k[1]=E=>V("download-excel"))},[k[22]||(k[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_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(P)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Bn.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:_t},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ct.value}]),onClick:k[2]||(k[2]=E=>Ct.value=!Ct.value),"aria-expanded":Ct.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(P)("table.columnVisibility"))+" ",1),k[23]||(k[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Fr),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.columns,(E,$)=>(e.openBlock(),e.createElementBlock("li",{key:Bt(E,$),role:"option",class:"dss-table-column-visibility-option",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Pr,[e.createElementVNode("span",Or,[e.createElementVNode("input",{type:"checkbox",checked:kt(E,$),onChange:U=>Lt(E,$),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Zr),kt(E,$)?(e.openBlock(),e.createElementBlock("span",Wr,[...k[24]||(k[24]=[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",qr,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,Ct.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ur,[pn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Fe.value||nt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:_e,"onUpdate:modelValue":k[4]||(k[4]=E=>nt.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(P)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:k[5]||(k[5]=E=>Fe.value=!0),onBlur:Cn},null,40,Xr),[[e.vModelText,nt.value]]),nt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:He},[...k[25]||(k[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":Fe.value||!!nt.value,onMousedown:e.withModifiers(nn,["prevent"])},[...k[26]||(k[26]=[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,Yr)],2)):e.createCommentVNode("",!0),f.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",jr,[e.renderSlot(f.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ee.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",bn.value])},[e.createElementVNode("thead",Kr,[e.createElementVNode("tr",null,[Dt.value?(e.openBlock(),e.createElementBlock("th",Gr,[Ue.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Qr,[e.createElementVNode("input",{type:"checkbox",checked:rn.value,indeterminate:Co.value,onChange:bo,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Jr),Co.value?(e.openBlock(),e.createElementBlock("span",ei)):rn.value?(e.openBlock(),e.createElementBlock("span",ti,[...k[27]||(k[27]=[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),re.value?(e.openBlock(),e.createElementBlock("th",ni)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(E,$)=>(e.openBlock(),e.createElementBlock("th",{key:je(E),class:e.normalizeClass(["dss-table-th",F(E)]),style:e.normalizeStyle(rt(E)),onClick:U=>ie(E)},[e.createElementVNode("div",li,[e.createElementVNode("span",ai,e.toDisplayString(E.header),1),E.sortable!==!1&&Ae.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Xe(E)])},[ge(E)===0?(e.openBlock(),e.createElementBlock("span",si,[...k[28]||(k[28]=[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)])])):ge(E)===1?(e.openBlock(),e.createElementBlock("span",ri,[...k[29]||(k[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:"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)])])):ge(E)===-1?(e.openBlock(),e.createElementBlock("span",ii,[...k[30]||(k[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 -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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Te.value===je(E)}]),onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":vn(je(E))}]),"aria-expanded":Te.value===je(E),"aria-label":"Filter column",onClick:U=>It(je(E),U)},[...k[31]||(k[31]=[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,ci)],2)):e.createCommentVNode("",!0)])],14,oi))),128))])]),e.createElementVNode("tbody",di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(E,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:he(E,Wt.value+$)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",fn(E,$)]),style:e.normalizeStyle(I.value),onClick:U=>Me(E,$,U)},[Dt.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:k[7]||(k[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",mi,[e.createElementVNode("input",{type:Ue.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${Z.tableId}`,checked:uo(E,Wt.value+$),onChange:U=>st(E,Wt.value+$),class:e.normalizeClass(["dss-table-checkbox",Ue.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,pi),Ue.value==="multiple"&&uo(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("span",vi,[...k[32]||(k[32]=[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)])])):Ue.value==="single"&&uo(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("span",fi)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(U=>Gt(E,Wt.value+$,U),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":bt(E,Wt.value+$),"aria-label":bt(E,Wt.value+$)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":bt(E,Wt.value+$)}]),"aria-hidden":"true"},[...k[33]||(k[33]=[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,hi)],8,gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(U,ye)=>(e.openBlock(),e.createElementBlock("td",{key:je(U),class:e.normalizeClass(["dss-table-td",F(U)]),style:e.normalizeStyle(rt(U))},[e.renderSlot(f.$slots,`cell-${U.field}`,{data:E,column:U,rowIndex:$},()=>[e.createTextVNode(e.toDisplayString(pe(E,U)),1)])],6))),128))],14,ui),re.value&&bt(E,Wt.value+$)?(e.openBlock(),e.createElementBlock("tr",yi,[e.createElementVNode("td",{colspan:me.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(f.$slots,"expansion",{data:E,rowIndex:$})],8,ki)])):e.createCommentVNode("",!0)],64))),128)),Ho.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(I.value)},[e.createElementVNode("td",{colspan:me.value,class:"dss-table-empty-cell"},[e.renderSlot(f.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(_n.value),1)])],8,Ci)],4))])],2)],2),fe.value?(e.openBlock(),e.createElementBlock("div",bi,[e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:k[8]||(k[8]=E=>In(0)),title:e.unref(P)("table.firstPage")},[...k[34]||(k[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Ei),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value===0,onClick:k[9]||(k[9]=E=>In(Se.value-1)),title:e.unref(P)("table.previousPage")}," ‹ ",8,Vi),e.createElementVNode("span",Ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===Se.value+1}]),onClick:$=>In(E-1)},e.toDisplayString(E),11,Si)):(e.openBlock(),e.createElementBlock("span",Mi,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Rn.value-1,onClick:k[10]||(k[10]=E=>In(Se.value+1)),title:e.unref(P)("table.nextPage")}," › ",8,Bi),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Se.value>=Rn.value-1,onClick:k[11]||(k[11]=E=>In(Rn.value-1)),title:e.unref(P)("table.lastPage")},[...k[35]||(k[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ti)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:sn},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Zt.value}]),onClick:k[12]||(k[12]=E=>Zt.value=!Zt.value),"aria-expanded":Zt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString($t.value)+" ",1),k[36]||(k[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Hi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===$t.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===$t.value}]),onClick:$=>Un(E)},e.toDisplayString(E),11,Li))),128))],512),[[e.vShow,Zt.value]])]),_:1})],512)])])):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(ot.value?{top:ot.value.top+"px",left:ot.value.left+"px",width:Ht+"px"}:void 0),onClick:k[20]||(k[20]=e.withModifiers(()=>{},["stop"]))},[We.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[We.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("input",{type:"text",value:Nt(Te.value).value??"",onInput:k[13]||(k[13]=E=>An(Te.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Ai)])):We.value.filter==="range"&&ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ut.value.minPct+"%","--range-max-pct":ut.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:lt,class:"dss-table-filter-double-range-track",onMousemove:ln,onMouseenter:ln},[e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMin,onInput:k[14]||(k[14]=E=>Dn(Te.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:at.value==="min"?2:1})},null,44,Di),e.createElementVNode("input",{type:"range",min:ut.value.rangeMin,max:ut.value.rangeMax,value:ut.value.currentMax,onInput:k[15]||(k[15]=E=>Dn(Te.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:at.value==="max"?2:1})},null,44,Ri)],544),e.createElementVNode("div",Ii,e.toDisplayString(ut.value.currentMin)+" – "+e.toDisplayString(ut.value.currentMax),1)],4)):We.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Fi,[e.createElementVNode("div",zi,[e.createElementVNode("label",Pi,e.toDisplayString(e.unref(P)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Nt(Te.value).from??"",onInput:k[16]||(k[16]=E=>M(Te.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Oi)]),e.createElementVNode("div",Zi,[e.createElementVNode("label",Wi,e.toDisplayString(e.unref(P)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Nt(Te.value).to??"",onInput:k[17]||(k[17]=E=>M(Te.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,qi)])])):We.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:A[Te.value]??"",onInput:k[18]||(k[18]=E=>T(Te.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(P)("table.search")||"Search..."},null,40,Ui),e.createElementVNode("div",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W(We.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:te(Te.value,E),onChange:$=>de(Te.value,E)},null,40,Yi),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",ji,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:k[19]||(k[19]=E=>wn(Te.value))},e.toDisplayString(e.unref(P)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Te.value&&We.value&&ot.value]])]),_:1})]))],64))}}),Qi={class:"dss-toolbar-left"},Ji=["title"],ec=["title"],tc={class:"dss-toolbar-dropdown-wrapper"},nc=["title"],oc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ac={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rc={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ic={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cc={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},dc=["title"],uc=["title"],mc=["title"],pc=["title"],vc=["title"],fc=["title"],gc=["title"],hc=["title"],yc=["title"],kc={key:2,class:"dss-toolbar-separator"},Cc=["title"],bc={key:4,class:"dss-toolbar-separator"},wc={key:5,class:"dss-toolbar-dropdown-wrapper"},xc=["title"],Ec={class:"dss-toolbar-dropdown-ai"},Vc={class:"dss-toolbar-right"},Nc={key:0,class:"dss-toolbar-custom-group"},Sc={key:1,class:"dss-toolbar-separator"},Mc={class:"dss-link-modal-content"},Bc={class:"dss-link-modal-field"},Tc={class:"dss-link-modal-label"},Hc=["placeholder"],$c={class:"dss-link-modal-field"},Lc={class:"dss-link-modal-label"},_c=["placeholder"],Ac={class:"dss-image-modal-tabs"},Dc={key:0,class:"dss-image-tab-content"},Rc={class:"dss-link-modal-content"},Ic={class:"dss-link-modal-field"},Fc={key:0,class:"dss-link-modal-label"},zc=["src"],Pc={class:"dss-link-modal-field"},Oc={class:"dss-link-modal-label"},Zc=["placeholder"],Wc={class:"dss-link-modal-field"},qc={class:"dss-link-modal-label"},Uc=["placeholder"],Xc={class:"dss-link-modal-field"},Yc={class:"dss-link-modal-label"},jc=["placeholder"],Kc={key:1,class:"dss-image-tab-content"},Gc={class:"dss-link-modal-content"},Qc={class:"dss-link-modal-field"},Jc={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},od=["placeholder"],ld={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-link-modal-field"},id={class:"dss-link-modal-label"},cd=["placeholder"],dd={class:"dss-text-editor-title-input-container"},ud={key:0,class:"dss-text-editor-title-preview"},md={key:0},pd={key:1,class:"dss-text-editor-preview-placeholder"},vd=["value","placeholder","disabled"],fd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},gd={class:"dss-text-editor-description-input-container"},hd={key:0,class:"dss-text-editor-description-preview"},yd={key:0},kd={key:1,class:"dss-text-editor-preview-placeholder"},Cd=["value","placeholder","disabled"],bd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},wd=["data-comment-id","onMouseenter"],xd=["onClick"],Ed=["src","alt"],Vd={key:1},Nd=["onClick"],Sd=["src","alt"],Md={key:1},Bd=["data-has-second-user","onClick"],Td={class:"editor-comment-marker-count"},Hd={key:4,class:"dss-text-editor-textarea-wrapper"},$d=["value","placeholder","rows","disabled"],Ld={class:"dss-text-editor-footer"},_d={class:"dss-text-editor-footer-content"},Ad={class:"dss-text-editor-footer-stat"},Dd={class:"dss-text-editor-footer-stat"},Rd={key:5,class:"dss-text-editor-content-wrapper"},Id={key:0,class:"dss-comment-overlay-body"},Fd={class:"dss-comment-selection-wrapper"},zd=["innerHTML"],Pd={class:"dss-comment-messages-wrapper"},Od={key:0,class:"dss-comment-avatar-wrapper"},Zd={class:"dss-comment-avatar"},Wd=["src","alt"],qd={key:1},Ud={class:"dss-comment-header"},Xd={class:"dss-comment-header-text"},Yd={class:"dss-comment-author"},jd={key:0,class:"dss-comment-date"},Kd=["onClick","title"],Gd={class:"dss-comment-overlay-inner"},Qd=["placeholder","onKeydown"],Jd={class:"dss-text-editor-footer"},eu={class:"dss-text-editor-footer-content"},tu={class:"dss-text-editor-footer-stat"},nu={class:"dss-text-editor-footer-stat"},ou=["title"],lu=["title"],au={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:""},su={class:"dss-image-popup-content"},ru={key:0,class:"dss-image-popup-no-alt-icon"},iu=["title"],cu=["title"],du={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:""},uu={class:"dss-toolbar-left"},mu=["title"],pu=["title"],vu={class:"dss-toolbar-dropdown-wrapper"},fu=["title"],gu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},hu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ku={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Cu={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},bu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},xu=["title"],Eu=["title"],Vu=["title"],Nu=["title"],Su=["title"],Mu=["title"],Bu=["title"],Tu=["title"],Hu=["title"],$u=["title"],Lu={key:2,class:"dss-toolbar-separator"},_u={key:3,class:"dss-toolbar-dropdown-wrapper"},Au=["title"],Du={class:"dss-toolbar-dropdown-ai"},Ru={key:0,class:"dss-toolbar-right"},Iu={key:0,class:"dss-toolbar-separator"},Fu={key:0,class:"dss-toolbar-custom-group"},zu={key:1,class:"dss-toolbar-separator"},Pu={name:"DSSTextEditor"},Ou=Object.assign(Pu,{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:Z=>typeof Z=="object"&&Z!==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:Z=>typeof Z=="object"&&Z!==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(Z,{expose:jt,emit:P}){const{t:D,locale:Ie}=al.useI18n(),V=Z,Ce=P,Ge=e.useSlots(),gt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
76
76
|
<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"/>
|
|
77
|
-
</svg>`,v=e.ref(null),be=e.ref(null),Le=e.ref(!1),Ne=e.ref(!1),I=e.ref(!1),re=e.ref(""),$e=e.ref({}),qe=e.ref(!1),Pt=e.ref(!1),O=e.ref(""),ht=e.ref(""),Dt=e.ref(null),Ue=e.ref(null),Ae=e.ref(null),Qe=e.ref(null),fe=e.ref(""),kn=e.ref(!1),Q=e.ref({}),Ee=e.ref(!1),_n=e.ref({}),Ot=e.ref(null),yt=e.ref(null),pn=e.ref(!1),Kt=e.ref(""),Bn=e.ref(null),nt=e.ref(""),Fe=e.ref(""),_e=e.ref(""),Ze=e.ref(null),on=e.ref(null),Cn=e.ref(null),He=e.ref(null),bn=e.ref(null),Bt=e.ref(!1),ln=e.ref(""),vo=e.ref({}),Ye=e.ref(!1),je=e.ref("upload"),kt=e.ref(""),Lt=e.ref(null),_t=e.ref(null),Ct=e.ref([]),Et=e.ref([]),me=e.ref(null),he=e.ref(!1),ct=e.ref(""),bt=e.ref(""),Gt=e.ref(""),dt=e.ref(""),ze=e.ref(""),Ke=e.ref(""),ge=e.ref(null),Xe=e.ref(null),Vt=e.ref(null),Te=e.ref(!1),ot=e.ref(null),Ht=e.ref(!1),We=e.ref(!1),ut=e.ref(null),lt=e.ref("p"),at=e.ref(!1),an=e.ref([]),Nt=e.ref(null),Rt=e.ref(null),vn=e.ref(null),wn=e.ref(!1),sn=e.ref(0),io=100,It=e.ref(null),An=e.computed(()=>({"dss-text-editor-no-border":!V.border,"dss-text-editor-rounded":V.rounded,"dss-text-editor-full-height":V.fullHeight,"dss-comment-overlay-open":Xt.value!==null})),xn=e.computed(()=>({})),Dn=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+24+2}px`,resize:"none",overflowY:"auto"}),M=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+32}px`,overflowY:"auto"}),A=e.computed(()=>V.richText&&Et.value.length>0),T=e.computed(()=>{if(!V.modelValue)return"";if(V.richText){let l=V.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return V.modelValue}),W=e.computed(()=>{const l=T.value.trim();return l?l.split(/\s+/).filter(n=>n.length>0).length:0}),te=e.computed(()=>T.value.length),de=e.computed(()=>He.value!==null&&je.value==="upload"&&nt.value&&nt.value.startsWith("data:")),we=e.computed(()=>V.titlePlaceholder||D("textEditor.placeholders.title")),ie=e.computed(()=>V.descriptionPlaceholder||D("textEditor.placeholders.description")),Ve=e.computed(()=>V.placeholder||D("textEditor.placeholders.startTyping")),Se=l=>Ge&&Ge[l]!==void 0,$t=l=>{for(let n=l+1;n<V.customToolbarSlots.length;n++)if(Se(V.customToolbarSlots[n]))return!0;return!1},Zt=l=>{for(let n=l+1;n<V.customToolbarSlots.length;n++){const a=V.customToolbarSlots[n];if(Se(a)&&rn(a))return!0}return!1},rn=l=>V.customToolbarFloatingMap.hasOwnProperty(l)?V.customToolbarFloatingMap[l]===!0:!0,Un=e.computed(()=>V.customToolbarSlots.some(l=>Se(l)&&rn(l))),ko=e.computed(()=>Se("title-slot")),co=e.computed(()=>Se("description-slot")),Rn=l=>{if(!l||l.trim()==="")return"<html></html>";const n=l.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?l:`<html>${l}</html>`},Wt=l=>{if(!l||l.trim()==="")return"";const n=l.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},Oo=l=>{if(!l)return;const n=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(i=>i.remove())},To=l=>{try{const n=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${n} ${r} ${i}`}catch{return""}},En=l=>{if(!l||typeof l!="string")return!1;const n=l.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const i=D("textEditor.started_conversation");if(i&&n===i)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Ho=l=>{const n=l.target.value;Ce("update:modelValue",n),Ce("change",n)},cn=()=>{if(!ge.value)return;const l=ge.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},Co=()=>{Ht.value=!0,cn()},uo=()=>{Ht.value=!1,bo()},bo=()=>{if(!ge.value)return;const l=ge.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},st=l=>{const a=l.target.value;Ht.value&&cn(),Ce("update:title",a),Ce("title-change",a),Vt.value="title",V.richText&&(he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f()},500))},K=()=>{if(!Xe.value)return;const l=Xe.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},In=()=>{We.value=!0,K()},Me=()=>{We.value=!1,fn()},fn=()=>{if(!Xe.value)return;const l=Xe.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},pe=l=>{const a=l.target.value;We.value&&K(),Ce("update:description",a),Ce("description-change",a),Vt.value="description",V.richText&&(he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f()},500))},ae=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const n=l.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(v.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},F=l=>{if(!(!l||!v.value))try{const n=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(v.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{v.value.focus();return}let r=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=r+u.length;!d&&l.start>=r&&l.start<=p&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=p&&(a.setEnd(u,l.end-r),m=!0),r=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}n.removeAllRanges(),n.addRange(a)}catch{v.value.focus()}},rt=()=>{if(!v.value)return;v.value.focus();const l=window.getSelection(),n=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},r=a(v.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(n.setStart(i,i.length),n.setEnd(i,i.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);l.removeAllRanges(),l.addRange(n)},f=(l=!1)=>{if(!v.value)return;const n=v.value.innerHTML,a=V.title||"",r=V.description||"";if(!l&&n===ct.value&&a===Gt.value&&r===dt.value)return;const i={content:bt.value||ct.value,title:ze.value!==void 0?ze.value:Gt.value,description:Ke.value!==void 0?Ke.value:dt.value},u=Ct.value.length>0?Ct.value[Ct.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(Ct.value.push(i),Ct.value.length>50&&Ct.value.shift(),Et.value=[]),ct.value=n,Gt.value=a,dt.value=r,bt.value=n,ze.value=a,Ke.value=r},k=l=>{if(!v.value)return;E(),v.value&&Oo(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=ae(),$()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ut.value&&(ut.value=null),Ne.value=!0;const r=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),i=Rn(r);Ce("update:modelValue",i),Ce("change",i),Vt.value="editor",he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f(),No(),Qo()},500),e.nextTick(()=>{n&&F(n),E();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,p=m&&m.collapsed;if(u.forEach(y=>{try{if(p&&ut.value?.command===y){Q.value[y]=ut.value.state;return}if(y==="bold")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x;let b=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(b=!0),!b&&N.style&&parseInt(N.style.fontWeight)>=600&&(b=!0),!b))try{const z=window.getComputedStyle(N);parseInt(z.fontWeight)>=600&&(b=!0)}catch{}Q.value[y]=b}else Q.value.hasOwnProperty(y)||(Q.value[y]=!1);else if(y==="italic")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x,b=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));Q.value[y]=!!b}else{const x=document.queryCommandState(y);Q.value[y]=x}else{const x=document.queryCommandState(y);Q.value[y]=x}}catch{}}),un(),U(),mt(),St(),mn(),Mn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const y=l.data||"";y&&y.length===1&&setTimeout(()=>Qo(y),0),(y===" "||y===`
|
|
78
|
-
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{No()},100)}Ne.value=!1})},E=()=>{if(!v.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),l.removeAllRanges(),l.addRange(p)}}}},$=()=>{if(!v.value)return;const l=v.value;if(l.querySelector&&l.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(n.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},U=()=>{if(v.value&&!Te.value){Te.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),v.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const y=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===u||i===y;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=r.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){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(d){p?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=gt,m.appendChild(y)}else if(p&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{Te.value=!1}}},ye=l=>{No(),Ce("blur",l),Vo()},Be=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),me.value&&(clearTimeout(me.value),me.value=null),he.value&&(f(),he.value=!1);const l=Vt.value==="title",n=Vt.value==="description",a=Vt.value==="editor";if(Ct.value.length===0){l&&ge.value?ge.value.focus():n&&Xe.value?Xe.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{k()});return}const r={content:v.value.innerHTML,title:V.title||"",description:V.description||""};Et.value.push(r);const i=Ct.value.pop();if(i!==void 0){Ne.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,ct.value=u,Gt.value=d,dt.value=m,bt.value=u,ze.value=d,Ke.value=m,e.nextTick(()=>{un(),dn(),On(),St();const p=Rn(u);Ce("update:modelValue",p),Ce("update:title",d),Ce("update:description",m),Ce("change",p),Ce("title-change",d),Ce("description-change",m),Ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(ge.value){ge.value.focus();const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),cn()}}else if(n){if(Xe.value){Xe.value.focus();const y=m.length;Xe.value.setSelectionRange(y,y)}}else if(a)rt();else if(ge.value&&document.activeElement===ge.value){const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),cn()}else if(Xe.value&&document.activeElement===Xe.value){const y=m.length;Xe.value.setSelectionRange(y,y)}else v.value&&rt()},10)})})}},qt=()=>{if(V.disabled||!V.richText||!v.value)return;Ut();const l=Vt.value==="title",n=Vt.value==="description",a=Vt.value==="editor";if(Et.value.length===0){l&&ge.value?ge.value.focus():n&&Xe.value?Xe.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{k()});return}const r={content:v.value.innerHTML,title:V.title||"",description:V.description||""};Ct.value.push(r);const i=Et.value.pop();if(i!==void 0){Ne.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,ct.value=u,Gt.value=d,dt.value=m,bt.value=u,ze.value=d,Ke.value=m,e.nextTick(()=>{un(),dn(),On(),St();const p=Rn(u);Ce("update:modelValue",p),Ce("update:title",d),Ce("update:description",m),Ce("change",p),Ce("title-change",d),Ce("description-change",m),Ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(ge.value){ge.value.focus();const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),cn()}}else if(n){if(Xe.value){Xe.value.focus();const y=m.length;Xe.value.setSelectionRange(y,y)}}else if(a)rt();else if(ge.value&&document.activeElement===ge.value){const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),cn()}else if(Xe.value&&document.activeElement===Xe.value){const y=m.length;Xe.value.setSelectionRange(y,y)}else v.value&&rt()},10)})})}},Tn=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},mt=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Zo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==v.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{mt()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{mt()});else try{const r=n.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{mt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{mt()})}return!0},Wo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==v.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==v.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const y=document.createDocumentFragment();for(;d.firstChild;)y.appendChild(d.firstChild);p.appendChild(y),d.parentNode&&d.parentNode.replaceChild(p,d),i.setStart(p,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}Tn()});else try{const r=n.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Xn=(l,n=null)=>{if(V.disabled||!V.richText||!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&tn(u)&&(r=ae())}if(l==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const p=document.createTextNode(n);d.insertNode(p),d.selectNodeContents(p)}}}if(l==="bold"){const u=Wo();Q.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:u}),e.nextTick(()=>{r&&(F(r),e.nextTick(()=>{const m=Qt("bold");Q.value.bold=m})),k(),dn(),St()});return}if(l==="italic"){const u=Zo();Q.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:u}),e.nextTick(()=>{r&&(F(r),e.nextTick(()=>{const m=Qt("italic");Q.value.italic=m})),k(),mt(),dn(),St()});return}let i=!1;try{i=document.execCommand(l,!1,n)}catch{}e.nextTick(()=>{if(r&&F(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=Qt("bold");Q.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=Qt("italic");Q.value.italic=d});else{const d=document.queryCommandState(l);Q.value[l]=d}else{const d=document.queryCommandState(l);Q.value[l]=d}}catch{Q.value.hasOwnProperty(l)?Q.value[l]=!Q.value[l]:Q.value[l]=!0}if(l==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0),y=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(p=>{const y=p.getAttribute("href");(!y||y===""||y==="#")&&p.setAttribute("href",n)})}k(),dn(),St()})},Qt=(l,n=null)=>{if(V.disabled||!v.value)return!1;try{if(l==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(d=!0),!d&&p.style&&parseInt(p.style.fontWeight)>=600&&(d=!0),!d))try{const y=window.getComputedStyle(p);parseInt(y.fontWeight)>=600&&(d=!0)}catch{}return Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let b=x.parentElement;for(;b&&b!==v.value;){if(b.tagName==="STRONG"||b.tagName==="B"){d=!0;break}if(b.style&&parseInt(b.style.fontWeight)>=600){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return Q.value[l]=d&&p,d&&p}}if(l==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(d=!0),!d&&p.style&&p.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(p).fontStyle==="italic"&&(d=!0)}catch{}return Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let b=x.parentElement;for(;b&&b!==v.value;){if(b.tagName==="EM"||b.tagName==="I"){d=!0;break}if(b.style&&b.style.fontStyle==="italic"){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return Q.value[l]=d&&p,d&&p}}const u=document.queryCommandState(l);return i.collapsed&&Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=u,u)}return Q.value.hasOwnProperty(l)?Q.value[l]:!1}catch{return Q.value.hasOwnProperty(l)?Q.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},qo=l=>{V.disabled||!V.richText||(be.value=be.value===l?null:l,l==="askAi"&&(yt.value=null))},Ut=()=>{be.value=null,Lt.value=null},Yn=l=>{Xn("formatBlock",l),Ut()},cl=l=>{if(!l||!v.value)return l;const n=J=>{let j=J.nodeType===Node.TEXT_NODE?J.parentElement:J;for(;j&&j!==v.value;){const ve=j.tagName;if(ve==="P"){const Tt=j.parentElement;if(Tt===v.value||Tt.tagName==="BLOCKQUOTE")return j}if(ve==="BLOCKQUOTE")break;j=j.parentElement}return null},a=n(l.startContainer),r=n(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:J=>{const j=J.tagName;if(j==="P"){const ve=J.parentElement;if(ve===v.value||ve.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return j==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),p=i.indexOf(r);if(m===-1||p===-1)return l;const y=Math.min(m,p),x=Math.max(m,p),N=i.slice(y,x+1);if(N.length===0)return l;const b=N[0],z=N[N.length-1],R=document.createRange();return R.setStartBefore(b),R.setEndAfter(z),R},dl=()=>{if(V.disabled||!V.richText||!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let n=l.getRangeAt(0);!n.collapsed&&tn(n)&&(n=cl(n),l.removeAllRanges(),l.addRange(n));let a=null;!n.collapsed&&tn(n)&&(a=ae());const r=n.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")d.insertBefore(p,i);else{const y=document.createElement("p");y.appendChild(p.cloneNode(!0)),d.insertBefore(y,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const y=document.createElement("p");y.appendChild(p.cloneNode(!0)),d.insertBefore(y,i)}}),i.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=n.extractContents();d.appendChild(m),n.insertNode(d);const p=[],y=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:b=>b.parentNode===d&&b.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=y.nextNode();)p.push(x);if(p.forEach(b=>{const z=document.createElement("p");b.parentNode.insertBefore(z,b),z.appendChild(b)}),d.querySelectorAll("p, div").forEach(b=>{b.textContent.trim()===""&&!b.querySelector("img")&&(b.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const b=document.createElement("p");b.innerHTML="<br>",d.appendChild(b)}}e.nextTick(()=>{a&&F(a),On(),k(),St()})},jn=()=>{if(!v.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!v.value.contains(r))return;const i=x=>{if(!x)return!1;const N=x.textContent||"",z=(x.innerHTML||"").trim();return N.trim()===""||z===""||z==="<br>"||z==="<br/>"||z==="<p></p>"||z==="<p><br></p>"||z==="<p><br/></p>"||z==="<p> </p>"||z==="<p><br> </p>"||z==="<div></div>"||z==="<div><br></div>"||z==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const x=r.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(r.children.length>0)for(let x=r.children.length-1;x>=0;x--){const N=r.children[x];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const p=document.createElement("p");p.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(p,r.nextSibling):r.parentNode.appendChild(p):v.value&&v.value.appendChild(p);const y=document.createRange();y.selectNodeContents(p),y.collapse(!0),l.removeAllRanges(),l.addRange(y),e.nextTick(()=>{On(),k()})},dn=()=>{if(!v.value){Le.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Le.value=!!r}else Le.value=!1}catch{Le.value=!1}},ul=()=>{if(!v.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),Qe.value=ae();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),O.value="",ht.value=a,fe.value="",Ae.value=null,Pt.value=!0,Ut(),e.nextTick(()=>{Dt.value&&Dt.value.focus()})},ml=()=>{if(!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f();const l=window.getSelection();let n=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&Ae.value&&(n=Ae.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}Ae.value=null}else Xn("unlink");Le.value=!1,Ut(),e.nextTick(()=>{k(),dn()})},Uo=()=>{V.disabled||!V.richText||v.value&&(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{un(),k(),St()}))},pl=()=>{V.disabled||!V.richText||v.value&&(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{un(),k(),St()}))},wo=l=>{const n=l.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},un=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=wo(a);r!==null&&Array.from(n.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},Kn=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{un(),k()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=wo(i);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),un();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),l.removeAllRanges(),l.addRange(p),e.nextTick(()=>{k(),St()})}else document.execCommand("indent",!1),e.nextTick(()=>{un(),k(),St()})},Vl=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{un(),k()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),un();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{k(),St()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{un(),k(),St()})},Xt=e.ref(null),Gn=e.ref(null),fo=e.ref({}),Fn=e.ref(""),zn=e.ref(null),Qn=e.ref("");e.ref("");const Pn=e.ref(null);e.ref("");const Jt=e.ref([]),$o=e.ref(!1),xo=e.ref(!1),Nl=l=>{if(!l)return"";const n=l.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},Lo=()=>{if(V.disabled||!V.richText||!v.value)return;if(Xt.value!==null){Xt.value=null,Fn.value="",Qn.value="",Pn.value=null,Jt.value=[],so(!0);return}Ut(),v.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0);if(n.collapsed||!tn(n))return;Qn.value=Nl(n)||"",Pn.value=ae();const a=n.getBoundingClientRect(),r=v.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);fo.value={top:`${m}px`,bottom:"auto"},Xt.value=Date.now(),e.nextTick(()=>{if(Fn.value="",zn.value){const y=zn.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const p=r.querySelector(".dss-comment-overlay");if(p&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const x=r.getBoundingClientRect(),N=p.getBoundingClientRect(),b=y.getBoundingClientRect(),z=N.bottom-x.top,R=b.top-x.top,J=8;if(z>R-J){const j=b.height;fo.value={bottom:`${j+J}px`,top:"auto"}}else fo.value={top:`${m}px`,bottom:"auto"}}}})},vl=()=>{if(!Fn.value.trim())return;const l=Fn.value.trim(),n=new Date,a={text:l,selectionText:Qn.value,selectionRange:Pn.value,commentId:Xt.value,user:V.commentUser||null,createdAt:n.toISOString()};Jt.value=[...Jt.value,a],Ce("comment-submitted",a),Vn(a),Pn.value&&!Jn(Pn.value)&&Yt(Xt.value,Pn.value),Fn.value="",e.nextTick(()=>{if(zn.value){const r=zn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Mn("sendComment")})},Xo=(l,n)=>{if(!(!V.commentUser||!l.user||l.user.id!==V.commentUser.id)){if(Jt.value=Jt.value.filter((a,r)=>r!==n),Xt.value!==null&&v.value){const a=String(Xt.value),r=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Jt.value.length>0){const i=[],u=new Set;Jt.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(Jt.value.length))}else r&&Jt.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ce("comment-deleted",{comment:l,index:n,commentId:Xt.value}),V.comments&&Array.isArray(V.comments)){const a=V.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));Ce("update:comments",a)}e.nextTick(()=>{Mn("deleteComment")})}},Jn=l=>{if(!l||!v.value)return!1;try{const n=B(l);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},B=l=>{if(!l||!v.value)return null;try{const n=document.createRange();if(l.type==="element"&&l.element)return v.value.contains(l.element)?(n.setStart(l.element,l.offset),n.collapse(!0),n):null;let a=0;const r=[v.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!u&&l.start>=a&&l.start<=m&&(n.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(n.setEnd(i,l.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return u?n:null}catch{return null}},Yt=(l,n)=>{if(!(!l||!n||!v.value))try{const a=B(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,p=a.endContainer,y=a.startOffset,x=a.endOffset,N=m.nodeType===3?m.parentNode:m,b=p.nodeType===3?p.parentNode:p;if(N===b&&y===0&&x===(p.nodeType===3?p.length:b.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const R=a.extractContents();u.appendChild(R),a.insertNode(u)}else a.surroundContents(u)}catch{const p=a.extractContents();u.appendChild(p),a.insertNode(u)}const d=v.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Mn("wrapSelectionWithCommentMarker"),k()})}catch{}},Vn=l=>{if(!l||!l.commentId)return;const n=Array.isArray(V.comments)?[...V.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=n.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=n[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&n.length>0){const d=n.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=n.length>0&&n.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};n.push(m)}$o.value=!0,Ce("update:comments",n)},gn=(l,n=[])=>{if(V.disabled||!V.richText||!v.value)return;const a=v.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;Ut(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),Qn.value=r.innerHTML||"",Pn.value=ae();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),N=d.bottom-x.top,z=Math.max(N+8,0);fo.value={top:`${z}px`,bottom:"auto"}}const p=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(p&&V.comments&&Array.isArray(V.comments)){const x=V.comments.find(N=>String(N.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const N=x.conversation.map(b=>({id:b.id||b.commentary_id,commentary_id:b.id||b.commentary_id,conversation_id:x.id||x.conversation_id,text:b.text,user:b.user,createdAt:b.created_at||b.createdAt,updated_at:b.updated_at||b.updatedAt}));y.push(...N)}}y.length===0&&Array.isArray(n)&&n.length>0&&(y=n.slice()),y.sort((x,N)=>{const b=J=>{if(!J)return 0;const j=new Date(J).getTime();return isNaN(j)?0:j},z=b(x.createdAt),R=b(N.createdAt);return z===R?0:z-R}),Jt.value=y,so(!0),Xt.value=p||null,r&&(Gn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Fn.value="",zn.value){const x=zn.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const N=m.querySelector(".dss-text-editor-footer");if(N){const b=m.getBoundingClientRect(),z=x.getBoundingClientRect(),R=N.getBoundingClientRect(),J=z.bottom-b.top,j=R.top-b.top,ve=8;if(J>j-ve){const Tt=R.height;fo.value={bottom:`${Tt+ve}px`,top:"auto"}}}}}Mn("openCommentOverlayForSelector")})},Nn=e.ref(null),wt=e.ref(0),At=l=>{if(!(V.disabled||!V.richText)){if(l.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{jn()},50);return}}}if(l.key.length===1||l.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(p)&&p!==d){l.preventDefault();const y=document.createRange();y.setStartAfter(u),y.collapse(!0),n.removeAllRanges(),n.addRange(y);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const p=i.contains(d)||d===i,y=i.contains(m)||m===i,N=a.cloneContents().textContent?.trim()||"",b=i.textContent?.trim()||"";(!p||!y||N.length>b.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{k()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Vl():Kn();return}if(l.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=p=>{if(!p)return!1;let y=p.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 x=p.parentElement;return x&&x!==v.value?m(x):!1};if(d.nodeType===3){const p=d.parentElement;if(p&&(m(p)||m(d))){const y=p.closest("p, div");if(y&&y!==v.value){l.preventDefault(),l.stopPropagation();let x=null;const N=a.startOffset;N<d.length&&(x=d.splitText(N));const b=document.createElement("p");if(x?b.appendChild(x):b.innerHTML="<br>",d.length===0){const R=d.parentElement;R&&(R.removeChild(d),R.childNodes.length===0&&R.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(b,y.nextSibling):y.parentNode.appendChild(b);const z=document.createRange();x?z.setStart(x,0):z.setStart(b,0),z.collapse(!0),n.removeAllRanges(),n.addRange(z),e.nextTick(()=>{k()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=R=>{if(!R)return!1;const J=R.textContent||"",ve=(R.innerHTML||"").trim(),Tt=ve.replace(/<br\s*\/?>/gi,"").trim();return J.trim()===""||ve===""||Tt===""||ve==="<br>"||ve==="<br/>"||ve==="<p></p>"||ve==="<p><br></p>"||ve==="<p><br/></p>"||ve==="<p> </p>"||ve==="<p><br> </p>"||ve==="<div></div>"||ve==="<div><br></div>"||ve==="<div><br/></div>"},p=i.lastChild,y=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,N=x.nodeType===3?x.parentElement:x,b=N===i||N&&N.parentElement===i;if(d&&m(d)||y&&b){l.preventDefault(),setTimeout(()=>{jn()},50);return}}}}if(l.key===" "){const n=Date.now(),a=n-wt.value;if(Nn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),Kn();return}}}}Nn.value=" ",wt.value=n}else Nn.value=l.key}},eo=l=>{if(V.disabled||!V.richText)return;l.preventDefault();let n=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),f();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const p=new DOMParser().parseFromString(d,"text/html");let y=v.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(N=>{if(y>0){const b=p.createElement("p");b.innerHTML=N.innerHTML,N.parentNode.replaceChild(b,N)}else y++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],b=Array.from(p.body.children).filter(z=>N.includes(z.tagName));if(b.length===1){const z=b[0].tagName,R=i.tagName,J=i.textContent.trim()===""&&!i.querySelector("img");let j=!1;if(["H1","H2","H3","H4","H5","H6"].includes(R)?j=!0:J||(z===R||z==="P")&&(j=!0),j)return b[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(n){const d=u(n);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);k()},to=l=>{if(be.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ut()}if(Ee.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=v.value&&a.closest(".dss-text-editor-content");!r&&!i&&Vo()}if(yt.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&gl()}const n=l.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Lt.value=null),!v.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);at.value=!r.collapsed&&tn(r)}else at.value=!1}if(Xt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,p=l.clientY;r=m>=d.left&&m<=d.right&&p>=d.top&&p<=d.bottom}const i=n.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(Xt.value=null,Fn.value="",Qn.value="",Pn.value=null,Jt.value=[],so(!0))}},Je=(l,n)=>{l&&l.stopPropagation&&l.stopPropagation(),_t.value&&(clearTimeout(_t.value),_t.value=null),Lt.value=n},et=l=>{const n=l.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}_t.value&&clearTimeout(_t.value),_t.value=setTimeout(()=>{Lt.value=null,_t.value=null},150)},Pe=l=>{Lt.value=null};let en=0;const fl=l=>{if(!l)return;const n=Array.from(l.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.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),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++en}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),p=u),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Yo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{fl(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=p=>{const y=i.getAttribute("data-submenu-id");y&&Je(p,y)},m=et;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=y=>{const x=i.getAttribute("data-submenu-id");x&&Je(y,x)},m=et;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",Pe)})})})};let Hn=null;const Eo=()=>{if(Lt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Lt.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Lt.value}"]`);l&&n&&wl(l,n)}if(Ee.value&&St(),V.richText){if(Hn!==null)return;Hn=setTimeout(()=>{Hn=null,Mn("handleWindowResize")},150)}},no=()=>{if(!V.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},jo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ht.value?cn():bo(),We.value?K():fn()})}),e.nextTick(()=>{jo()}),V.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",to),window.addEventListener("resize",Eo);let l=null;const n=()=>{l===null&&(l=setTimeout(()=>{l=null,Eo()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=l,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const a=v.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,Eo()},150))};a&&(a.addEventListener("scroll",i),v.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Yo(),no()}),v.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!V.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),N=p.closest(".dss-image-wrapper");if(x||N&&p===N){m.preventDefault(),m.stopPropagation();const b=window.getSelection(),z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.removeAllRanges(),b.addRange(z)}else N&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const b=window.getSelection();if(b.rangeCount>0){const R=b.getRangeAt(0).commonAncestorContainer,J=R.nodeType===3?R.parentElement:R;if(N.contains(J)&&J!==N.querySelector("img")){const j=document.createRange();j.setStartAfter(N),j.collapse(!0),b.removeAllRanges(),b.addRange(j)}}else{const z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.addRange(z)}}))},!0),v.value.addEventListener("mousedown",m=>{const p=m.target,y=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(y||x&&p.tagName!=="IMG"){m.preventDefault();const N=window.getSelection(),b=document.createRange();x&&(b.setStartAfter(x),b.collapse(!0),N.removeAllRanges(),N.addRange(b))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.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 N=y.getAttribute("alt")||y.alt||"";if(N){const b=y.getAttribute("src")||y.src||"",z=b.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),R=N===b||N===z;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||R||R)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),U()})}),v.value.addEventListener("dragstart",m=>{const p=m.target,y=p.tagName==="IMG"?p:p.closest("img"),x=y?.closest(".dss-image-wrapper");y&&v.value.contains(y)&&(ot.value=x||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{ot.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{ot.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!ot.value||!v.value)return;m.preventDefault(),m.stopPropagation();const p=ot.value,y=p.classList?.contains("dss-image-wrapper"),x=y?p.querySelector("img"):p,N=y?p:x?.closest(".dss-image-wrapper");if(!x||!v.value.contains(x)){ot.value=null;return}let b=null;const z=m.clientX,R=m.clientY;if(document.caretRangeFromPoint)b=document.caretRangeFromPoint(z,R);else{const De=window.getSelection();De.rangeCount>0?b=De.getRangeAt(0).cloneRange():(b=document.createRange(),b.selectNodeContents(v.value),b.collapse(!1))}if(!b){ot.value=null;return}const J=b.commonAncestorContainer,j=J.nodeType===3?J.parentElement:J;if(j?.closest(".dss-image-wrapper")===N||N&&N.contains(j)){ot.value=null;return}if(N&&(j===N||N.contains(j))){ot.value=null;return}const Tt=x.getAttribute("src");let xt=null;N?xt=N.cloneNode(!0):xt=x.cloneNode(!0);try{let De=b.startContainer;if(De.nodeType===3&&(De=De.parentElement),N&&(De===N||N.contains(De))){const it=document.createRange();it.setStartAfter(N),it.collapse(!0),b=it}b.insertNode(xt);const vt=document.createRange();vt.setStartAfter(xt),vt.collapse(!0);const ft=window.getSelection();ft.removeAllRanges(),ft.addRange(vt)}catch{if(v.value.childNodes.length===0){const vt=document.createElement("p");vt.appendChild(xt),v.value.appendChild(vt)}else{const vt=v.value.lastChild;if(vt&&vt.nodeType===1)vt.appendChild(xt);else{const ft=document.createElement("p");ft.appendChild(xt),v.value.appendChild(ft)}}}N?N.remove():x.remove(),ot.value=null,e.nextTick(()=>{const De=v.value.querySelectorAll("img");let vt=!1;De.forEach(ft=>{if(ft.getAttribute("src")===Tt)if(!vt)vt=!0;else{const it=ft.closest(".dss-image-wrapper");it?it.remove():ft.remove()}}),U(),k()})}),v.value.addEventListener("dragend",m=>{ot.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(p=>{p.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 x=y.querySelectorAll&&y.querySelectorAll("img");x&&x.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{U(),no(),u=null},100)});if(d.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{no()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),V.modelValue){const m=Wt(V.modelValue);v.value.innerHTML=m,$()}e.nextTick(()=>{const m=v.value.innerHTML||"",p=V.title||"",y=V.description||"";ct.value=m,Gt.value=p,dt.value=y,ze.value=p,Ke.value=y,un(),U(),mt(),mn(),ol(),el()}),dn(),On(),v.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",to),window.removeEventListener("resize",Eo),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Hn!==null&&(clearTimeout(Hn),Hn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),me.value&&clearTimeout(me.value),_t.value&&clearTimeout(_t.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Nt.value&&Nt.value.disconnect(),Rt.value!==null&&(cancelAnimationFrame(Rt.value),Rt.value=null),vn.value!==null&&(clearTimeout(vn.value),vn.value=null),It.value!==null&&(clearTimeout(It.value),It.value=null),so(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const Sl=l=>{const n=l.target,a=n.closest("a");if(a&&!V.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const p=document.createRange();p.setStartAfter(r),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}U(),dn(),On(),St(),mn()}):e.nextTick(()=>{U(),dn(),On(),St(),mn()})},Ko=()=>{E();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);at.value=!a.collapsed&&tn(a),!a.collapsed&&ut.value&&(ut.value=null)}else at.value=!1;if(U(),dn(),On(),St(),mn(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),at.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const p=window.getComputedStyle(d);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}Q.value[a]=m}else{const u=document.queryCommandState(a);Q.value[a]=u}}}catch{}})},mn=()=>{if(!V.richText||V.disabled||!v.value){lt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){lt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!v.value.contains(r)){lt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){lt.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?lt.value=u:lt.value="p"}catch{lt.value="p"}},On=()=>{if(!v.value){kn.value=!1;return}try{const l=window.getSelection();let n=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(i&&v.value.contains(i))}kn.value=n}catch{kn.value=!1}},tn=l=>{if(!l||!v.value)return!1;const n=l.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?v.value.contains(a):!1},Vo=()=>{Ee.value=!1},St=()=>{if(!V.floatingToolbar||!V.richText||V.disabled){Ee.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){Ee.value=!1;return}const n=l.getRangeAt(0);if(n.collapsed||!tn(n)){Ee.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ee.value=!1;return}const r=v.value;if(!r){Ee.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){Ee.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let p=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Ot.value&&(x=Ot.value.getBoundingClientRect().width);const N=(x||320)/2;let b=i.left+N,z=i.right-N;if(z<b){const R=i.left+i.width/2;b=R,z=R}if(y>0){const R=N+d,J=y-N-d;if(b=Math.max(b,R),z=Math.min(z,J),z<b){const j=y/2;b=j,z=j}}p<b?p=b:p>z&&(p=z),_n.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ee.value=!0},go=l=>{V.disabled||!V.richText||(yt.value=yt.value===l?null:l,l==="askAi"&&(be.value=null))},gl=()=>{yt.value=null,Lt.value=null},oo=l=>{Yn(l),gl()};let mo=null,po=null,lo=null,ho=null;const Ml=l=>{if(V.disabled||!V.richText){Sn(),tt();return}const n=l.target,a=n.closest("a"),r=n.closest("img");if(mo&&(clearTimeout(mo),mo=null),lo&&(clearTimeout(lo),lo=null),a&&a!==po){tt(),po=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),Ae.value=a,re.value=i,I.value=!0,qe.value=!0,Wn(a)}else!a&&po?(po=null,mo=setTimeout(()=>{qe.value||Sn()},150)):a&&a===po&&Wn(a);if(r&&r!==ho){Sn(),ho=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),He.value=r,ln.value=i.trim()||D("textEditor.image.noAlt"),Bt.value=!0,Ye.value=!0,hl(r)}else!r&&ho?(ho=null,lo=setTimeout(()=>{Ye.value||tt()},150)):r&&r===ho&&hl(r)},Zn=l=>{const n=l.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(po=null,ho=null,mo&&(clearTimeout(mo),mo=null),lo&&(clearTimeout(lo),lo=null),Sn(),tt())},Sn=()=>{qe.value=!1,setTimeout(()=>{qe.value||(I.value=!1,re.value="",Pt.value||(Ae.value=null))},100)},Wn=l=>{if(!l||!v.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;$e.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},tt=()=>{Ye.value=!1,setTimeout(()=>{Ye.value||(Bt.value=!1,ln.value="",pn.value||(He.value=null))},100)},hl=l=>{if(!l||!v.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;vo.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Mt=()=>{if(!re.value||!Ae.value)return;let n=Ae.value.getAttribute("href")||re.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ft=()=>{if(Ae.value){const l=Ae.value.textContent||"",n=Ae.value.getAttribute("href")||"",a=Ae.value;O.value=n,ht.value=l,fe.value=l,qe.value=!1,I.value=!1,re.value="",Ae.value=a,Pt.value=!0}else if(Le.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";O.value=u,ht.value=i,fe.value=i,Ae.value=r,Pt.value=!0}}}else{Qe.value=ae();const l=window.getSelection();let n="";l.rangeCount>0&&(n=l.getRangeAt(0).toString()),O.value="",ht.value=n,fe.value="",Ae.value=null,Pt.value=!0}e.nextTick(()=>{Dt.value&&(Dt.value.focus(),Dt.value.select())})},_o=()=>{Pt.value=!1,O.value="",ht.value="",fe.value="",Ae.value=null,Qe.value=null},Go=()=>{if(!O.value.trim()){_o();return}if(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),ht.value.trim()||(ht.value=O.value.trim()),Ae.value&&v.value&&v.value.contains(Ae.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const n=Ae.value;if(n.setAttribute("href",O.value.trim()),ht.value.trim()!==fe.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ht.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),l.removeAllRanges(),l.addRange(a),k()}else if(v.value){v.value.focus();const l=window.getSelection();l.removeAllRanges(),Qe.value&&F(Qe.value);let n=null;if(l.rangeCount>0&&(n=l.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=O.value.trim(),a.textContent=ht.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,i=r&&n.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=O.value.trim(),u.textContent=ht.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==v.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const p=document.createTextNode(" ");m.appendChild(p);const y=document.createRange();y.setStartAfter(u),y.collapse(!0),l.removeAllRanges(),l.addRange(y)}else{if(n.startOffset>0){const y=a.textContent.substring(0,n.startOffset),x=y[y.length-1];if(x&&x!==" "&&x!==" "&&x!==`
|
|
77
|
+
</svg>`,v=e.ref(null),be=e.ref(null),Le=e.ref(!1),Ne=e.ref(!1),I=e.ref(!1),re=e.ref(""),$e=e.ref({}),qe=e.ref(!1),Pt=e.ref(!1),O=e.ref(""),ht=e.ref(""),Dt=e.ref(null),Ue=e.ref(null),Ae=e.ref(null),Qe=e.ref(null),fe=e.ref(""),kn=e.ref(!1),Q=e.ref({}),Ee=e.ref(!1),_n=e.ref({}),Ot=e.ref(null),yt=e.ref(null),pn=e.ref(!1),Kt=e.ref(""),Bn=e.ref(null),nt=e.ref(""),Fe=e.ref(""),_e=e.ref(""),Ze=e.ref(null),nn=e.ref(null),Cn=e.ref(null),He=e.ref(null),bn=e.ref(null),Bt=e.ref(!1),on=e.ref(""),vo=e.ref({}),Ye=e.ref(!1),je=e.ref("upload"),kt=e.ref(""),Lt=e.ref(null),_t=e.ref(null),Ct=e.ref([]),Et=e.ref([]),me=e.ref(null),he=e.ref(!1),ct=e.ref(""),bt=e.ref(""),Gt=e.ref(""),dt=e.ref(""),ze=e.ref(""),Ke=e.ref(""),ge=e.ref(null),Xe=e.ref(null),Vt=e.ref(null),Te=e.ref(!1),ot=e.ref(null),Ht=e.ref(!1),We=e.ref(!1),ut=e.ref(null),lt=e.ref("p"),at=e.ref(!1),ln=e.ref([]),Nt=e.ref(null),Rt=e.ref(null),vn=e.ref(null),wn=e.ref(!1),an=e.ref(0),io=100,It=e.ref(null),An=e.computed(()=>({"dss-text-editor-no-border":!V.border,"dss-text-editor-rounded":V.rounded,"dss-text-editor-full-height":V.fullHeight,"dss-comment-overlay-open":Xt.value!==null})),xn=e.computed(()=>({})),Dn=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+24+2}px`,resize:"none",overflowY:"auto"}),M=e.computed(()=>!V.fixedHeight||V.fullHeight?{}:{height:`${1.6*14*V.rows+32}px`,overflowY:"auto"}),A=e.computed(()=>V.richText&&Et.value.length>0),T=e.computed(()=>{if(!V.modelValue)return"";if(V.richText){let l=V.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return V.modelValue}),W=e.computed(()=>{const l=T.value.trim();return l?l.split(/\s+/).filter(n=>n.length>0).length:0}),te=e.computed(()=>T.value.length),de=e.computed(()=>He.value!==null&&je.value==="upload"&&nt.value&&nt.value.startsWith("data:")),we=e.computed(()=>V.titlePlaceholder||D("textEditor.placeholders.title")),ie=e.computed(()=>V.descriptionPlaceholder||D("textEditor.placeholders.description")),Ve=e.computed(()=>V.placeholder||D("textEditor.placeholders.startTyping")),Se=l=>Ge&&Ge[l]!==void 0,$t=l=>{for(let n=l+1;n<V.customToolbarSlots.length;n++)if(Se(V.customToolbarSlots[n]))return!0;return!1},Zt=l=>{for(let n=l+1;n<V.customToolbarSlots.length;n++){const a=V.customToolbarSlots[n];if(Se(a)&&sn(a))return!0}return!1},sn=l=>V.customToolbarFloatingMap.hasOwnProperty(l)?V.customToolbarFloatingMap[l]===!0:!0,Un=e.computed(()=>V.customToolbarSlots.some(l=>Se(l)&&sn(l))),ko=e.computed(()=>Se("title-slot")),co=e.computed(()=>Se("description-slot")),Rn=l=>{if(!l||l.trim()==="")return"<html></html>";const n=l.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?l:`<html>${l}</html>`},Wt=l=>{if(!l||l.trim()==="")return"";const n=l.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},To=l=>{if(!l)return;const n=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(i=>i.remove())},Ho=l=>{try{const n=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],i=l.getFullYear();return`${n} ${r} ${i}`}catch{return""}},En=l=>{if(!l||typeof l!="string")return!1;const n=l.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const i=D("textEditor.started_conversation");if(i&&n===i)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},$o=l=>{const n=l.target.value;Ce("update:modelValue",n),Ce("change",n)},rn=()=>{if(!ge.value)return;const l=ge.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},Co=()=>{Ht.value=!0,rn()},uo=()=>{Ht.value=!1,bo()},bo=()=>{if(!ge.value)return;const l=ge.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},st=l=>{const a=l.target.value;Ht.value&&rn(),Ce("update:title",a),Ce("title-change",a),Vt.value="title",V.richText&&(he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f()},500))},K=()=>{if(!Xe.value)return;const l=Xe.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const i=l.scrollHeight;l.value=r,l.style.setProperty("height",`${i}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},In=()=>{We.value=!0,K()},Me=()=>{We.value=!1,fn()},fn=()=>{if(!Xe.value)return;const l=Xe.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const n=l.value;l.value="M";const a=l.scrollHeight;l.value=n,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},pe=l=>{const a=l.target.value;We.value&&K(),Ce("update:description",a),Ce("description-change",a),Vt.value="description",V.richText&&(he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f()},500))},ae=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const n=l.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(v.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},F=l=>{if(!(!l||!v.value))try{const n=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(v.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{v.value.focus();return}let r=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=r+u.length;!d&&l.start>=r&&l.start<=p&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=p&&(a.setEnd(u,l.end-r),m=!0),r=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}n.removeAllRanges(),n.addRange(a)}catch{v.value.focus()}},rt=()=>{if(!v.value)return;v.value.focus();const l=window.getSelection(),n=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let u=i.childNodes.length-1;u>=0;u--){const d=i.childNodes[u],m=a(d);if(m)return m}return i},r=a(v.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(n.setStart(i,i.length),n.setEnd(i,i.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);l.removeAllRanges(),l.addRange(n)},f=(l=!1)=>{if(!v.value)return;const n=v.value.innerHTML,a=V.title||"",r=V.description||"";if(!l&&n===ct.value&&a===Gt.value&&r===dt.value)return;const i={content:bt.value||ct.value,title:ze.value!==void 0?ze.value:Gt.value,description:Ke.value!==void 0?Ke.value:dt.value},u=Ct.value.length>0?Ct.value[Ct.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=i.content!==u:d=i.content!==u.content||i.title!==u.title||i.description!==u.description),d&&(Ct.value.push(i),Ct.value.length>50&&Ct.value.shift(),Et.value=[]),ct.value=n,Gt.value=a,dt.value=r,bt.value=n,ze.value=a,Ke.value=r},k=l=>{if(!v.value)return;E(),v.value&&To(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=ae(),$()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&ut.value&&(ut.value=null),Ne.value=!0;const r=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),i=Rn(r);Ce("update:modelValue",i),Ce("change",i),Vt.value="editor",he.value||(bt.value=ct.value,ze.value=Gt.value,Ke.value=dt.value),me.value&&clearTimeout(me.value),he.value=!0,me.value=setTimeout(()=>{he.value=!1,f(),No(),Qo()},500),e.nextTick(()=>{n&&F(n),E();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,p=m&&m.collapsed;if(u.forEach(y=>{try{if(p&&ut.value?.command===y){Q.value[y]=ut.value.state;return}if(y==="bold")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x;let b=!1;if(N&&((N.tagName==="STRONG"||N.tagName==="B"||N.closest&&N.closest("strong, b"))&&(b=!0),!b&&N.style&&parseInt(N.style.fontWeight)>=600&&(b=!0),!b))try{const z=window.getComputedStyle(N);parseInt(z.fontWeight)>=600&&(b=!0)}catch{}Q.value[y]=b}else Q.value.hasOwnProperty(y)||(Q.value[y]=!1);else if(y==="italic")if(m){const x=m.commonAncestorContainer,N=x.nodeType===3?x.parentElement:x,b=N&&(N.tagName==="EM"||N.tagName==="I"||N.closest&&N.closest("em, i"));Q.value[y]=!!b}else{const x=document.queryCommandState(y);Q.value[y]=x}else{const x=document.queryCommandState(y);Q.value[y]=x}}catch{}}),dn(),U(),mt(),St(),mn(),Mn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const y=l.data||"";y&&y.length===1&&setTimeout(()=>Qo(y),0),(y===" "||y===`
|
|
78
|
+
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{No()},100)}Ne.value=!1})},E=()=>{if(!v.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const u=i.querySelector("img");if(r!==u&&!u?.contains(r)){const d=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(i.contains(d)&&d!==u||i.contains(m)&&m!==u){const p=document.createRange();p.setStartAfter(i),p.collapse(!0),l.removeAllRanges(),l.addRange(p)}}}},$=()=>{if(!v.value)return;const l=v.value;if(l.querySelector&&l.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===l&&l.removeChild(i);return}r||(r=document.createElement("p"),l.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const u=i,d=u.tagName;if(d==="BR"){r=null;return}if(n.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},U=()=>{if(v.value&&!Te.value){Te.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),v.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const u=r.getAttribute("src")||r.src||"";if(i){const y=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),x=i===u||i===y;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||x||x)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const d=!i||i.trim()==="";let m=r.parentElement;const p=m&&m.classList.contains("dss-image-wrapper");if(p){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(d){p?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=gt,m.appendChild(y)}else if(p&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{Te.value=!1}}},ye=l=>{No(),Ce("blur",l),Vo()},Be=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),me.value&&(clearTimeout(me.value),me.value=null),he.value&&(f(),he.value=!1);const l=Vt.value==="title",n=Vt.value==="description",a=Vt.value==="editor";if(Ct.value.length===0){l&&ge.value?ge.value.focus():n&&Xe.value?Xe.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{k()});return}const r={content:v.value.innerHTML,title:V.title||"",description:V.description||""};Et.value.push(r);const i=Ct.value.pop();if(i!==void 0){Ne.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,ct.value=u,Gt.value=d,dt.value=m,bt.value=u,ze.value=d,Ke.value=m,e.nextTick(()=>{dn(),cn(),On(),St();const p=Rn(u);Ce("update:modelValue",p),Ce("update:title",d),Ce("update:description",m),Ce("change",p),Ce("title-change",d),Ce("description-change",m),Ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(ge.value){ge.value.focus();const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),rn()}}else if(n){if(Xe.value){Xe.value.focus();const y=m.length;Xe.value.setSelectionRange(y,y)}}else if(a)rt();else if(ge.value&&document.activeElement===ge.value){const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),rn()}else if(Xe.value&&document.activeElement===Xe.value){const y=m.length;Xe.value.setSelectionRange(y,y)}else v.value&&rt()},10)})})}},qt=()=>{if(V.disabled||!V.richText||!v.value)return;Ut();const l=Vt.value==="title",n=Vt.value==="description",a=Vt.value==="editor";if(Et.value.length===0){l&&ge.value?ge.value.focus():n&&Xe.value?Xe.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{k()});return}const r={content:v.value.innerHTML,title:V.title||"",description:V.description||""};Ct.value.push(r);const i=Et.value.pop();if(i!==void 0){Ne.value=!0;const u=typeof i=="string"?i:i.content,d=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";v.value.innerHTML=u,ct.value=u,Gt.value=d,dt.value=m,bt.value=u,ze.value=d,Ke.value=m,e.nextTick(()=>{dn(),cn(),On(),St();const p=Rn(u);Ce("update:modelValue",p),Ce("update:title",d),Ce("update:description",m),Ce("change",p),Ce("title-change",d),Ce("description-change",m),Ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(ge.value){ge.value.focus();const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),rn()}}else if(n){if(Xe.value){Xe.value.focus();const y=m.length;Xe.value.setSelectionRange(y,y)}}else if(a)rt();else if(ge.value&&document.activeElement===ge.value){const y=d.length;ge.value.setSelectionRange&&ge.value.setSelectionRange(y,y),rn()}else if(Xe.value&&document.activeElement===Xe.value){const y=m.length;Xe.value.setSelectionRange(y,y)}else v.value&&rt()},10)})})}},Tn=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},mt=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Zo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==v.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{mt()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{mt()});else try{const r=n.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{mt()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{mt()})}return!0},Wo=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const n=l.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==v.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=i.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==v.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const p=document.createElement("b");p.style.fontWeight="600";const y=document.createDocumentFragment();for(;d.firstChild;)y.appendChild(d.firstChild);p.appendChild(y),d.parentNode&&d.parentNode.replaceChild(p,d),i.setStart(p,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}Tn()});else try{const r=n.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),l.removeAllRanges(),l.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Xn=(l,n=null)=>{if(V.disabled||!V.richText||!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&en(u)&&(r=ae())}if(l==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const p=document.createTextNode(n);d.insertNode(p),d.selectNodeContents(p)}}}if(l==="bold"){const u=Wo();Q.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"bold",state:u}),e.nextTick(()=>{r&&(F(r),e.nextTick(()=>{const m=Qt("bold");Q.value.bold=m})),k(),cn(),St()});return}if(l==="italic"){const u=Zo();Q.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(ut.value={command:"italic",state:u}),e.nextTick(()=>{r&&(F(r),e.nextTick(()=>{const m=Qt("italic");Q.value.italic=m})),k(),mt(),cn(),St()});return}let i=!1;try{i=document.execCommand(l,!1,n)}catch{}e.nextTick(()=>{if(r&&F(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=Qt("bold");Q.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=Qt("italic");Q.value.italic=d});else{const d=document.queryCommandState(l);Q.value[l]=d}else{const d=document.queryCommandState(l);Q.value[l]=d}}catch{Q.value.hasOwnProperty(l)?Q.value[l]=!Q.value[l]:Q.value[l]=!0}if(l==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0),y=p.commonAncestorContainer.nodeType===1?p.commonAncestorContainer.closest("a"):p.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(p=>{const y=p.getAttribute("href");(!y||y===""||y==="#")&&p.setAttribute("href",n)})}k(),cn(),St()})},Qt=(l,n=null)=>{if(V.disabled||!v.value)return!1;try{if(l==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(l==="bold"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="STRONG"||p.tagName==="B"||p.closest&&p.closest("strong, b"))&&(d=!0),!d&&p.style&&parseInt(p.style.fontWeight)>=600&&(d=!0),!d))try{const y=window.getComputedStyle(p);parseInt(y.fontWeight)>=600&&(d=!0)}catch{}return Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let b=x.parentElement;for(;b&&b!==v.value;){if(b.tagName==="STRONG"||b.tagName==="B"){d=!0;break}if(b.style&&parseInt(b.style.fontWeight)>=600){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="STRONG"||N.tagName==="B"){d=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){d=!0;break}}if(d)break}}return Q.value[l]=d&&p,d&&p}}if(l==="italic"){let d=!1;if(i.collapsed){const m=i.commonAncestorContainer,p=m.nodeType===3?m.parentElement:m;if(p&&((p.tagName==="EM"||p.tagName==="I"||p.closest&&p.closest("em, i"))&&(d=!0),!d&&p.style&&p.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(p).fontStyle==="italic"&&(d=!0)}catch{}return Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=d,d)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let p=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let x;for(;x=y.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(x))){if(x.nodeType===3){if(!(x.textContent||"").trim())continue;p=!0;let b=x.parentElement;for(;b&&b!==v.value;){if(b.tagName==="EM"||b.tagName==="I"){d=!0;break}if(b.style&&b.style.fontStyle==="italic"){d=!0;break}b=b.parentElement}}else if(x.nodeType===1){const N=x;if(N.tagName==="EM"||N.tagName==="I"){d=!0;break}if(N.style&&N.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return Q.value[l]=d&&p,d&&p}}const u=document.queryCommandState(l);return i.collapsed&&Q.value.hasOwnProperty(l)?Q.value[l]:(Q.value[l]=u,u)}return Q.value.hasOwnProperty(l)?Q.value[l]:!1}catch{return Q.value.hasOwnProperty(l)?Q.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},qo=l=>{V.disabled||!V.richText||(be.value=be.value===l?null:l,l==="askAi"&&(yt.value=null))},Ut=()=>{be.value=null,Lt.value=null},Yn=l=>{Xn("formatBlock",l),Ut()},cl=l=>{if(!l||!v.value)return l;const n=J=>{let j=J.nodeType===Node.TEXT_NODE?J.parentElement:J;for(;j&&j!==v.value;){const ve=j.tagName;if(ve==="P"){const Tt=j.parentElement;if(Tt===v.value||Tt.tagName==="BLOCKQUOTE")return j}if(ve==="BLOCKQUOTE")break;j=j.parentElement}return null},a=n(l.startContainer),r=n(l.endContainer);if(!a||!r)return l;const i=[],u=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:J=>{const j=J.tagName;if(j==="P"){const ve=J.parentElement;if(ve===v.value||ve.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return j==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)i.push(d);const m=i.indexOf(a),p=i.indexOf(r);if(m===-1||p===-1)return l;const y=Math.min(m,p),x=Math.max(m,p),N=i.slice(y,x+1);if(N.length===0)return l;const b=N[0],z=N[N.length-1],R=document.createRange();return R.setStartBefore(b),R.setEndAfter(z),R},dl=()=>{if(V.disabled||!V.richText||!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let n=l.getRangeAt(0);!n.collapsed&&en(n)&&(n=cl(n),l.removeAllRanges(),l.addRange(n));let a=null;!n.collapsed&&en(n)&&(a=ae());const r=n.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value.contains(i))){if(i){const d=i.parentNode;Array.from(i.childNodes).forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE)if(p.tagName==="P"||p.tagName==="DIV")d.insertBefore(p,i);else{const y=document.createElement("p");y.appendChild(p.cloneNode(!0)),d.insertBefore(y,i)}else if(p.nodeType===Node.TEXT_NODE&&p.textContent.trim()){const y=document.createElement("p");y.appendChild(p.cloneNode(!0)),d.insertBefore(y,i)}}),i.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=n.extractContents();d.appendChild(m),n.insertNode(d);const p=[],y=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:b=>b.parentNode===d&&b.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let x;for(;x=y.nextNode();)p.push(x);if(p.forEach(b=>{const z=document.createElement("p");b.parentNode.insertBefore(z,b),z.appendChild(b)}),d.querySelectorAll("p, div").forEach(b=>{b.textContent.trim()===""&&!b.querySelector("img")&&(b.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const b=document.createElement("p");b.innerHTML="<br>",d.appendChild(b)}}e.nextTick(()=>{a&&F(a),On(),k(),St()})},jn=()=>{if(!v.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!v.value.contains(r))return;const i=x=>{if(!x)return!1;const N=x.textContent||"",z=(x.innerHTML||"").trim();return N.trim()===""||z===""||z==="<br>"||z==="<br/>"||z==="<p></p>"||z==="<p><br></p>"||z==="<p><br/></p>"||z==="<p> </p>"||z==="<p><br> </p>"||z==="<div></div>"||z==="<div><br></div>"||z==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&i(u)&&u.remove();r.lastChild;){const x=r.lastChild;if(x.nodeType===1&&x.tagName==="BR")x.remove();else if(x.nodeType===3)if((x.textContent||"").trim()==="")x.remove();else break;else break}if(r.children.length>0)for(let x=r.children.length-1;x>=0;x--){const N=r.children[x];if((N.tagName==="P"||N.tagName==="DIV")&&i(N))N.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const p=document.createElement("p");p.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(p,r.nextSibling):r.parentNode.appendChild(p):v.value&&v.value.appendChild(p);const y=document.createRange();y.selectNodeContents(p),y.collapse(!0),l.removeAllRanges(),l.addRange(y),e.nextTick(()=>{On(),k()})},cn=()=>{if(!v.value){Le.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Le.value=!!r}else Le.value=!1}catch{Le.value=!1}},ul=()=>{if(!v.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),Qe.value=ae();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),O.value="",ht.value=a,fe.value="",Ae.value=null,Pt.value=!0,Ut(),e.nextTick(()=>{Dt.value&&Dt.value.focus()})},ml=()=>{if(!v.value)return;he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f();const l=window.getSelection();let n=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&Ae.value&&(n=Ae.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}Ae.value=null}else Xn("unlink");Le.value=!1,Ut(),e.nextTick(()=>{k(),cn()})},Uo=()=>{V.disabled||!V.richText||v.value&&(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{dn(),k(),St()}))},pl=()=>{V.disabled||!V.richText||v.value&&(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),Ut(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{dn(),k(),St()}))},wo=l=>{const n=l.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},dn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=wo(a);r!==null&&Array.from(n.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},Kn=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{dn(),k()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const u=r.tagName.toLowerCase();let d=i.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),i.appendChild(d));const m=wo(i);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),dn();const p=document.createRange();p.selectNodeContents(a),p.collapse(!1),l.removeAllRanges(),l.addRange(p),e.nextTick(()=>{k(),St()})}else document.execCommand("indent",!1),e.nextTick(()=>{dn(),k(),St()})},Vl=()=>{if(V.disabled||!V.richText||!v.value)return;Ut(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const n=l.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{dn(),k()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const u=i.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),dn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{k(),St()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{dn(),k(),St()})},Xt=e.ref(null),Gn=e.ref(null),fo=e.ref({}),Fn=e.ref(""),zn=e.ref(null),Qn=e.ref("");e.ref("");const Pn=e.ref(null);e.ref("");const Jt=e.ref([]),Lo=e.ref(!1),xo=e.ref(!1),Nl=l=>{if(!l)return"";const n=l.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},_o=()=>{if(V.disabled||!V.richText||!v.value)return;if(Xt.value!==null){Xt.value=null,Fn.value="",Qn.value="",Pn.value=null,Jt.value=[],so(!0);return}Ut(),v.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const n=l.getRangeAt(0);if(n.collapsed||!en(n))return;Qn.value=Nl(n)||"",Pn.value=ae();const a=n.getBoundingClientRect(),r=v.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),u=a.bottom-i.top,m=Math.max(u+8,0);fo.value={top:`${m}px`,bottom:"auto"},Xt.value=Date.now(),e.nextTick(()=>{if(Fn.value="",zn.value){const y=zn.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const p=r.querySelector(".dss-comment-overlay");if(p&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const x=r.getBoundingClientRect(),N=p.getBoundingClientRect(),b=y.getBoundingClientRect(),z=N.bottom-x.top,R=b.top-x.top,J=8;if(z>R-J){const j=b.height;fo.value={bottom:`${j+J}px`,top:"auto"}}else fo.value={top:`${m}px`,bottom:"auto"}}}})},vl=()=>{if(!Fn.value.trim())return;const l=Fn.value.trim(),n=new Date,a={text:l,selectionText:Qn.value,selectionRange:Pn.value,commentId:Xt.value,user:V.commentUser||null,createdAt:n.toISOString()};Jt.value=[...Jt.value,a],Ce("comment-submitted",a),Vn(a),Pn.value&&!Jn(Pn.value)&&Yt(Xt.value,Pn.value),Fn.value="",e.nextTick(()=>{if(zn.value){const r=zn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Mn("sendComment")})},Xo=(l,n)=>{if(!(!V.commentUser||!l.user||l.user.id!==V.commentUser.id)){if(Jt.value=Jt.value.filter((a,r)=>r!==n),Xt.value!==null&&v.value){const a=String(Xt.value),r=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Jt.value.length>0){const i=[],u=new Set;Jt.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),i.push(d.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(Jt.value.length))}else r&&Jt.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ce("comment-deleted",{comment:l,index:n,commentId:Xt.value}),V.comments&&Array.isArray(V.comments)){const a=V.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));Ce("update:comments",a)}e.nextTick(()=>{Mn("deleteComment")})}},Jn=l=>{if(!l||!v.value)return!1;try{const n=B(l);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},B=l=>{if(!l||!v.value)return null;try{const n=document.createRange();if(l.type==="element"&&l.element)return v.value.contains(l.element)?(n.setStart(l.element,l.offset),n.collapse(!0),n):null;let a=0;const r=[v.value];let i=null,u=!1,d=!1;for(;!d&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!u&&l.start>=a&&l.start<=m&&(n.setStart(i,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(n.setEnd(i,l.end-a),d=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return u?n:null}catch{return null}},Yt=(l,n)=>{if(!(!l||!n||!v.value))try{const a=B(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,p=a.endContainer,y=a.startOffset,x=a.endOffset,N=m.nodeType===3?m.parentNode:m,b=p.nodeType===3?p.parentNode:p;if(N===b&&y===0&&x===(p.nodeType===3?p.length:b.childNodes.length)&&(N.tagName==="P"||N.tagName==="DIV"||N.tagName==="H1"||N.tagName==="H2"||N.tagName==="H3"||N.tagName==="H4"||N.tagName==="H5"||N.tagName==="H6")){const R=a.extractContents();u.appendChild(R),a.insertNode(u)}else a.surroundContents(u)}catch{const p=a.extractContents();u.appendChild(p),a.insertNode(u)}const d=v.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Mn("wrapSelectionWithCommentMarker"),k()})}catch{}},Vn=l=>{if(!l||!l.commentId)return;const n=Array.isArray(V.comments)?[...V.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=n.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const i={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=n[r];if(u.conversation||(u.conversation=[]),u.conversation.push(i),u.updated_at=l.createdAt,!u.article_id&&n.length>0){const d=n.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=n.length>0&&n.find(p=>p.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[i],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};n.push(m)}Lo.value=!0,Ce("update:comments",n)},gn=(l,n=[])=>{if(V.disabled||!V.richText||!v.value)return;const a=v.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;Ut(),a.focus();const i=document.createRange();i.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(i)),Qn.value=r.innerHTML||"",Pn.value=ae();const d=i.getBoundingClientRect(),m=a.parentElement;if(m){const x=m.getBoundingClientRect(),N=d.bottom-x.top,z=Math.max(N+8,0);fo.value={top:`${z}px`,bottom:"auto"}}const p=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(p&&V.comments&&Array.isArray(V.comments)){const x=V.comments.find(N=>String(N.conversation_id)===String(p));if(x&&x.conversation&&Array.isArray(x.conversation)){const N=x.conversation.map(b=>({id:b.id||b.commentary_id,commentary_id:b.id||b.commentary_id,conversation_id:x.id||x.conversation_id,text:b.text,user:b.user,createdAt:b.created_at||b.createdAt,updated_at:b.updated_at||b.updatedAt}));y.push(...N)}}y.length===0&&Array.isArray(n)&&n.length>0&&(y=n.slice()),y.sort((x,N)=>{const b=J=>{if(!J)return 0;const j=new Date(J).getTime();return isNaN(j)?0:j},z=b(x.createdAt),R=b(N.createdAt);return z===R?0:z-R}),Jt.value=y,so(!0),Xt.value=p||null,r&&(Gn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Fn.value="",zn.value){const x=zn.value;x.style.height="auto",x.style.height=`${x.scrollHeight}px`,x.focus()}if(m){const x=m.querySelector(".dss-comment-overlay");if(x){const N=m.querySelector(".dss-text-editor-footer");if(N){const b=m.getBoundingClientRect(),z=x.getBoundingClientRect(),R=N.getBoundingClientRect(),J=z.bottom-b.top,j=R.top-b.top,ve=8;if(J>j-ve){const Tt=R.height;fo.value={bottom:`${Tt+ve}px`,top:"auto"}}}}}Mn("openCommentOverlayForSelector")})},Nn=e.ref(null),wt=e.ref(0),At=l=>{if(!(V.disabled||!V.richText)){if(l.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&i.contains(d)&&d.nextSibling?i.insertBefore(m,d.nextSibling):i.appendChild(m),setTimeout(()=>{jn()},50);return}}}if(l.key.length===1||l.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const u=i.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(i!==d&&!d?.contains(i)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,p=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(p)&&p!==d){l.preventDefault();const y=document.createRange();y.setStartAfter(u),y.collapse(!0),n.removeAllRanges(),n.addRange(y);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,i=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=d.closest(".dss-image-wrapper"),i&&(r=i.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,i=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const p=i.contains(d)||d===i,y=i.contains(m)||m===i,N=a.cloneContents().textContent?.trim()||"",b=i.textContent?.trim()||"";(!p||!y||N.length>b.length)&&(i=null,r=null)}}if(i){l.preventDefault(),l.stopPropagation();const u=i.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,i),i.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{k()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Vl():Kn();return}if(l.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=p=>{if(!p)return!1;let y=p.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 x=p.parentElement;return x&&x!==v.value?m(x):!1};if(d.nodeType===3){const p=d.parentElement;if(p&&(m(p)||m(d))){const y=p.closest("p, div");if(y&&y!==v.value){l.preventDefault(),l.stopPropagation();let x=null;const N=a.startOffset;N<d.length&&(x=d.splitText(N));const b=document.createElement("p");if(x?b.appendChild(x):b.innerHTML="<br>",d.length===0){const R=d.parentElement;R&&(R.removeChild(d),R.childNodes.length===0&&R.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(b,y.nextSibling):y.parentNode.appendChild(b);const z=document.createRange();x?z.setStart(x,0):z.setStart(b,0),z.collapse(!0),n.removeAllRanges(),n.addRange(z),e.nextTick(()=>{k()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&v.value&&v.value.contains(i))){let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=R=>{if(!R)return!1;const J=R.textContent||"",ve=(R.innerHTML||"").trim(),Tt=ve.replace(/<br\s*\/?>/gi,"").trim();return J.trim()===""||ve===""||Tt===""||ve==="<br>"||ve==="<br/>"||ve==="<p></p>"||ve==="<p><br></p>"||ve==="<p><br/></p>"||ve==="<p> </p>"||ve==="<p><br> </p>"||ve==="<div></div>"||ve==="<div><br></div>"||ve==="<div><br/></div>"},p=i.lastChild,y=p&&p.nodeType===1&&p.tagName==="BR",x=a.startContainer,N=x.nodeType===3?x.parentElement:x,b=N===i||N&&N.parentElement===i;if(d&&m(d)||y&&b){l.preventDefault(),setTimeout(()=>{jn()},50);return}}}}if(l.key===" "){const n=Date.now(),a=n-wt.value;if(Nn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),u=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(u){const d=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),Kn();return}}}}Nn.value=" ",wt.value=n}else Nn.value=l.key}},eo=l=>{if(V.disabled||!V.richText)return;l.preventDefault();let n=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),f();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const u=d=>{const p=new DOMParser().parseFromString(d,"text/html");let y=v.value.querySelector("h1")?1:0;if(p.querySelectorAll("h1").forEach(N=>{if(y>0){const b=p.createElement("p");b.innerHTML=N.innerHTML,N.parentNode.replaceChild(b,N)}else y++}),i){const N=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],b=Array.from(p.body.children).filter(z=>N.includes(z.tagName));if(b.length===1){const z=b[0].tagName,R=i.tagName,J=i.textContent.trim()===""&&!i.querySelector("img");let j=!1;if(["H1","H2","H3","H4","H5","H6"].includes(R)?j=!0:J||(z===R||z==="P")&&(j=!0),j)return b[0].innerHTML.trim()}}return p.body.innerHTML.trim()};if(n){const d=u(n);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);k()},to=l=>{if(be.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ut()}if(Ee.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=v.value&&a.closest(".dss-text-editor-content");!r&&!i&&Vo()}if(yt.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&gl()}const n=l.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Lt.value=null),!v.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);at.value=!r.collapsed&&en(r)}else at.value=!1}if(Xt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,p=l.clientY;r=m>=d.left&&m<=d.right&&p>=d.top&&p<=d.bottom}const i=n.closest(".dss-toolbar-button"),u=i&&i.getAttribute("title")==="Comment";!r&&!u&&(Xt.value=null,Fn.value="",Qn.value="",Pn.value=null,Jt.value=[],so(!0))}},Je=(l,n)=>{l&&l.stopPropagation&&l.stopPropagation(),_t.value&&(clearTimeout(_t.value),_t.value=null),Lt.value=n},et=l=>{const n=l.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}_t.value&&clearTimeout(_t.value),_t.value=setTimeout(()=>{Lt.value=null,_t.value=null},150)},Pe=l=>{Lt.value=null};let un=0;const fl=l=>{if(!l)return;const n=Array.from(l.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const i=Array.from(a.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),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(i||d){const m=`submenu-auto-${++un}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let p=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),p=i):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),p=u),p&&(p.setAttribute("data-submenu-id",m),p.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?p.dataset.originalParentRef="inside":p.dataset.originalParentRef="sibling",Array.from(p.children).forEach(x=>{(x.tagName==="BUTTON"||x.tagName==="DIV")&&!x.classList.contains("dss-toolbar-dropdown-item")&&x.classList.add("dss-toolbar-dropdown-item")}))}})},Yo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{fl(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=p=>{const y=i.getAttribute("data-submenu-id");y&&Je(p,y)},m=et;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const u=i._subMenuHandlers;u&&(i.removeEventListener("mouseenter",u.enter),i.removeEventListener("mouseleave",u.leave));const d=y=>{const x=i.getAttribute("data-submenu-id");x&&Je(y,x)},m=et;i.addEventListener("mouseenter",d),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:d,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",Pe)})})})};let Hn=null;const Eo=()=>{if(Lt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Lt.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Lt.value}"]`);l&&n&&wl(l,n)}if(Ee.value&&St(),V.richText){if(Hn!==null)return;Hn=setTimeout(()=>{Hn=null,Mn("handleWindowResize")},150)}},no=()=>{if(!V.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},jo=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ht.value?rn():bo(),We.value?K():fn()})}),e.nextTick(()=>{jo()}),V.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",to),window.addEventListener("resize",Eo);let l=null;const n=()=>{l===null&&(l=setTimeout(()=>{l=null,Eo()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=l,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const a=v.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,Eo()},150))};a&&(a.addEventListener("scroll",i),v.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Yo(),no()}),v.value.addEventListener("click",m=>{const p=m.target;p.closest("a")&&!V.disabled&&m.preventDefault();const x=p.closest(".dss-image-no-alt-icon"),N=p.closest(".dss-image-wrapper");if(x||N&&p===N){m.preventDefault(),m.stopPropagation();const b=window.getSelection(),z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.removeAllRanges(),b.addRange(z)}else N&&p.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const b=window.getSelection();if(b.rangeCount>0){const R=b.getRangeAt(0).commonAncestorContainer,J=R.nodeType===3?R.parentElement:R;if(N.contains(J)&&J!==N.querySelector("img")){const j=document.createRange();j.setStartAfter(N),j.collapse(!0),b.removeAllRanges(),b.addRange(j)}}else{const z=document.createRange();z.setStartAfter(N),z.collapse(!0),b.addRange(z)}}))},!0),v.value.addEventListener("mousedown",m=>{const p=m.target,y=p.closest(".dss-image-no-alt-icon"),x=p.closest(".dss-image-wrapper");if(y||x&&p.tagName!=="IMG"){m.preventDefault();const N=window.getSelection(),b=document.createRange();x&&(b.setStartAfter(x),b.collapse(!0),N.removeAllRanges(),N.addRange(b))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.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 N=y.getAttribute("alt")||y.alt||"";if(N){const b=y.getAttribute("src")||y.src||"",z=b.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),R=N===b||N===z;(N.startsWith("http://")||N.startsWith("https://")||N.startsWith("data:")||R||R)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),U()})}),v.value.addEventListener("dragstart",m=>{const p=m.target,y=p.tagName==="IMG"?p:p.closest("img"),x=y?.closest(".dss-image-wrapper");y&&v.value.contains(y)&&(ot.value=x||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{ot.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{ot.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!ot.value||!v.value)return;m.preventDefault(),m.stopPropagation();const p=ot.value,y=p.classList?.contains("dss-image-wrapper"),x=y?p.querySelector("img"):p,N=y?p:x?.closest(".dss-image-wrapper");if(!x||!v.value.contains(x)){ot.value=null;return}let b=null;const z=m.clientX,R=m.clientY;if(document.caretRangeFromPoint)b=document.caretRangeFromPoint(z,R);else{const De=window.getSelection();De.rangeCount>0?b=De.getRangeAt(0).cloneRange():(b=document.createRange(),b.selectNodeContents(v.value),b.collapse(!1))}if(!b){ot.value=null;return}const J=b.commonAncestorContainer,j=J.nodeType===3?J.parentElement:J;if(j?.closest(".dss-image-wrapper")===N||N&&N.contains(j)){ot.value=null;return}if(N&&(j===N||N.contains(j))){ot.value=null;return}const Tt=x.getAttribute("src");let xt=null;N?xt=N.cloneNode(!0):xt=x.cloneNode(!0);try{let De=b.startContainer;if(De.nodeType===3&&(De=De.parentElement),N&&(De===N||N.contains(De))){const it=document.createRange();it.setStartAfter(N),it.collapse(!0),b=it}b.insertNode(xt);const vt=document.createRange();vt.setStartAfter(xt),vt.collapse(!0);const ft=window.getSelection();ft.removeAllRanges(),ft.addRange(vt)}catch{if(v.value.childNodes.length===0){const vt=document.createElement("p");vt.appendChild(xt),v.value.appendChild(vt)}else{const vt=v.value.lastChild;if(vt&&vt.nodeType===1)vt.appendChild(xt);else{const ft=document.createElement("p");ft.appendChild(xt),v.value.appendChild(ft)}}}N?N.remove():x.remove(),ot.value=null,e.nextTick(()=>{const De=v.value.querySelectorAll("img");let vt=!1;De.forEach(ft=>{if(ft.getAttribute("src")===Tt)if(!vt)vt=!0;else{const it=ft.closest(".dss-image-wrapper");it?it.remove():ft.remove()}}),U(),k()})}),v.value.addEventListener("dragend",m=>{ot.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(p=>{p.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 x=y.querySelectorAll&&y.querySelectorAll("img");x&&x.forEach(N=>{N.removeAttribute("alt"),N.removeAttribute("data-alt"),N.setAttribute("alt",""),N.setAttribute("data-alt",""),N.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{U(),no(),u=null},100)});if(d.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const p=new MutationObserver(()=>{e.nextTick(()=>{no()})});p.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=p}}),V.modelValue){const m=Wt(V.modelValue);v.value.innerHTML=m,$()}e.nextTick(()=>{const m=v.value.innerHTML||"",p=V.title||"",y=V.description||"";ct.value=m,Gt.value=p,dt.value=y,ze.value=p,Ke.value=y,dn(),U(),mt(),mn(),ol(),el()}),cn(),On(),v.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",to),window.removeEventListener("resize",Eo),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Hn!==null&&(clearTimeout(Hn),Hn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),me.value&&clearTimeout(me.value),_t.value&&clearTimeout(_t.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Nt.value&&Nt.value.disconnect(),Rt.value!==null&&(cancelAnimationFrame(Rt.value),Rt.value=null),vn.value!==null&&(clearTimeout(vn.value),vn.value=null),It.value!==null&&(clearTimeout(It.value),It.value=null),so(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const Sl=l=>{const n=l.target,a=n.closest("a");if(a&&!V.disabled){l.preventDefault();const i=document.createRange();i.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(i)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const d=i.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const p=document.createRange();p.setStartAfter(r),p.collapse(!0),i.removeAllRanges(),i.addRange(p)}}U(),cn(),On(),St(),mn()}):e.nextTick(()=>{U(),cn(),On(),St(),mn()})},Ko=()=>{E();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);at.value=!a.collapsed&&en(a),!a.collapsed&&ut.value&&(ut.value=null)}else at.value=!1;if(U(),cn(),On(),St(),mn(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){l.removeAllRanges(),at.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const u=i.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const p=window.getComputedStyle(d);parseInt(p.fontWeight)>=600&&(m=!0)}catch{}Q.value[a]=m}else{const u=document.queryCommandState(a);Q.value[a]=u}}}catch{}})},mn=()=>{if(!V.richText||V.disabled||!v.value){lt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){lt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!v.value.contains(r)){lt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){lt.value="p";return}const u=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?lt.value=u:lt.value="p"}catch{lt.value="p"}},On=()=>{if(!v.value){kn.value=!1;return}try{const l=window.getSelection();let n=!1;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(i&&v.value.contains(i))}kn.value=n}catch{kn.value=!1}},en=l=>{if(!l||!v.value)return!1;const n=l.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?v.value.contains(a):!1},Vo=()=>{Ee.value=!1},St=()=>{if(!V.floatingToolbar||!V.richText||V.disabled){Ee.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){Ee.value=!1;return}const n=l.getRangeAt(0);if(n.collapsed||!en(n)){Ee.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ee.value=!1;return}const r=v.value;if(!r){Ee.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){Ee.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let p=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let x=0;Ot.value&&(x=Ot.value.getBoundingClientRect().width);const N=(x||320)/2;let b=i.left+N,z=i.right-N;if(z<b){const R=i.left+i.width/2;b=R,z=R}if(y>0){const R=N+d,J=y-N-d;if(b=Math.max(b,R),z=Math.min(z,J),z<b){const j=y/2;b=j,z=j}}p<b?p=b:p>z&&(p=z),_n.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${p}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ee.value=!0},go=l=>{V.disabled||!V.richText||(yt.value=yt.value===l?null:l,l==="askAi"&&(be.value=null))},gl=()=>{yt.value=null,Lt.value=null},oo=l=>{Yn(l),gl()};let mo=null,po=null,lo=null,ho=null;const Ml=l=>{if(V.disabled||!V.richText){Sn(),tt();return}const n=l.target,a=n.closest("a"),r=n.closest("img");if(mo&&(clearTimeout(mo),mo=null),lo&&(clearTimeout(lo),lo=null),a&&a!==po){tt(),po=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),Ae.value=a,re.value=i,I.value=!0,qe.value=!0,Wn(a)}else!a&&po?(po=null,mo=setTimeout(()=>{qe.value||Sn()},150)):a&&a===po&&Wn(a);if(r&&r!==ho){Sn(),ho=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),He.value=r,on.value=i.trim()||D("textEditor.image.noAlt"),Bt.value=!0,Ye.value=!0,hl(r)}else!r&&ho?(ho=null,lo=setTimeout(()=>{Ye.value||tt()},150)):r&&r===ho&&hl(r)},Zn=l=>{const n=l.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(po=null,ho=null,mo&&(clearTimeout(mo),mo=null),lo&&(clearTimeout(lo),lo=null),Sn(),tt())},Sn=()=>{qe.value=!1,setTimeout(()=>{qe.value||(I.value=!1,re.value="",Pt.value||(Ae.value=null))},100)},Wn=l=>{if(!l||!v.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;$e.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},tt=()=>{Ye.value=!1,setTimeout(()=>{Ye.value||(Bt.value=!1,on.value="",pn.value||(He.value=null))},100)},hl=l=>{if(!l||!v.value)return;const n=l.getBoundingClientRect(),i=n.top-32-8,u=n.left+n.width/2;vo.value={position:"fixed",top:`${i}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Mt=()=>{if(!re.value||!Ae.value)return;let n=Ae.value.getAttribute("href")||re.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ft=()=>{if(Ae.value){const l=Ae.value.textContent||"",n=Ae.value.getAttribute("href")||"",a=Ae.value;O.value=n,ht.value=l,fe.value=l,qe.value=!1,I.value=!1,re.value="",Ae.value=a,Pt.value=!0}else if(Le.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const i=r.textContent||"",u=r.getAttribute("href")||"";O.value=u,ht.value=i,fe.value=i,Ae.value=r,Pt.value=!0}}}else{Qe.value=ae();const l=window.getSelection();let n="";l.rangeCount>0&&(n=l.getRangeAt(0).toString()),O.value="",ht.value=n,fe.value="",Ae.value=null,Pt.value=!0}e.nextTick(()=>{Dt.value&&(Dt.value.focus(),Dt.value.select())})},Ao=()=>{Pt.value=!1,O.value="",ht.value="",fe.value="",Ae.value=null,Qe.value=null},Go=()=>{if(!O.value.trim()){Ao();return}if(he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f(),ht.value.trim()||(ht.value=O.value.trim()),Ae.value&&v.value&&v.value.contains(Ae.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const n=Ae.value;if(n.setAttribute("href",O.value.trim()),ht.value.trim()!==fe.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ht.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),l.removeAllRanges(),l.addRange(a),k()}else if(v.value){v.value.focus();const l=window.getSelection();l.removeAllRanges(),Qe.value&&F(Qe.value);let n=null;if(l.rangeCount>0&&(n=l.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=O.value.trim(),a.textContent=ht.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,i=r&&n.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=O.value.trim(),u.textContent=ht.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",i){let d=a.parentElement;for(;d&&d!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==v.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const p=document.createTextNode(" ");m.appendChild(p);const y=document.createRange();y.setStartAfter(u),y.collapse(!0),l.removeAllRanges(),l.addRange(y)}else{if(n.startOffset>0){const y=a.textContent.substring(0,n.startOffset),x=y[y.length-1];if(x&&x!==" "&&x!==" "&&x!==`
|
|
79
79
|
`){const N=document.createTextNode(" ");n.insertNode(N),n.setStartAfter(N)}}n.insertNode(u);const p=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(p),n.setStartAfter(p),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}}}else{if(r&&n.startOffset>0){const m=a.textContent.substring(0,n.startOffset),p=m[m.length-1];if(p&&p!==" "&&p!==" "&&p!==`
|
|
80
|
-
`){const y=document.createTextNode(" ");n.insertNode(y),n.setStartAfter(y)}}n.insertNode(u);const d=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(d),n.setStartAfter(d),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}}k()}e.nextTick(()=>{dn(),_o()})},No=()=>{if(!v.value||Ne.value)return;const l=window.getSelection();let n=null;l&&l.rangeCount>0&&(n=ae());const a=/(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(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],y=p.textContent;a.lastIndex=0;const x=[...y.matchAll(a)];if(x.length===0)continue;const N=x.filter(R=>{const J=R[0],j=R.index;if(j>0&&y[j-1]==="@"||j+J.length<y.length&&y[j+J.length]==="@")return!1;const ve=p.parentElement;return!(ve&&ve.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===y.trim()){const R=N[0][0],J=R.startsWith("http://")||R.startsWith("https://")?R:`https://${R}`,j=document.createElement("a");j.href=J,j.textContent=R,j.style.color="#60afdf",j.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(j,p),d=!0);continue}let b=0;const z=document.createDocumentFragment();if(N.forEach(R=>{const J=R.index,j=R[0];if(J>b){const xt=y.substring(b,J);xt&&z.appendChild(document.createTextNode(xt))}const ve=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Tt=document.createElement("a");Tt.href=ve,Tt.textContent=j,Tt.style.color="#60afdf",Tt.style.textDecoration="underline",z.appendChild(Tt),b=J+j.length}),b<y.length){const R=y.substring(b);R&&z.appendChild(document.createTextNode(R))}p.parentNode&&z.childNodes.length>0&&(p.parentNode.replaceChild(z,p),d=!0)}d&&n&&e.nextTick(()=>{F(n),dn()})},Bl=()=>{if(!v.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let p=0;const y=document.createDocumentFragment();m.forEach(x=>{const N=x.index,b=x[0].startsWith("<u>")?"u":"ins",z=x[1]||x[2]||"";N>p&&y.appendChild(document.createTextNode(d.substring(p,N)));const R=document.createElement(b);R.textContent=z,y.appendChild(R),p=N+x[0].length}),p<d.length&&y.appendChild(document.createTextNode(d.substring(p))),u.parentNode&&y.childNodes.length>0&&u.parentNode.replaceChild(y,u)}},Qo=l=>{if(!v.value||Ne.value)return;if(!l){Bl();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=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(!i||i===v.value||!v.value.contains(i))return;const u=()=>{let xt="",De=0,vt=!1;const ft=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:xe=>xe.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let it=0;for(;ft.nextNode();){const xe=ft.currentNode,$n=xe.textContent||"",nn=it;if(it+=$n.length,xe===r.startContainer){xt+=$n.substring(0,r.startOffset),De=nn+r.startOffset,vt=!0;break}xt+=$n}return vt||(De=xt.length),{textBeforeCursor:xt,cursorCharOffset:De}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,p=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?p="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],x=m[1],N=d.length-y.length,z=(xt=>{let De=0;const vt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:it=>it.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let ft;for(;ft=vt.nextNode();){const it=(ft.textContent||"").length;if(De+it>=xt)return{node:ft,offset:xt-De};De+=it}return null})(N);if(!z)return;const R=document.createRange();R.setStart(z.node,z.offset),R.setEnd(r.endContainer,r.endOffset);const J=document.createElement(p);J.textContent=x,R.deleteContents(),R.insertNode(J);const j=window.getSelection(),ve=document.createRange();ve.setStartAfter(J),ve.collapse(!0),j.removeAllRanges(),j.addRange(ve);const Tt=ae();e.nextTick(()=>{k(),Tt&&F(Tt)})},pt=()=>{v.value&&(bn.value=ae(),Kt.value="",nt.value="",kt.value="",Fe.value="",_e.value="",Bn.value=null,He.value=null,je.value="upload",pn.value=!0,Ut(),e.nextTick(()=>{Ze.value&&Ze.value.focus(),on.value&&(on.value.value="")}))},Ao=l=>{const n=l.target?.files?.[0];if(!n){Bn.value=null,nt.value="";return}Bn.value=n;const a=new FileReader;a.onload=r=>{nt.value=r.target?.result||""},a.readAsDataURL(n)},yl=()=>{on.value&&on.value.click()},Do=()=>{Fe.value&&(_e.value="")},Jo=()=>{_e.value&&(Fe.value="")},kl=()=>{let l=He.value;if(!l){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const n=l.getAttribute("data-alt")||l.getAttribute("alt")||"";He.value=l,Kt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(kt.value=a,nt.value="",je.value="url"):(nt.value=a,kt.value="",je.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";Fe.value=i.endsWith("px")?i.replace("px",""):i,_e.value=u.endsWith("px")?u.replace("px",""):u,bn.value=null}else{pt();return}pn.value=!0,Ye.value=!1,Bt.value=!1,e.nextTick(()=>{je.value==="url"&&Cn.value?(Cn.value.focus(),Cn.value.select()):Ze.value&&(Ze.value.focus(),Ze.value.select()),on.value&&(on.value.value="")})},So=()=>{pn.value=!1,Kt.value="",nt.value="",kt.value="",Fe.value="",_e.value="",Bn.value=null,He.value=null,bn.value=null,je.value="upload"},ao=()=>{const l=(Kt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f();const a=je.value==="url"?kt.value.trim():nt.value;if(He.value&&v.value&&v.value.contains(He.value)){a&&(He.value.src=a),He.value.setAttribute("alt",l),He.value.setAttribute("data-alt",l),Fe.value?(He.value.style.width=`${Fe.value}px`,He.value.setAttribute("width",Fe.value)):(He.value.style.removeProperty("width"),He.value.removeAttribute("width")),_e.value?(He.value.style.height=`${_e.value}px`,He.value.setAttribute("height",_e.value)):(He.value.style.removeProperty("height"),He.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(He.value),i.collapse(!0),r.addRange(i)}k()}else{if(!a){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),So();return}if(v.value){v.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if(bn.value&&(F(bn.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&v.value){if(u=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){So();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!v.value.contains(m)){if(u=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",l),p.setAttribute("data-alt",l),Fe.value&&(p.style.width=`${Fe.value}px`,p.setAttribute("width",Fe.value)),_e.value&&(p.style.height=`${_e.value}px`,p.setAttribute("height",_e.value));try{u.insertNode(p),u.setStartAfter(p),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(v.value){if(v.value.childNodes.length===0){const N=document.createElement("p");v.value.appendChild(N),N.appendChild(p)}else{const N=v.value.lastChild;if(N&&N.nodeType===1)N.appendChild(p);else{const b=document.createElement("p");v.value.appendChild(b),b.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}He.value=p,k()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),dn(),St(),So()})};e.watch(()=>V.modelValue,l=>{if(V.richText&&v.value&&!Ne.value){const n=Wt(l||""),r=v.value.innerHTML.replace(/ |\u00A0/g," "),i=n.replace(/ |\u00A0/g," ");if(r!==i){const u=ae();v.value.innerHTML=n,e.nextTick(()=>{$();const d=v.value.innerHTML||"",m=V.title||"",p=V.description||"";ct.value=d,Gt.value=m,dt.value=p,bt.value=d,ze.value=m,Ke.value=p,Ct.value=[],Et.value=[],me.value&&(clearTimeout(me.value),me.value=null),he.value=!1,u&&F(u),un(),U(),mt(),dn(),St(),mn(),Mn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>V.richText,l=>{l?(St(),e.nextTick(()=>{ol()})):(Vo(),an.value=[],Nt.value&&(Nt.value.disconnect(),Nt.value=null)),mn()}),e.watch(()=>V.floatingToolbar,l=>{l?St():Vo()}),e.watch(()=>V.disabled,l=>{l&&Vo(),mn()}),e.watch(()=>V.description,()=>{e.nextTick(()=>{We.value?K():fn()})}),e.watch(()=>V.title,()=>{e.nextTick(()=>{Ht.value?cn():bo()})}),e.watch(()=>V.customToolbarSlots,()=>{e.nextTick(()=>{no()})},{deep:!0}),e.watch(()=>V.comments,(l,n)=>{if($o.value){$o.value=!1;return}xo.value||V.richText&&v.value&&e.nextTick(()=>{el()})},{deep:!0,immediate:!1});const el=()=>{if(!xo.value&&!(!V.comments||!Array.isArray(V.comments)||V.comments.length===0)&&!(!V.richText||!v.value)){xo.value=!0;try{const l=new Set,n=V.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;n.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const p=String(m);if(u.has(p))return;const y=v.value.querySelector(`[data-comment="${p}"]`);if(y){Ro(y,d),u.add(p);return}try{const x=yo(d.selection_range,d.selection_text);if(x&&!x.collapsed){const N=x.commonAncestorContainer,b=N.nodeType===3?N.parentElement:N;if(b){const J=b.closest("[data-comment], [data-fake-comment]");if(J){const j=J.getAttribute("data-comment")||J.getAttribute("data-fake-comment");if(String(j)===String(m)){J.setAttribute("data-comment",p),J.removeAttribute("data-fake-comment"),Ro(J,d),u.add(p);return}else return}}const z=v.value.querySelector(`[data-comment="${p}"]`);if(z){Ro(z,d),u.add(p);return}const R=document.createElement("span");R.setAttribute("data-comment",p),Ro(R,d);try{x.surroundContents(R),i++,u.add(p)}catch{try{const j=document.createRange();j.setStart(x.startContainer,x.startOffset),j.setEnd(x.endContainer,x.endOffset),Mo(j),j.surroundContents(R),i++,u.add(p)}catch{try{const ve=x.extractContents();R.appendChild(ve),x.insertNode(R),i++,u.add(p)}catch(ve){console.warn("Failed to create comment marker:",ve)}}}}}catch{}}),e.nextTick(()=>{Mn("restoreCommentsFromModel"),k(),xo.value=!1})}catch{xo.value=!1}}},Mo=l=>{if(!l||!v.value)return l;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&n.includes(d.tagName)&&(r===0&&!tl(a)||l.setStartBefore(d))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&n.includes(d.tagName)&&(u===i.length&&!Cl(i)||l.setEndAfter(d))}else i.nodeType===1&&n.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},tl=l=>{let n=l.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},Cl=l=>{let n=l.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},yo=(l,n)=>{if(!l||!v.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=r+u.length;!d&&l.start>=r&&l.start<=p&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=p&&(a.setEnd(u,l.end-r),m=!0),r=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}return d?Mo(a):null}}catch{return null}return null},Ro=(l,n)=>{if(!l||!n)return;const a=n.conversation||[],r=new Set,i=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Mn=(l="unknown")=>{if(!V.richText||!v.value){an.value=[];return}Date.now()-sn.value<io&&Rt.value!==null||Rt.value===null&&(Rt.value=requestAnimationFrame(()=>{if(Rt.value=null,sn.value=Date.now(),wn.value)return;wn.value=!0;const a={},r=v.value;if(!r){wn.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){wn.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");z&&b.tagName==="SPAN"&&(m.has(z)||(d.push(b),m.add(z)))}),u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");!z||m.has(z)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(b.tagName)?b.querySelector(`span[data-comment="${z}"], span[data-fake-comment="${z}"]`)||(d.push(b),m.add(z)):b.tagName!=="SPAN"&&(d.push(b),m.add(z)))});const p=i.getBoundingClientRect(),y=r.getBoundingClientRect();d.forEach((b,z)=>{let R=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");if(!R)return;if(typeof R=="string"&&R.startsWith("comment-")){const qn=b.textContent?.trim(),Ln=V.comments?.find(hn=>(typeof hn.conversation_id=="string"&&hn.conversation_id.startsWith("comment-")?null:hn.conversation_id)&&hn.selection_text?.trim()===qn);Ln?(R=String(Ln.conversation_id),b.setAttribute("data-comment",R),b.removeAttribute("data-fake-comment")):(R=String(Date.now()),b.setAttribute("data-comment",R),b.removeAttribute("data-fake-comment"))}const J=b.getBoundingClientRect(),j=window.getComputedStyle(b),ve=parseFloat(j.lineHeight)||parseFloat(j.fontSize)*1.2,De=J.top-y.top+ve/2-15,ft=y.top-p.top+De;let it=null,xe=null,$n=0;const nn=[],ll=new Set;if(R&&V.comments){const qn=V.comments.find(Ln=>String(Ln.conversation_id||Ln.id)===String(R));if(qn){const Ln=qn.conversation||[];Ln.length>0?(Ln.forEach(hn=>{hn.user&&hn.user.id&&!ll.has(hn.user.id)&&(ll.add(hn.user.id),nn.push(hn.user))}),$n=Ln.length):($n=0,it=null,xe=null),nn.length>0?it=nn[0]:it=null,nn.length>1?xe=nn[1]:xe=null}}const xl=J.top+ve/2-15,Hl=xl+30,Io=5,Bo=Hl>y.top+Io&&xl<y.bottom-Io?1:0;an.value.find(qn=>qn.id===R);let Fo=b;if(!Fo&&R&&v.value){const qn=String(R);Fo=v.value.querySelector(`[data-comment="${qn}"], [data-fake-comment="${qn}"]`)}const El=nn.length;a[R]?(a[R].top=ft,a[R].opacity=Bo,a[R].element=Fo,a[R].firstUser=it,a[R].secondUser=xe,a[R].totalCount=$n,a[R].uniqueUserCount=El):a[R]={id:R,top:ft,opacity:Bo,element:Fo,firstUser:it,secondUser:xe,totalCount:$n,uniqueUserCount:El}});const x=Object.values(a).map(b=>{const z=Math.max(0,(b.uniqueUserCount??0)-2);if(!b.element&&b.id&&v.value){const J=String(b.id);b.element=v.value.querySelector(`[data-comment="${J}"], [data-fake-comment="${J}"]`)}return{...b,firstUser:b.firstUser||null,secondUser:b.secondUser||null,totalCount:b.totalCount,additionalCount:z}});(an.value.length!==x.length||x.some((b,z)=>{const R=an.value[z];if(!R)return!0;const J=(R.firstUser?.id||null)!==(b.firstUser?.id||null),j=(R.secondUser?.id||null)!==(b.secondUser?.id||null);return R.id!==b.id||Math.abs(R.top-b.top)>1||R.opacity!==b.opacity||R.totalCount!==b.totalCount||R.additionalCount!==b.additionalCount||J||j||R.element!==b.element}))&&(an.value=x),wn.value=!1}))},Tl=l=>{if(!l)return;let n=l.element;if(!n&&l.id&&v.value){const a=String(l.id);n=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(so(),Gn.value=n,n.classList.add("editor-comment-highlighted"))},so=(l=!1)=>{!l&&Xt.value!==null&&Gn.value&&(Gn.value.getAttribute("data-comment")||Gn.value.getAttribute("data-fake-comment"))===Xt.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Gn.value&&(Gn.value.classList.remove("editor-comment-highlighted"),Gn.value=null))},nl=l=>{if(!l||!l.element)return;so(!0);const n=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;Ce("comment-marker-clicked",{commentId:n,selector:a,element:l.element})},bl=()=>{so()},ol=()=>{!V.richText||!v.value||(Nt.value&&Nt.value.disconnect(),It.value!==null&&(clearTimeout(It.value),It.value=null),Nt.value=new MutationObserver(()=>{It.value===null&&(It.value=setTimeout(()=>{It.value=null,e.nextTick(()=>{Mn("MutationObserver")})},200))}),Nt.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Mn("setupCommentMarkersObserver-initial"))},wl=(l,n)=>{if(!l||!n)return;const a=n.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const p=a.left-u.width-4;l.style.left=`${p}px`}if(u.bottom>m){const p=Math.max(8,m-u.height-8);l.style.top=`${p}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>Lt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{wl(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[be.value,yt.value],()=>{be.value==="askAi"||yt.value==="askAi"?e.nextTick(()=>{Yo()}):(Lt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>V.locale,l=>{l&&l!==Ie.value&&(Ie.value=l)},{immediate:!0}),jt({openCommentOverlayForSelector:gn,updateCommentMarkers:Mn,restoreCommentsFromModel:el}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",An.value]),style:e.normalizeStyle(xn.value)},[Z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Qi,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Be,title:e.unref(D)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Ji),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:qt,title:e.unref(D)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,ec),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",tc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>qo("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",oc,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",lc,[...n[48]||(n[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",ac,[...n[49]||(n[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",sc,[...n[50]||(n[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",rc,[...n[51]||(n[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",ic,[...n[52]||(n[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",cc,[...n[53]||(n[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[54]||(n[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,nc),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Yn("<h1>"))},[n[55]||(n[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Yn("<h2>"))},[n[56]||(n[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Yn("<h3>"))},[n[57]||(n[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Yn("<h4>"))},[n[58]||(n[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Yn("<h5>"))},[n[59]||(n[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Yn("<h6>"))},[n[60]||(n[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Yn("<p>"))},[n[61]||(n[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:n[9]||(n[9]=a=>Xn("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...n[62]||(n[62]=[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,dc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:n[10]||(n[10]=a=>Xn("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...n[63]||(n[63]=[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,uc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:n[11]||(n[11]=a=>Xn("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...n[64]||(n[64]=[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,mc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kn.value}]),onClick:dl,title:e.unref(D)("textEditor.toolbar.citation")},[...n[65]||(n[65]=[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,pc),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Le.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ml,title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[67]||(n[67]=[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,fc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ul,title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[66]||(n[66]=[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,vc)),n[75]||(n[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:Uo,title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[68]||(n[68]=[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,gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:pl,title:e.unref(D)("textEditor.toolbar.numberList")},[...n[69]||(n[69]=[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,hc),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:pt,title:e.unref(D)("textEditor.toolbar.image")},[...n[70]||(n[70]=[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,yc),at.value?(e.openBlock(),e.createElementBlock("div",kc)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:Lo},[...n[71]||(n[71]=[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,Cc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",bc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",wc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>qo("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[n[72]||(n[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Ec,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,xc),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)?(e.openBlock(),e.createElementBlock("div",Nc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&r<Z.customToolbarSlots.length-1&&$t(r)?(e.openBlock(),e.createElementBlock("div",Sc)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&Z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ut})):e.createCommentVNode("",!0),e.createVNode(Ll,{showModal:Pt.value,width:"500px",height:"55vh",onCloseModal:_o},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Mc,[e.createElementVNode("div",Bc,[e.createElementVNode("label",Tc,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ue,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Go,["enter"])},null,40,Hc),[[e.vModelText,ht.value]])]),e.createElementVNode("div",$c,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Dt,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Go,["enter"])},null,40,_c),[[e.vModelText,O.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:_o},e.toDisplayString(e.unref(D)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Go},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ll,{showModal:pn.value,width:"500px",height:"80vh",onCloseModal:So},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(He.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ac,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":je.value==="upload"}]),onClick:n[17]||(n[17]=a=>je.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),n[77]||(n[77]=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":je.value==="url"}]),onClick:n[18]||(n[18]=a=>je.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),je.value==="upload"?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("div",Ic,[de.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Fc,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:yl},[e.createElementVNode("img",{src:nt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,zc),n[78]||(n[78]=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:on,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Ao},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:on,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Ao},null,544))]),e.createElementVNode("div",Pc,[e.createElementVNode("label",Oc,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ze,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,Zc),[[e.vModelText,Kt.value]])]),e.createElementVNode("div",Wc,[e.createElementVNode("label",qc,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Do},null,40,Uc),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Xc,[e.createElementVNode("label",Yc,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>_e.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Jo},null,40,jc),[[e.vModelText,_e.value]])])])])):e.createCommentVNode("",!0),je.value==="url"?(e.openBlock(),e.createElementBlock("div",Kc,[e.createElementVNode("div",Gc,[e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Cn,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,ed),[[e.vModelText,kt.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,od),[[e.vModelText,Kt.value]])]),e.createElementVNode("div",ld,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Do},null,40,sd),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",rd,[e.createElementVNode("label",id,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>_e.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Jo},null,40,cd),[[e.vModelText,_e.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:So},e.toDisplayString(e.unref(D)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ko.value&&Ht.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",dd,[Ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ud,[Z.title?(e.openBlock(),e.createElementBlock("span",md,e.toDisplayString(Z.title),1)):(e.openBlock(),e.createElementBlock("span",pd,e.toDisplayString(we.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ge,value:Z.title,onInput:st,onFocus:Co,onBlur:uo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ht.value}]),placeholder:we.value,disabled:Z.disabled,rows:"1"},null,42,vd)])],2),ko.value&&Ht.value?(e.openBlock(),e.createElementBlock("div",fd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":co.value&&We.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",gd,[We.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hd,[Z.description?(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(Z.description),1)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(ie.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Xe,value:Z.description,onInput:pe,onFocus:In,onBlur:Me,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!We.value}]),placeholder:ie.value,disabled:Z.disabled,rows:"1"},null,42,Cd)])],2),co.value&&We.value?(e.openBlock(),e.createElementBlock("div",bd,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Xt.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Tl(a),onMouseleave:bl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>nl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ed)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,xd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>nl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Sd)):(e.openBlock(),e.createElementBlock("span",Md,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Nd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>nl(a),["stop"])},[e.createElementVNode("span",Td,"+"+e.toDisplayString(a.additionalCount),1)],12,Bd)):e.createCommentVNode("",!0)],46,wd))),128)),Z.richText?(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":Z.disabled,"dss-text-editor-fixed-height":Z.fixedHeight}]),style:e.normalizeStyle(M.value),onInput:k,onBlur:ye,onClick:Sl,onMouseup:Ko,onKeyup:Ko,onKeydown:At,onPaste:eo,onMousemove:Ml,onMouseleave:Zn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Xt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(fo.value)},[Qn.value||Jt.value.length>0?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",Fd,[Qn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Qn.value},null,8,zd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",Zd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Wd)):(e.openBlock(),e.createElementBlock("span",qd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ud,[e.createElementVNode("div",Xd,[e.createElementVNode("div",Yd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",jd,e.toDisplayString(To(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":En(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),V.commentUser&&a.user&&a.user.id===V.commentUser.id&&!En(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Xo(a,r),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...n[80]||(n[80]=[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,Kd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Gd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:zn,"onUpdate:modelValue":n[26]||(n[26]=a=>Fn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(vl,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(zn.value){const a=zn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Qd),[[e.vModelText,Fn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(vl,["stop"])},[...n[81]||(n[81]=[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",Jd,[e.createElementVNode("div",eu,[e.createElementVNode("span",tu,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",nu,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("textarea",{value:Z.modelValue,onInput:Ho,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":Z.fixedHeight}]),placeholder:Ve.value,rows:Z.rows,disabled:Z.disabled,style:e.normalizeStyle(Dn.value)},null,46,$d),e.createElementVNode("div",Ld,[e.createElementVNode("div",_d,[e.createElementVNode("span",Ad,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Dd,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[I.value&&re.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle($e.value),onMouseenter:n[28]||(n[28]=a=>qe.value=!0),onMouseleave:Sn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Mt,["stop"]),title:re.value},e.toDisplayString(re.value),9,ou),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ft,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",au,[...n[83]||(n[83]=[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,lu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Bt.value&&ln.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(vo.value),onMouseenter:n[29]||(n[29]=a=>Ye.value=!0),onMouseleave:tt},[e.createElementVNode("div",su,[ln.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",ru,[...n[84]||(n[84]=[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:ln.value},e.toDisplayString(ln.value),9,iu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(kl,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",du,[...n[85]||(n[85]=[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,cu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.floatingToolbar&&Z.richText&&Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ot,class:"dss-floating-toolbar",style:e.normalizeStyle(_n.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",uu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Be,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...n[86]||(n[86]=[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,mu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:e.withModifiers(qt,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...n[87]||(n[87]=[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,pu),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",vu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>go("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",gu,[...n[88]||(n[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",hu,[...n[89]||(n[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",yu,[...n[90]||(n[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",ku,[...n[91]||(n[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Cu,[...n[92]||(n[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",bu,[...n[93]||(n[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",wu,[...n[94]||(n[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[95]||(n[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,fu),yt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>oo("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>oo("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>oo("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>oo("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>oo("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>oo("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>oo("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[108]||(n[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>Xn("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...n[96]||(n[96]=[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,xu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>Xn("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...n[97]||(n[97]=[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,Eu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>Xn("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...n[98]||(n[98]=[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,Vu),n[109]||(n[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kn.value}]),onClick:e.withModifiers(dl,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...n[99]||(n[99]=[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,Nu),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Le.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ml,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[101]||(n[101]=[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,Mu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ul,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[100]||(n[100]=[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,Su)),n[111]||(n[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:e.withModifiers(Uo,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[102]||(n[102]=[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,Bu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:e.withModifiers(pl,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...n[103]||(n[103]=[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,Tu),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(pt,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...n[104]||(n[104]=[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,Hu),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(Lo,["stop"])},[...n[105]||(n[105]=[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,$u),Z.askAi?(e.openBlock(),e.createElementBlock("div",Lu)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",_u,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>go("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[n[106]||(n[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Du,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Au),yt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Un.value?(e.openBlock(),e.createElementBlock("div",Ru,[Z.askAi&&Un.value?(e.openBlock(),e.createElementBlock("div",Iu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)&&rn(a)?(e.openBlock(),e.createElementBlock("div",Fu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&rn(a)&&r<Z.customToolbarSlots.length-1&&Zt(r)?(e.openBlock(),e.createElementBlock("div",zu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Zu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Wu=["value"],qu=["placeholder","value","disabled"],Uu=["placeholder","value"],Xu={key:0,class:"dss-datepicker__double-wrap"},Yu={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ju=["onClick"],Ku={class:"dss-datepicker__double-calendars"},Gu={class:"dss-datepicker__double-calendar"},Qu={class:"dss-datepicker__calendar-header"},Ju=["aria-label"],e1={class:"dss-datepicker__month-year-row"},t1=["aria-label"],n1={class:"dss-datepicker__weekdays"},o1={class:"dss-datepicker__grid"},l1=["disabled","onClick","onMouseenter"],a1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},s1={class:"dss-datepicker__double-calendar"},r1={class:"dss-datepicker__calendar-header"},i1=["aria-label"],c1={class:"dss-datepicker__month-year-row"},d1=["aria-label"],u1={class:"dss-datepicker__weekdays"},m1={class:"dss-datepicker__grid"},p1=["disabled","onClick","onMouseenter"],v1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},f1={class:"dss-datepicker__calendar-header"},g1=["aria-label"],h1={class:"dss-datepicker__month-year-row"},y1=["aria-label"],k1={class:"dss-datepicker__weekdays"},C1={class:"dss-datepicker__grid"},b1=["disabled","onClick","onMouseenter"],w1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},x1={class:"dss-datepicker__calendar-header"},E1={class:"dss-datepicker__month-year-row"},V1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},N1={class:"dss-datepicker__months-grid"},S1=["onClick"],M1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},B1={class:"dss-datepicker__month-year"},T1={class:"dss-datepicker__years-grid"},H1=["onClick"],zl=15,$1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:Z=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(Z)},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}},emits:["update:modelValue"],setup(Z,{emit:jt}){const P=Z,D=jt,{t:Ie,locale:V}=al.useI18n(),Ce=e.ref(!1),Ge=e.ref("days"),gt=e.ref(new Date().getMonth()),v=e.ref(new Date().getFullYear()),be=e.ref(new Date().getMonth()),Le=e.ref(new Date().getFullYear()),Ne=e.ref(new Date().getMonth()),I=e.ref(new Date().getFullYear()),re=e.ref("start"),$e=e.ref(null),qe=e.ref(null),Pt=new Date;function O(){const M=Pt.getMonth(),A=Pt.getFullYear(),T=M===11?0:M+1,W=M===11?A+1:A;return{left:{month:M,year:A},right:{month:T,year:W}}}const ht=e.ref(null),Dt=e.ref(null),Ue=e.ref(null),Ae=e.ref(null),Qe=e.ref(null),fe=e.ref(null),kn=new Date().getFullYear(),Q=e.computed(()=>["single","singleFromAvailable"].includes(P.mode)),Ee=e.computed(()=>["range","rangeFromAvailable"].includes(P.mode)),_n=e.computed(()=>{if(P.mode!=="single"&&P.mode!=="singleFromAvailable")return null;const M=P.modelValue;return M instanceof Date?M:null}),Ot=e.computed(()=>{if(!Ee.value)return{start:null,end:null};const M=P.modelValue;return!M||typeof M!="object"?{start:null,end:null}:{start:M.start instanceof Date?M.start:null,end:M.end instanceof Date?M.end:null}});function yt(M){if(!M||!(M instanceof Date))return"";const A=M.getDate(),T=M.getMonth()+1,W=M.getFullYear(),te=de=>String(de).padStart(2,"0");return`${te(A)}/${te(T)}/${W}`}const pn=e.computed(()=>yt(_n.value)),Kt=e.computed(()=>{const{start:M,end:A}=Ot.value;if(!M&&!A)return"";const T=!A||M&&M<=A?M:A,W=!M||A&&A>=M?A:M;return he(T,W)?yt(T):`${yt(T)} - ${yt(W)}`}),Bn=e.computed(()=>{if(P.mode!=="readonly")return"—";const M=P.modelValue;if(M instanceof Date)return yt(M)||"—";if(M&&typeof M=="object"&&("start"in M||"end"in M)){const A=M.start instanceof Date?M.start:null,T=M.end instanceof Date?M.end:null;if(!A&&!T)return"—";const W=!T||A&&A<=T?A:T,te=!A||T&&T>=A?T:A;return he(W,te)?yt(W):`${yt(W)} - ${yt(te)}`}return"—"});e.computed(()=>{const M=new Date(v.value,gt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)});const nt=e.computed(()=>qe.value==="left"?be.value:qe.value==="right"?Ne.value:gt.value),Fe=e.computed(()=>qe.value==="left"?Le.value:qe.value==="right"?I.value:v.value),_e=e.computed(()=>{const M=new Date(v.value,gt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),Ze=e.computed(()=>{const M=new Date(Fe.value,nt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),on=e.computed(()=>{const M=new Intl.DateTimeFormat(V.value,{month:"short"});return Array.from({length:12},(A,T)=>M.format(new Date(2024,T,1)))}),Cn=e.computed(()=>{const A=(qe.value?Fe.value:v.value)-Math.floor(zl/2);return Array.from({length:zl},(T,W)=>A+W)}),He=e.computed(()=>{const M=Cn.value;return M.length?`${M[0]} – ${M[M.length-1]}`:""}),bn=e.computed(()=>{const M=new Intl.DateTimeFormat(V.value,{weekday:"short"}),A=new Date(2024,0,1),T=[];for(let W=0;W<7;W++){const te=new Date(A);te.setDate(A.getDate()+W),T.push(M.format(te).slice(0,2))}return T});function Bt(M,A){const T=new Date(M,A,1),W=new Date(M,A+1,0),te=T.getDay(),de=W.getDate(),we=[];for(let ie=0;ie<te;ie++)we.push(null);for(let ie=1;ie<=de;ie++)we.push(new Date(M,A,ie));return we}const ln=e.computed(()=>Bt(v.value,gt.value)),vo=e.computed(()=>Bt(Le.value,be.value)),Ye=e.computed(()=>Bt(I.value,Ne.value));e.computed(()=>{const M=new Date(Le.value,be.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)}),e.computed(()=>{const M=new Date(I.value,Ne.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)});const je=e.computed(()=>{const M=new Date(Le.value,be.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),kt=e.computed(()=>{const M=new Date(I.value,Ne.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),Lt=e.computed(()=>P.availableDates&&P.availableDates.length>0),_t=e.computed(()=>Lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ct=e.ref({top:0,left:0});function Et(){if(!Ae.value||!Ce.value)return;const M=Ae.value.getBoundingClientRect(),A=window.innerWidth||document.documentElement.clientWidth,T=window.innerHeight||document.documentElement.clientHeight;let W=M.left,te=M.bottom+4;const de=Qe.value;if(de){const we=de.offsetWidth,ie=de.offsetHeight;if(W+we>A-8&&(W=M.right-we,W<8&&(W=8)),te+ie>T-8){const Ve=M.top-4-ie;Ve>=8?te=Ve:te=Math.max(8,T-ie-8)}}Ct.value={top:te,left:W}}const me=e.computed(()=>!Ae.value||!Ce.value?{}:{position:"fixed",left:`${Ct.value.left}px`,top:`${Ct.value.top}px`,zIndex:1002});function he(M,A){return!M||!A?!1:M.getFullYear()===A.getFullYear()&&M.getMonth()===A.getMonth()&&M.getDate()===A.getDate()}function ct(M){return new Date(M.getFullYear(),M.getMonth(),M.getDate()).getTime()}function bt(M){return!P.availableDates||!P.availableDates.length?!0:P.availableDates.some(A=>A instanceof Date&&he(A,M))}function Gt(M){const A=ct(M);return!(P.minDate instanceof Date&&A<ct(P.minDate)||P.maxDate instanceof Date&&A>ct(P.maxDate))}function dt(M){return!P.exceptDates||!P.exceptDates.length?!1:P.exceptDates.some(A=>A instanceof Date&&he(A,M))}function ze(M){return dt(M)?!1:["singleFromAvailable","rangeFromAvailable"].includes(P.mode)?bt(M):Gt(M)}function Ke(M){const A=_n.value,T=Ot.value,W=ct(M),te=Ee.value&&T.start&&T.end&&W>ct(T.start)&&W<ct(T.end),de=Ee.value&&T.start&&he(M,T.start),we=Ee.value&&T.end&&he(M,T.end),ie=de&&we,Ve=Q.value&&A&&he(M,A)||de||we;let Se=!1;if(Ee.value&&T.start&&!T.end&&$e.value){const $t=ct(T.start),Zt=ct($e.value),rn=Math.min($t,Zt),Un=Math.max($t,Zt);Se=W>rn&&W<Un}return{"dss-datepicker__day--selected":Ve&&!ie,"dss-datepicker__day--range-start":de&&!ie,"dss-datepicker__day--range-end":we&&!ie,"dss-datepicker__day--range-single":ie,"dss-datepicker__day--in-range":te&&!de&&!we,"dss-datepicker__day--in-range-preview":Se&&!de&&!we&&!te,"dss-datepicker__day--disabled":!ze(M)}}function ge(M){if(!Ee.value)return;const A=Ot.value;if(!A.start||A.end){$e.value=null;return}if(!ze(M)){$e.value=null;return}$e.value=new Date(M.getFullYear(),M.getMonth(),M.getDate())}function Xe(){$e.value=null}function Vt(){if(!P.doubleCalendar||!Ee.value)return;const M=Ot.value,{start:A,end:T}=M;if(A&&T){const de=A<=T?A:T,we=A<=T?T:A,ie=de.getMonth(),Ve=de.getFullYear(),Se=we.getMonth(),$t=we.getFullYear();if(ie!==Se||Ve!==$t){const Zt=be.value===ie&&Le.value===Ve,rn=Ne.value===Se&&I.value===$t;if(Zt&&rn)return;be.value=ie,Le.value=Ve,Ne.value=Se,I.value=$t}else{const Zt=ie===0?11:ie-1,rn=ie===0?Ve-1:Ve;be.value===Zt&&Le.value===rn&&Ne.value===ie&&I.value===Ve||(be.value=ie,Le.value=Ve,ie===11?(Ne.value=0,I.value=Ve+1):(Ne.value=ie+1,I.value=Ve))}return}const W=A||T;if(W){const de=W.getMonth(),we=W.getFullYear(),ie=be.value===de&&Le.value===we,Ve=Ne.value===de&&I.value===we;if(ie||Ve)return;be.value=de,Le.value=we,de===11?(Ne.value=0,I.value=we+1):(Ne.value=de+1,I.value=we);return}const te=O();be.value=te.left.month,Le.value=te.left.year,Ne.value=te.right.month,I.value=te.right.year}function Te(M="start"){if(P.mode==="readonly")return;re.value=M;const A=_n.value,T=Ot.value;if(Q.value&&A)gt.value=A.getMonth(),v.value=A.getFullYear();else if(Ee.value)if(P.doubleCalendar)Vt();else{const W=M==="start"&&T.start?T.start:T.end||T.start;W&&(gt.value=W.getMonth(),v.value=W.getFullYear())}Ae.value=Q.value?ht.value?.closest(".dss-datepicker__input-wrap"):Dt.value,Ge.value="days",qe.value=null,Ce.value=!0,e.nextTick(()=>{Et()})}function ot(){Ge.value="days",qe.value=null,$e.value=null,Ce.value=!1}function Ht(M,A){qe.value=M,Ge.value=A}function We(){Ge.value="days",qe.value=null}function ut(M){const A=new Date,T=A.getFullYear(),W=A.getMonth(),te=A.getDate();let de,we;if(Lt.value){const ie=[...P.availableDates].filter(Ve=>Ve instanceof Date).map(Ve=>new Date(Ve.getFullYear(),Ve.getMonth(),Ve.getDate()));if(ie.sort((Ve,Se)=>Ve.getTime()-Se.getTime()),ie.length===0)return;if(M==="all")de=ie[0],we=ie[ie.length-1];else{const Ve=parseInt(M.replace("last",""),10);if(Ve<2||Ve>5)return;const Se=ie.slice(-Ve);de=Se[0],we=Se[Se.length-1]}}else{const ie=new Date(T,W,te);switch(M){case"today":de=ie,we=ie;break;case"lastWeek":de=new Date(T,W,te-6),we=ie;break;case"last15Days":de=new Date(T,W,te-14),we=ie;break;case"last30Days":de=new Date(T,W,te-29),we=ie;break;case"thisMonth":de=new Date(T,W,1),we=ie;break;case"last3Months":de=new Date(T,W-3,1),we=new Date(T,W,0);break;case"last6Months":de=new Date(T,W-6,1),we=new Date(T,W,0);break;case"last12Months":de=new Date(T,W-12,1),we=new Date(T,W,0);break;case"lastYear":de=new Date(T-1,0,1),we=new Date(T-1,11,31);break;default:return}}D("update:modelValue",{start:de,end:we}),Vt()}function lt(M){qe.value==="left"?be.value=M:qe.value==="right"?Ne.value=M:gt.value=M,We()}function at(M){qe.value==="left"?Le.value=M:qe.value==="right"?I.value=M:v.value=M,We()}function an(){gt.value===0?(gt.value=11,v.value--):gt.value--}function Nt(){gt.value===11?(gt.value=0,v.value++):gt.value++}function Rt(){be.value===0?(be.value=11,Le.value--):be.value--}function vn(){be.value===11?(be.value=0,Le.value++):be.value++}function wn(){Ne.value===0?(Ne.value=11,I.value--):Ne.value--}function sn(){Ne.value===11?(Ne.value=0,I.value++):Ne.value++}function io(M){if(!ze(M))return;const A=new Date(M.getFullYear(),M.getMonth(),M.getDate());if(Q.value){D("update:modelValue",A),ot();return}const T=Ot.value;if(!T.start&&!T.end){D("update:modelValue",{start:A,end:null}),re.value="end";return}if(T.start&&T.end){D("update:modelValue",{start:A,end:null}),re.value="end";return}if(re.value==="start"){let W=A,te=T.end;W&&te&&W>te&&([W,te]=[te,W]),D("update:modelValue",{start:W||te,end:te||W}),re.value="end"}else{let W=T.start,te=A;W&&te&&te<W&&([W,te]=[te,W]),D("update:modelValue",{start:W||te,end:te||W}),re.value="start"}}e.watch(Ot,()=>{P.doubleCalendar&&Ee.value&&Ce.value&&Vt()},{deep:!0});let It=null,An=null,xn=null;function Dn(){It&&(document.removeEventListener("keydown",It),It=null),An&&(window.removeEventListener("resize",An),An=null),xn&&(window.removeEventListener("scroll",xn,!0),xn=null)}return e.watch(Ce,M=>{Dn(),M&&(It=A=>{A.key==="Escape"&&(Ge.value==="years"||Ge.value==="months"?We():ot())},An=()=>{Et()},xn=()=>{Et()},document.addEventListener("keydown",It),window.addEventListener("resize",An),window.addEventListener("scroll",xn,!0))}),e.onBeforeUnmount(()=>{Dn()}),(M,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":Z.mode==="readonly"}])},[Z.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Zu,[A[9]||(A[9]=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:Bn.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Wu)])):Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:A[0]||(A[0]=T=>Te("start"))},[A[10]||(A[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",{ref_key:"inputSingleRef",ref:ht,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectDate"),value:pn.value,readonly:"",disabled:Z.mode==="readonly"},null,8,qu)])):Ee.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Dt,onClick:A[1]||(A[1]=T=>Te("start"))},[A[11]||(A[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:"inputRangeRef",ref:Ue,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectRange"),value:Kt.value,readonly:""},null,8,Uu)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ot,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Qe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":Z.doubleCalendar&&Ee.value&&Ge.value==="days","dss-datepicker__dropdown--quick-select":Z.doubleCalendar&&Ee.value&&Ge.value==="days"&&Z.quickSelect}]),style:e.normalizeStyle(me.value)},[Ge.value==="days"&&Z.doubleCalendar&&Ee.value?(e.openBlock(),e.createElementBlock("div",Xu,[Z.quickSelect?(e.openBlock(),e.createElementBlock("nav",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:W=>ut(T.id)},e.toDisplayString(e.unref(Ie)(T.labelKey)),9,ju))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ku,[e.createElementVNode("div",Gu,[e.createElementVNode("div",Qu,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:Rt}," ‹ ",8,Ju),e.createElementVNode("div",e1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[2]||(A[2]=T=>Ht("left","months"))},e.toDisplayString(je.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[3]||(A[3]=T=>Ht("left","years"))},e.toDisplayString(Le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:vn}," › ",8,t1)]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",o1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vo.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,l1)):(e.openBlock(),e.createElementBlock("span",a1))],64))),128))])]),e.createElementVNode("div",s1,[e.createElementVNode("div",r1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:wn}," ‹ ",8,i1),e.createElementVNode("div",c1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[4]||(A[4]=T=>Ht("right","months"))},e.toDisplayString(kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[5]||(A[5]=T=>Ht("right","years"))},e.toDisplayString(I.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:sn}," › ",8,d1)]),e.createElementVNode("div",u1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",m1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,p1)):(e.openBlock(),e.createElementBlock("span",v1))],64))),128))])])])])):Ge.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",f1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:an}," ‹ ",8,g1),e.createElementVNode("div",h1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[6]||(A[6]=T=>Ge.value="months")},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[7]||(A[7]=T=>Ge.value="years")},e.toDisplayString(v.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:Nt}," › ",8,y1)]),e.createElementVNode("div",k1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,b1)):(e.openBlock(),e.createElementBlock("span",w1))],64))),128))])],64)):Ge.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",x1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," ‹ "),e.createElementVNode("div",E1,[e.createElementVNode("span",V1,e.toDisplayString(Ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[8]||(A[8]=T=>Ge.value="years")},e.toDisplayString(Fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," › ")]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(T,W)=>(e.openBlock(),e.createElementBlock("button",{key:W,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":W===nt.value}]),onClick:te=>lt(W)},e.toDisplayString(T),11,S1))),128))])],64)):Ge.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",M1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," ‹ "),e.createElementVNode("span",B1,e.toDisplayString(He.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:fe},[e.createElementVNode("div",T1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":T===Fe.value,"dss-datepicker__year-cell--current":T===e.unref(kn)}]),onClick:W=>at(T)},e.toDisplayString(T),11,H1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},L1={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 (optional)"},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"}},_1={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},A1={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"}},D1={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"}},sl={chart:L1,table:_1,datepicker:A1,textEditor:D1},R1={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 (optionnel)"},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"}},I1={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},F1={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"}},z1={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"}},rl={chart:R1,table:I1,datepicker:F1,textEditor:z1},P1={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"}},O1={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},Z1={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"}},W1={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"}},il={chart:P1,table:O1,datepicker:Z1,textEditor:W1},_l={en:sl,fr:rl,nl:il};function q1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(_l).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,_l[P])})}const Al={en:{textEditor:sl.textEditor},fr:{textEditor:rl.textEditor},nl:{textEditor:il.textEditor}};function U1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Al).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Al[P])})}const Dl={en:{table:sl.table},fr:{table:rl.table},nl:{table:il.table}};function X1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Dl).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Dl[P])})}const Rl={en:{datepicker:sl.datepicker},fr:{datepicker:rl.datepicker},nl:{datepicker:il.datepicker}};function Y1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Rl).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Rl[P])})}const j1={en:{...sl},fr:{...rl},nl:{...il}};al.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:j1});exports.DSSChart=_r;exports.DSSChartMessages=_l;exports.DSSDatepicker=$1;exports.DSSDatepickerMessages=Rl;exports.DSSModal=Ll;exports.DSSTable=Gi;exports.DSSTableMessages=Dl;exports.DSSTextEditor=Ou;exports.DSSTextEditorMessages=Al;exports.addDSSChartTranslations=q1;exports.addDSSDatepickerTranslations=Y1;exports.addDSSTableTranslations=X1;exports.addDSSTextEditorTranslations=U1;
|
|
80
|
+
`){const y=document.createTextNode(" ");n.insertNode(y),n.setStartAfter(y)}}n.insertNode(u);const d=document.createTextNode(" ");n.setStartAfter(u),n.insertNode(d),n.setStartAfter(d),n.collapse(!0),l.removeAllRanges(),l.addRange(n)}}k()}e.nextTick(()=>{cn(),Ao()})},No=()=>{if(!v.value||Ne.value)return;const l=window.getSelection();let n=null;l&&l.rangeCount>0&&(n=ae());const a=/(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(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const p=m.parentElement;return!p||p.closest("a")||p.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),i=[];let u;for(;u=r.nextNode();)i.push(u);let d=!1;for(let m=i.length-1;m>=0;m--){const p=i[m],y=p.textContent;a.lastIndex=0;const x=[...y.matchAll(a)];if(x.length===0)continue;const N=x.filter(R=>{const J=R[0],j=R.index;if(j>0&&y[j-1]==="@"||j+J.length<y.length&&y[j+J.length]==="@")return!1;const ve=p.parentElement;return!(ve&&ve.closest("a"))});if(N.length===0)continue;if(N.length===1&&N[0][0]===y.trim()){const R=N[0][0],J=R.startsWith("http://")||R.startsWith("https://")?R:`https://${R}`,j=document.createElement("a");j.href=J,j.textContent=R,j.style.color="#60afdf",j.style.textDecoration="underline",p.parentNode&&(p.parentNode.replaceChild(j,p),d=!0);continue}let b=0;const z=document.createDocumentFragment();if(N.forEach(R=>{const J=R.index,j=R[0];if(J>b){const xt=y.substring(b,J);xt&&z.appendChild(document.createTextNode(xt))}const ve=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Tt=document.createElement("a");Tt.href=ve,Tt.textContent=j,Tt.style.color="#60afdf",Tt.style.textDecoration="underline",z.appendChild(Tt),b=J+j.length}),b<y.length){const R=y.substring(b);R&&z.appendChild(document.createTextNode(R))}p.parentNode&&z.childNodes.length>0&&(p.parentNode.replaceChild(z,p),d=!0)}d&&n&&e.nextTick(()=>{F(n),cn()})},Bl=()=>{if(!v.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const u=i.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const u=a[i],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let p=0;const y=document.createDocumentFragment();m.forEach(x=>{const N=x.index,b=x[0].startsWith("<u>")?"u":"ins",z=x[1]||x[2]||"";N>p&&y.appendChild(document.createTextNode(d.substring(p,N)));const R=document.createElement(b);R.textContent=z,y.appendChild(R),p=N+x[0].length}),p<d.length&&y.appendChild(document.createTextNode(d.substring(p))),u.parentNode&&y.childNodes.length>0&&u.parentNode.replaceChild(y,u)}},Qo=l=>{if(!v.value||Ne.value)return;if(!l){Bl();return}if(!["*","_",">"].includes(l))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const i=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(!i||i===v.value||!v.value.contains(i))return;const u=()=>{let xt="",De=0,vt=!1;const ft=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:xe=>xe.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let it=0;for(;ft.nextNode();){const xe=ft.currentNode,$n=xe.textContent||"",tn=it;if(it+=$n.length,xe===r.startContainer){xt+=$n.substring(0,r.startOffset),De=tn+r.startOffset,vt=!0;break}xt+=$n}return vt||(De=xt.length),{textBeforeCursor:xt,cursorCharOffset:De}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,p=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?p="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?p="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(p=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],x=m[1],N=d.length-y.length,z=(xt=>{let De=0;const vt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:it=>it.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let ft;for(;ft=vt.nextNode();){const it=(ft.textContent||"").length;if(De+it>=xt)return{node:ft,offset:xt-De};De+=it}return null})(N);if(!z)return;const R=document.createRange();R.setStart(z.node,z.offset),R.setEnd(r.endContainer,r.endOffset);const J=document.createElement(p);J.textContent=x,R.deleteContents(),R.insertNode(J);const j=window.getSelection(),ve=document.createRange();ve.setStartAfter(J),ve.collapse(!0),j.removeAllRanges(),j.addRange(ve);const Tt=ae();e.nextTick(()=>{k(),Tt&&F(Tt)})},pt=()=>{v.value&&(bn.value=ae(),Kt.value="",nt.value="",kt.value="",Fe.value="",_e.value="",Bn.value=null,He.value=null,je.value="upload",pn.value=!0,Ut(),e.nextTick(()=>{Ze.value&&Ze.value.focus(),nn.value&&(nn.value.value="")}))},Do=l=>{const n=l.target?.files?.[0];if(!n){Bn.value=null,nt.value="";return}Bn.value=n;const a=new FileReader;a.onload=r=>{nt.value=r.target?.result||""},a.readAsDataURL(n)},yl=()=>{nn.value&&nn.value.click()},Ro=()=>{Fe.value&&(_e.value="")},Jo=()=>{_e.value&&(Fe.value="")},kl=()=>{let l=He.value;if(!l){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const n=l.getAttribute("data-alt")||l.getAttribute("alt")||"";He.value=l,Kt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(kt.value=a,nt.value="",je.value="url"):(nt.value=a,kt.value="",je.value="upload");const i=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";Fe.value=i.endsWith("px")?i.replace("px",""):i,_e.value=u.endsWith("px")?u.replace("px",""):u,bn.value=null}else{pt();return}pn.value=!0,Ye.value=!1,Bt.value=!1,e.nextTick(()=>{je.value==="url"&&Cn.value?(Cn.value.focus(),Cn.value.select()):Ze.value&&(Ze.value.focus(),Ze.value.select()),nn.value&&(nn.value.value="")})},So=()=>{pn.value=!1,Kt.value="",nt.value="",kt.value="",Fe.value="",_e.value="",Bn.value=null,He.value=null,bn.value=null,je.value="upload"},ao=()=>{const l=(Kt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),he.value?(me.value&&(clearTimeout(me.value),me.value=null),f(),he.value=!1):f();const a=je.value==="url"?kt.value.trim():nt.value;if(He.value&&v.value&&v.value.contains(He.value)){a&&(He.value.src=a),He.value.setAttribute("alt",l),He.value.setAttribute("data-alt",l),Fe.value?(He.value.style.width=`${Fe.value}px`,He.value.setAttribute("width",Fe.value)):(He.value.style.removeProperty("width"),He.value.removeAttribute("width")),_e.value?(He.value.style.height=`${_e.value}px`,He.value.setAttribute("height",_e.value)):(He.value.style.removeProperty("height"),He.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(He.value),i.collapse(!0),r.addRange(i)}k()}else{if(!a){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),So();return}if(v.value){v.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let u=null;if(bn.value&&(F(bn.value),i&&i.rangeCount>0&&(u=i.getRangeAt(0))),!u&&i&&i.rangeCount>0&&(u=i.getRangeAt(0)),!u&&v.value){if(u=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}if(!u){So();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!v.value.contains(m)){if(u=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),u.setStart(y,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);i&&(i.removeAllRanges(),i.addRange(u))}const p=document.createElement("img");p.src=a,p.setAttribute("alt",l),p.setAttribute("data-alt",l),Fe.value&&(p.style.width=`${Fe.value}px`,p.setAttribute("width",Fe.value)),_e.value&&(p.style.height=`${_e.value}px`,p.setAttribute("height",_e.value));try{u.insertNode(p),u.setStartAfter(p),u.collapse(!0),i&&(i.removeAllRanges(),i.addRange(u))}catch{if(v.value){if(v.value.childNodes.length===0){const N=document.createElement("p");v.value.appendChild(N),N.appendChild(p)}else{const N=v.value.lastChild;if(N&&N.nodeType===1)N.appendChild(p);else{const b=document.createElement("p");v.value.appendChild(b),b.appendChild(p)}}const x=document.createRange();x.setStartAfter(p),x.collapse(!0),i&&(i.removeAllRanges(),i.addRange(x))}}He.value=p,k()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),cn(),St(),So()})};e.watch(()=>V.modelValue,l=>{if(V.richText&&v.value&&!Ne.value){const n=Wt(l||""),r=v.value.innerHTML.replace(/ |\u00A0/g," "),i=n.replace(/ |\u00A0/g," ");if(r!==i){const u=ae();v.value.innerHTML=n,e.nextTick(()=>{$();const d=v.value.innerHTML||"",m=V.title||"",p=V.description||"";ct.value=d,Gt.value=m,dt.value=p,bt.value=d,ze.value=m,Ke.value=p,Ct.value=[],Et.value=[],me.value&&(clearTimeout(me.value),me.value=null),he.value=!1,u&&F(u),dn(),U(),mt(),cn(),St(),mn(),Mn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>V.richText,l=>{l?(St(),e.nextTick(()=>{ol()})):(Vo(),ln.value=[],Nt.value&&(Nt.value.disconnect(),Nt.value=null)),mn()}),e.watch(()=>V.floatingToolbar,l=>{l?St():Vo()}),e.watch(()=>V.disabled,l=>{l&&Vo(),mn()}),e.watch(()=>V.description,()=>{e.nextTick(()=>{We.value?K():fn()})}),e.watch(()=>V.title,()=>{e.nextTick(()=>{Ht.value?rn():bo()})}),e.watch(()=>V.customToolbarSlots,()=>{e.nextTick(()=>{no()})},{deep:!0}),e.watch(()=>V.comments,(l,n)=>{if(Lo.value){Lo.value=!1;return}xo.value||V.richText&&v.value&&e.nextTick(()=>{el()})},{deep:!0,immediate:!1});const el=()=>{if(!xo.value&&!(!V.comments||!Array.isArray(V.comments)||V.comments.length===0)&&!(!V.richText||!v.value)){xo.value=!0;try{const l=new Set,n=V.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let i=0;const u=new Set;n.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const p=String(m);if(u.has(p))return;const y=v.value.querySelector(`[data-comment="${p}"]`);if(y){Io(y,d),u.add(p);return}try{const x=yo(d.selection_range,d.selection_text);if(x&&!x.collapsed){const N=x.commonAncestorContainer,b=N.nodeType===3?N.parentElement:N;if(b){const J=b.closest("[data-comment], [data-fake-comment]");if(J){const j=J.getAttribute("data-comment")||J.getAttribute("data-fake-comment");if(String(j)===String(m)){J.setAttribute("data-comment",p),J.removeAttribute("data-fake-comment"),Io(J,d),u.add(p);return}else return}}const z=v.value.querySelector(`[data-comment="${p}"]`);if(z){Io(z,d),u.add(p);return}const R=document.createElement("span");R.setAttribute("data-comment",p),Io(R,d);try{x.surroundContents(R),i++,u.add(p)}catch{try{const j=document.createRange();j.setStart(x.startContainer,x.startOffset),j.setEnd(x.endContainer,x.endOffset),Mo(j),j.surroundContents(R),i++,u.add(p)}catch{try{const ve=x.extractContents();R.appendChild(ve),x.insertNode(R),i++,u.add(p)}catch(ve){console.warn("Failed to create comment marker:",ve)}}}}}catch{}}),e.nextTick(()=>{Mn("restoreCommentsFromModel"),k(),xo.value=!1})}catch{xo.value=!1}}},Mo=l=>{if(!l||!v.value)return l;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&n.includes(d.tagName)&&(r===0&&!tl(a)||l.setStartBefore(d))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&l.setStartBefore(a);let i=l.endContainer,u=l.endOffset;if(i.nodeType===3){const d=i.parentElement;d&&n.includes(d.tagName)&&(u===i.length&&!Cl(i)||l.setEndAfter(d))}else i.nodeType===1&&n.includes(i.tagName)&&u<i.childNodes.length&&l.setEndAfter(i);return l}catch{return l}},tl=l=>{let n=l.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},Cl=l=>{let n=l.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},yo=(l,n)=>{if(!l||!v.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const i=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=i.pop());)if(u.nodeType===3){const p=r+u.length;!d&&l.start>=r&&l.start<=p&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=p&&(a.setEnd(u,l.end-r),m=!0),r=p}else{let p=u.childNodes.length;for(;p--;)i.push(u.childNodes[p])}return d?Mo(a):null}}catch{return null}return null},Io=(l,n)=>{if(!l||!n)return;const a=n.conversation||[],r=new Set,i=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),i.length>0?l.setAttribute("data-comment-user",JSON.stringify(i[0])):l.removeAttribute("data-comment-user"),i.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(i[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Mn=(l="unknown")=>{if(!V.richText||!v.value){ln.value=[];return}Date.now()-an.value<io&&Rt.value!==null||Rt.value===null&&(Rt.value=requestAnimationFrame(()=>{if(Rt.value=null,an.value=Date.now(),wn.value)return;wn.value=!0;const a={},r=v.value;if(!r){wn.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){wn.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");z&&b.tagName==="SPAN"&&(m.has(z)||(d.push(b),m.add(z)))}),u.forEach(b=>{const z=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");!z||m.has(z)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(b.tagName)?b.querySelector(`span[data-comment="${z}"], span[data-fake-comment="${z}"]`)||(d.push(b),m.add(z)):b.tagName!=="SPAN"&&(d.push(b),m.add(z)))});const p=i.getBoundingClientRect(),y=r.getBoundingClientRect();d.forEach((b,z)=>{let R=b.getAttribute("data-comment")||b.getAttribute("data-fake-comment");if(!R)return;if(typeof R=="string"&&R.startsWith("comment-")){const qn=b.textContent?.trim(),Ln=V.comments?.find(hn=>(typeof hn.conversation_id=="string"&&hn.conversation_id.startsWith("comment-")?null:hn.conversation_id)&&hn.selection_text?.trim()===qn);Ln?(R=String(Ln.conversation_id),b.setAttribute("data-comment",R),b.removeAttribute("data-fake-comment")):(R=String(Date.now()),b.setAttribute("data-comment",R),b.removeAttribute("data-fake-comment"))}const J=b.getBoundingClientRect(),j=window.getComputedStyle(b),ve=parseFloat(j.lineHeight)||parseFloat(j.fontSize)*1.2,De=J.top-y.top+ve/2-15,ft=y.top-p.top+De;let it=null,xe=null,$n=0;const tn=[],ll=new Set;if(R&&V.comments){const qn=V.comments.find(Ln=>String(Ln.conversation_id||Ln.id)===String(R));if(qn){const Ln=qn.conversation||[];Ln.length>0?(Ln.forEach(hn=>{hn.user&&hn.user.id&&!ll.has(hn.user.id)&&(ll.add(hn.user.id),tn.push(hn.user))}),$n=Ln.length):($n=0,it=null,xe=null),tn.length>0?it=tn[0]:it=null,tn.length>1?xe=tn[1]:xe=null}}const xl=J.top+ve/2-15,Hl=xl+30,Fo=5,Bo=Hl>y.top+Fo&&xl<y.bottom-Fo?1:0;ln.value.find(qn=>qn.id===R);let zo=b;if(!zo&&R&&v.value){const qn=String(R);zo=v.value.querySelector(`[data-comment="${qn}"], [data-fake-comment="${qn}"]`)}const El=tn.length;a[R]?(a[R].top=ft,a[R].opacity=Bo,a[R].element=zo,a[R].firstUser=it,a[R].secondUser=xe,a[R].totalCount=$n,a[R].uniqueUserCount=El):a[R]={id:R,top:ft,opacity:Bo,element:zo,firstUser:it,secondUser:xe,totalCount:$n,uniqueUserCount:El}});const x=Object.values(a).map(b=>{const z=Math.max(0,(b.uniqueUserCount??0)-2);if(!b.element&&b.id&&v.value){const J=String(b.id);b.element=v.value.querySelector(`[data-comment="${J}"], [data-fake-comment="${J}"]`)}return{...b,firstUser:b.firstUser||null,secondUser:b.secondUser||null,totalCount:b.totalCount,additionalCount:z}});(ln.value.length!==x.length||x.some((b,z)=>{const R=ln.value[z];if(!R)return!0;const J=(R.firstUser?.id||null)!==(b.firstUser?.id||null),j=(R.secondUser?.id||null)!==(b.secondUser?.id||null);return R.id!==b.id||Math.abs(R.top-b.top)>1||R.opacity!==b.opacity||R.totalCount!==b.totalCount||R.additionalCount!==b.additionalCount||J||j||R.element!==b.element}))&&(ln.value=x),wn.value=!1}))},Tl=l=>{if(!l)return;let n=l.element;if(!n&&l.id&&v.value){const a=String(l.id);n=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(so(),Gn.value=n,n.classList.add("editor-comment-highlighted"))},so=(l=!1)=>{!l&&Xt.value!==null&&Gn.value&&(Gn.value.getAttribute("data-comment")||Gn.value.getAttribute("data-fake-comment"))===Xt.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Gn.value&&(Gn.value.classList.remove("editor-comment-highlighted"),Gn.value=null))},nl=l=>{if(!l||!l.element)return;so(!0);const n=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;Ce("comment-marker-clicked",{commentId:n,selector:a,element:l.element})},bl=()=>{so()},ol=()=>{!V.richText||!v.value||(Nt.value&&Nt.value.disconnect(),It.value!==null&&(clearTimeout(It.value),It.value=null),Nt.value=new MutationObserver(()=>{It.value===null&&(It.value=setTimeout(()=>{It.value=null,e.nextTick(()=>{Mn("MutationObserver")})},200))}),Nt.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Mn("setupCommentMarkersObserver-initial"))},wl=(l,n)=>{if(!l||!n)return;const a=n.getBoundingClientRect();let r=a.top,i=a.right+4;l.style.top=`${r}px`,l.style.left=`${i}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const p=a.left-u.width-4;l.style.left=`${p}px`}if(u.bottom>m){const p=Math.max(8,m-u.height-8);l.style.top=`${p}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>Lt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{wl(a,i),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[be.value,yt.value],()=>{be.value==="askAi"||yt.value==="askAi"?e.nextTick(()=>{Yo()}):(Lt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>V.locale,l=>{l&&l!==Ie.value&&(Ie.value=l)},{immediate:!0}),jt({openCommentOverlayForSelector:gn,updateCommentMarkers:Mn,restoreCommentsFromModel:el}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",An.value]),style:e.normalizeStyle(xn.value)},[Z.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Qi,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Be,title:e.unref(D)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Ji),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:qt,title:e.unref(D)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,ec),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",tc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>qo("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",oc,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",lc,[...n[48]||(n[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",ac,[...n[49]||(n[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",sc,[...n[50]||(n[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",rc,[...n[51]||(n[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",ic,[...n[52]||(n[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",cc,[...n[53]||(n[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[54]||(n[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,nc),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Yn("<h1>"))},[n[55]||(n[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Yn("<h2>"))},[n[56]||(n[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Yn("<h3>"))},[n[57]||(n[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Yn("<h4>"))},[n[58]||(n[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Yn("<h5>"))},[n[59]||(n[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Yn("<h6>"))},[n[60]||(n[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Yn("<p>"))},[n[61]||(n[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:n[9]||(n[9]=a=>Xn("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...n[62]||(n[62]=[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,dc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:n[10]||(n[10]=a=>Xn("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...n[63]||(n[63]=[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,uc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:n[11]||(n[11]=a=>Xn("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...n[64]||(n[64]=[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,mc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kn.value}]),onClick:dl,title:e.unref(D)("textEditor.toolbar.citation")},[...n[65]||(n[65]=[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,pc),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Le.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ml,title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[67]||(n[67]=[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,fc)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ul,title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[66]||(n[66]=[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,vc)),n[75]||(n[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:Uo,title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[68]||(n[68]=[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,gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:pl,title:e.unref(D)("textEditor.toolbar.numberList")},[...n[69]||(n[69]=[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,hc),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:pt,title:e.unref(D)("textEditor.toolbar.image")},[...n[70]||(n[70]=[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,yc),at.value?(e.openBlock(),e.createElementBlock("div",kc)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:_o},[...n[71]||(n[71]=[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,Cc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",bc)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",wc,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>qo("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[n[72]||(n[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Ec,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,xc),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)?(e.openBlock(),e.createElementBlock("div",Nc,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&r<Z.customToolbarSlots.length-1&&$t(r)?(e.openBlock(),e.createElementBlock("div",Sc)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&Z.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ut})):e.createCommentVNode("",!0),e.createVNode(Ll,{showModal:Pt.value,width:"500px",height:"55vh",onCloseModal:Ao},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Mc,[e.createElementVNode("div",Bc,[e.createElementVNode("label",Tc,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ue,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Go,["enter"])},null,40,Hc),[[e.vModelText,ht.value]])]),e.createElementVNode("div",$c,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Dt,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Go,["enter"])},null,40,_c),[[e.vModelText,O.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Ao},e.toDisplayString(e.unref(D)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Go},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ll,{showModal:pn.value,width:"500px",height:"80vh",onCloseModal:So},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(He.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ac,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":je.value==="upload"}]),onClick:n[17]||(n[17]=a=>je.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),n[77]||(n[77]=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":je.value==="url"}]),onClick:n[18]||(n[18]=a=>je.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),je.value==="upload"?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("div",Ic,[de.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Fc,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:yl},[e.createElementVNode("img",{src:nt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,zc),n[78]||(n[78]=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:nn,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Do},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:nn,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Do},null,544))]),e.createElementVNode("div",Pc,[e.createElementVNode("label",Oc,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ze,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,Zc),[[e.vModelText,Kt.value]])]),e.createElementVNode("div",Wc,[e.createElementVNode("label",qc,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Ro},null,40,Uc),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Xc,[e.createElementVNode("label",Yc,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>_e.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Jo},null,40,jc),[[e.vModelText,_e.value]])])])])):e.createCommentVNode("",!0),je.value==="url"?(e.openBlock(),e.createElementBlock("div",Kc,[e.createElementVNode("div",Gc,[e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Cn,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,ed),[[e.vModelText,kt.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,od),[[e.vModelText,Kt.value]])]),e.createElementVNode("div",ld,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>Fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Ro},null,40,sd),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",rd,[e.createElementVNode("label",id,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>_e.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ao,["enter"]),onInput:Jo},null,40,cd),[[e.vModelText,_e.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:So},e.toDisplayString(e.unref(D)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ko.value&&Ht.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",dd,[Ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ud,[Z.title?(e.openBlock(),e.createElementBlock("span",md,e.toDisplayString(Z.title),1)):(e.openBlock(),e.createElementBlock("span",pd,e.toDisplayString(we.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ge,value:Z.title,onInput:st,onFocus:Co,onBlur:uo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ht.value}]),placeholder:we.value,disabled:Z.disabled,rows:"1"},null,42,vd)])],2),ko.value&&Ht.value?(e.openBlock(),e.createElementBlock("div",fd,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":co.value&&We.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",gd,[We.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hd,[Z.description?(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(Z.description),1)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(ie.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Xe,value:Z.description,onInput:pe,onFocus:In,onBlur:Me,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!We.value}]),placeholder:ie.value,disabled:Z.disabled,rows:"1"},null,42,Cd)])],2),co.value&&We.value?(e.openBlock(),e.createElementBlock("div",bd,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ln.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Xt.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>Tl(a),onMouseleave:bl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>nl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ed)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,xd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>nl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Sd)):(e.openBlock(),e.createElementBlock("span",Md,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Nd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>nl(a),["stop"])},[e.createElementVNode("span",Td,"+"+e.toDisplayString(a.additionalCount),1)],12,Bd)):e.createCommentVNode("",!0)],46,wd))),128)),Z.richText?(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":Z.disabled,"dss-text-editor-fixed-height":Z.fixedHeight}]),style:e.normalizeStyle(M.value),onInput:k,onBlur:ye,onClick:Sl,onMouseup:Ko,onKeyup:Ko,onKeydown:At,onPaste:eo,onMousemove:Ml,onMouseleave:Zn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Xt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(fo.value)},[Qn.value||Jt.value.length>0?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",Fd,[Qn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Qn.value},null,8,zd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",Zd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Wd)):(e.openBlock(),e.createElementBlock("span",qd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ud,[e.createElementVNode("div",Xd,[e.createElementVNode("div",Yd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",jd,e.toDisplayString(Ho(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":En(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),V.commentUser&&a.user&&a.user.id===V.commentUser.id&&!En(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>Xo(a,r),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...n[80]||(n[80]=[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,Kd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Gd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:zn,"onUpdate:modelValue":n[26]||(n[26]=a=>Fn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(vl,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(zn.value){const a=zn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Qd),[[e.vModelText,Fn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(vl,["stop"])},[...n[81]||(n[81]=[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",Jd,[e.createElementVNode("div",eu,[e.createElementVNode("span",tu,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",nu,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("textarea",{value:Z.modelValue,onInput:$o,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":Z.fixedHeight}]),placeholder:Ve.value,rows:Z.rows,disabled:Z.disabled,style:e.normalizeStyle(Dn.value)},null,46,$d),e.createElementVNode("div",Ld,[e.createElementVNode("div",_d,[e.createElementVNode("span",Ad,e.toDisplayString(W.value)+" "+e.toDisplayString(W.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Dd,e.toDisplayString(te.value)+" "+e.toDisplayString(te.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[I.value&&re.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle($e.value),onMouseenter:n[28]||(n[28]=a=>qe.value=!0),onMouseleave:Sn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Mt,["stop"]),title:re.value},e.toDisplayString(re.value),9,ou),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ft,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",au,[...n[83]||(n[83]=[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,lu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Bt.value&&on.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(vo.value),onMouseenter:n[29]||(n[29]=a=>Ye.value=!0),onMouseleave:tt},[e.createElementVNode("div",su,[on.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",ru,[...n[84]||(n[84]=[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:on.value},e.toDisplayString(on.value),9,iu)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(kl,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",du,[...n[85]||(n[85]=[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,cu)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Z.floatingToolbar&&Z.richText&&Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ot,class:"dss-floating-toolbar",style:e.normalizeStyle(_n.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",uu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Be,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...n[86]||(n[86]=[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,mu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:e.withModifiers(qt,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...n[87]||(n[87]=[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,pu),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",vu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>go("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[lt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",gu,[...n[88]||(n[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):lt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",hu,[...n[89]||(n[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):lt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",yu,[...n[90]||(n[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):lt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",ku,[...n[91]||(n[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):lt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Cu,[...n[92]||(n[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):lt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",bu,[...n[93]||(n[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",wu,[...n[94]||(n[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[95]||(n[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,fu),yt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>oo("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>oo("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>oo("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>oo("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>oo("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>oo("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>oo("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[108]||(n[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>Xn("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...n[96]||(n[96]=[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,xu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>Xn("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...n[97]||(n[97]=[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,Eu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>Xn("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...n[98]||(n[98]=[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,Vu),n[109]||(n[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kn.value}]),onClick:e.withModifiers(dl,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...n[99]||(n[99]=[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,Nu),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Le.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ml,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[101]||(n[101]=[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,Mu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ul,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[100]||(n[100]=[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,Su)),n[111]||(n[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:e.withModifiers(Uo,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[102]||(n[102]=[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,Bu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:e.withModifiers(pl,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...n[103]||(n[103]=[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,Tu),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(pt,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...n[104]||(n[104]=[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,Hu),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(_o,["stop"])},[...n[105]||(n[105]=[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,$u),Z.askAi?(e.openBlock(),e.createElementBlock("div",Lu)):e.createCommentVNode("",!0),Z.askAi?(e.openBlock(),e.createElementBlock("div",_u,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>go("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[n[106]||(n[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",Du,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Au),yt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Un.value?(e.openBlock(),e.createElementBlock("div",Ru,[Z.askAi&&Un.value?(e.openBlock(),e.createElementBlock("div",Iu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Se(a)&&sn(a)?(e.openBlock(),e.createElementBlock("div",Fu,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),Se(a)&&sn(a)&&r<Z.customToolbarSlots.length-1&&Zt(r)?(e.openBlock(),e.createElementBlock("div",zu)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Zu={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Wu=["value"],qu=["placeholder","value","disabled"],Uu=["placeholder","value"],Xu={key:0,class:"dss-datepicker__double-wrap"},Yu={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ju=["onClick"],Ku={class:"dss-datepicker__double-calendars"},Gu={class:"dss-datepicker__double-calendar"},Qu={class:"dss-datepicker__calendar-header"},Ju=["aria-label"],e1={class:"dss-datepicker__month-year-row"},t1=["aria-label"],n1={class:"dss-datepicker__weekdays"},o1={class:"dss-datepicker__grid"},l1=["disabled","onClick","onMouseenter"],a1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},s1={class:"dss-datepicker__double-calendar"},r1={class:"dss-datepicker__calendar-header"},i1=["aria-label"],c1={class:"dss-datepicker__month-year-row"},d1=["aria-label"],u1={class:"dss-datepicker__weekdays"},m1={class:"dss-datepicker__grid"},p1=["disabled","onClick","onMouseenter"],v1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},f1={class:"dss-datepicker__calendar-header"},g1=["aria-label"],h1={class:"dss-datepicker__month-year-row"},y1=["aria-label"],k1={class:"dss-datepicker__weekdays"},C1={class:"dss-datepicker__grid"},b1=["disabled","onClick","onMouseenter"],w1={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},x1={class:"dss-datepicker__calendar-header"},E1={class:"dss-datepicker__month-year-row"},V1={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},N1={class:"dss-datepicker__months-grid"},S1=["onClick"],M1={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},B1={class:"dss-datepicker__month-year"},T1={class:"dss-datepicker__years-grid"},H1=["onClick"],zl=15,$1={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:Z=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(Z)},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}},emits:["update:modelValue"],setup(Z,{emit:jt}){const P=Z,D=jt,{t:Ie,locale:V}=al.useI18n(),Ce=e.ref(!1),Ge=e.ref("days"),gt=e.ref(new Date().getMonth()),v=e.ref(new Date().getFullYear()),be=e.ref(new Date().getMonth()),Le=e.ref(new Date().getFullYear()),Ne=e.ref(new Date().getMonth()),I=e.ref(new Date().getFullYear()),re=e.ref("start"),$e=e.ref(null),qe=e.ref(null),Pt=new Date;function O(){const M=Pt.getMonth(),A=Pt.getFullYear(),T=M===11?0:M+1,W=M===11?A+1:A;return{left:{month:M,year:A},right:{month:T,year:W}}}const ht=e.ref(null),Dt=e.ref(null),Ue=e.ref(null),Ae=e.ref(null),Qe=e.ref(null),fe=e.ref(null),kn=new Date().getFullYear(),Q=e.computed(()=>["single","singleFromAvailable"].includes(P.mode)),Ee=e.computed(()=>["range","rangeFromAvailable"].includes(P.mode)),_n=e.computed(()=>{if(P.mode!=="single"&&P.mode!=="singleFromAvailable")return null;const M=P.modelValue;return M instanceof Date?M:null}),Ot=e.computed(()=>{if(!Ee.value)return{start:null,end:null};const M=P.modelValue;return!M||typeof M!="object"?{start:null,end:null}:{start:M.start instanceof Date?M.start:null,end:M.end instanceof Date?M.end:null}});function yt(M){if(!M||!(M instanceof Date))return"";const A=M.getDate(),T=M.getMonth()+1,W=M.getFullYear(),te=de=>String(de).padStart(2,"0");return`${te(A)}/${te(T)}/${W}`}const pn=e.computed(()=>yt(_n.value)),Kt=e.computed(()=>{const{start:M,end:A}=Ot.value;if(!M&&!A)return"";const T=!A||M&&M<=A?M:A,W=!M||A&&A>=M?A:M;return he(T,W)?yt(T):`${yt(T)} - ${yt(W)}`}),Bn=e.computed(()=>{if(P.mode!=="readonly")return"—";const M=P.modelValue;if(M instanceof Date)return yt(M)||"—";if(M&&typeof M=="object"&&("start"in M||"end"in M)){const A=M.start instanceof Date?M.start:null,T=M.end instanceof Date?M.end:null;if(!A&&!T)return"—";const W=!T||A&&A<=T?A:T,te=!A||T&&T>=A?T:A;return he(W,te)?yt(W):`${yt(W)} - ${yt(te)}`}return"—"});e.computed(()=>{const M=new Date(v.value,gt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)});const nt=e.computed(()=>qe.value==="left"?be.value:qe.value==="right"?Ne.value:gt.value),Fe=e.computed(()=>qe.value==="left"?Le.value:qe.value==="right"?I.value:v.value),_e=e.computed(()=>{const M=new Date(v.value,gt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),Ze=e.computed(()=>{const M=new Date(Fe.value,nt.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),nn=e.computed(()=>{const M=new Intl.DateTimeFormat(V.value,{month:"short"});return Array.from({length:12},(A,T)=>M.format(new Date(2024,T,1)))}),Cn=e.computed(()=>{const A=(qe.value?Fe.value:v.value)-Math.floor(zl/2);return Array.from({length:zl},(T,W)=>A+W)}),He=e.computed(()=>{const M=Cn.value;return M.length?`${M[0]} – ${M[M.length-1]}`:""}),bn=e.computed(()=>{const M=new Intl.DateTimeFormat(V.value,{weekday:"short"}),A=new Date(2024,0,1),T=[];for(let W=0;W<7;W++){const te=new Date(A);te.setDate(A.getDate()+W),T.push(M.format(te).slice(0,2))}return T});function Bt(M,A){const T=new Date(M,A,1),W=new Date(M,A+1,0),te=T.getDay(),de=W.getDate(),we=[];for(let ie=0;ie<te;ie++)we.push(null);for(let ie=1;ie<=de;ie++)we.push(new Date(M,A,ie));return we}const on=e.computed(()=>Bt(v.value,gt.value)),vo=e.computed(()=>Bt(Le.value,be.value)),Ye=e.computed(()=>Bt(I.value,Ne.value));e.computed(()=>{const M=new Date(Le.value,be.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)}),e.computed(()=>{const M=new Date(I.value,Ne.value,1);return new Intl.DateTimeFormat(V.value,{month:"long",year:"numeric"}).format(M)});const je=e.computed(()=>{const M=new Date(Le.value,be.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),kt=e.computed(()=>{const M=new Date(I.value,Ne.value,1);return new Intl.DateTimeFormat(V.value,{month:"long"}).format(M)}),Lt=e.computed(()=>P.availableDates&&P.availableDates.length>0),_t=e.computed(()=>Lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ct=e.ref({top:0,left:0});function Et(){if(!Ae.value||!Ce.value)return;const M=Ae.value.getBoundingClientRect(),A=window.innerWidth||document.documentElement.clientWidth,T=window.innerHeight||document.documentElement.clientHeight;let W=M.left,te=M.bottom+4;const de=Qe.value;if(de){const we=de.offsetWidth,ie=de.offsetHeight;if(W+we>A-8&&(W=M.right-we,W<8&&(W=8)),te+ie>T-8){const Ve=M.top-4-ie;Ve>=8?te=Ve:te=Math.max(8,T-ie-8)}}Ct.value={top:te,left:W}}const me=e.computed(()=>!Ae.value||!Ce.value?{}:{position:"fixed",left:`${Ct.value.left}px`,top:`${Ct.value.top}px`,zIndex:1002});function he(M,A){return!M||!A?!1:M.getFullYear()===A.getFullYear()&&M.getMonth()===A.getMonth()&&M.getDate()===A.getDate()}function ct(M){return new Date(M.getFullYear(),M.getMonth(),M.getDate()).getTime()}function bt(M){return!P.availableDates||!P.availableDates.length?!0:P.availableDates.some(A=>A instanceof Date&&he(A,M))}function Gt(M){const A=ct(M);return!(P.minDate instanceof Date&&A<ct(P.minDate)||P.maxDate instanceof Date&&A>ct(P.maxDate))}function dt(M){return!P.exceptDates||!P.exceptDates.length?!1:P.exceptDates.some(A=>A instanceof Date&&he(A,M))}function ze(M){return dt(M)?!1:["singleFromAvailable","rangeFromAvailable"].includes(P.mode)?bt(M):Gt(M)}function Ke(M){const A=_n.value,T=Ot.value,W=ct(M),te=Ee.value&&T.start&&T.end&&W>ct(T.start)&&W<ct(T.end),de=Ee.value&&T.start&&he(M,T.start),we=Ee.value&&T.end&&he(M,T.end),ie=de&&we,Ve=Q.value&&A&&he(M,A)||de||we;let Se=!1;if(Ee.value&&T.start&&!T.end&&$e.value){const $t=ct(T.start),Zt=ct($e.value),sn=Math.min($t,Zt),Un=Math.max($t,Zt);Se=W>sn&&W<Un}return{"dss-datepicker__day--selected":Ve&&!ie,"dss-datepicker__day--range-start":de&&!ie,"dss-datepicker__day--range-end":we&&!ie,"dss-datepicker__day--range-single":ie,"dss-datepicker__day--in-range":te&&!de&&!we,"dss-datepicker__day--in-range-preview":Se&&!de&&!we&&!te,"dss-datepicker__day--disabled":!ze(M)}}function ge(M){if(!Ee.value)return;const A=Ot.value;if(!A.start||A.end){$e.value=null;return}if(!ze(M)){$e.value=null;return}$e.value=new Date(M.getFullYear(),M.getMonth(),M.getDate())}function Xe(){$e.value=null}function Vt(){if(!P.doubleCalendar||!Ee.value)return;const M=Ot.value,{start:A,end:T}=M;if(A&&T){const de=A<=T?A:T,we=A<=T?T:A,ie=de.getMonth(),Ve=de.getFullYear(),Se=we.getMonth(),$t=we.getFullYear();if(ie!==Se||Ve!==$t){const Zt=be.value===ie&&Le.value===Ve,sn=Ne.value===Se&&I.value===$t;if(Zt&&sn)return;be.value=ie,Le.value=Ve,Ne.value=Se,I.value=$t}else{const Zt=ie===0?11:ie-1,sn=ie===0?Ve-1:Ve;be.value===Zt&&Le.value===sn&&Ne.value===ie&&I.value===Ve||(be.value=ie,Le.value=Ve,ie===11?(Ne.value=0,I.value=Ve+1):(Ne.value=ie+1,I.value=Ve))}return}const W=A||T;if(W){const de=W.getMonth(),we=W.getFullYear(),ie=be.value===de&&Le.value===we,Ve=Ne.value===de&&I.value===we;if(ie||Ve)return;be.value=de,Le.value=we,de===11?(Ne.value=0,I.value=we+1):(Ne.value=de+1,I.value=we);return}const te=O();be.value=te.left.month,Le.value=te.left.year,Ne.value=te.right.month,I.value=te.right.year}function Te(M="start"){if(P.mode==="readonly")return;re.value=M;const A=_n.value,T=Ot.value;if(Q.value&&A)gt.value=A.getMonth(),v.value=A.getFullYear();else if(Ee.value)if(P.doubleCalendar)Vt();else{const W=M==="start"&&T.start?T.start:T.end||T.start;W&&(gt.value=W.getMonth(),v.value=W.getFullYear())}Ae.value=Q.value?ht.value?.closest(".dss-datepicker__input-wrap"):Dt.value,Ge.value="days",qe.value=null,Ce.value=!0,e.nextTick(()=>{Et()})}function ot(){Ge.value="days",qe.value=null,$e.value=null,Ce.value=!1}function Ht(M,A){qe.value=M,Ge.value=A}function We(){Ge.value="days",qe.value=null}function ut(M){const A=new Date,T=A.getFullYear(),W=A.getMonth(),te=A.getDate();let de,we;if(Lt.value){const ie=[...P.availableDates].filter(Ve=>Ve instanceof Date).map(Ve=>new Date(Ve.getFullYear(),Ve.getMonth(),Ve.getDate()));if(ie.sort((Ve,Se)=>Ve.getTime()-Se.getTime()),ie.length===0)return;if(M==="all")de=ie[0],we=ie[ie.length-1];else{const Ve=parseInt(M.replace("last",""),10);if(Ve<2||Ve>5)return;const Se=ie.slice(-Ve);de=Se[0],we=Se[Se.length-1]}}else{const ie=new Date(T,W,te);switch(M){case"today":de=ie,we=ie;break;case"lastWeek":de=new Date(T,W,te-6),we=ie;break;case"last15Days":de=new Date(T,W,te-14),we=ie;break;case"last30Days":de=new Date(T,W,te-29),we=ie;break;case"thisMonth":de=new Date(T,W,1),we=ie;break;case"last3Months":de=new Date(T,W-3,1),we=new Date(T,W,0);break;case"last6Months":de=new Date(T,W-6,1),we=new Date(T,W,0);break;case"last12Months":de=new Date(T,W-12,1),we=new Date(T,W,0);break;case"lastYear":de=new Date(T-1,0,1),we=new Date(T-1,11,31);break;default:return}}D("update:modelValue",{start:de,end:we}),Vt()}function lt(M){qe.value==="left"?be.value=M:qe.value==="right"?Ne.value=M:gt.value=M,We()}function at(M){qe.value==="left"?Le.value=M:qe.value==="right"?I.value=M:v.value=M,We()}function ln(){gt.value===0?(gt.value=11,v.value--):gt.value--}function Nt(){gt.value===11?(gt.value=0,v.value++):gt.value++}function Rt(){be.value===0?(be.value=11,Le.value--):be.value--}function vn(){be.value===11?(be.value=0,Le.value++):be.value++}function wn(){Ne.value===0?(Ne.value=11,I.value--):Ne.value--}function an(){Ne.value===11?(Ne.value=0,I.value++):Ne.value++}function io(M){if(!ze(M))return;const A=new Date(M.getFullYear(),M.getMonth(),M.getDate());if(Q.value){D("update:modelValue",A),ot();return}const T=Ot.value;if(!T.start&&!T.end){D("update:modelValue",{start:A,end:null}),re.value="end";return}if(T.start&&T.end){D("update:modelValue",{start:A,end:null}),re.value="end";return}if(re.value==="start"){let W=A,te=T.end;W&&te&&W>te&&([W,te]=[te,W]),D("update:modelValue",{start:W||te,end:te||W}),re.value="end"}else{let W=T.start,te=A;W&&te&&te<W&&([W,te]=[te,W]),D("update:modelValue",{start:W||te,end:te||W}),re.value="start"}}e.watch(Ot,()=>{P.doubleCalendar&&Ee.value&&Ce.value&&Vt()},{deep:!0});let It=null,An=null,xn=null;function Dn(){It&&(document.removeEventListener("keydown",It),It=null),An&&(window.removeEventListener("resize",An),An=null),xn&&(window.removeEventListener("scroll",xn,!0),xn=null)}return e.watch(Ce,M=>{Dn(),M&&(It=A=>{A.key==="Escape"&&(Ge.value==="years"||Ge.value==="months"?We():ot())},An=()=>{Et()},xn=()=>{Et()},document.addEventListener("keydown",It),window.addEventListener("resize",An),window.addEventListener("scroll",xn,!0))}),e.onBeforeUnmount(()=>{Dn()}),(M,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":Z.mode==="readonly"}])},[Z.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Zu,[A[9]||(A[9]=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:Bn.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Wu)])):Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:A[0]||(A[0]=T=>Te("start"))},[A[10]||(A[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",{ref_key:"inputSingleRef",ref:ht,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectDate"),value:pn.value,readonly:"",disabled:Z.mode==="readonly"},null,8,qu)])):Ee.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Dt,onClick:A[1]||(A[1]=T=>Te("start"))},[A[11]||(A[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:"inputRangeRef",ref:Ue,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ie)("datepicker.selectRange"),value:Kt.value,readonly:""},null,8,Uu)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ce.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ot,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Qe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":Z.doubleCalendar&&Ee.value&&Ge.value==="days","dss-datepicker__dropdown--quick-select":Z.doubleCalendar&&Ee.value&&Ge.value==="days"&&Z.quickSelect}]),style:e.normalizeStyle(me.value)},[Ge.value==="days"&&Z.doubleCalendar&&Ee.value?(e.openBlock(),e.createElementBlock("div",Xu,[Z.quickSelect?(e.openBlock(),e.createElementBlock("nav",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:W=>ut(T.id)},e.toDisplayString(e.unref(Ie)(T.labelKey)),9,ju))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ku,[e.createElementVNode("div",Gu,[e.createElementVNode("div",Qu,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:Rt}," ‹ ",8,Ju),e.createElementVNode("div",e1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[2]||(A[2]=T=>Ht("left","months"))},e.toDisplayString(je.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[3]||(A[3]=T=>Ht("left","years"))},e.toDisplayString(Le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:vn}," › ",8,t1)]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",o1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vo.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,l1)):(e.openBlock(),e.createElementBlock("span",a1))],64))),128))])]),e.createElementVNode("div",s1,[e.createElementVNode("div",r1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:wn}," ‹ ",8,i1),e.createElementVNode("div",c1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[4]||(A[4]=T=>Ht("right","months"))},e.toDisplayString(kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[5]||(A[5]=T=>Ht("right","years"))},e.toDisplayString(I.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:an}," › ",8,d1)]),e.createElementVNode("div",u1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",m1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,p1)):(e.openBlock(),e.createElementBlock("span",v1))],64))),128))])])])])):Ge.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",f1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.prevMonth"),onClick:ln}," ‹ ",8,g1),e.createElementVNode("div",h1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[6]||(A[6]=T=>Ge.value="months")},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[7]||(A[7]=T=>Ge.value="years")},e.toDisplayString(v.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ie)("datepicker.nextMonth"),onClick:Nt}," › ",8,y1)]),e.createElementVNode("div",k1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T,class:"dss-datepicker__weekday"},e.toDisplayString(T),1))),128))]),e.createElementVNode("div",C1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,(T,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[T?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ke(T)]),disabled:!ze(T),onClick:te=>io(T),onMouseenter:te=>ge(T),onMouseleave:Xe},e.toDisplayString(T.getDate()),43,b1)):(e.openBlock(),e.createElementBlock("span",w1))],64))),128))])],64)):Ge.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",x1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," ‹ "),e.createElementVNode("div",E1,[e.createElementVNode("span",V1,e.toDisplayString(Ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:A[8]||(A[8]=T=>Ge.value="years")},e.toDisplayString(Fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," › ")]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(T,W)=>(e.openBlock(),e.createElementBlock("button",{key:W,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":W===nt.value}]),onClick:te=>lt(W)},e.toDisplayString(T),11,S1))),128))])],64)):Ge.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",M1,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," ‹ "),e.createElementVNode("span",B1,e.toDisplayString(He.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:We}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:fe},[e.createElementVNode("div",T1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,T=>(e.openBlock(),e.createElementBlock("button",{key:T,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":T===Fe.value,"dss-datepicker__year-cell--current":T===e.unref(kn)}]),onClick:W=>at(T)},e.toDisplayString(T),11,H1))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},L1={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 (optional)"},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"}},_1={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},A1={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"}},D1={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"}},sl={chart:L1,table:_1,datepicker:A1,textEditor:D1},R1={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 (optionnel)"},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"}},I1={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},F1={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"}},z1={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"}},rl={chart:R1,table:I1,datepicker:F1,textEditor:z1},P1={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"}},O1={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},Z1={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"}},W1={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"}},il={chart:P1,table:O1,datepicker:Z1,textEditor:W1},_l={en:sl,fr:rl,nl:il};function q1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(_l).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,_l[P])})}const Al={en:{textEditor:sl.textEditor},fr:{textEditor:rl.textEditor},nl:{textEditor:il.textEditor}};function U1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Al).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Al[P])})}const Dl={en:{table:sl.table},fr:{table:rl.table},nl:{table:il.table}};function X1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Dl).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Dl[P])})}const Rl={en:{datepicker:sl.datepicker},fr:{datepicker:rl.datepicker},nl:{datepicker:il.datepicker}};function Y1(Z){if(!Z||!Z.global)return;const jt=Z.global.availableLocales||[];Object.keys(Rl).forEach(P=>{jt.includes(P)&&Z.global.mergeLocaleMessage(P,Rl[P])})}const j1={en:{...sl},fr:{...rl},nl:{...il}};al.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:j1});exports.DSSChart=_r;exports.DSSChartMessages=_l;exports.DSSDatepicker=$1;exports.DSSDatepickerMessages=Rl;exports.DSSModal=Ll;exports.DSSTable=Gi;exports.DSSTableMessages=Dl;exports.DSSTextEditor=Ou;exports.DSSTextEditorMessages=Al;exports.addDSSChartTranslations=q1;exports.addDSSDatepickerTranslations=Y1;exports.addDSSTableTranslations=X1;exports.addDSSTextEditorTranslations=U1;
|