u)throw new SyntaxError(`Expected positive number, got "${u}" at index "${o}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${o}"`)}this.curArgs.push(u),this.curArgs.length===fbe[this.curCommandType]&&(ut.HORIZ_LINE_TO===this.curCommandType?i({type:ut.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):ut.VERT_LINE_TO===this.curCommandType?i({type:ut.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===ut.MOVE_TO||this.curCommandType===ut.LINE_TO||this.curCommandType===ut.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ut.MOVE_TO===this.curCommandType&&(this.curCommandType=ut.LINE_TO)):this.curCommandType===ut.CURVE_TO?i({type:ut.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ut.SMOOTH_CURVE_TO?i({type:ut.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ut.QUAD_TO?i({type:ut.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ut.ARC&&i({type:ut.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!ube(a)){if(a===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(a==="+"||a==="-"||a==="."){this.curNumber=a,this.curNumberHasDecimal=a===".";continue}if(l){this.curNumber=a,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${o}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${a}" at index ${o}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,a==="z"||a==="Z"){r.push({type:ut.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(a==="h"||a==="H")this.curCommandType=ut.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=ut.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=ut.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=ut.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=ut.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=ut.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=ut.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=ut.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else if(a==="a"||a==="A")this.curCommandType=ut.ARC,this.curCommandRelative=a==="a";else throw new SyntaxError(`Unexpected character "${a}" at index ${o}.`)}}return r}transform(n){return Object.create(this,{parse:{value(i,o=[]){const a=Object.getPrototypeOf(this).parse.call(this,i);for(const s of a){const l=n(s);Array.isArray(l)?o.push(...l):o.push(l)}return o}}})}}const cr=class cr extends UG{constructor(n){super();Tr(this,"commands");typeof n=="string"?this.commands=cr.parse(n):this.commands=n}encode(){return cr.encode(this.commands)}getBounds(){const n=xi.CALCULATE_BOUNDS();return this.transform(n),n}transform(n){const r=[];for(const i of this.commands){const o=n(i);Array.isArray(o)?r.push(...o):r.push(o)}return this.commands=r,this}static encode(n){return HRe(n)}static parse(n){const r=new cbe,i=[];return r.parse(n,i),r.finish(i),i}};Tr(cr,"CLOSE_PATH",1),Tr(cr,"MOVE_TO",2),Tr(cr,"HORIZ_LINE_TO",4),Tr(cr,"VERT_LINE_TO",8),Tr(cr,"LINE_TO",16),Tr(cr,"CURVE_TO",32),Tr(cr,"SMOOTH_CURVE_TO",64),Tr(cr,"QUAD_TO",128),Tr(cr,"SMOOTH_QUAD_TO",256),Tr(cr,"ARC",512),Tr(cr,"LINE_COMMANDS",cr.LINE_TO|cr.HORIZ_LINE_TO|cr.VERT_LINE_TO),Tr(cr,"DRAWING_COMMANDS",cr.HORIZ_LINE_TO|cr.VERT_LINE_TO|cr.LINE_TO|cr.CURVE_TO|cr.SMOOTH_CURVE_TO|cr.QUAD_TO|cr.SMOOTH_QUAD_TO|cr.ARC);let ut=cr;const fbe={[ut.MOVE_TO]:2,[ut.LINE_TO]:2,[ut.HORIZ_LINE_TO]:1,[ut.VERT_LINE_TO]:1,[ut.CLOSE_PATH]:0,[ut.QUAD_TO]:4,[ut.SMOOTH_QUAD_TO]:2,[ut.CURVE_TO]:6,[ut.SMOOTH_CURVE_TO]:4,[ut.ARC]:7};var dbe=function(){function e(t,n){var r=[],i=!0,o=!1,a=void 0;try{for(var s=t[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),am=Math.PI*2,M5=function(t,n,r,i,o,a,s){var l=t.x,u=t.y;l*=n,u*=r;var c=i*l-o*u,f=o*l+i*u;return{x:c+a,y:f+s}},hbe=function(t,n){var r=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),i=Math.cos(t),o=Math.sin(t),a=Math.cos(t+n),s=Math.sin(t+n);return[{x:i-o*r,y:o+i*r},{x:a+s*r,y:s-a*r},{x:a,y:s}]},iX=function(t,n,r,i){var o=t*i-n*r<0?-1:1,a=t*r+n*i;return a>1&&(a=1),a<-1&&(a=-1),o*Math.acos(a)},pbe=function(t,n,r,i,o,a,s,l,u,c,f,d){var h=Math.pow(o,2),p=Math.pow(a,2),v=Math.pow(f,2),g=Math.pow(d,2),m=h*p-h*g-p*v;m<0&&(m=0),m/=h*g+p*v,m=Math.sqrt(m)*(s===l?-1:1);var y=m*o/a*d,R=m*-a/o*f,A=c*y-u*R+(t+r)/2,x=u*y+c*R+(n+i)/2,S=(f-y)/o,T=(d-R)/a,L=(-f-y)/o,w=(-d-R)/a,M=iX(1,0,S,T),P=iX(S,T,L,w);return l===0&&P>0&&(P-=am),l===1&&P<0&&(P+=am),[A,x,M,P]},vbe=function(t){var n=t.px,r=t.py,i=t.cx,o=t.cy,a=t.rx,s=t.ry,l=t.xAxisRotation,u=l===void 0?0:l,c=t.largeArcFlag,f=c===void 0?0:c,d=t.sweepFlag,h=d===void 0?0:d,p=[];if(a===0||s===0)return[];var v=Math.sin(u*am/360),g=Math.cos(u*am/360),m=g*(n-i)/2+v*(r-o)/2,y=-v*(n-i)/2+g*(r-o)/2;if(m===0&&y===0)return[];a=Math.abs(a),s=Math.abs(s);var R=Math.pow(m,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(s,2);R>1&&(a*=Math.sqrt(R),s*=Math.sqrt(R));var A=pbe(n,r,i,o,a,s,f,h,v,g,m,y),x=dbe(A,4),S=x[0],T=x[1],L=x[2],w=x[3],M=Math.abs(w)/(am/4);Math.abs(1-M)<1e-7&&(M=1);var P=Math.max(Math.ceil(M),1);w/=P;for(var k=0;k{const t=new ut(e),n=[];for(const r of t.commands){const i=gbe[r.type];if((r.type===2||r.type===16)&&n.push({x:r.x,y:r.y,relative:r.relative,type:i}),r.type===32)n.push({x:r.x,y:r.y,curve:{type:"cubic",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},relative:r.relative,type:i});else if(r.type===128)n.push({x:r.x,y:r.y,curve:{type:"quadratic",x1:r.x1,y1:r.y1},relative:r.relative,type:i});else if(r.type===512){const o=n[n.length-1];if(!["M","L","Q","C"].includes(o.type))continue;const a=vbe({px:o.x,py:o.y,cx:r.x,cy:r.y,rx:r.rX,ry:r.rY,xAxisRotation:r.xRot,largeArcFlag:r.lArcFlag,sweepFlag:r.sweepFlag});for(const s of a)n.push({x:s.x,y:s.y,curve:{type:"cubic",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2},relative:!1,type:"C"})}else if(r.type===1)n.push({close:!0,type:i});else continue}return n},mbe=e=>{try{const t=new ut(e),n=[],r=[];for(const i of t.commands){const o="x"in i?i.x:0,a="y"in i?i.y:0;n.push(o),r.push(a)}return{minX:Math.min(...n),minY:Math.min(...r),maxX:Math.max(...n),maxY:Math.max(...r)}}catch{return{minX:0,minY:0,maxX:0,maxY:0}}},aX=(e,t)=>e.replace(/font-size:\s*([\d.]+)pt/g,(n,r)=>`font-size: ${(parseFloat(r)*t).toFixed(1)}px`),ybe=()=>{const e=lt(),{theme:t}=Ve(lt()),{addSlidesFromData:n}=Q2(),{isEmptySlide:r}=gc(),i=he(!1),o=(u,c=!1)=>{const f=u[0],d=new FileReader;d.addEventListener("load",()=>{try{const h=JSON.parse(PH(d.result));c?(e.updateSlideIndex(0),e.setSlides(h)):r.value?e.setSlides(h):n(h)}catch{hn.error("无法正确读取 / 解析该文件")}}),d.readAsText(f)},a=u=>{let c=[0,0],f=[0,0];!u.isFlipV&&!u.isFlipH?(c=[0,0],f=[u.width,u.height]):u.isFlipV&&u.isFlipH?(c=[u.width,u.height],f=[0,0]):u.isFlipV&&!u.isFlipH?(c=[0,u.height],f=[u.width,0]):(c=[u.width,0],f=[0,u.height]);const d={type:"line",id:Zt(10),width:u.borderWidth||1,left:u.left,top:u.top,start:c,end:f,style:u.borderType,color:u.borderColor,points:["",/straightConnector/.test(u.shapType)?"arrow":""]};return/bentConnector/.test(u.shapType)&&(d.broken2=[Math.abs(c[0]-f[0])/2,Math.abs(c[1]-f[1])/2]),d},s=(u,c,f,d,h,p,v)=>{const g=v*(Math.PI/180),m=u+f/2,y=c+d/2,R=h-f/2,A=p-d/2,x=R*Math.cos(g)+A*Math.sin(g),S=-R*Math.sin(g)+A*Math.cos(g),T=m+x,L=y+S;return{x:T,y:L}};return{importSpecificFile:o,importPPTXFile:u=>{const c=u[0];if(!c)return;i.value=!0;const f=[];for(const h of HO)f.push(...h.children);const d=new FileReader;d.onload=async h=>{const p=await IRe(h.target.result),v=96/72,g=p.size.width;e.setViewportSize(g*v);const m=[];for(const y of p.slides){const{type:R,value:A}=y.fill;let x;R==="image"?x={type:"image",image:{src:A.picBase64,size:"cover"}}:R==="gradient"?x={type:"gradient",gradient:{type:"linear",colors:A.colors.map(L=>({...L,pos:parseInt(L.pos)})),rotate:A.rot}}:x={type:"solid",color:A};const S={id:Zt(10),elements:[],background:x,remark:y.note||""},T=L=>{const w=L.sort((M,P)=>M.order-P.order);for(const M of w){const P=M.width||1,k=M.height||1,F=M.left,C=M.top;if(M.width=M.width*v,M.height=M.height*v,M.left=M.left*v,M.top=M.top*v,M.type==="text"){const N={type:"text",id:Zt(10),width:M.width,height:M.height,left:M.left,top:M.top,rotate:M.rotate,defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,content:aX(M.content,v),lineHeight:1,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType},fill:M.fillColor,vertical:M.isVertical};M.shadow&&(N.shadow={h:M.shadow.h*v,v:M.shadow.v*v,blur:M.shadow.blur*v,color:M.shadow.color}),S.elements.push(N)}else if(M.type==="image")S.elements.push({type:"image",id:Zt(10),src:M.src,width:M.width,height:M.height,left:M.left,top:M.top,fixedRatio:!0,rotate:M.rotate,flipH:M.isFlipH,flipV:M.isFlipV});else if(M.type==="audio")S.elements.push({type:"audio",id:Zt(10),src:M.blob,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,fixedRatio:!1,color:t.value.themeColor,loop:!1,autoplay:!1});else if(M.type==="video")S.elements.push({type:"video",id:Zt(10),src:M.blob||M.src,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,autoplay:!1});else if(M.type==="shape")if(M.shapType==="line"||/Connector/.test(M.shapType)){const N=a(M);S.elements.push(N)}else{const N=f.find(U=>U.pptxShapeType===M.shapType),I={mid:"middle",down:"bottom",up:"top"},W={type:"shape",id:Zt(10),width:M.width,height:M.height,left:M.left,top:M.top,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:M.fillColor||"none",fixedRatio:!1,rotate:M.rotate,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType},text:{content:aX(M.content,v),defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,align:I[M.vAlign]||"middle"},flipH:M.isFlipH,flipV:M.isFlipV};if(M.shadow&&(W.shadow={h:M.shadow.h*v,v:M.shadow.v*v,blur:M.shadow.blur*v,color:M.shadow.color}),N&&(W.path=N.path,W.viewBox=N.viewBox,N.pathFormula)){W.pathFormula=N.pathFormula,W.viewBox=[M.width,M.height];const U=u0[N.pathFormula];"editable"in U&&U.editable?(W.path=U.formula(M.width,M.height,U.defaultValue),W.keypoints=U.defaultValue):W.path=U.formula(M.width,M.height)}if(M.shapType==="custom")if(M.path.indexOf("NaN")!==-1)W.path="";else{W.special=!0,W.path=M.path;const{maxX:U,maxY:Z}=mbe(W.path);W.viewBox=[U||P,Z||k]}W.path&&S.elements.push(W)}else if(M.type==="table"){const N=M.data.length,I=M.data[0].length,W={fontname:t.value.fontName,color:t.value.fontColor},U=[];for(let ne=0;ne`坐标${B+1}`),I=["X","Y"],W=M.data;else{const ne=M.data;N=Object.values(ne[0].xlabels),I=ne.map(B=>B.key),W=ne.map(B=>B.values.map(Y=>Y.y))}const U={};let Z="bar";switch(M.chartType){case"barChart":case"bar3DChart":Z="bar",M.barDir==="bar"&&(Z="column"),(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0);break;case"lineChart":case"line3DChart":(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0),Z="line";break;case"areaChart":case"area3DChart":(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0),Z="area";break;case"scatterChart":case"bubbleChart":Z="scatter";break;case"pieChart":case"pie3DChart":Z="pie";break;case"radarChart":Z="radar";break;case"doughnutChart":Z="ring";break}S.elements.push({type:"chart",id:Zt(10),chartType:Z,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,themeColors:[t.value.themeColor],textColor:t.value.fontColor,data:{labels:N,legends:I,series:W},options:U})}else if(M.type==="group"){const N=M.elements.map(I=>{let W=I.left+F,U=I.top+C;if(M.rotate){const{x:Z,y:ne}=s(F,C,P,k,I.left,I.top,M.rotate);W=Z,U=ne}return{...I,left:W,top:U}});T(N)}else if(M.type==="diagram"){const N=M.elements.map(I=>({...I,left:I.left+F,top:I.top+C}));T(N)}}};T(y.elements),m.push(S)}e.updateSlideIndex(0),e.setSlides(m),i.value=!1},d.readAsArrayBuffer(c)},exporting:i}},Abe={class:"hotkey-doc"},Rbe={class:"title"},bbe={class:"label"},xbe={class:"value"},Sbe={key:1,class:"row"},wbe=We({__name:"HotkeyDoc",setup(e){return(t,n)=>(D(),q("div",Abe,[(D(!0),q(Xe,null,nt(z(Xme),r=>(D(),q(Xe,{key:r.type},[V("div",Rbe,ht(r.type),1),(D(!0),q(Xe,null,nt(r.children,i=>(D(),q("div",{class:"hotkey-item",key:i.label},[i.value?(D(),q(Xe,{key:0},[V("div",bbe,ht(i.label),1),V("div",xbe,ht(i.value),1)],64)):(D(),q("div",Sbe,ht(i.label),1))]))),128))],64))),128))]))}}),Mbe=Be(wbe,[["__scopeId","data-v-42fbe598"]]),Lbe=["accept"],Tbe=We({__name:"FileInput",props:{accept:{default:"image/*"}},emits:["change"],setup(e,{emit:t}){const n=t,r=he(),i=()=>{r.value&&(r.value.value="",r.value.click())},o=a=>{const s=a.target.files;s&&n("change",s)};return(a,s)=>(D(),q("div",{class:"file-input",onClick:s[1]||(s[1]=l=>i())},[ar(a.$slots,"default",{},void 0,!0),V("input",{class:"input",type:"file",name:"upload",ref_key:"inputRef",ref:r,accept:a.accept,onChange:s[0]||(s[0]=l=>o(l))},null,40,Lbe)]))}}),$h=Be(Tbe,[["__scopeId","data-v-1bd53d05"]]),_be=e=>(tn("data-v-cb40f98b"),e=e(),nn(),e),Obe={class:"spin"},kbe=_be(()=>V("div",{class:"spinner"},null,-1)),Pbe={class:"text"},Cbe=We({__name:"FullscreenSpin",props:{loading:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},tip:{default:""}},setup(e){return(t,n)=>t.loading?(D(),q("div",{key:0,class:ze(["fullscreen-spin",{mask:t.mask}])},[V("div",Obe,[kbe,V("div",Pbe,ht(t.tip),1)])],2)):Ye("",!0)}}),ey=Be(Cbe,[["__scopeId","data-v-cb40f98b"]]),Ibe={class:"header"},Nbe=We({__name:"Drawer",props:{visible:{type:Boolean},width:{default:320},contentStyle:{},placement:{default:"right"}},emits:["update:visible"],setup(e,{emit:t}){const n=e,r=t,i=he(!1),o=Se(()=>({width:n.width+"px",...n.contentStyle||{}}));return(a,s)=>{const l=xe("IconClose");return D(),_e(dO,{to:"body"},[O(Yh,{name:`drawer-slide-${a.placement}`,onAfterLeave:s[1]||(s[1]=u=>i.value=!1),onBeforeEnter:s[2]||(s[2]=u=>i.value=!0)},{default:ie(()=>[Ge(V("div",{class:ze(["drawer",a.placement]),style:Le({width:n.width+"px"})},[V("div",Ibe,[ar(a.$slots,"title",{},void 0,!0),V("span",{class:"close-btn",onClick:s[0]||(s[0]=u=>r("update:visible",!1))},[O(l)])]),i.value?(D(),q("div",{key:0,class:"content",style:Le(o.value)},[ar(a.$slots,"default",{},void 0,!0)],4)):Ye("",!0)],6),[[cc,a.visible]])]),_:3},8,["name"])])}}}),Fbe=Be(Nbe,[["__scopeId","data-v-46f39759"]]),Ebe={class:"prefix"},Xbe=["disabled","value","placeholder","maxlength"],Wbe={class:"suffix"},Vbe=We({__name:"Input",props:{value:{},disabled:{type:Boolean,default:!1},placeholder:{default:""},simple:{type:Boolean,default:!1},maxlength:{}},emits:["update:value","input","change","blur","focus","enter","backspace"],setup(e,{expose:t,emit:n}){const r=n,i=he(!1),o=c=>{r("update:value",c.target.value)},a=c=>{i.value=!1,r("blur",c)},s=c=>{i.value=!0,r("focus",c)},l=he();return t({focus:()=>{l.value&&l.value.focus()}}),(c,f)=>(D(),q("div",{class:ze(["input",{disabled:c.disabled,focused:i.value,simple:c.simple}])},[V("span",Ebe,[ar(c.$slots,"prefix",{},void 0,!0)]),V("input",{type:"text",ref_key:"inputRef",ref:l,disabled:c.disabled,value:c.value,placeholder:c.placeholder,maxlength:c.maxlength,onInput:f[0]||(f[0]=d=>o(d)),onFocus:f[1]||(f[1]=d=>s(d)),onBlur:f[2]||(f[2]=d=>a(d)),onChange:f[3]||(f[3]=d=>r("change",d)),onKeydown:[f[4]||(f[4]=dl(d=>r("enter",d),["enter"])),f[5]||(f[5]=dl(d=>r("backspace",d),["backspace"]))]},null,40,Xbe),V("span",Wbe,[ar(c.$slots,"suffix",{},void 0,!0)])],2))}}),hu=Be(Vbe,[["__scopeId","data-v-cc7e5c91"]]);var ia="top",_s="bottom",Os="right",oa="left",dk="auto",ty=[ia,_s,Os,oa],Sv="start",t2="end",Dbe="clippingParents",BG="viewport",k1="popper",Ube="reference",sX=ty.reduce(function(e,t){return e.concat([t+"-"+Sv,t+"-"+t2])},[]),YG=[].concat(ty,[dk]).reduce(function(e,t){return e.concat([t,t+"-"+Sv,t+"-"+t2])},[]),Bbe="beforeRead",Ybe="read",Zbe="afterRead",Qbe="beforeMain",Hbe="main",Kbe="afterMain",Gbe="beforeWrite",zbe="write",Jbe="afterWrite",$be=[Bbe,Ybe,Zbe,Qbe,Hbe,Kbe,Gbe,zbe,Jbe];function pu(e){return e?(e.nodeName||"").toLowerCase():null}function Za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function jh(e){var t=Za(e).Element;return e instanceof t||e instanceof Element}function Ss(e){var t=Za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hk(e){if(typeof ShadowRoot>"u")return!1;var t=Za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jbe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Ss(o)||!pu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function qbe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!Ss(i)||!pu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const ZG={name:"applyStyles",enabled:!0,phase:"write",fn:jbe,effect:qbe,requires:["computeStyles"]};function su(e){return e.split("-")[0]}var Ch=Math.max,Fx=Math.min,wv=Math.round;function n6(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function QG(){return!/^((?!chrome|android).)*safari/i.test(n6())}function Mv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Ss(e)&&(i=e.offsetWidth>0&&wv(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&wv(r.height)/e.offsetHeight||1);var a=jh(e)?Za(e):window,s=a.visualViewport,l=!QG()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function pk(e){var t=Mv(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function HG(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&hk(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function dc(e){return Za(e).getComputedStyle(e)}function exe(e){return["table","td","th"].indexOf(pu(e))>=0}function cd(e){return((jh(e)?e.ownerDocument:e.document)||window.document).documentElement}function p3(e){return pu(e)==="html"?e:e.assignedSlot||e.parentNode||(hk(e)?e.host:null)||cd(e)}function lX(e){return!Ss(e)||dc(e).position==="fixed"?null:e.offsetParent}function txe(e){var t=/firefox/i.test(n6()),n=/Trident/i.test(n6());if(n&&Ss(e)){var r=dc(e);if(r.position==="fixed")return null}var i=p3(e);for(hk(i)&&(i=i.host);Ss(i)&&["html","body"].indexOf(pu(i))<0;){var o=dc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ny(e){for(var t=Za(e),n=lX(e);n&&exe(n)&&dc(n).position==="static";)n=lX(n);return n&&(pu(n)==="html"||pu(n)==="body"&&dc(n).position==="static")?t:n||txe(e)||t}function vk(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sm(e,t,n){return Ch(e,Fx(t,n))}function nxe(e,t,n){var r=sm(e,t,n);return r>n?n:r}function KG(){return{top:0,right:0,bottom:0,left:0}}function GG(e){return Object.assign({},KG(),e)}function zG(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var rxe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,GG(typeof t!="number"?t:zG(t,ty))};function ixe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=su(n.placement),l=vk(s),u=[oa,Os].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=rxe(i.padding,n),d=pk(o),h=l==="y"?ia:oa,p=l==="y"?_s:Os,v=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],m=ny(o),y=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,R=v/2-g/2,A=f[h],x=y-d[c]-f[p],S=y/2-d[c]/2+R,T=sm(A,S,x),L=l;n.modifiersData[r]=(t={},t[L]=T,t.centerOffset=T-S,t)}}function oxe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||HG(t.elements.popper,i)&&(t.elements.arrow=i))}const axe={name:"arrow",enabled:!0,phase:"main",fn:ixe,effect:oxe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Lv(e){return e.split("-")[1]}var sxe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lxe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:wv(n*i)/i||0,y:wv(r*i)/i||0}}function uX(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,v=p===void 0?0:p,g=typeof c=="function"?c({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),R=oa,A=ia,x=window;if(u){var S=ny(n),T="clientHeight",L="clientWidth";if(S===Za(n)&&(S=cd(n),dc(S).position!=="static"&&s==="absolute"&&(T="scrollHeight",L="scrollWidth")),S=S,i===ia||(i===oa||i===Os)&&o===t2){A=_s;var w=f&&S===x&&x.visualViewport?x.visualViewport.height:S[T];v-=w-r.height,v*=l?1:-1}if(i===oa||(i===ia||i===_s)&&o===t2){R=Os;var M=f&&S===x&&x.visualViewport?x.visualViewport.width:S[L];h-=M-r.width,h*=l?1:-1}}var P=Object.assign({position:s},u&&sxe),k=c===!0?lxe({x:h,y:v},Za(n)):{x:h,y:v};if(h=k.x,v=k.y,l){var F;return Object.assign({},P,(F={},F[A]=y?"0":"",F[R]=m?"0":"",F.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",F))}return Object.assign({},P,(t={},t[A]=y?v+"px":"",t[R]=m?h+"px":"",t.transform="",t))}function uxe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:su(t.placement),variation:Lv(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,uX(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,uX(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cxe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uxe,data:{}};var YA={passive:!0};function fxe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Za(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,YA)}),s&&l.addEventListener("resize",n.update,YA),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,YA)}),s&&l.removeEventListener("resize",n.update,YA)}}const dxe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fxe,data:{}};var hxe={left:"right",right:"left",bottom:"top",top:"bottom"};function mb(e){return e.replace(/left|right|bottom|top/g,function(t){return hxe[t]})}var pxe={start:"end",end:"start"};function cX(e){return e.replace(/start|end/g,function(t){return pxe[t]})}function gk(e){var t=Za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function mk(e){return Mv(cd(e)).left+gk(e).scrollLeft}function vxe(e,t){var n=Za(e),r=cd(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=QG();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+mk(e),y:l}}function gxe(e){var t,n=cd(e),r=gk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Ch(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ch(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+mk(e),l=-r.scrollTop;return dc(i||n).direction==="rtl"&&(s+=Ch(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function yk(e){var t=dc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function JG(e){return["html","body","#document"].indexOf(pu(e))>=0?e.ownerDocument.body:Ss(e)&&yk(e)?e:JG(p3(e))}function lm(e,t){var n;t===void 0&&(t=[]);var r=JG(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Za(r),a=i?[o].concat(o.visualViewport||[],yk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(lm(p3(a)))}function r6(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function mxe(e,t){var n=Mv(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function fX(e,t,n){return t===BG?r6(vxe(e,n)):jh(t)?mxe(t,n):r6(gxe(cd(e)))}function yxe(e){var t=lm(p3(e)),n=["absolute","fixed"].indexOf(dc(e).position)>=0,r=n&&Ss(e)?ny(e):e;return jh(r)?t.filter(function(i){return jh(i)&&HG(i,r)&&pu(i)!=="body"}):[]}function Axe(e,t,n,r){var i=t==="clippingParents"?yxe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=fX(e,u,r);return l.top=Ch(c.top,l.top),l.right=Fx(c.right,l.right),l.bottom=Fx(c.bottom,l.bottom),l.left=Ch(c.left,l.left),l},fX(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function $G(e){var t=e.reference,n=e.element,r=e.placement,i=r?su(r):null,o=r?Lv(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case ia:l={x:a,y:t.y-n.height};break;case _s:l={x:a,y:t.y+t.height};break;case Os:l={x:t.x+t.width,y:s};break;case oa:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?vk(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Sv:l[u]=l[u]-(t[c]/2-n[c]/2);break;case t2:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function n2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Dbe:s,u=n.rootBoundary,c=u===void 0?BG:u,f=n.elementContext,d=f===void 0?k1:f,h=n.altBoundary,p=h===void 0?!1:h,v=n.padding,g=v===void 0?0:v,m=GG(typeof g!="number"?g:zG(g,ty)),y=d===k1?Ube:k1,R=e.rects.popper,A=e.elements[p?y:d],x=Axe(jh(A)?A:A.contextElement||cd(e.elements.popper),l,c,a),S=Mv(e.elements.reference),T=$G({reference:S,element:R,strategy:"absolute",placement:i}),L=r6(Object.assign({},R,T)),w=d===k1?L:S,M={top:x.top-w.top+m.top,bottom:w.bottom-x.bottom+m.bottom,left:x.left-w.left+m.left,right:w.right-x.right+m.right},P=e.modifiersData.offset;if(d===k1&&P){var k=P[i];Object.keys(M).forEach(function(F){var C=[Os,_s].indexOf(F)>=0?1:-1,N=[ia,_s].indexOf(F)>=0?"y":"x";M[F]+=k[N]*C})}return M}function Rxe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?YG:l,c=Lv(r),f=c?s?sX:sX.filter(function(p){return Lv(p)===c}):ty,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,v){return p[v]=n2(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[su(v)],p},{});return Object.keys(h).sort(function(p,v){return h[p]-h[v]})}function bxe(e){if(su(e)===dk)return[];var t=mb(e);return[cX(e),t,cX(t)]}function xxe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,v=n.allowedAutoPlacements,g=t.options.placement,m=su(g),y=m===g,R=l||(y||!p?[mb(g)]:bxe(g)),A=[g].concat(R).reduce(function(K,te){return K.concat(su(te)===dk?Rxe(t,{placement:te,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:v}):te)},[]),x=t.rects.reference,S=t.rects.popper,T=new Map,L=!0,w=A[0],M=0;M=0,N=C?"width":"height",I=n2(t,{placement:P,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),W=C?F?Os:oa:F?_s:ia;x[N]>S[N]&&(W=mb(W));var U=mb(W),Z=[];if(o&&Z.push(I[k]<=0),s&&Z.push(I[W]<=0,I[U]<=0),Z.every(function(K){return K})){w=P,L=!1;break}T.set(P,Z)}if(L)for(var ne=p?3:1,B=function(te){var j=A.find(function(de){var G=T.get(de);if(G)return G.slice(0,te).every(function(Ae){return Ae})});if(j)return w=j,"break"},Y=ne;Y>0;Y--){var Q=B(Y);if(Q==="break")break}t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}const Sxe={name:"flip",enabled:!0,phase:"main",fn:xxe,requiresIfExists:["offset"],data:{_skip:!1}};function dX(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hX(e){return[ia,Os,_s,oa].some(function(t){return e[t]>=0})}function wxe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=n2(t,{elementContext:"reference"}),s=n2(t,{altBoundary:!0}),l=dX(a,r),u=dX(s,i,o),c=hX(l),f=hX(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const Mxe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wxe};function Lxe(e,t,n){var r=su(e),i=[oa,ia].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[oa,Os].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Txe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=YG.reduce(function(c,f){return c[f]=Lxe(f,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const _xe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Txe};function Oxe(e){var t=e.state,n=e.name;t.modifiersData[n]=$G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const kxe={name:"popperOffsets",enabled:!0,phase:"read",fn:Oxe,data:{}};function Pxe(e){return e==="x"?"y":"x"}function Cxe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,v=p===void 0?0:p,g=n2(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),m=su(t.placement),y=Lv(t.placement),R=!y,A=vk(m),x=Pxe(A),S=t.modifiersData.popperOffsets,T=t.rects.reference,L=t.rects.popper,w=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,M=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(S){if(o){var F,C=A==="y"?ia:oa,N=A==="y"?_s:Os,I=A==="y"?"height":"width",W=S[A],U=W+g[C],Z=W-g[N],ne=h?-L[I]/2:0,B=y===Sv?T[I]:L[I],Y=y===Sv?-L[I]:-T[I],Q=t.elements.arrow,K=h&&Q?pk(Q):{width:0,height:0},te=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:KG(),j=te[C],de=te[N],G=sm(0,T[I],K[I]),Ae=R?T[I]/2-ne-G-j-M.mainAxis:B-G-j-M.mainAxis,ce=R?-T[I]/2+ne+G+de+M.mainAxis:Y+G+de+M.mainAxis,fe=t.elements.arrow&&ny(t.elements.arrow),le=fe?A==="y"?fe.clientTop||0:fe.clientLeft||0:0,$=(F=P==null?void 0:P[A])!=null?F:0,X=W+Ae-$-le,J=W+ce-$,se=sm(h?Fx(U,X):U,W,h?Ch(Z,J):Z);S[A]=se,k[A]=se-W}if(s){var ee,re=A==="x"?ia:oa,oe=A==="x"?_s:Os,pe=S[x],ue=x==="y"?"height":"width",ge=pe+g[re],Re=pe-g[oe],Ee=[ia,oa].indexOf(m)!==-1,Ne=(ee=P==null?void 0:P[x])!=null?ee:0,He=Ee?ge:pe-T[ue]-L[ue]-Ne+M.altAxis,De=Ee?pe+T[ue]+L[ue]-Ne-M.altAxis:Re,we=h&&Ee?nxe(He,pe,De):sm(h?He:ge,pe,h?De:Re);S[x]=we,k[x]=we-pe}t.modifiersData[r]=k}}const Ixe={name:"preventOverflow",enabled:!0,phase:"main",fn:Cxe,requiresIfExists:["offset"]};function Nxe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Fxe(e){return e===Za(e)||!Ss(e)?gk(e):Nxe(e)}function Exe(e){var t=e.getBoundingClientRect(),n=wv(t.width)/e.offsetWidth||1,r=wv(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Xxe(e,t,n){n===void 0&&(n=!1);var r=Ss(t),i=Ss(t)&&Exe(t),o=cd(t),a=Mv(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((pu(t)!=="body"||yk(o))&&(s=Fxe(t)),Ss(t)?(l=Mv(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=mk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Wxe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Vxe(e){var t=Wxe(e);return $be.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Dxe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Uxe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var pX={placement:"bottom",modifiers:[],strategy:"absolute"};function vX(){for(var e=arguments.length,t=new Array(e),n=0;n-1}function nz(e,t){return typeof e=="function"?e.apply(void 0,t):e}function gX(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Kxe(e){return e.split(/\s+/).filter(Boolean)}function Ap(e){return[].concat(e)}function mX(e,t){e.indexOf(t)===-1&&e.push(t)}function Gxe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function zxe(e){return e.split("-")[0]}function Ex(e){return[].slice.call(e)}function yX(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function um(){return document.createElement("div")}function v3(e){return["Element","Fragment"].some(function(t){return Ak(e,t)})}function Jxe(e){return Ak(e,"NodeList")}function $xe(e){return Ak(e,"MouseEvent")}function jxe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function qxe(e){return v3(e)?[e]:Jxe(e)?Ex(e):Array.isArray(e)?e:Ex(document.querySelectorAll(e))}function T5(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function AX(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function eSe(e){var t,n=Ap(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function tSe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,u=zxe(a.placement),c=a.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,v=o.top-r+f>l,g=r-o.bottom-d>l,m=o.left-n+h>l,y=n-o.right-p>l;return v||g||m||y})}function _5(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function RX(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Ql={isTouch:!1},bX=0;function nSe(){Ql.isTouch||(Ql.isTouch=!0,window.performance&&document.addEventListener("mousemove",rz))}function rz(){var e=performance.now();e-bX<20&&(Ql.isTouch=!1,document.removeEventListener("mousemove",rz)),bX=e}function rSe(){var e=document.activeElement;if(jxe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function iSe(){document.addEventListener("touchstart",nSe,rh),window.addEventListener("blur",rSe)}var oSe=typeof window<"u"&&typeof document<"u",aSe=oSe?!!window.msCrypto:!1,sSe={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lSe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ul=Object.assign({appendTo:tz,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},sSe,lSe),uSe=Object.keys(ul),cSe=function(t){var n=Object.keys(t);n.forEach(function(r){ul[r]=t[r]})};function iz(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=ul[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function fSe(e,t){var n=t?Object.keys(iz(Object.assign({},ul,{plugins:t}))):uSe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function xX(e,t){var n=Object.assign({},t,{content:nz(t.content,[e])},t.ignoreAttributes?{}:fSe(e,t.plugins));return n.aria=Object.assign({},ul.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var dSe=function(){return"innerHTML"};function i6(e,t){e[dSe()]=t}function SX(e){var t=um();return e===!0?t.className=qG:(t.className=ez,v3(e)?t.appendChild(e):i6(t,e)),t}function wX(e,t){v3(t.content)?(i6(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?i6(e,t.content):e.textContent=t.content)}function o6(e){var t=e.firstElementChild,n=Ex(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(jG)}),arrow:n.find(function(r){return r.classList.contains(qG)||r.classList.contains(ez)}),backdrop:n.find(function(r){return r.classList.contains(Hxe)})}}function oz(e){var t=um(),n=um();n.className=Qxe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=um();r.className=jG,r.setAttribute("data-state","hidden"),wX(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=o6(t),l=s.box,u=s.content,c=s.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&wX(u,e.props),a.arrow?c?o.arrow!==a.arrow&&(l.removeChild(c),l.appendChild(SX(a.arrow))):l.appendChild(SX(a.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}oz.$$tippy=!0;var hSe=1,ZA=[],O5=[];function pSe(e,t){var n=xX(e,Object.assign({},ul,iz(yX(t)))),r,i,o,a=!1,s=!1,l=!1,u=!1,c,f,d,h=[],p=gX(X,n.interactiveDebounce),v,g=hSe++,m=null,y=Gxe(n.plugins),R={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},A={id:g,reference:e,popper:um(),popperInstance:m,props:n,state:R,plugins:y,clearDelayTimeouts:He,setProps:De,setContent:we,show:me,hide:Me,hideWithInteractivity:Ce,enable:Ee,disable:Ne,unmount:Qe,destroy:ot};if(!n.render)return A;var x=n.render(A),S=x.popper,T=x.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+A.id,A.popper=S,e._tippy=A,S._tippy=A;var L=y.map(function(ke){return ke.fn(A)}),w=e.hasAttribute("aria-expanded");return fe(),ne(),W(),U("onCreate",[A]),n.showOnCreate&&ge(),S.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&C().addEventListener("mousemove",p)}),A;function M(){var ke=A.props.touch;return Array.isArray(ke)?ke:[ke,0]}function P(){return M()[0]==="hold"}function k(){var ke;return!!((ke=A.props.render)!=null&&ke.$$tippy)}function F(){return v||e}function C(){var ke=F().parentNode;return ke?eSe(ke):document}function N(){return o6(S)}function I(ke){return A.state.isMounted&&!A.state.isVisible||Ql.isTouch||c&&c.type==="focus"?0:L5(A.props.delay,ke?0:1,ul.delay)}function W(ke){ke===void 0&&(ke=!1),S.style.pointerEvents=A.props.interactive&&!ke?"":"none",S.style.zIndex=""+A.props.zIndex}function U(ke,je,tt){if(tt===void 0&&(tt=!0),L.forEach(function(dt){dt[ke]&&dt[ke].apply(dt,je)}),tt){var Rt;(Rt=A.props)[ke].apply(Rt,je)}}function Z(){var ke=A.props.aria;if(ke.content){var je="aria-"+ke.content,tt=S.id,Rt=Ap(A.props.triggerTarget||e);Rt.forEach(function(dt){var vt=dt.getAttribute(je);if(A.state.isVisible)dt.setAttribute(je,vt?vt+" "+tt:tt);else{var wt=vt&&vt.replace(tt,"").trim();wt?dt.setAttribute(je,wt):dt.removeAttribute(je)}})}}function ne(){if(!(w||!A.props.aria.expanded)){var ke=Ap(A.props.triggerTarget||e);ke.forEach(function(je){A.props.interactive?je.setAttribute("aria-expanded",A.state.isVisible&&je===F()?"true":"false"):je.removeAttribute("aria-expanded")})}}function B(){C().removeEventListener("mousemove",p),ZA=ZA.filter(function(ke){return ke!==p})}function Y(ke){if(!(Ql.isTouch&&(l||ke.type==="mousedown"))){var je=ke.composedPath&&ke.composedPath()[0]||ke.target;if(!(A.props.interactive&&RX(S,je))){if(Ap(A.props.triggerTarget||e).some(function(tt){return RX(tt,je)})){if(Ql.isTouch||A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[A,ke]);A.props.hideOnClick===!0&&(A.clearDelayTimeouts(),A.hide(),s=!0,setTimeout(function(){s=!1}),A.state.isMounted||j())}}}function Q(){l=!0}function K(){l=!1}function te(){var ke=C();ke.addEventListener("mousedown",Y,!0),ke.addEventListener("touchend",Y,rh),ke.addEventListener("touchstart",K,rh),ke.addEventListener("touchmove",Q,rh)}function j(){var ke=C();ke.removeEventListener("mousedown",Y,!0),ke.removeEventListener("touchend",Y,rh),ke.removeEventListener("touchstart",K,rh),ke.removeEventListener("touchmove",Q,rh)}function de(ke,je){Ae(ke,function(){!A.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&je()})}function G(ke,je){Ae(ke,je)}function Ae(ke,je){var tt=N().box;function Rt(dt){dt.target===tt&&(_5(tt,"remove",Rt),je())}if(ke===0)return je();_5(tt,"remove",f),_5(tt,"add",Rt),f=Rt}function ce(ke,je,tt){tt===void 0&&(tt=!1);var Rt=Ap(A.props.triggerTarget||e);Rt.forEach(function(dt){dt.addEventListener(ke,je,tt),h.push({node:dt,eventType:ke,handler:je,options:tt})})}function fe(){P()&&(ce("touchstart",$,{passive:!0}),ce("touchend",J,{passive:!0})),Kxe(A.props.trigger).forEach(function(ke){if(ke!=="manual")switch(ce(ke,$),ke){case"mouseenter":ce("mouseleave",J);break;case"focus":ce(aSe?"focusout":"blur",se);break;case"focusin":ce("focusout",se);break}})}function le(){h.forEach(function(ke){var je=ke.node,tt=ke.eventType,Rt=ke.handler,dt=ke.options;je.removeEventListener(tt,Rt,dt)}),h=[]}function $(ke){var je,tt=!1;if(!(!A.state.isEnabled||ee(ke)||s)){var Rt=((je=c)==null?void 0:je.type)==="focus";c=ke,v=ke.currentTarget,ne(),!A.state.isVisible&&$xe(ke)&&ZA.forEach(function(dt){return dt(ke)}),ke.type==="click"&&(A.props.trigger.indexOf("mouseenter")<0||a)&&A.props.hideOnClick!==!1&&A.state.isVisible?tt=!0:ge(ke),ke.type==="click"&&(a=!tt),tt&&!Rt&&Re(ke)}}function X(ke){var je=ke.target,tt=F().contains(je)||S.contains(je);if(!(ke.type==="mousemove"&&tt)){var Rt=ue().concat(S).map(function(dt){var vt,wt=dt._tippy,Ut=(vt=wt.popperInstance)==null?void 0:vt.state;return Ut?{popperRect:dt.getBoundingClientRect(),popperState:Ut,props:n}:null}).filter(Boolean);tSe(Rt,ke)&&(B(),Re(ke))}}function J(ke){var je=ee(ke)||A.props.trigger.indexOf("click")>=0&&a;if(!je){if(A.props.interactive){A.hideWithInteractivity(ke);return}Re(ke)}}function se(ke){A.props.trigger.indexOf("focusin")<0&&ke.target!==F()||A.props.interactive&&ke.relatedTarget&&S.contains(ke.relatedTarget)||Re(ke)}function ee(ke){return Ql.isTouch?P()!==ke.type.indexOf("touch")>=0:!1}function re(){oe();var ke=A.props,je=ke.popperOptions,tt=ke.placement,Rt=ke.offset,dt=ke.getReferenceClientRect,vt=ke.moveTransition,wt=k()?o6(S).arrow:null,Ut=dt?{getBoundingClientRect:dt,contextElement:dt.contextElement||F()}:e,$t={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Sl){var Ji=Sl.state;if(k()){var y0=N(),vd=y0.box;["placement","reference-hidden","escaped"].forEach(function(Mu){Mu==="placement"?vd.setAttribute("data-placement",Ji.placement):Ji.attributes.popper["data-popper-"+Mu]?vd.setAttribute("data-"+Mu,""):vd.removeAttribute("data-"+Mu)}),Ji.attributes.popper={}}}},Zn=[{name:"offset",options:{offset:Rt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!vt}},$t];k()&&wt&&Zn.push({name:"arrow",options:{element:wt,padding:3}}),Zn.push.apply(Zn,(je==null?void 0:je.modifiers)||[]),A.popperInstance=Zxe(Ut,S,Object.assign({},je,{placement:tt,onFirstUpdate:d,modifiers:Zn}))}function oe(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function pe(){var ke=A.props.appendTo,je,tt=F();A.props.interactive&&ke===tz||ke==="parent"?je=tt.parentNode:je=nz(ke,[tt]),je.contains(S)||je.appendChild(S),A.state.isMounted=!0,re()}function ue(){return Ex(S.querySelectorAll("[data-tippy-root]"))}function ge(ke){A.clearDelayTimeouts(),ke&&U("onTrigger",[A,ke]),te();var je=I(!0),tt=M(),Rt=tt[0],dt=tt[1];Ql.isTouch&&Rt==="hold"&&dt&&(je=dt),je?r=setTimeout(function(){A.show()},je):A.show()}function Re(ke){if(A.clearDelayTimeouts(),U("onUntrigger",[A,ke]),!A.state.isVisible){j();return}if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ke.type)>=0&&a)){var je=I(!1);je?i=setTimeout(function(){A.state.isVisible&&A.hide()},je):o=requestAnimationFrame(function(){A.hide()})}}function Ee(){A.state.isEnabled=!0}function Ne(){A.hide(),A.state.isEnabled=!1}function He(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function De(ke){if(!A.state.isDestroyed){U("onBeforeUpdate",[A,ke]),le();var je=A.props,tt=xX(e,Object.assign({},je,yX(ke),{ignoreAttributes:!0}));A.props=tt,fe(),je.interactiveDebounce!==tt.interactiveDebounce&&(B(),p=gX(X,tt.interactiveDebounce)),je.triggerTarget&&!tt.triggerTarget?Ap(je.triggerTarget).forEach(function(Rt){Rt.removeAttribute("aria-expanded")}):tt.triggerTarget&&e.removeAttribute("aria-expanded"),ne(),W(),T&&T(je,tt),A.popperInstance&&(re(),ue().forEach(function(Rt){requestAnimationFrame(Rt._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[A,ke])}}function we(ke){A.setProps({content:ke})}function me(){var ke=A.state.isVisible,je=A.state.isDestroyed,tt=!A.state.isEnabled,Rt=Ql.isTouch&&!A.props.touch,dt=L5(A.props.duration,0,ul.duration);if(!(ke||je||tt||Rt)&&!F().hasAttribute("disabled")&&(U("onShow",[A],!1),A.props.onShow(A)!==!1)){if(A.state.isVisible=!0,k()&&(S.style.visibility="visible"),W(),te(),A.state.isMounted||(S.style.transition="none"),k()){var vt=N(),wt=vt.box,Ut=vt.content;T5([wt,Ut],0)}d=function(){var Zn;if(!(!A.state.isVisible||u)){if(u=!0,S.offsetHeight,S.style.transition=A.props.moveTransition,k()&&A.props.animation){var Es=N(),Sl=Es.box,Ji=Es.content;T5([Sl,Ji],dt),AX([Sl,Ji],"visible")}Z(),ne(),mX(O5,A),(Zn=A.popperInstance)==null||Zn.forceUpdate(),U("onMount",[A]),A.props.animation&&k()&&G(dt,function(){A.state.isShown=!0,U("onShown",[A])})}},pe()}}function Me(){var ke=!A.state.isVisible,je=A.state.isDestroyed,tt=!A.state.isEnabled,Rt=L5(A.props.duration,1,ul.duration);if(!(ke||je||tt)&&(U("onHide",[A],!1),A.props.onHide(A)!==!1)){if(A.state.isVisible=!1,A.state.isShown=!1,u=!1,a=!1,k()&&(S.style.visibility="hidden"),B(),j(),W(!0),k()){var dt=N(),vt=dt.box,wt=dt.content;A.props.animation&&(T5([vt,wt],Rt),AX([vt,wt],"hidden"))}Z(),ne(),A.props.animation?k()&&de(Rt,A.unmount):A.unmount()}}function Ce(ke){C().addEventListener("mousemove",p),mX(ZA,p),p(ke)}function Qe(){A.state.isVisible&&A.hide(),A.state.isMounted&&(oe(),ue().forEach(function(ke){ke._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),O5=O5.filter(function(ke){return ke!==A}),A.state.isMounted=!1,U("onHidden",[A]))}function ot(){A.state.isDestroyed||(A.clearDelayTimeouts(),A.unmount(),le(),delete e._tippy,A.state.isDestroyed=!0,U("onDestroy",[A]))}}function h0(e,t){t===void 0&&(t={});var n=ul.plugins.concat(t.plugins||[]);iSe();var r=Object.assign({},t,{plugins:n}),i=qxe(e),o=i.reduce(function(a,s){var l=s&&pSe(s,r);return l&&a.push(l),a},[]);return v3(e)?o[0]:o}h0.defaultProps=ul;h0.setDefaultProps=cSe;h0.currentInput=Ql;Object.assign({},ZG,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});h0.setDefaultProps({render:oz});const vSe=We({__name:"Popover",props:{value:{type:Boolean,default:!1},trigger:{default:"click"},placement:{default:"bottom"},appendTo:{},contentStyle:{},center:{type:Boolean,default:!1},offset:{default:8}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=he(),o=he(),a=he(),s=he(!1),l=Se(()=>n.contentStyle||{});return Lt(()=>n.value,()=>{i.value&&(n.value?i.value.show():i.value.hide())}),Fn(()=>{i.value&&i.value.destroy()}),Vt(()=>{i.value=h0(o.value,{content:a.value,allowHTML:!0,trigger:n.trigger,placement:n.placement,interactive:!0,appendTo:n.appendTo||document.body,maxWidth:"none",offset:[0,n.offset],duration:200,animation:"scale",theme:"popover",onShow(){s.value=!0},onShown(){n.value||r("update:value",!0)},onHidden(){n.value&&r("update:value",!1),s.value=!1}})}),(u,c)=>(D(),q("div",{class:ze(["popover",{center:u.center}]),ref_key:"triggerRef",ref:o},[V("div",{class:"popover-content",style:Le(l.value),ref_key:"contentRef",ref:a},[s.value?ar(u.$slots,"content",{key:0},void 0,!0):Ye("",!0)],4),ar(u.$slots,"default",{},void 0,!0)],2))}}),Nt=Be(vSe,[["__scopeId","data-v-6a57fbcf"]]),gSe=We({__name:"PopoverMenuItem",props:{center:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,i)=>(D(),q("div",{class:ze(["popover-menu-item",{center:r.center}]),onClick:i[0]||(i[0]=o=>n("click"))},[ar(r.$slots,"default",{},void 0,!0)],2))}}),Zr=Be(gSe,[["__scopeId","data-v-1f176c16"]]),mSe=e=>(tn("data-v-c5f9ed82"),e=e(),nn(),e),ySe={class:"editor-header"},ASe={class:"left"},RSe={class:"menu-item"},bSe={class:"title"},xSe=["title"],SSe={class:"right"},wSe={class:"group-menu-item"},MSe={class:"arrow-btn"},LSe=mSe(()=>V("span",{class:"text"},"AI",-1)),TSe=[LSe],_Se={class:"github-link",href:"https://github.com/pipipi-pikachu/PPTist",target:"_blank"},OSe={class:"menu-item"},kSe=We({__name:"index",setup(e){const t=pt(),n=lt(),{title:r}=Ve(n),{enterScreening:i,enterScreeningFromStart:o}=ld(),{importSpecificFile:a,importPPTXFile:s,exporting:l}=ybe(),{resetSlides:u}=gc(),c=he(!1),f=he(!1),d=he(!1),h=he(),p=he(""),v=()=>{p.value=r.value,d.value=!0,Rr(()=>{var x;return(x=h.value)==null?void 0:x.focus()})},g=()=>{n.setTitle(p.value),d.value=!1},m=x=>{window.open(x),c.value=!1},y=x=>{t.setDialogForExport(x),c.value=!1},R=()=>{t.setMarkupPanelState(!0)},A=()=>{t.setAIPPTDialogState(!0)};return(x,S)=>{const T=xe("IconHamburgerButton"),L=xe("IconPpt"),w=xe("IconDown"),M=xe("IconDownload"),P=xe("IconGithub"),k=Tn("tooltip");return D(),q("div",ySe,[V("div",ASe,[O(Nt,{trigger:"click",placement:"bottom-start",value:c.value,"onUpdate:value":S[9]||(S[9]=F=>c.value=F)},{content:ie(()=>[O(Zr,{onClick:S[0]||(S[0]=F=>{A(),c.value=!1})},{default:ie(()=>[Ue("AI 生成 PPT(测试版)")]),_:1}),O($h,{accept:"application/vnd.openxmlformats-officedocument.presentationml.presentation",onChange:S[1]||(S[1]=F=>{z(s)(F),c.value=!1})},{default:ie(()=>[O(Zr,null,{default:ie(()=>[Ue("导入 pptx 文件(测试版)")]),_:1})]),_:1}),O($h,{accept:".pptist",onChange:S[2]||(S[2]=F=>{z(a)(F),c.value=!1})},{default:ie(()=>[O(Zr,null,{default:ie(()=>[Ue("导入 pptist 文件")]),_:1})]),_:1}),O(Zr,{onClick:S[3]||(S[3]=F=>y("pptx"))},{default:ie(()=>[Ue("导出文件")]),_:1}),O(Zr,{onClick:S[4]||(S[4]=F=>{z(u)(),c.value=!1})},{default:ie(()=>[Ue("重置幻灯片")]),_:1}),O(Zr,{onClick:S[5]||(S[5]=F=>{R(),c.value=!1})},{default:ie(()=>[Ue("幻灯片类型标注")]),_:1}),O(Zr,{onClick:S[6]||(S[6]=F=>m("https://github.com/pipipi-pikachu/PPTist/issues"))},{default:ie(()=>[Ue("意见反馈")]),_:1}),O(Zr,{onClick:S[7]||(S[7]=F=>m("https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md"))},{default:ie(()=>[Ue("常见问题")]),_:1}),O(Zr,{onClick:S[8]||(S[8]=F=>{c.value=!1,f.value=!0})},{default:ie(()=>[Ue("快捷操作")]),_:1})]),default:ie(()=>[V("div",RSe,[O(T,{class:"icon"})])]),_:1},8,["value"]),V("div",bSe,[d.value?(D(),_e(hu,{key:0,class:"title-input",ref_key:"titleInputRef",ref:h,value:p.value,"onUpdate:value":S[10]||(S[10]=F=>p.value=F),onBlur:S[11]||(S[11]=F=>g())},null,8,["value"])):(D(),q("div",{key:1,class:"title-text",onClick:S[12]||(S[12]=F=>v()),title:z(r)},ht(z(r)),9,xSe))])]),V("div",SSe,[V("div",wSe,[Ge((D(),q("div",{class:"menu-item",onClick:S[13]||(S[13]=F=>z(i)())},[O(L,{class:"icon"})])),[[k,"幻灯片放映(F5)"]]),O(Nt,{trigger:"click",center:""},{content:ie(()=>[O(Zr,{onClick:S[14]||(S[14]=F=>z(o)())},{default:ie(()=>[Ue("从头开始")]),_:1}),O(Zr,{onClick:S[15]||(S[15]=F=>z(i)())},{default:ie(()=>[Ue("从当前页开始")]),_:1})]),default:ie(()=>[V("div",MSe,[O(w,{class:"arrow"})])]),_:1})]),Ge((D(),q("div",{class:"menu-item",onClick:S[16]||(S[16]=F=>{A(),c.value=!1})},TSe)),[[k,"AI生成PPT"]]),Ge((D(),q("div",{class:"menu-item",onClick:S[17]||(S[17]=F=>y("pptx"))},[O(M,{class:"icon"})])),[[k,"导出"]]),Ge((D(),q("a",_Se,[V("div",OSe,[O(P,{class:"icon"})])])),[[k,"Copyright © 2020-PRESENT pipipi-pikachu"]])]),O(Fbe,{width:320,visible:f.value,"onUpdate:visible":S[18]||(S[18]=F=>f.value=F),placement:"right"},{title:ie(()=>[Ue("快捷操作")]),default:ie(()=>[O(Mbe)]),_:1},8,["visible"]),O(ey,{loading:z(l),tip:"正在导入..."},null,8,["loading"])])}}}),PSe=Be(kSe,[["__scopeId","data-v-c5f9ed82"]]),ry=Symbol(),Rk=Symbol(),az=Symbol(),CSe=()=>{const e=window.getSelection();e&&e.removeAllRanges()},ISe=e=>{const t=he(0),n=he(0),r=pt(),{canvasPercentage:i,canvasDragged:o}=Ve(r),{viewportRatio:a,viewportSize:s}=Ve(lt()),l=()=>{if(!e.value)return;const h=e.value.clientWidth,p=e.value.clientHeight;if(p/h>a.value){const v=h*(i.value/100);r.setCanvasScale(v/s.value),t.value=(h-v)/2,n.value=(p-v*a.value)/2}else{const v=p*(i.value/100);r.setCanvasScale(v/(s.value*a.value)),t.value=(h-v/a.value)/2,n.value=(p-v)/2}};Lt(i,(h,p)=>{if(!e.value)return;const v=e.value.clientWidth,g=e.value.clientHeight;if(g/v>a.value){const m=v*(h/100),y=v*(p/100),R=m*a.value,A=y*a.value;r.setCanvasScale(m/s.value),t.value=t.value-(m-y)/2,n.value=n.value-(R-A)/2}else{const m=g*(h/100),y=g*(p/100),R=m/a.value,A=y/a.value;r.setCanvasScale(m/(s.value*a.value)),t.value=t.value-(R-A)/2,n.value=n.value-(m-y)/2}}),Lt(a,l),Lt(s,l),Lt(o,()=>{o.value||l()});const c=Se(()=>({width:s.value,height:s.value*a.value,left:t.value,top:n.value})),f=new ResizeObserver(l);return Vt(()=>{e.value&&f.observe(e.value)}),Fn(()=>{e.value&&f.unobserve(e.value)}),{viewportStyles:c,dragViewport:h=>{let p=!0;const v=h.pageX,g=h.pageY,m=t.value,y=n.value;document.onmousemove=R=>{if(!p)return;const A=R.pageX,x=R.pageY;t.value=m+(A-v),n.value=y+(x-g)},document.onmouseup=()=>{p=!1,document.onmousemove=null,document.onmouseup=null,r.setCanvasDragged(!0)}}}},NSe=(e,t)=>{const n=pt(),{canvasScale:r,hiddenElementIdList:i}=Ve(n),o=he(!1),a=he(1),s=he({top:0,left:0,width:0,height:0});return{mouseSelection:s,mouseSelectionVisible:o,mouseSelectionQuadrant:a,updateMouseSelection:u=>{if(!t.value)return;let c=!0;const f=t.value.getBoundingClientRect(),d=5,h=u.pageX,p=u.pageY,v=(h-f.x)/r.value,g=(p-f.y)/r.value;s.value={top:g,left:v,width:0,height:0},o.value=!1,a.value=4,document.onmousemove=m=>{if(!c)return;const y=m.pageX,R=m.pageY,A=(y-h)/r.value,x=(R-p)/r.value,S=Math.abs(A),T=Math.abs(x);if(S0&&x>0?L=4:A<0&&x<0?L=2:A>0&&x<0?L=1:A<0&&x>0&&(L=3),s.value={...s.value,width:S,height:T},o.value=!0,a.value=L},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,c=!1;let m=[];for(let R=0;Rx&&MS&&kx-T&&MS-L&&kx&&MS-L&&kx-T&&MS&&k{if(R.groupId){const A=m.map(S=>S.id);return e.value.filter(S=>S.groupId===R.groupId).every(S=>A.includes(S.id))}return!0});const y=m.map(R=>R.id);n.setActiveElementIdList(y),o.value=!1}}}},FSe=e=>{const{disableHotkeys:t}=Ve(pt()),{createImageElement:n,createTextElement:r}=c0(),i=o=>{if(!o.dataTransfer||o.dataTransfer.items.length===0)return;const a=o.dataTransfer.items,s=a[0];let l=!1;for(const u of a)if(u.kind==="file"&&u.type.indexOf("image")!==-1){const c=u.getAsFile();c&&sd(c).then(f=>n(f)),l=!0}l||s.kind==="string"&&s.type==="text/plain"&&s.getAsString(u=>{if(t.value)return;const c=xx(u);r({left:0,top:0,width:600,height:50},{content:c})})};Vt(()=>{e.value&&e.value.addEventListener("drop",i),document.ondragleave=o=>o.preventDefault(),document.ondrop=o=>o.preventDefault(),document.ondragenter=o=>o.preventDefault(),document.ondragover=o=>o.preventDefault()}),Fn(()=>{e.value&&e.value.removeEventListener("drop",i),document.ondragleave=null,document.ondrop=null,document.ondragenter=null,document.ondragover=null})},ESe=(e,t)=>{const n=Math.atan2(e,t);return 180/Math.PI*n},sz=(e,t,n)=>{const r=lt(),{addHistorySnapshot:i}=rn();return{rotateElement:(a,s)=>{const l=!(a instanceof MouseEvent);if(l&&(!a.changedTouches||!a.changedTouches[0]))return;let u=!0,c=0;const f=s.rotate||0,d=s.left,h=s.top,p=s.width,v=s.height,g=d+p/2,m=h+v/2;if(!t.value)return;const y=t.value.getBoundingClientRect(),R=x=>{if(!u)return;const S=x instanceof MouseEvent?x.pageX:x.changedTouches[0].pageX,T=x instanceof MouseEvent?x.pageY:x.changedTouches[0].pageY,L=(S-y.left)/n.value,w=(T-y.top)/n.value,M=L-g,P=m-w;c=ESe(M,P);const k=5;Math.abs(c)<=k?c=0:c>0&&Math.abs(c-45)<=k?c-=c-45:c<0&&Math.abs(c+45)<=k?c-=c+45:c>0&&Math.abs(c-90)<=k?c-=c-90:c<0&&Math.abs(c+90)<=k?c-=c+90:c>0&&Math.abs(c-135)<=k?c-=c-135:c<0&&Math.abs(c+135)<=k?c-=c+135:c>0&&Math.abs(c-180)<=k?c-=c-180:c<0&&Math.abs(c+180)<=k&&(c-=c+180),e.value=e.value.map(F=>s.id===F.id?{...F,rotate:c}:F)},A=()=>{u=!1,document.onmousemove=null,document.onmouseup=null,f!==c&&(r.updateSlide({elements:e.value}),i())};l?(document.ontouchmove=R,document.ontouchend=A):(document.onmousemove=R,document.onmouseup=A)}}},Lg={text:"文本",image:"图片",shape:"形状",line:"线条",chart:"图表",table:"表格",video:"视频",audio:"音频",latex:"公式"},lz={text:40,image:20,shape:20,chart:200,table:30,video:250,audio:20,latex:20},MX=(e,t)=>{const{left:n,top:r,width:i,height:o}=e,a=Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/2,s=Math.atan(o/i)*180/Math.PI,l=(180-t-s)*Math.PI/180,u=(s-t)*Math.PI/180,c=(90-t)*Math.PI/180,f=t*Math.PI/180,d=i/2,h=o/2,p=n+d,v=r+h,g={left:p+a*Math.cos(l),top:v-a*Math.sin(l)},m={left:p+h*Math.cos(c),top:v-h*Math.sin(c)},y={left:p+a*Math.cos(u),top:v-a*Math.sin(u)},R={left:p+d*Math.cos(f),top:v+d*Math.sin(f)},A={left:p-a*Math.cos(l),top:v+a*Math.sin(l)},x={left:p-h*Math.sin(f),top:v+h*Math.cos(f)},S={left:p-a*Math.cos(u),top:v+a*Math.sin(u)},T={left:p-d*Math.cos(f),top:v-d*Math.sin(f)};return{leftTopPoint:g,topPoint:m,rightTopPoint:y,rightPoint:R,rightBottomPoint:A,bottomPoint:x,leftBottomPoint:S,leftPoint:T}},LX=(e,t)=>({[bt.RIGHT_BOTTOM]:t.leftTopPoint,[bt.LEFT_BOTTOM]:t.rightTopPoint,[bt.LEFT_TOP]:t.rightBottomPoint,[bt.RIGHT_TOP]:t.leftBottomPoint,[bt.TOP]:t.bottomPoint,[bt.BOTTOM]:t.topPoint,[bt.LEFT]:t.rightPoint,[bt.RIGHT]:t.leftPoint})[e],uz=(e,t,n)=>{const r=pt(),i=lt(),{activeElementIdList:o,activeGroupElementId:a}=Ve(r),{viewportRatio:s,viewportSize:l}=Ve(i),{ctrlOrShiftKeyActive:u}=Ve(vl()),{addHistorySnapshot:c}=rn();return{scaleElement:(h,p,v)=>{const g=!(h instanceof MouseEvent);if(g&&(!h.changedTouches||!h.changedTouches[0]))return;let m=!0;r.setScalingState(!0);const y=p.left,R=p.top,A=p.width,x=p.height,S=p.type==="table"?p.cellMinHeight:0,T="rotate"in p&&p.rotate?p.rotate:0,L=Math.PI*T/180,w=u.value||"fixedRatio"in p&&p.fixedRatio,M=A/x,P=g?h.changedTouches[0].pageX:h.pageX,k=g?h.changedTouches[0].pageY:h.pageY,F=lz[p.type]||20,C=(Q,K)=>{if(!w)return Q1&&(te=F*de),K==="width"?Q{const j=[];let de=!1,G=!1;const Ae={offsetX:0,offsetY:0};if(K||K===0)for(let ce=0;ce{if(!m)return;const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY,j=K-P,de=te-k;let G=A,Ae=x,ce=y,fe=R;if(T){const le=(Math.cos(L)*j+Math.sin(L)*de)/n.value;let $=(Math.cos(L)*de-Math.sin(L)*j)/n.value;w&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&($=le/M),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&($=-le/M)),v===bt.RIGHT_BOTTOM?(G=C(A+le,"width"),Ae=C(x+$,"height")):v===bt.LEFT_BOTTOM?(G=C(A-le,"width"),Ae=C(x+$,"height"),ce=y-(G-A)):v===bt.LEFT_TOP?(G=C(A-le,"width"),Ae=C(x-$,"height"),ce=y-(G-A),fe=R-(Ae-x)):v===bt.RIGHT_TOP?(G=C(A+le,"width"),Ae=C(x-$,"height"),fe=R-(Ae-x)):v===bt.TOP?(Ae=C(x-$,"height"),fe=R-(Ae-x)):v===bt.BOTTOM?Ae=C(x+$,"height"):v===bt.LEFT?(G=C(A-le,"width"),ce=y-(G-A)):v===bt.RIGHT&&(G=C(A+le,"width"));const X=MX({width:G,height:Ae,left:ce,top:fe},T),J=LX(v,X),se=J.left,ee=J.top,re=se-I,oe=ee-W;ce=ce-re,fe=fe-oe}else{let le=j/n.value,$=de/n.value;if(w&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&($=le/M),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&($=-le/M)),v===bt.RIGHT_BOTTOM){const{offsetX:X,offsetY:J}=ne(y+A+le,R+x+$);le=le-X,$=$-J,w&&(J?le=$*M:$=le/M),G=C(A+le,"width"),Ae=C(x+$,"height")}else if(v===bt.LEFT_BOTTOM){const{offsetX:X,offsetY:J}=ne(y+le,R+x+$);le=le-X,$=$-J,w&&(J?le=-$*M:$=-le/M),G=C(A-le,"width"),Ae=C(x+$,"height"),ce=y-(G-A)}else if(v===bt.LEFT_TOP){const{offsetX:X,offsetY:J}=ne(y+le,R+$);le=le-X,$=$-J,w&&(J?le=$*M:$=le/M),G=C(A-le,"width"),Ae=C(x-$,"height"),ce=y-(G-A),fe=R-(Ae-x)}else if(v===bt.RIGHT_TOP){const{offsetX:X,offsetY:J}=ne(y+A+le,R+$);le=le-X,$=$-J,w&&(J?le=-$*M:$=-le/M),G=C(A+le,"width"),Ae=C(x-$,"height"),fe=R-(Ae-x)}else if(v===bt.LEFT){const{offsetX:X}=ne(y+le,null);le=le-X,G=C(A-le,"width"),ce=y-(G-A)}else if(v===bt.RIGHT){const{offsetX:X}=ne(y+A+le,null);le=le-X,G=C(A+le,"width")}else if(v===bt.TOP){const{offsetY:X}=ne(null,R+$);$=$-X,Ae=C(x-$,"height"),fe=R-(Ae-x)}else if(v===bt.BOTTOM){const{offsetY:X}=ne(null,R+x+$);$=$-X,Ae=C(x+$,"height")}}e.value=e.value.map(le=>{if(p.id!==le.id)return le;if(le.type==="shape"&&"pathFormula"in le&&le.pathFormula){const $=u0[le.pathFormula];let X="";return"editable"in $?X=$.formula(G,Ae,le.keypoints):X=$.formula(G,Ae),{...le,left:ce,top:fe,width:G,height:Ae,viewBox:[G,Ae],path:X}}if(le.type==="table"){let $=S+(Ae-x)/le.data.length;return $=$<36?36:$,$===S?{...le,left:ce,width:G}:{...le,left:ce,top:fe,width:G,height:Ae,cellMinHeight:$<36?36:$}}return{...le,left:ce,top:fe,width:G,height:Ae}})},Y=Q=>{m=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;P===K&&k===te||(i.updateSlide({elements:e.value}),r.setScalingState(!1),c())};g?(document.ontouchmove=B,document.ontouchend=Y):(document.onmousemove=B,document.onmouseup=Y)},scaleMultiElement:(h,p,v)=>{let g=!0;const{minX:m,maxX:y,minY:R,maxY:A}=p,x=y-m,S=A-R,T=x/S,L=h.pageX,w=h.pageY,M=JSON.parse(JSON.stringify(e.value));document.onmousemove=P=>{if(!g)return;const k=P.pageX,F=P.pageY,C=(k-L)/n.value;let N=(F-w)/n.value;u.value&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&(N=C/T),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&(N=-C/T));let I=m,W=y,U=R,Z=A;v===bt.RIGHT_BOTTOM?(W=y+C,Z=A+N):v===bt.LEFT_BOTTOM?(I=m+C,Z=A+N):v===bt.LEFT_TOP?(I=m+C,U=R+N):v===bt.RIGHT_TOP?(W=y+C,U=R+N):v===bt.TOP?U=R+N:v===bt.BOTTOM?Z=A+N:v===bt.LEFT?I=m+C:v===bt.RIGHT&&(W=y+C);const ne=W-I,B=Z-U;let Y=ne/x,Q=B/S;Y<=0&&(Y=0),Q<=0&&(Q=0),e.value=e.value.map(K=>{if((K.type==="image"||K.type==="shape")&&o.value.includes(K.id)){const te=M.find(j=>j.id===K.id);return{...K,width:te.width*Y,height:te.height*Q,left:I+(te.left-m)*Y,top:U+(te.top-R)*Q}}return K})},document.onmouseup=P=>{g=!1,document.onmousemove=null,document.onmouseup=null,!(L===P.pageX&&w===P.pageY)&&(i.updateSlide({elements:e.value}),c())}}}},XSe=(e,t)=>{const n=pt(),{activeElementIdList:r,activeGroupElementId:i,handleElementId:o,editorAreaFocus:a}=Ve(n),{ctrlOrShiftKeyActive:s}=Ve(vl());return{selectElement:(u,c,f=!0)=>{if(a.value||n.setEditorareaFocus(!0),r.value.includes(c.id)){if(s.value){let d=[];if(c.groupId){const h=[];e.value.forEach(p=>{p.groupId===c.groupId&&h.push(p.id)}),d=r.value.filter(p=>!h.includes(p))}else d=r.value.filter(h=>h!==c.id);d.length>0&&n.setActiveElementIdList(d)}else if(o.value!==c.id)n.setHandleElementId(c.id);else if(i.value!==c.id){const d=u instanceof MouseEvent?u.pageX:u.changedTouches[0].pageX,h=u instanceof MouseEvent?u.pageY:u.changedTouches[0].pageY;u.target.onmouseup=p=>{const v=p.pageX,g=p.pageY;d===v&&h===g&&(n.setActiveGroupElementId(c.id),p.target.onmouseup=null)}}}else{let d=[];if(s.value?d=[...r.value,c.id]:d=[c.id],c.groupId){const h=[];e.value.forEach(p=>{p.groupId===c.groupId&&h.push(p.id)}),d=[...d,...h]}n.setActiveElementIdList(Yn.uniq(d)),n.setHandleElementId(c.id)}f&&t(u,c)}}},cz=(e,t,n)=>{const r=lt(),{activeElementIdList:i,activeGroupElementId:o}=Ve(pt()),{shiftKeyState:a}=Ve(vl()),{viewportRatio:s,viewportSize:l}=Ve(r),{addHistorySnapshot:u}=rn();return{dragElement:(f,d)=>{const h=!(f instanceof MouseEvent);if(h&&(!f.changedTouches||!f.changedTouches[0])||!i.value.includes(d.id))return;let p=!0;const v=l.value,g=l.value*s.value,m=5,R=JSON.parse(JSON.stringify(e.value)).filter(Q=>i.value.includes(Q.id)),A=d.left,x=d.top,S=d.width,T="height"in d&&d.height?d.height:0,L="rotate"in d&&d.rotate?d.rotate:0,w=h?f.changedTouches[0].pageX:f.pageX,M=h?f.changedTouches[0].pageY:f.pageY;let P=null;const k=d.id===o.value;let F=[],C=[];for(const Q of e.value){if(Q.type==="line"||k&&Q.id===d.id||!k&&i.value.includes(Q.id))continue;let K,te,j,de;if("rotate"in Q&&Q.rotate){const{xRange:re,yRange:oe}=ev({left:Q.left,top:Q.top,width:Q.width,height:Q.height,rotate:Q.rotate});K=re[0],te=oe[0],j=re[1]-re[0],de=oe[1]-oe[0]}else K=Q.left,te=Q.top,j=Q.width,de=Q.height;const G=K+j,Ae=te+de,ce=te+de/2,fe=K+j/2,le={value:te,range:[K,G]},$={value:Ae,range:[K,G]},X={value:ce,range:[K,G]},J={value:K,range:[te,Ae]},se={value:G,range:[te,Ae]},ee={value:fe,range:[te,Ae]};F.push(le,$,X),C.push(J,se,ee)}const N={value:0,range:[0,v]},I={value:g,range:[0,v]},W={value:g/2,range:[0,v]},U={value:0,range:[0,g]},Z={value:v,range:[0,g]},ne={value:v/2,range:[0,g]};F.push(N,I,W),C.push(U,Z,ne),F=bx(F),C=bx(C);const B=Q=>{const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;if(P!==!1&&(P=Math.abs(w-K)Math.abs(de)&&(de=0),Math.abs(j)oe.id===d.id?{...oe,left:G,top:Ae}:oe);else{const oe=e.value.find(pe=>pe.id===d.id);if(!oe)return;e.value=e.value.map(pe=>i.value.includes(pe.id)?pe.id===d.id?{...pe,left:G,top:Ae}:{...pe,left:pe.left+(G-oe.left),top:pe.top+(Ae-oe.top)}:pe)}},Y=Q=>{p=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;w===K&&M===te||(r.updateSlide({elements:e.value}),u())};h?(document.ontouchmove=B,document.ontouchend=Y):(document.onmousemove=B,document.onmouseup=Y)}}},WSe=e=>{const t=lt(),{canvasScale:n}=Ve(pt()),{ctrlOrShiftKeyActive:r}=Ve(vl()),{addHistorySnapshot:i}=rn();return{dragLineElement:(a,s,l)=>{let u=!0;const c=8,f=a.pageX,d=a.pageY,h=[];for(let p=0;p{if(!u)return;const v=p.pageX,g=p.pageY,m=(v-f)/n.value,y=(g-d)/n.value;let R=s.left+s.start[0],A=s.top+s.start[1],x=s.left+s.end[0],S=s.top+s.end[1];const T=s.broken||s.broken2||s.curve||[0,0];let L=s.left+T[0],w=s.top+T[1];const[M,P]=s.cubic||[[0,0],[0,0]];let k=s.left+M[0],F=s.top+M[1],C=s.left+P[0],N=s.top+P[1];if(l===Ho.START){R=R+m,A=A+y,Math.abs(R-x)x&&(ne[0]=U-I,B[0]=0),A>S&&(ne[1]=Z-W,B[1]=0),e.value=e.value.map(Y=>{if(Y.id===s.id){const Q={...Y,left:I,top:W,start:ne,end:B};return l===Ho.START||l===Ho.END?(r.value?(s.broken&&(Q.broken=[L-I,w-W]),s.curve&&(Q.curve=[L-I,w-W]),s.cubic&&(Q.cubic=[[k-I,F-W],[C-I,N-W]])):(s.broken&&(Q.broken=[(ne[0]+B[0])/2,(ne[1]+B[1])/2]),s.curve&&(Q.curve=[(ne[0]+B[0])/2,(ne[1]+B[1])/2]),s.cubic&&(Q.cubic=[[(ne[0]+B[0])/2,(ne[1]+B[1])/2],[(ne[0]+B[0])/2,(ne[1]+B[1])/2]])),s.broken2&&(Q.broken2=[(ne[0]+B[0])/2,(ne[1]+B[1])/2])):l===Ho.C?(s.broken&&(Q.broken=[L-I,w-W]),s.curve&&(Q.curve=[L-I,w-W]),s.broken2&&(U-I>=Z-W?Q.broken2=[L-I,Q.broken2[1]]:Q.broken2=[Q.broken2[0],w-W])):s.cubic&&(Q.cubic=[[k-I,F-W],[C-I,N-W]]),Q}return Y})},document.onmouseup=p=>{u=!1,document.onmousemove=null,document.onmouseup=null;const v=p.pageX,g=p.pageY;f===v&&d===g||(t.updateSlide({elements:e.value}),i())}}}},VSe=(e,t)=>{const n=lt(),{addHistorySnapshot:r}=rn();return{moveShapeKeypoint:(o,a,s=0)=>{const l=!(o instanceof MouseEvent);if(l&&(!o.changedTouches||!o.changedTouches[0]))return;let u=!0;const c=l?o.changedTouches[0].pageX:o.pageX,f=l?o.changedTouches[0].pageY:o.pageY,d=a.keypoints,h=u0[a.pathFormula];let p=null;if("editable"in h&&h.editable){const m=h.getBaseSize[s],y=h.range[s],R=h.relative[s],A=d[s],x=m(a.width,a.height),S=x*A,[T,L]=y;p={baseSize:x,originPos:S,min:T,max:L,relative:R}}const v=m=>{if(!u)return;const y=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,R=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY,A=(y-c)/t.value,x=(R-f)/t.value;e.value=e.value.map(S=>{if(S.id===a.id&&p){const{baseSize:T,originPos:L,min:w,max:M,relative:P}=p,k=S;let F=0;P==="center"?F=(L-A*2)/T:P==="left"?F=(L+A)/T:P==="right"?F=(L-A)/T:P==="top"?F=(L+x)/T:P==="bottom"?F=(L-x)/T:P==="left_bottom"?F=(L+A)/T:P==="right_bottom"?F=(L-A)/T:P==="top_right"?F=(L+x)/T:P==="bottom_right"&&(F=(L-x)/T),FM&&(F=M);let C=[];return Array.isArray(d)?(C=[...d],C[s]=F):C=[F],{...S,keypoints:C,path:h.formula(k.width,k.height,C)}}return S})},g=m=>{u=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;const y=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,R=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY;c===y&&f===R||(n.updateSlide({elements:e.value}),r())};l?(document.ontouchmove=v,document.ontouchend=g):(document.onmousemove=v,document.onmouseup=g)}}},DSe=e=>{const t=pt(),{canvasScale:n,creatingElement:r}=Ve(t),i=c=>{const{start:f,end:d}=c;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,v]=f,[g,m]=d,y=Math.min(p,g),R=Math.max(p,g),A=Math.min(v,m),x=Math.max(v,m),S=(y-h.x)/n.value,T=(A-h.y)/n.value,L=(R-y)/n.value,w=(x-A)/n.value;return{left:S,top:T,width:L,height:w}},o=c=>{const{start:f,end:d}=c;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,v]=f,[g,m]=d,y=Math.min(p,g),R=Math.max(p,g),A=Math.min(v,m),x=Math.max(v,m),S=(y-h.x)/n.value,T=(A-h.y)/n.value,L=(R-y)/n.value,w=(x-A)/n.value;return{left:S,top:T,start:[p===y?0:L,v===A?0:w],end:[g===y?0:L,m===A?0:w]}},{createTextElement:a,createShapeElement:s,createLineElement:l}=c0();return{formatCreateSelection:i,insertElementFromCreateSelection:c=>{if(!r.value)return;const f=r.value.type;if(f==="text"){const d=i(c);d&&a(d,{vertical:r.value.vertical})}else if(f==="shape"){const d=i(c);d&&s(d,r.value.data)}else if(f==="line"){const d=o(c);d&&l(d,r.value.data)}t.setCreatingElement(null)}}},g3=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=Ve(pt()),{currentSlide:r,viewportRatio:i,viewportSize:o}=Ve(e),{addHistorySnapshot:a}=rn();return{alignElementToCanvas:l=>{const u=o.value,c=o.value*i.value,{minX:f,maxX:d,minY:h,maxY:p}=qu(n.value),v=JSON.parse(JSON.stringify(r.value.elements));for(const g of v)if(t.value.includes(g.id)){if(l===vn.CENTER){const m=h+(p-h)/2-c/2,y=f+(d-f)/2-u/2;g.top=g.top-m,g.left=g.left-y}if(l===vn.TOP){const m=h-0;g.top=g.top-m}else if(l===vn.VERTICAL){const m=h+(p-h)/2-c/2;g.top=g.top-m}else if(l===vn.BOTTOM){const m=p-c;g.top=g.top-m}else if(l===vn.LEFT){const m=f-0;g.left=g.left-m}else if(l===vn.HORIZONTAL){const m=f+(d-f)/2-u/2;g.left=g.left-m}else if(l===vn.RIGHT){const m=d-u;g.left=g.left-m}}e.updateSlide({elements:v}),a()}}},fd=e=>({shadowStyle:Se(()=>{if(e.value){const{h:n,v:r,blur:i,color:o}=e.value;return`${n}px ${r}px ${i}px ${o}`}return""})}),m3=(e,t)=>({flipStyle:Se(()=>{let r="";return e.value&&t.value?r="rotateX(180deg) rotateY(180deg)":t.value?r="rotateX(180deg)":e.value&&(r="rotateY(180deg)"),r})});var fz=(e=>(e.RECT="rect",e.ELLIPSE="ellipse",e.POLYGON="polygon",e))(fz||{});const a6={rect:{name:"矩形",type:"rect",radius:"0",style:""},rect2:{name:"矩形2",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L 0 ${t} Z`},rect3:{name:"矩形3",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L ${e*.2} ${t} L 0 ${t*.8} Z`},roundRect:{name:"圆角矩形",type:"rect",radius:"10px",style:"inset(0 round 10px)"},ellipse:{name:"圆形",type:"ellipse",style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:"polygon",style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M ${e*.5} 0 L 0 ${t} L ${e} ${t} Z`},triangle2:{name:"三角形2",type:"polygon",style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:(e,t)=>`M ${e*.5} ${t} L 0 0 L ${e} 0 Z`},triangle3:{name:"三角形3",type:"polygon",style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M 0 0 L 0 ${t} L ${e} ${t} Z`},rhombus:{name:"菱形",type:"polygon",style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${t*.5} L ${e*.5} ${t} L 0 ${t*.5} Z`},pentagon:{name:"五边形",type:"polygon",style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${.38*t} L ${.82*e} ${t} L ${.18*e} ${t} L 0 ${.38*t} Z`},hexagon:{name:"六边形",type:"polygon",style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.2} 0 L ${e*.8} 0 L ${e} ${t*.5} L ${e*.8} ${t} L ${e*.2} ${t} L 0 ${t*.5} Z`},heptagon:{name:"七边形",type:"polygon",style:"polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e*.9} ${t*.2} L ${e} ${t*.6} L ${e*.75} ${t} L ${e*.25} ${t} L 0 ${t*.6} L ${e*.1} ${t*.2} Z`},octagon:{name:"八边形",type:"polygon",style:"polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e*.7} 0 L ${e} ${t*.3} L ${e} ${t*.7} L ${e*.7} ${t} L ${e*.3} ${t} L 0 ${t*.7} L 0 ${t*.3} Z`},chevron:{name:"V形",type:"polygon",style:"polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%)",createPath:(e,t)=>`M ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} L ${e*.25} ${t*.5} L 0 0 Z`},point:{name:"点",type:"polygon",style:"polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%)",createPath:(e,t)=>`M 0 0 L ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} Z`},arrow:{name:"箭头",type:"polygon",style:"polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%)",createPath:(e,t)=>`M 0 ${t*.2} L ${e*.6} ${t*.2} L ${e*.6} 0 L ${e} ${t*.5} L ${e*.6} ${t} L ${e*.6} ${t*.8} L 0 ${t*.8} Z`},parallelogram:{name:"平行四边形",type:"polygon",style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e} 0 L ${e*.7} ${t} L 0 ${t} Z`},parallelogram2:{name:"平行四边形2",type:"polygon",style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:(e,t)=>`M ${e*.3} ${t} L ${e} ${t} L ${e*.7} 0 L 0 0 Z`},trapezoid:{name:"梯形",type:"polygon",style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${t} L 0 ${t} Z`},trapezoid2:{name:"梯形2",type:"polygon",style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:(e,t)=>`M 0 0 L ${e} 0 L ${e*.75} ${t} L ${e*.25} ${t} Z`}},bk=e=>{const t=Se(()=>{let r=a6.rect;if(e.value.clip){const i=e.value.clip.shape||fz.RECT;r=a6[i]}return r.radius!==void 0&&e.value.radius&&(r={...r,radius:`${e.value.radius}px`,style:`inset(0 round ${e.value.radius}px)`}),r}),n=Se(()=>{if(!e.value.clip)return{top:"0",left:"0",width:"100%",height:"100%"};const[r,i]=e.value.clip.range,o=(i[0]-r[0])/100,a=(i[1]-r[1])/100,s=r[0]/o,l=r[1]/a;return{left:-s+"%",top:-l+"%",width:100/o+"%",height:100/a+"%"}});return{clipShape:t,imgPosition:n}},dz=e=>({filter:Se(()=>{if(!e.value)return"";let n="";const r=Object.keys(e.value);for(const i of r)n+=`${i}(${e.value[i]}) `;return n})}),jv=e=>{const t=Se(()=>{var o;return((o=e.value)==null?void 0:o.width)??0}),n=Se(()=>{var o;return((o=e.value)==null?void 0:o.style)||"solid"}),r=Se(()=>{var o;return((o=e.value)==null?void 0:o.color)||"#d14424"}),i=Se(()=>{const o=t.value;return n.value==="dashed"?o<=6?`${o*4.5} ${o*2}`:`${o*4} ${o*1.5}`:n.value==="dotted"?o<=6?`${o*1.8} ${o*1.6}`:`${o*1.5} ${o*1.2}`:"0 0"});return{outlineWidth:t,outlineStyle:n,outlineColor:r,strokeDashArray:i}},USe=["width","height"],BSe=["rx","ry","width","height","stroke","stroke-width","stroke-dasharray"],YSe=We({__name:"ImageRectOutline",props:{width:{},height:{},outline:{},radius:{default:"0"}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-rect-outline",overflow:"visible",width:o.width,height:o.height},[V("rect",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",rx:o.radius,ry:o.radius,width:o.width,height:o.height,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,BSe)],8,USe)):Ye("",!0)}}),ZSe=Be(YSe,[["__scopeId","data-v-09a0319c"]]),QSe=["width","height"],HSe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],KSe=We({__name:"ImageEllipseOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-ellipse-outline",overflow:"visible",width:o.width,height:o.height},[V("ellipse",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",cx:o.width/2,cy:o.height/2,rx:o.width/2,ry:o.height/2,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,HSe)],8,QSe)):Ye("",!0)}}),GSe=Be(KSe,[["__scopeId","data-v-19e68d74"]]),zSe=["width","height"],JSe=["d","stroke","stroke-width","stroke-dasharray"],$Se=We({__name:"ImagePolygonOutline",props:{width:{},height:{},createPath:{type:Function},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-polygon-outline",overflow:"visible",width:o.width,height:o.height},[V("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:o.createPath(o.width,o.height),stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,JSe)],8,zSe)):Ye("",!0)}}),jSe=Be($Se,[["__scopeId","data-v-a036b0a3"]]),qSe={class:"image-outline"},hz=We({__name:"index",props:{elementInfo:{}},setup(e){const t=e,n=Se(()=>t.elementInfo),{clipShape:r}=bk(n);return(i,o)=>(D(),q("div",qSe,[z(r).type==="rect"?(D(),_e(ZSe,{key:0,width:i.elementInfo.width,height:i.elementInfo.height,radius:z(r).radius,outline:i.elementInfo.outline},null,8,["width","height","radius","outline"])):z(r).type==="ellipse"?(D(),_e(GSe,{key:1,width:i.elementInfo.width,height:i.elementInfo.height,outline:i.elementInfo.outline},null,8,["width","height","outline"])):z(r).type==="polygon"?(D(),_e(jSe,{key:2,width:i.elementInfo.width,height:i.elementInfo.height,outline:i.elementInfo.outline,createPath:z(r).createPath},null,8,["width","height","outline","createPath"])):Ye("",!0)]))}}),pz=e=>(tn("data-v-31b3b0f9"),e=e(),nn(),e),e3e=["src"],t3e=["src"],n3e=["onMousedown"],r3e=pz(()=>V("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[V("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z"})],-1)),i3e=[r3e],o3e=["onMousedown"],a3e=pz(()=>V("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[V("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 4 L 16 4 Z"})],-1)),s3e=[a3e],l3e=We({__name:"ImageClipHandler",props:{src:{},clipPath:{},width:{},height:{},top:{},left:{},rotate:{},clipData:{}},emits:["clip"],setup(e,{emit:t}){const n=e,r=t,{canvasScale:i}=Ve(pt()),{ctrlOrShiftKeyActive:o}=Ve(vl()),a=he({top:"0",left:"0"}),s=he(!1),l=he(null),u=()=>{const[L,w]=n.clipData?n.clipData.range:[[0,0],[100,100]],M=(w[0]-L[0])/100,P=(w[1]-L[1])/100,k=L[0]/M,F=L[1]/P;return{widthScale:M,heightScale:P,left:k,top:F}},c=Se(()=>{const{widthScale:L,heightScale:w,left:M,top:P}=u();return{left:-M,top:-P,width:100/L,height:100/w}}),f=Se(()=>({top:c.value.top+"%",left:c.value.left+"%",width:c.value.width+"%",height:c.value.height+"%"})),d=he({top:0,left:0,width:0,height:0}),h=Se(()=>{const{top:L,left:w,width:M,height:P}=d.value;return{top:L+"%",left:w+"%",width:M+"%",height:P+"%"}}),p=Se(()=>{const L=c.value.width,w=c.value.height,{top:M,left:P,width:k,height:F}=d.value;return{left:-P*(100/k)+"%",top:-M*(100/F)+"%",width:L/k*100+"%",height:w/F*100+"%"}}),v=()=>{const{left:L,top:w}=u();d.value={left:L,top:w,width:100,height:100},a.value={top:-w+"%",left:-L+"%"}},g=()=>{if(s.value)return;if(!l.value){r("clip",null);return}const{left:L,top:w}=u(),M={left:(d.value.left-L)/100*n.width,top:(d.value.top-w)/100*n.height,width:(d.value.width-100)/100*n.width,height:(d.value.height-100)/100*n.height},P={range:l.value,position:M};r("clip",P)},m=L=>{L.key.toUpperCase()===At.ENTER&&g()};Vt(()=>{v(),document.addEventListener("keydown",m)}),Fn(()=>{document.removeEventListener("keydown",m)});const y=()=>{const L={left:parseInt(p.value.left),top:parseInt(p.value.top),width:parseInt(p.value.width),height:parseInt(p.value.height)},w=100/L.width,M=100/L.height,P=[-L.left*w,-L.top*M],k=[w*100+P[0],M*100+P[1]];l.value=[P,k]},R=L=>{s.value=!0;let w=!0;const M=L.pageX,P=L.pageY,k=c.value,F={...d.value};document.onmousemove=C=>{if(!w)return;const N=C.pageX,I=C.pageY,W=(N-M)/i.value,U=(I-P)/i.value,Z=Math.sqrt(W*W+U*U),B=Math.atan2(U,W)-n.rotate/180*Math.PI,Y=Z*Math.cos(B)/n.width*100,Q=Z*Math.sin(B)/n.height*100;let K=F.left+Y,te=F.top+Q;K<0?K=0:K+F.width>k.width&&(K=k.width-F.width),te<0?te=0:te+F.height>k.height&&(te=k.height-F.height),d.value={...d.value,left:K,top:te}},document.onmouseup=()=>{w=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>{s.value=!1},0)}},A=(L,w)=>{s.value=!0;let M=!0;const P=50/n.width*100,k=50/n.height*100,F=L.pageX,C=L.pageY,N=c.value,I={...d.value},W=d.value.width/d.value.height;document.onmousemove=U=>{if(!M)return;const Z=U.pageX,ne=U.pageY,B=(Z-F)/i.value,Y=(ne-C)/i.value,Q=Math.sqrt(B*B+Y*Y),te=Math.atan2(Y,B)-n.rotate/180*Math.PI;let j=Q*Math.cos(te)/n.width*100,de=Q*Math.sin(te)/n.height*100;o.value&&((w===bt.RIGHT_BOTTOM||w===bt.LEFT_TOP)&&(de=j/W),(w===bt.LEFT_BOTTOM||w===bt.RIGHT_TOP)&&(de=-j/W));let G,Ae,ce,fe;w===bt.LEFT_TOP?(I.left+j<0&&(j=-I.left),I.top+de<0&&(de=-I.top),I.width-jN.width&&(j=N.width-(I.left+I.width)),I.top+de<0&&(de=-I.top),I.width+j
N.height&&(de=N.height-(I.top+I.height)),I.width-j
N.width&&(j=N.width-(I.left+I.width)),I.top+I.height+de>N.height&&(de=N.height-(I.top+I.height)),I.width+j
N.height&&(de=N.height-(I.top+I.height)),I.height+deN.width&&(j=N.width-(I.left+I.width)),I.width+j{M=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>s.value=!1,0)}},x=Se(()=>{const L="rotate-",w=n.rotate;return w>-22.5&&w<=22.5?L+0:w>22.5&&w<=67.5?L+45:w>67.5&&w<=112.5?L+90:w>112.5&&w<=157.5?L+135:w>157.5||w<=-157.5?L+0:w>-157.5&&w<=-112.5?L+45:w>-112.5&&w<=-67.5?L+90:w>-67.5&&w<=-22.5?L+135:L+0}),S=[bt.LEFT_TOP,bt.RIGHT_TOP,bt.LEFT_BOTTOM,bt.RIGHT_BOTTOM],T=[bt.TOP,bt.BOTTOM,bt.LEFT,bt.RIGHT];return(L,w)=>{const M=Tn("click-outside");return Ge((D(),q("div",{class:"image-clip-handler",style:Le(a.value)},[V("img",{class:"bottom-img",src:L.src,draggable:!1,alt:"",style:Le(f.value)},null,12,e3e),V("div",{class:"top-image-content",style:Le({...h.value,clipPath:L.clipPath})},[V("img",{class:"top-img",src:L.src,draggable:!1,alt:"",style:Le(p.value)},null,12,t3e)],4),V("div",{class:"operate",style:Le(h.value),onMousedown:w[0]||(w[0]=Ft(P=>R(P),["stop"]))},[(D(),q(Xe,null,nt(S,P=>V("div",{class:ze(["clip-point",P,x.value]),key:P,onMousedown:Ft(k=>A(k,P),["stop"])},i3e,42,n3e)),64)),(D(),q(Xe,null,nt(T,P=>V("div",{class:ze(["clip-point",P,x.value]),key:P,onMousedown:Ft(k=>A(k,P),["stop"])},s3e,42,o3e)),64))],36)],4)),[[M,g]])}}}),u3e=Be(l3e,[["__scopeId","data-v-31b3b0f9"]]),c3e=["src"],f3e=We({__name:"index",props:{elementInfo:{},selectElement:{type:Function},contextmenus:{type:Function}},setup(e){const t=e,n=pt(),r=lt(),{clipingImageElementId:i}=Ve(n),o=Se(()=>i.value===t.elementInfo.id),{addHistorySnapshot:a}=rn(),s=Se(()=>t.elementInfo.shadow),{shadowStyle:l}=fd(s),u=Se(()=>t.elementInfo.flipH),c=Se(()=>t.elementInfo.flipV),{flipStyle:f}=m3(u,c),d=Se(()=>t.elementInfo),{clipShape:h,imgPosition:p}=bk(d),v=Se(()=>t.elementInfo.filters),{filter:g}=dz(v),m=R=>{t.elementInfo.lock||(R.stopPropagation(),t.selectElement(R,t.elementInfo))},y=R=>{if(n.setClipingImageElementId(""),!R)return;const{range:A,position:x}=R,S=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},T=t.elementInfo.left+x.left,L=t.elementInfo.top+x.top,w=t.elementInfo.width+x.width,M=t.elementInfo.height+x.height;let P=0,k=0;if(t.elementInfo.rotate){const C=T+w/2-(t.elementInfo.left+t.elementInfo.width/2),N=-(L+M/2-(t.elementInfo.top+t.elementInfo.height/2)),I=-t.elementInfo.rotate*Math.PI/180,W=C*Math.cos(I)-N*Math.sin(I),U=C*Math.sin(I)+N*Math.cos(I);P=W-C,k=-(U-N)}const F={clip:{...S,range:A},left:T+P,top:L+k,width:w,height:M};r.updateElement({id:t.elementInfo.id,props:F}),a()};return(R,A)=>{const x=Tn("contextmenu");return D(),q("div",{class:ze(["editable-element-image",{lock:R.elementInfo.lock}]),style:Le({top:R.elementInfo.top+"px",left:R.elementInfo.left+"px",width:R.elementInfo.width+"px",height:R.elementInfo.height+"px"})},[V("div",{class:"rotate-wrapper",style:Le({transform:`rotate(${R.elementInfo.rotate}deg)`})},[o.value?(D(),_e(u3e,{key:0,src:R.elementInfo.src,clipData:R.elementInfo.clip,width:R.elementInfo.width,height:R.elementInfo.height,top:R.elementInfo.top,left:R.elementInfo.left,rotate:R.elementInfo.rotate,clipPath:z(h).style,onClip:A[0]||(A[0]=S=>y(S))},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Ge((D(),q("div",{key:1,class:"element-content",style:Le({filter:z(l)?`drop-shadow(${z(l)})`:"",transform:z(f)}),onMousedown:A[2]||(A[2]=S=>m(S)),onTouchstart:A[3]||(A[3]=S=>m(S))},[O(hz,{elementInfo:R.elementInfo},null,8,["elementInfo"]),V("div",{class:"image-content",style:Le({clipPath:z(h).style})},[V("img",{src:R.elementInfo.src,draggable:!1,style:Le({top:z(p).top,left:z(p).left,width:z(p).width,height:z(p).height,filter:z(g)}),onDragstart:A[1]||(A[1]=Ft(()=>{},["prevent"])),alt:""},null,44,c3e),R.elementInfo.colorMask?(D(),q("div",{key:0,class:"color-mask",style:Le({backgroundColor:R.elementInfo.colorMask})},null,4)):Ye("",!0)],4)],36)),[[x,R.contextmenus]])],4)],6)}}}),vz=Be(f3e,[["__scopeId","data-v-86b9f3af"]]),d3e=["width","height"],h3e=["d","stroke","stroke-width","stroke-dasharray"],p3e=We({__name:"ElementOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"element-outline",overflow:"visible",width:o.width,height:o.height},[V("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:`M0,0 L${o.width},0 L${o.width},${o.height} L0,${o.height} Z`,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,h3e)],8,d3e)):Ye("",!0)}}),y3=Be(p3e,[["__scopeId","data-v-e2ef58f5"]]),Yi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},r2=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let s6=null;const Hu=function(e,t,n){let r=s6||(s6=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},v3e=function(){s6=null},qh=function(e,t,n,r){return n&&(TX(e,t,n,r,-1)||TX(e,t,n,r,1))},g3e=/^(img|br|input|textarea|hr)$/i;function TX(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Jl(e))){let o=e.parentNode;if(!o||o.nodeType!=1||iy(e)||g3e.test(e.nodeName)||e.contentEditable=="false")return!1;t=Yi(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Jl(e):0}else return!1}}function Jl(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function m3e(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Jl(e)}else if(e.parentNode&&!iy(e))t=Yi(e),e=e.parentNode;else return null}}function y3e(e,t){for(;;){if(e.nodeType==3&&t2),ds=Tv||(vu?/Mac/.test(vu.platform):!1),x3e=vu?/Win/.test(vu.platform):!1,il=/Android \d/.test(dd),oy=!!_X&&"webkitFontSmoothing"in _X.documentElement.style,S3e=oy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function w3e(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Du(e,t){return typeof e=="number"?e:e[t]}function M3e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function OX(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=r2(a)){if(a.nodeType!=1)continue;let s=a,l=s==o.body,u=l?w3e(o):M3e(s),c=0,f=0;if(t.topu.bottom-Du(r,"bottom")&&(f=t.bottom-t.top>u.bottom-u.top?t.top+Du(i,"top")-u.top:t.bottom-u.bottom+Du(i,"bottom")),t.leftu.right-Du(r,"right")&&(c=t.right-u.right+Du(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);let p=s.scrollLeft-d,v=s.scrollTop-h;t={left:t.left-p,top:t.top-v,right:t.right-p,bottom:t.bottom-v}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function L3e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a=n-20){r=s,i=l.top;break}}return{refDOM:r,refTop:i,stack:yz(e.dom)}}function yz(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=r2(r));return t}function T3e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Az(n,r==0?0:r-t)}function Az(e,t){for(let n=0;n=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);let v=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?O3e(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:Rz(n,i)}function O3e(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function xk(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function k3e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function C3e(e,t,n,r){let i=-1;for(let o=t,a=!1;o!=e.dom;){let s=e.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)){let l=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&(!a&&l.left>r.left||l.top>r.top?i=s.posBefore:(!a&&l.right-1?i:e.docView.posFromDOM(t,n,-1)}function bz(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let u;oy&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=C3e(e,r,i,t))}s==null&&(s=P3e(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function kX(e){return e.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,P1(tf(Hu(r,l,u),c),c<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Jl(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return k5(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Jl(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Hu(l,Jl(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return P1(tf(u,1),!1)}if(o==null&&i=0)}function P1(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function k5(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Sz(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function F3e(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Sz(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=xz(e,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Hu(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?a.top-c.top>(c.bottom-a.top)*2:c.bottom-a.bottom>(a.bottom-c.top)*2))return!1}}return!0})}const E3e=/[\u0590-\u08ac]/;function X3e(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=e.domSelection();return!E3e.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?o:a:Sz(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=e.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:v}=e.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==v;try{s.collapse(c,f),l&&(l!=c||u!=f)&&s.extend&&s.extend(l,u)}catch{}return d!=null&&(s.caretBidiLevel=d),g})}let PX=null,CX=null,IX=!1;function W3e(e,t,n){return PX==t&&CX==n?IX:(PX=t,CX=n,IX=n=="up"||n=="down"?F3e(e,t,n):X3e(e,t,n))}const ws=0,NX=1,gh=2,gu=3;class ay{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ws,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nYi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||a instanceof Mz){i=t-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof wz&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Yi(o.dom)+1:0}}else{let o,a=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=a;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Yi(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||s==this.children.length-1)){n=u;for(let c=s+1;ch&&a48<=e.charCodeAt(0)&&e.charCodeAt(0)<=57;class cbe extends UG{constructor(){super();Tr(this,"curNumber","");Tr(this,"curCommandType",-1);Tr(this,"curCommandRelative",!1);Tr(this,"canParseCommandOrComma",!0);Tr(this,"curNumberHasExp",!1);Tr(this,"curNumberHasExpDigits",!1);Tr(this,"curNumberHasDecimal",!1);Tr(this,"curArgs",[])}finish(n=[]){if(this.parse(" ",n),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return n}parse(n,r=[]){const i=o=>{r.push(o),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let o=0;ou)throw new SyntaxError(`Expected positive number, got "${u}" at index "${o}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${o}"`)}this.curArgs.push(u),this.curArgs.length===fbe[this.curCommandType]&&(ut.HORIZ_LINE_TO===this.curCommandType?i({type:ut.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):ut.VERT_LINE_TO===this.curCommandType?i({type:ut.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===ut.MOVE_TO||this.curCommandType===ut.LINE_TO||this.curCommandType===ut.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ut.MOVE_TO===this.curCommandType&&(this.curCommandType=ut.LINE_TO)):this.curCommandType===ut.CURVE_TO?i({type:ut.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ut.SMOOTH_CURVE_TO?i({type:ut.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ut.QUAD_TO?i({type:ut.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ut.ARC&&i({type:ut.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!ube(a)){if(a===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(a==="+"||a==="-"||a==="."){this.curNumber=a,this.curNumberHasDecimal=a===".";continue}if(l){this.curNumber=a,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${o}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${a}" at index ${o}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,a==="z"||a==="Z"){r.push({type:ut.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(a==="h"||a==="H")this.curCommandType=ut.HORIZ_LINE_TO,this.curCommandRelative=a==="h";else if(a==="v"||a==="V")this.curCommandType=ut.VERT_LINE_TO,this.curCommandRelative=a==="v";else if(a==="m"||a==="M")this.curCommandType=ut.MOVE_TO,this.curCommandRelative=a==="m";else if(a==="l"||a==="L")this.curCommandType=ut.LINE_TO,this.curCommandRelative=a==="l";else if(a==="c"||a==="C")this.curCommandType=ut.CURVE_TO,this.curCommandRelative=a==="c";else if(a==="s"||a==="S")this.curCommandType=ut.SMOOTH_CURVE_TO,this.curCommandRelative=a==="s";else if(a==="q"||a==="Q")this.curCommandType=ut.QUAD_TO,this.curCommandRelative=a==="q";else if(a==="t"||a==="T")this.curCommandType=ut.SMOOTH_QUAD_TO,this.curCommandRelative=a==="t";else if(a==="a"||a==="A")this.curCommandType=ut.ARC,this.curCommandRelative=a==="a";else throw new SyntaxError(`Unexpected character "${a}" at index ${o}.`)}}return r}transform(n){return Object.create(this,{parse:{value(i,o=[]){const a=Object.getPrototypeOf(this).parse.call(this,i);for(const s of a){const l=n(s);Array.isArray(l)?o.push(...l):o.push(l)}return o}}})}}const cr=class cr extends UG{constructor(n){super();Tr(this,"commands");typeof n=="string"?this.commands=cr.parse(n):this.commands=n}encode(){return cr.encode(this.commands)}getBounds(){const n=xi.CALCULATE_BOUNDS();return this.transform(n),n}transform(n){const r=[];for(const i of this.commands){const o=n(i);Array.isArray(o)?r.push(...o):r.push(o)}return this.commands=r,this}static encode(n){return HRe(n)}static parse(n){const r=new cbe,i=[];return r.parse(n,i),r.finish(i),i}};Tr(cr,"CLOSE_PATH",1),Tr(cr,"MOVE_TO",2),Tr(cr,"HORIZ_LINE_TO",4),Tr(cr,"VERT_LINE_TO",8),Tr(cr,"LINE_TO",16),Tr(cr,"CURVE_TO",32),Tr(cr,"SMOOTH_CURVE_TO",64),Tr(cr,"QUAD_TO",128),Tr(cr,"SMOOTH_QUAD_TO",256),Tr(cr,"ARC",512),Tr(cr,"LINE_COMMANDS",cr.LINE_TO|cr.HORIZ_LINE_TO|cr.VERT_LINE_TO),Tr(cr,"DRAWING_COMMANDS",cr.HORIZ_LINE_TO|cr.VERT_LINE_TO|cr.LINE_TO|cr.CURVE_TO|cr.SMOOTH_CURVE_TO|cr.QUAD_TO|cr.SMOOTH_QUAD_TO|cr.ARC);let ut=cr;const fbe={[ut.MOVE_TO]:2,[ut.LINE_TO]:2,[ut.HORIZ_LINE_TO]:1,[ut.VERT_LINE_TO]:1,[ut.CLOSE_PATH]:0,[ut.QUAD_TO]:4,[ut.SMOOTH_QUAD_TO]:2,[ut.CURVE_TO]:6,[ut.SMOOTH_CURVE_TO]:4,[ut.ARC]:7};var dbe=function(){function e(t,n){var r=[],i=!0,o=!1,a=void 0;try{for(var s=t[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),am=Math.PI*2,M5=function(t,n,r,i,o,a,s){var l=t.x,u=t.y;l*=n,u*=r;var c=i*l-o*u,f=o*l+i*u;return{x:c+a,y:f+s}},hbe=function(t,n){var r=n===1.5707963267948966?.551915024494:n===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(n/4),i=Math.cos(t),o=Math.sin(t),a=Math.cos(t+n),s=Math.sin(t+n);return[{x:i-o*r,y:o+i*r},{x:a+s*r,y:s-a*r},{x:a,y:s}]},iX=function(t,n,r,i){var o=t*i-n*r<0?-1:1,a=t*r+n*i;return a>1&&(a=1),a<-1&&(a=-1),o*Math.acos(a)},pbe=function(t,n,r,i,o,a,s,l,u,c,f,d){var h=Math.pow(o,2),p=Math.pow(a,2),v=Math.pow(f,2),g=Math.pow(d,2),m=h*p-h*g-p*v;m<0&&(m=0),m/=h*g+p*v,m=Math.sqrt(m)*(s===l?-1:1);var y=m*o/a*d,R=m*-a/o*f,A=c*y-u*R+(t+r)/2,x=u*y+c*R+(n+i)/2,S=(f-y)/o,T=(d-R)/a,L=(-f-y)/o,w=(-d-R)/a,M=iX(1,0,S,T),P=iX(S,T,L,w);return l===0&&P>0&&(P-=am),l===1&&P<0&&(P+=am),[A,x,M,P]},vbe=function(t){var n=t.px,r=t.py,i=t.cx,o=t.cy,a=t.rx,s=t.ry,l=t.xAxisRotation,u=l===void 0?0:l,c=t.largeArcFlag,f=c===void 0?0:c,d=t.sweepFlag,h=d===void 0?0:d,p=[];if(a===0||s===0)return[];var v=Math.sin(u*am/360),g=Math.cos(u*am/360),m=g*(n-i)/2+v*(r-o)/2,y=-v*(n-i)/2+g*(r-o)/2;if(m===0&&y===0)return[];a=Math.abs(a),s=Math.abs(s);var R=Math.pow(m,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(s,2);R>1&&(a*=Math.sqrt(R),s*=Math.sqrt(R));var A=pbe(n,r,i,o,a,s,f,h,v,g,m,y),x=dbe(A,4),S=x[0],T=x[1],L=x[2],w=x[3],M=Math.abs(w)/(am/4);Math.abs(1-M)<1e-7&&(M=1);var P=Math.max(Math.ceil(M),1);w/=P;for(var k=0;k{const t=new ut(e),n=[];for(const r of t.commands){const i=gbe[r.type];if((r.type===2||r.type===16)&&n.push({x:r.x,y:r.y,relative:r.relative,type:i}),r.type===32)n.push({x:r.x,y:r.y,curve:{type:"cubic",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},relative:r.relative,type:i});else if(r.type===128)n.push({x:r.x,y:r.y,curve:{type:"quadratic",x1:r.x1,y1:r.y1},relative:r.relative,type:i});else if(r.type===512){const o=n[n.length-1];if(!["M","L","Q","C"].includes(o.type))continue;const a=vbe({px:o.x,py:o.y,cx:r.x,cy:r.y,rx:r.rX,ry:r.rY,xAxisRotation:r.xRot,largeArcFlag:r.lArcFlag,sweepFlag:r.sweepFlag});for(const s of a)n.push({x:s.x,y:s.y,curve:{type:"cubic",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2},relative:!1,type:"C"})}else if(r.type===1)n.push({close:!0,type:i});else continue}return n},mbe=e=>{try{const t=new ut(e),n=[],r=[];for(const i of t.commands){const o="x"in i?i.x:0,a="y"in i?i.y:0;n.push(o),r.push(a)}return{minX:Math.min(...n),minY:Math.min(...r),maxX:Math.max(...n),maxY:Math.max(...r)}}catch{return{minX:0,minY:0,maxX:0,maxY:0}}},aX=(e,t)=>e.replace(/font-size:\s*([\d.]+)pt/g,(n,r)=>`font-size: ${(parseFloat(r)*t).toFixed(1)}px`),ybe=()=>{const e=lt(),{theme:t}=Ve(lt()),{addSlidesFromData:n}=Q2(),{isEmptySlide:r}=gc(),i=he(!1),o=(u,c=!1)=>{const f=u[0],d=new FileReader;d.addEventListener("load",()=>{try{const h=JSON.parse(PH(d.result));c?(e.updateSlideIndex(0),e.setSlides(h)):r.value?e.setSlides(h):n(h)}catch{hn.error("无法正确读取 / 解析该文件")}}),d.readAsText(f)},a=u=>{let c=[0,0],f=[0,0];!u.isFlipV&&!u.isFlipH?(c=[0,0],f=[u.width,u.height]):u.isFlipV&&u.isFlipH?(c=[u.width,u.height],f=[0,0]):u.isFlipV&&!u.isFlipH?(c=[0,u.height],f=[u.width,0]):(c=[u.width,0],f=[0,u.height]);const d={type:"line",id:Zt(10),width:u.borderWidth||1,left:u.left,top:u.top,start:c,end:f,style:u.borderType,color:u.borderColor,points:["",/straightConnector/.test(u.shapType)?"arrow":""]};return/bentConnector/.test(u.shapType)&&(d.broken2=[Math.abs(c[0]-f[0])/2,Math.abs(c[1]-f[1])/2]),d},s=(u,c,f,d,h,p,v)=>{const g=v*(Math.PI/180),m=u+f/2,y=c+d/2,R=h-f/2,A=p-d/2,x=R*Math.cos(g)+A*Math.sin(g),S=-R*Math.sin(g)+A*Math.cos(g),T=m+x,L=y+S;return{x:T,y:L}};return{importSpecificFile:o,importPPTXFile:u=>{const c=u[0];if(!c)return;i.value=!0;const f=[];for(const h of HO)f.push(...h.children);const d=new FileReader;d.onload=async h=>{const p=await IRe(h.target.result),v=96/72,g=p.size.width;e.setViewportSize(g*v);const m=[];for(const y of p.slides){const{type:R,value:A}=y.fill;let x;R==="image"?x={type:"image",image:{src:A.picBase64,size:"cover"}}:R==="gradient"?x={type:"gradient",gradient:{type:"linear",colors:A.colors.map(L=>({...L,pos:parseInt(L.pos)})),rotate:A.rot}}:x={type:"solid",color:A};const S={id:Zt(10),elements:[],background:x,remark:y.note||""},T=L=>{const w=L.sort((M,P)=>M.order-P.order);for(const M of w){const P=M.width||1,k=M.height||1,F=M.left,C=M.top;if(M.width=M.width*v,M.height=M.height*v,M.left=M.left*v,M.top=M.top*v,M.type==="text"){const N={type:"text",id:Zt(10),width:M.width,height:M.height,left:M.left,top:M.top,rotate:M.rotate,defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,content:aX(M.content,v),lineHeight:1,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType},fill:M.fillColor,vertical:M.isVertical};M.shadow&&(N.shadow={h:M.shadow.h*v,v:M.shadow.v*v,blur:M.shadow.blur*v,color:M.shadow.color}),S.elements.push(N)}else if(M.type==="image")S.elements.push({type:"image",id:Zt(10),src:M.src,width:M.width,height:M.height,left:M.left,top:M.top,fixedRatio:!0,rotate:M.rotate,flipH:M.isFlipH,flipV:M.isFlipV});else if(M.type==="audio")S.elements.push({type:"audio",id:Zt(10),src:M.blob,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,fixedRatio:!1,color:t.value.themeColor,loop:!1,autoplay:!1});else if(M.type==="video")S.elements.push({type:"video",id:Zt(10),src:M.blob||M.src,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,autoplay:!1});else if(M.type==="shape")if(M.shapType==="line"||/Connector/.test(M.shapType)){const N=a(M);S.elements.push(N)}else{const N=f.find(U=>U.pptxShapeType===M.shapType),I={mid:"middle",down:"bottom",up:"top"},W={type:"shape",id:Zt(10),width:M.width,height:M.height,left:M.left,top:M.top,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:M.fillColor||"none",fixedRatio:!1,rotate:M.rotate,outline:{color:M.borderColor,width:M.borderWidth,style:M.borderType},text:{content:aX(M.content,v),defaultFontName:t.value.fontName,defaultColor:t.value.fontColor,align:I[M.vAlign]||"middle"},flipH:M.isFlipH,flipV:M.isFlipV};if(M.shadow&&(W.shadow={h:M.shadow.h*v,v:M.shadow.v*v,blur:M.shadow.blur*v,color:M.shadow.color}),N&&(W.path=N.path,W.viewBox=N.viewBox,N.pathFormula)){W.pathFormula=N.pathFormula,W.viewBox=[M.width,M.height];const U=u0[N.pathFormula];"editable"in U&&U.editable?(W.path=U.formula(M.width,M.height,U.defaultValue),W.keypoints=U.defaultValue):W.path=U.formula(M.width,M.height)}if(M.shapType==="custom")if(M.path.indexOf("NaN")!==-1)W.path="";else{W.special=!0,W.path=M.path;const{maxX:U,maxY:Z}=mbe(W.path);W.viewBox=[U||P,Z||k]}W.path&&S.elements.push(W)}else if(M.type==="table"){const N=M.data.length,I=M.data[0].length,W={fontname:t.value.fontName,color:t.value.fontColor},U=[];for(let ne=0;ne`坐标${B+1}`),I=["X","Y"],W=M.data;else{const ne=M.data;N=Object.values(ne[0].xlabels),I=ne.map(B=>B.key),W=ne.map(B=>B.values.map(Y=>Y.y))}const U={};let Z="bar";switch(M.chartType){case"barChart":case"bar3DChart":Z="bar",M.barDir==="bar"&&(Z="column"),(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0);break;case"lineChart":case"line3DChart":(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0),Z="line";break;case"areaChart":case"area3DChart":(M.grouping==="stacked"||M.grouping==="percentStacked")&&(U.stack=!0),Z="area";break;case"scatterChart":case"bubbleChart":Z="scatter";break;case"pieChart":case"pie3DChart":Z="pie";break;case"radarChart":Z="radar";break;case"doughnutChart":Z="ring";break}S.elements.push({type:"chart",id:Zt(10),chartType:Z,width:M.width,height:M.height,left:M.left,top:M.top,rotate:0,themeColors:[t.value.themeColor],textColor:t.value.fontColor,data:{labels:N,legends:I,series:W},options:U})}else if(M.type==="group"){const N=M.elements.map(I=>{let W=I.left+F,U=I.top+C;if(M.rotate){const{x:Z,y:ne}=s(F,C,P,k,I.left,I.top,M.rotate);W=Z,U=ne}return{...I,left:W,top:U}});T(N)}else if(M.type==="diagram"){const N=M.elements.map(I=>({...I,left:I.left+F,top:I.top+C}));T(N)}}};T(y.elements),m.push(S)}e.updateSlideIndex(0),e.setSlides(m),i.value=!1},d.readAsArrayBuffer(c)},exporting:i}},Abe={class:"hotkey-doc"},Rbe={class:"title"},bbe={class:"label"},xbe={class:"value"},Sbe={key:1,class:"row"},wbe=We({__name:"HotkeyDoc",setup(e){return(t,n)=>(D(),q("div",Abe,[(D(!0),q(Xe,null,nt(z(Xme),r=>(D(),q(Xe,{key:r.type},[V("div",Rbe,ht(r.type),1),(D(!0),q(Xe,null,nt(r.children,i=>(D(),q("div",{class:"hotkey-item",key:i.label},[i.value?(D(),q(Xe,{key:0},[V("div",bbe,ht(i.label),1),V("div",xbe,ht(i.value),1)],64)):(D(),q("div",Sbe,ht(i.label),1))]))),128))],64))),128))]))}}),Mbe=Be(wbe,[["__scopeId","data-v-42fbe598"]]),Lbe=["accept"],Tbe=We({__name:"FileInput",props:{accept:{default:"image/*"}},emits:["change"],setup(e,{emit:t}){const n=t,r=he(),i=()=>{r.value&&(r.value.value="",r.value.click())},o=a=>{const s=a.target.files;s&&n("change",s)};return(a,s)=>(D(),q("div",{class:"file-input",onClick:s[1]||(s[1]=l=>i())},[ar(a.$slots,"default",{},void 0,!0),V("input",{class:"input",type:"file",name:"upload",ref_key:"inputRef",ref:r,accept:a.accept,onChange:s[0]||(s[0]=l=>o(l))},null,40,Lbe)]))}}),$h=Be(Tbe,[["__scopeId","data-v-1bd53d05"]]),_be=e=>(tn("data-v-cb40f98b"),e=e(),nn(),e),Obe={class:"spin"},kbe=_be(()=>V("div",{class:"spinner"},null,-1)),Pbe={class:"text"},Cbe=We({__name:"FullscreenSpin",props:{loading:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},tip:{default:""}},setup(e){return(t,n)=>t.loading?(D(),q("div",{key:0,class:ze(["fullscreen-spin",{mask:t.mask}])},[V("div",Obe,[kbe,V("div",Pbe,ht(t.tip),1)])],2)):Ye("",!0)}}),ey=Be(Cbe,[["__scopeId","data-v-cb40f98b"]]),Ibe={class:"header"},Nbe=We({__name:"Drawer",props:{visible:{type:Boolean},width:{default:320},contentStyle:{},placement:{default:"right"}},emits:["update:visible"],setup(e,{emit:t}){const n=e,r=t,i=he(!1),o=Se(()=>({width:n.width+"px",...n.contentStyle||{}}));return(a,s)=>{const l=xe("IconClose");return D(),_e(dO,{to:"body"},[O(Yh,{name:`drawer-slide-${a.placement}`,onAfterLeave:s[1]||(s[1]=u=>i.value=!1),onBeforeEnter:s[2]||(s[2]=u=>i.value=!0)},{default:ie(()=>[Ge(V("div",{class:ze(["drawer",a.placement]),style:Le({width:n.width+"px"})},[V("div",Ibe,[ar(a.$slots,"title",{},void 0,!0),V("span",{class:"close-btn",onClick:s[0]||(s[0]=u=>r("update:visible",!1))},[O(l)])]),i.value?(D(),q("div",{key:0,class:"content",style:Le(o.value)},[ar(a.$slots,"default",{},void 0,!0)],4)):Ye("",!0)],6),[[cc,a.visible]])]),_:3},8,["name"])])}}}),Fbe=Be(Nbe,[["__scopeId","data-v-46f39759"]]),Ebe={class:"prefix"},Xbe=["disabled","value","placeholder","maxlength"],Wbe={class:"suffix"},Vbe=We({__name:"Input",props:{value:{},disabled:{type:Boolean,default:!1},placeholder:{default:""},simple:{type:Boolean,default:!1},maxlength:{}},emits:["update:value","input","change","blur","focus","enter","backspace"],setup(e,{expose:t,emit:n}){const r=n,i=he(!1),o=c=>{r("update:value",c.target.value)},a=c=>{i.value=!1,r("blur",c)},s=c=>{i.value=!0,r("focus",c)},l=he();return t({focus:()=>{l.value&&l.value.focus()}}),(c,f)=>(D(),q("div",{class:ze(["input",{disabled:c.disabled,focused:i.value,simple:c.simple}])},[V("span",Ebe,[ar(c.$slots,"prefix",{},void 0,!0)]),V("input",{type:"text",ref_key:"inputRef",ref:l,disabled:c.disabled,value:c.value,placeholder:c.placeholder,maxlength:c.maxlength,onInput:f[0]||(f[0]=d=>o(d)),onFocus:f[1]||(f[1]=d=>s(d)),onBlur:f[2]||(f[2]=d=>a(d)),onChange:f[3]||(f[3]=d=>r("change",d)),onKeydown:[f[4]||(f[4]=dl(d=>r("enter",d),["enter"])),f[5]||(f[5]=dl(d=>r("backspace",d),["backspace"]))]},null,40,Xbe),V("span",Wbe,[ar(c.$slots,"suffix",{},void 0,!0)])],2))}}),hu=Be(Vbe,[["__scopeId","data-v-cc7e5c91"]]);var ia="top",_s="bottom",Os="right",oa="left",dk="auto",ty=[ia,_s,Os,oa],Sv="start",t2="end",Dbe="clippingParents",BG="viewport",k1="popper",Ube="reference",sX=ty.reduce(function(e,t){return e.concat([t+"-"+Sv,t+"-"+t2])},[]),YG=[].concat(ty,[dk]).reduce(function(e,t){return e.concat([t,t+"-"+Sv,t+"-"+t2])},[]),Bbe="beforeRead",Ybe="read",Zbe="afterRead",Qbe="beforeMain",Hbe="main",Kbe="afterMain",Gbe="beforeWrite",zbe="write",Jbe="afterWrite",$be=[Bbe,Ybe,Zbe,Qbe,Hbe,Kbe,Gbe,zbe,Jbe];function pu(e){return e?(e.nodeName||"").toLowerCase():null}function Za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function jh(e){var t=Za(e).Element;return e instanceof t||e instanceof Element}function Ss(e){var t=Za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hk(e){if(typeof ShadowRoot>"u")return!1;var t=Za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function jbe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Ss(o)||!pu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function qbe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!Ss(i)||!pu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const ZG={name:"applyStyles",enabled:!0,phase:"write",fn:jbe,effect:qbe,requires:["computeStyles"]};function su(e){return e.split("-")[0]}var Ch=Math.max,Fx=Math.min,wv=Math.round;function n6(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function QG(){return!/^((?!chrome|android).)*safari/i.test(n6())}function Mv(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Ss(e)&&(i=e.offsetWidth>0&&wv(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&wv(r.height)/e.offsetHeight||1);var a=jh(e)?Za(e):window,s=a.visualViewport,l=!QG()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:c,right:u+f,bottom:c+d,left:u,x:u,y:c}}function pk(e){var t=Mv(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function HG(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&hk(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function dc(e){return Za(e).getComputedStyle(e)}function exe(e){return["table","td","th"].indexOf(pu(e))>=0}function cd(e){return((jh(e)?e.ownerDocument:e.document)||window.document).documentElement}function p3(e){return pu(e)==="html"?e:e.assignedSlot||e.parentNode||(hk(e)?e.host:null)||cd(e)}function lX(e){return!Ss(e)||dc(e).position==="fixed"?null:e.offsetParent}function txe(e){var t=/firefox/i.test(n6()),n=/Trident/i.test(n6());if(n&&Ss(e)){var r=dc(e);if(r.position==="fixed")return null}var i=p3(e);for(hk(i)&&(i=i.host);Ss(i)&&["html","body"].indexOf(pu(i))<0;){var o=dc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ny(e){for(var t=Za(e),n=lX(e);n&&exe(n)&&dc(n).position==="static";)n=lX(n);return n&&(pu(n)==="html"||pu(n)==="body"&&dc(n).position==="static")?t:n||txe(e)||t}function vk(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sm(e,t,n){return Ch(e,Fx(t,n))}function nxe(e,t,n){var r=sm(e,t,n);return r>n?n:r}function KG(){return{top:0,right:0,bottom:0,left:0}}function GG(e){return Object.assign({},KG(),e)}function zG(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var rxe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,GG(typeof t!="number"?t:zG(t,ty))};function ixe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=su(n.placement),l=vk(s),u=[oa,Os].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=rxe(i.padding,n),d=pk(o),h=l==="y"?ia:oa,p=l==="y"?_s:Os,v=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],g=a[l]-n.rects.reference[l],m=ny(o),y=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,R=v/2-g/2,A=f[h],x=y-d[c]-f[p],S=y/2-d[c]/2+R,T=sm(A,S,x),L=l;n.modifiersData[r]=(t={},t[L]=T,t.centerOffset=T-S,t)}}function oxe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||HG(t.elements.popper,i)&&(t.elements.arrow=i))}const axe={name:"arrow",enabled:!0,phase:"main",fn:ixe,effect:oxe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Lv(e){return e.split("-")[1]}var sxe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function lxe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:wv(n*i)/i||0,y:wv(r*i)/i||0}}function uX(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,v=p===void 0?0:p,g=typeof c=="function"?c({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),R=oa,A=ia,x=window;if(u){var S=ny(n),T="clientHeight",L="clientWidth";if(S===Za(n)&&(S=cd(n),dc(S).position!=="static"&&s==="absolute"&&(T="scrollHeight",L="scrollWidth")),S=S,i===ia||(i===oa||i===Os)&&o===t2){A=_s;var w=f&&S===x&&x.visualViewport?x.visualViewport.height:S[T];v-=w-r.height,v*=l?1:-1}if(i===oa||(i===ia||i===_s)&&o===t2){R=Os;var M=f&&S===x&&x.visualViewport?x.visualViewport.width:S[L];h-=M-r.width,h*=l?1:-1}}var P=Object.assign({position:s},u&&sxe),k=c===!0?lxe({x:h,y:v},Za(n)):{x:h,y:v};if(h=k.x,v=k.y,l){var F;return Object.assign({},P,(F={},F[A]=y?"0":"",F[R]=m?"0":"",F.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",F))}return Object.assign({},P,(t={},t[A]=y?v+"px":"",t[R]=m?h+"px":"",t.transform="",t))}function uxe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:su(t.placement),variation:Lv(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,uX(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,uX(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const cxe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uxe,data:{}};var YA={passive:!0};function fxe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Za(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,YA)}),s&&l.addEventListener("resize",n.update,YA),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,YA)}),s&&l.removeEventListener("resize",n.update,YA)}}const dxe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fxe,data:{}};var hxe={left:"right",right:"left",bottom:"top",top:"bottom"};function mb(e){return e.replace(/left|right|bottom|top/g,function(t){return hxe[t]})}var pxe={start:"end",end:"start"};function cX(e){return e.replace(/start|end/g,function(t){return pxe[t]})}function gk(e){var t=Za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function mk(e){return Mv(cd(e)).left+gk(e).scrollLeft}function vxe(e,t){var n=Za(e),r=cd(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=QG();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+mk(e),y:l}}function gxe(e){var t,n=cd(e),r=gk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Ch(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ch(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+mk(e),l=-r.scrollTop;return dc(i||n).direction==="rtl"&&(s+=Ch(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function yk(e){var t=dc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function JG(e){return["html","body","#document"].indexOf(pu(e))>=0?e.ownerDocument.body:Ss(e)&&yk(e)?e:JG(p3(e))}function lm(e,t){var n;t===void 0&&(t=[]);var r=JG(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Za(r),a=i?[o].concat(o.visualViewport||[],yk(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(lm(p3(a)))}function r6(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function mxe(e,t){var n=Mv(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function fX(e,t,n){return t===BG?r6(vxe(e,n)):jh(t)?mxe(t,n):r6(gxe(cd(e)))}function yxe(e){var t=lm(p3(e)),n=["absolute","fixed"].indexOf(dc(e).position)>=0,r=n&&Ss(e)?ny(e):e;return jh(r)?t.filter(function(i){return jh(i)&&HG(i,r)&&pu(i)!=="body"}):[]}function Axe(e,t,n,r){var i=t==="clippingParents"?yxe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=fX(e,u,r);return l.top=Ch(c.top,l.top),l.right=Fx(c.right,l.right),l.bottom=Fx(c.bottom,l.bottom),l.left=Ch(c.left,l.left),l},fX(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function $G(e){var t=e.reference,n=e.element,r=e.placement,i=r?su(r):null,o=r?Lv(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case ia:l={x:a,y:t.y-n.height};break;case _s:l={x:a,y:t.y+t.height};break;case Os:l={x:t.x+t.width,y:s};break;case oa:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?vk(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Sv:l[u]=l[u]-(t[c]/2-n[c]/2);break;case t2:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function n2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?Dbe:s,u=n.rootBoundary,c=u===void 0?BG:u,f=n.elementContext,d=f===void 0?k1:f,h=n.altBoundary,p=h===void 0?!1:h,v=n.padding,g=v===void 0?0:v,m=GG(typeof g!="number"?g:zG(g,ty)),y=d===k1?Ube:k1,R=e.rects.popper,A=e.elements[p?y:d],x=Axe(jh(A)?A:A.contextElement||cd(e.elements.popper),l,c,a),S=Mv(e.elements.reference),T=$G({reference:S,element:R,strategy:"absolute",placement:i}),L=r6(Object.assign({},R,T)),w=d===k1?L:S,M={top:x.top-w.top+m.top,bottom:w.bottom-x.bottom+m.bottom,left:x.left-w.left+m.left,right:w.right-x.right+m.right},P=e.modifiersData.offset;if(d===k1&&P){var k=P[i];Object.keys(M).forEach(function(F){var C=[Os,_s].indexOf(F)>=0?1:-1,N=[ia,_s].indexOf(F)>=0?"y":"x";M[F]+=k[N]*C})}return M}function Rxe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?YG:l,c=Lv(r),f=c?s?sX:sX.filter(function(p){return Lv(p)===c}):ty,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,v){return p[v]=n2(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[su(v)],p},{});return Object.keys(h).sort(function(p,v){return h[p]-h[v]})}function bxe(e){if(su(e)===dk)return[];var t=mb(e);return[cX(e),t,cX(t)]}function xxe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,v=n.allowedAutoPlacements,g=t.options.placement,m=su(g),y=m===g,R=l||(y||!p?[mb(g)]:bxe(g)),A=[g].concat(R).reduce(function(K,te){return K.concat(su(te)===dk?Rxe(t,{placement:te,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:v}):te)},[]),x=t.rects.reference,S=t.rects.popper,T=new Map,L=!0,w=A[0],M=0;M=0,N=C?"width":"height",I=n2(t,{placement:P,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),W=C?F?Os:oa:F?_s:ia;x[N]>S[N]&&(W=mb(W));var U=mb(W),Z=[];if(o&&Z.push(I[k]<=0),s&&Z.push(I[W]<=0,I[U]<=0),Z.every(function(K){return K})){w=P,L=!1;break}T.set(P,Z)}if(L)for(var ne=p?3:1,B=function(te){var j=A.find(function(de){var G=T.get(de);if(G)return G.slice(0,te).every(function(Ae){return Ae})});if(j)return w=j,"break"},Y=ne;Y>0;Y--){var Q=B(Y);if(Q==="break")break}t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}const Sxe={name:"flip",enabled:!0,phase:"main",fn:xxe,requiresIfExists:["offset"],data:{_skip:!1}};function dX(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function hX(e){return[ia,Os,_s,oa].some(function(t){return e[t]>=0})}function wxe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=n2(t,{elementContext:"reference"}),s=n2(t,{altBoundary:!0}),l=dX(a,r),u=dX(s,i,o),c=hX(l),f=hX(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const Mxe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wxe};function Lxe(e,t,n){var r=su(e),i=[oa,ia].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[oa,Os].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function Txe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=YG.reduce(function(c,f){return c[f]=Lxe(f,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const _xe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Txe};function Oxe(e){var t=e.state,n=e.name;t.modifiersData[n]=$G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const kxe={name:"popperOffsets",enabled:!0,phase:"read",fn:Oxe,data:{}};function Pxe(e){return e==="x"?"y":"x"}function Cxe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,v=p===void 0?0:p,g=n2(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),m=su(t.placement),y=Lv(t.placement),R=!y,A=vk(m),x=Pxe(A),S=t.modifiersData.popperOffsets,T=t.rects.reference,L=t.rects.popper,w=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,M=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(S){if(o){var F,C=A==="y"?ia:oa,N=A==="y"?_s:Os,I=A==="y"?"height":"width",W=S[A],U=W+g[C],Z=W-g[N],ne=h?-L[I]/2:0,B=y===Sv?T[I]:L[I],Y=y===Sv?-L[I]:-T[I],Q=t.elements.arrow,K=h&&Q?pk(Q):{width:0,height:0},te=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:KG(),j=te[C],de=te[N],G=sm(0,T[I],K[I]),Ae=R?T[I]/2-ne-G-j-M.mainAxis:B-G-j-M.mainAxis,ce=R?-T[I]/2+ne+G+de+M.mainAxis:Y+G+de+M.mainAxis,fe=t.elements.arrow&&ny(t.elements.arrow),le=fe?A==="y"?fe.clientTop||0:fe.clientLeft||0:0,$=(F=P==null?void 0:P[A])!=null?F:0,X=W+Ae-$-le,J=W+ce-$,se=sm(h?Fx(U,X):U,W,h?Ch(Z,J):Z);S[A]=se,k[A]=se-W}if(s){var ee,re=A==="x"?ia:oa,oe=A==="x"?_s:Os,pe=S[x],ue=x==="y"?"height":"width",ge=pe+g[re],Re=pe-g[oe],Ee=[ia,oa].indexOf(m)!==-1,Ne=(ee=P==null?void 0:P[x])!=null?ee:0,He=Ee?ge:pe-T[ue]-L[ue]-Ne+M.altAxis,De=Ee?pe+T[ue]+L[ue]-Ne-M.altAxis:Re,we=h&&Ee?nxe(He,pe,De):sm(h?He:ge,pe,h?De:Re);S[x]=we,k[x]=we-pe}t.modifiersData[r]=k}}const Ixe={name:"preventOverflow",enabled:!0,phase:"main",fn:Cxe,requiresIfExists:["offset"]};function Nxe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Fxe(e){return e===Za(e)||!Ss(e)?gk(e):Nxe(e)}function Exe(e){var t=e.getBoundingClientRect(),n=wv(t.width)/e.offsetWidth||1,r=wv(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Xxe(e,t,n){n===void 0&&(n=!1);var r=Ss(t),i=Ss(t)&&Exe(t),o=cd(t),a=Mv(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((pu(t)!=="body"||yk(o))&&(s=Fxe(t)),Ss(t)?(l=Mv(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=mk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Wxe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Vxe(e){var t=Wxe(e);return $be.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Dxe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Uxe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var pX={placement:"bottom",modifiers:[],strategy:"absolute"};function vX(){for(var e=arguments.length,t=new Array(e),n=0;n-1}function nz(e,t){return typeof e=="function"?e.apply(void 0,t):e}function gX(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function Kxe(e){return e.split(/\s+/).filter(Boolean)}function Ap(e){return[].concat(e)}function mX(e,t){e.indexOf(t)===-1&&e.push(t)}function Gxe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function zxe(e){return e.split("-")[0]}function Ex(e){return[].slice.call(e)}function yX(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function um(){return document.createElement("div")}function v3(e){return["Element","Fragment"].some(function(t){return Ak(e,t)})}function Jxe(e){return Ak(e,"NodeList")}function $xe(e){return Ak(e,"MouseEvent")}function jxe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function qxe(e){return v3(e)?[e]:Jxe(e)?Ex(e):Array.isArray(e)?e:Ex(document.querySelectorAll(e))}function T5(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function AX(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function eSe(e){var t,n=Ap(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function tSe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,u=zxe(a.placement),c=a.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,d=u==="top"?c.bottom.y:0,h=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,v=o.top-r+f>l,g=r-o.bottom-d>l,m=o.left-n+h>l,y=n-o.right-p>l;return v||g||m||y})}function _5(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function RX(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Ql={isTouch:!1},bX=0;function nSe(){Ql.isTouch||(Ql.isTouch=!0,window.performance&&document.addEventListener("mousemove",rz))}function rz(){var e=performance.now();e-bX<20&&(Ql.isTouch=!1,document.removeEventListener("mousemove",rz)),bX=e}function rSe(){var e=document.activeElement;if(jxe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function iSe(){document.addEventListener("touchstart",nSe,rh),window.addEventListener("blur",rSe)}var oSe=typeof window<"u"&&typeof document<"u",aSe=oSe?!!window.msCrypto:!1,sSe={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},lSe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ul=Object.assign({appendTo:tz,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},sSe,lSe),uSe=Object.keys(ul),cSe=function(t){var n=Object.keys(t);n.forEach(function(r){ul[r]=t[r]})};function iz(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=ul[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function fSe(e,t){var n=t?Object.keys(iz(Object.assign({},ul,{plugins:t}))):uSe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function xX(e,t){var n=Object.assign({},t,{content:nz(t.content,[e])},t.ignoreAttributes?{}:fSe(e,t.plugins));return n.aria=Object.assign({},ul.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var dSe=function(){return"innerHTML"};function i6(e,t){e[dSe()]=t}function SX(e){var t=um();return e===!0?t.className=qG:(t.className=ez,v3(e)?t.appendChild(e):i6(t,e)),t}function wX(e,t){v3(t.content)?(i6(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?i6(e,t.content):e.textContent=t.content)}function o6(e){var t=e.firstElementChild,n=Ex(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(jG)}),arrow:n.find(function(r){return r.classList.contains(qG)||r.classList.contains(ez)}),backdrop:n.find(function(r){return r.classList.contains(Hxe)})}}function oz(e){var t=um(),n=um();n.className=Qxe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=um();r.className=jG,r.setAttribute("data-state","hidden"),wX(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=o6(t),l=s.box,u=s.content,c=s.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&wX(u,e.props),a.arrow?c?o.arrow!==a.arrow&&(l.removeChild(c),l.appendChild(SX(a.arrow))):l.appendChild(SX(a.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}oz.$$tippy=!0;var hSe=1,ZA=[],O5=[];function pSe(e,t){var n=xX(e,Object.assign({},ul,iz(yX(t)))),r,i,o,a=!1,s=!1,l=!1,u=!1,c,f,d,h=[],p=gX(X,n.interactiveDebounce),v,g=hSe++,m=null,y=Gxe(n.plugins),R={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},A={id:g,reference:e,popper:um(),popperInstance:m,props:n,state:R,plugins:y,clearDelayTimeouts:He,setProps:De,setContent:we,show:me,hide:Me,hideWithInteractivity:Ce,enable:Ee,disable:Ne,unmount:Qe,destroy:ot};if(!n.render)return A;var x=n.render(A),S=x.popper,T=x.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+A.id,A.popper=S,e._tippy=A,S._tippy=A;var L=y.map(function(ke){return ke.fn(A)}),w=e.hasAttribute("aria-expanded");return fe(),ne(),W(),U("onCreate",[A]),n.showOnCreate&&ge(),S.addEventListener("mouseenter",function(){A.props.interactive&&A.state.isVisible&&A.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){A.props.interactive&&A.props.trigger.indexOf("mouseenter")>=0&&C().addEventListener("mousemove",p)}),A;function M(){var ke=A.props.touch;return Array.isArray(ke)?ke:[ke,0]}function P(){return M()[0]==="hold"}function k(){var ke;return!!((ke=A.props.render)!=null&&ke.$$tippy)}function F(){return v||e}function C(){var ke=F().parentNode;return ke?eSe(ke):document}function N(){return o6(S)}function I(ke){return A.state.isMounted&&!A.state.isVisible||Ql.isTouch||c&&c.type==="focus"?0:L5(A.props.delay,ke?0:1,ul.delay)}function W(ke){ke===void 0&&(ke=!1),S.style.pointerEvents=A.props.interactive&&!ke?"":"none",S.style.zIndex=""+A.props.zIndex}function U(ke,je,tt){if(tt===void 0&&(tt=!0),L.forEach(function(dt){dt[ke]&&dt[ke].apply(dt,je)}),tt){var Rt;(Rt=A.props)[ke].apply(Rt,je)}}function Z(){var ke=A.props.aria;if(ke.content){var je="aria-"+ke.content,tt=S.id,Rt=Ap(A.props.triggerTarget||e);Rt.forEach(function(dt){var vt=dt.getAttribute(je);if(A.state.isVisible)dt.setAttribute(je,vt?vt+" "+tt:tt);else{var wt=vt&&vt.replace(tt,"").trim();wt?dt.setAttribute(je,wt):dt.removeAttribute(je)}})}}function ne(){if(!(w||!A.props.aria.expanded)){var ke=Ap(A.props.triggerTarget||e);ke.forEach(function(je){A.props.interactive?je.setAttribute("aria-expanded",A.state.isVisible&&je===F()?"true":"false"):je.removeAttribute("aria-expanded")})}}function B(){C().removeEventListener("mousemove",p),ZA=ZA.filter(function(ke){return ke!==p})}function Y(ke){if(!(Ql.isTouch&&(l||ke.type==="mousedown"))){var je=ke.composedPath&&ke.composedPath()[0]||ke.target;if(!(A.props.interactive&&RX(S,je))){if(Ap(A.props.triggerTarget||e).some(function(tt){return RX(tt,je)})){if(Ql.isTouch||A.state.isVisible&&A.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[A,ke]);A.props.hideOnClick===!0&&(A.clearDelayTimeouts(),A.hide(),s=!0,setTimeout(function(){s=!1}),A.state.isMounted||j())}}}function Q(){l=!0}function K(){l=!1}function te(){var ke=C();ke.addEventListener("mousedown",Y,!0),ke.addEventListener("touchend",Y,rh),ke.addEventListener("touchstart",K,rh),ke.addEventListener("touchmove",Q,rh)}function j(){var ke=C();ke.removeEventListener("mousedown",Y,!0),ke.removeEventListener("touchend",Y,rh),ke.removeEventListener("touchstart",K,rh),ke.removeEventListener("touchmove",Q,rh)}function de(ke,je){Ae(ke,function(){!A.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&je()})}function G(ke,je){Ae(ke,je)}function Ae(ke,je){var tt=N().box;function Rt(dt){dt.target===tt&&(_5(tt,"remove",Rt),je())}if(ke===0)return je();_5(tt,"remove",f),_5(tt,"add",Rt),f=Rt}function ce(ke,je,tt){tt===void 0&&(tt=!1);var Rt=Ap(A.props.triggerTarget||e);Rt.forEach(function(dt){dt.addEventListener(ke,je,tt),h.push({node:dt,eventType:ke,handler:je,options:tt})})}function fe(){P()&&(ce("touchstart",$,{passive:!0}),ce("touchend",J,{passive:!0})),Kxe(A.props.trigger).forEach(function(ke){if(ke!=="manual")switch(ce(ke,$),ke){case"mouseenter":ce("mouseleave",J);break;case"focus":ce(aSe?"focusout":"blur",se);break;case"focusin":ce("focusout",se);break}})}function le(){h.forEach(function(ke){var je=ke.node,tt=ke.eventType,Rt=ke.handler,dt=ke.options;je.removeEventListener(tt,Rt,dt)}),h=[]}function $(ke){var je,tt=!1;if(!(!A.state.isEnabled||ee(ke)||s)){var Rt=((je=c)==null?void 0:je.type)==="focus";c=ke,v=ke.currentTarget,ne(),!A.state.isVisible&&$xe(ke)&&ZA.forEach(function(dt){return dt(ke)}),ke.type==="click"&&(A.props.trigger.indexOf("mouseenter")<0||a)&&A.props.hideOnClick!==!1&&A.state.isVisible?tt=!0:ge(ke),ke.type==="click"&&(a=!tt),tt&&!Rt&&Re(ke)}}function X(ke){var je=ke.target,tt=F().contains(je)||S.contains(je);if(!(ke.type==="mousemove"&&tt)){var Rt=ue().concat(S).map(function(dt){var vt,wt=dt._tippy,Ut=(vt=wt.popperInstance)==null?void 0:vt.state;return Ut?{popperRect:dt.getBoundingClientRect(),popperState:Ut,props:n}:null}).filter(Boolean);tSe(Rt,ke)&&(B(),Re(ke))}}function J(ke){var je=ee(ke)||A.props.trigger.indexOf("click")>=0&&a;if(!je){if(A.props.interactive){A.hideWithInteractivity(ke);return}Re(ke)}}function se(ke){A.props.trigger.indexOf("focusin")<0&&ke.target!==F()||A.props.interactive&&ke.relatedTarget&&S.contains(ke.relatedTarget)||Re(ke)}function ee(ke){return Ql.isTouch?P()!==ke.type.indexOf("touch")>=0:!1}function re(){oe();var ke=A.props,je=ke.popperOptions,tt=ke.placement,Rt=ke.offset,dt=ke.getReferenceClientRect,vt=ke.moveTransition,wt=k()?o6(S).arrow:null,Ut=dt?{getBoundingClientRect:dt,contextElement:dt.contextElement||F()}:e,$t={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Sl){var Ji=Sl.state;if(k()){var y0=N(),vd=y0.box;["placement","reference-hidden","escaped"].forEach(function(Mu){Mu==="placement"?vd.setAttribute("data-placement",Ji.placement):Ji.attributes.popper["data-popper-"+Mu]?vd.setAttribute("data-"+Mu,""):vd.removeAttribute("data-"+Mu)}),Ji.attributes.popper={}}}},Zn=[{name:"offset",options:{offset:Rt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!vt}},$t];k()&&wt&&Zn.push({name:"arrow",options:{element:wt,padding:3}}),Zn.push.apply(Zn,(je==null?void 0:je.modifiers)||[]),A.popperInstance=Zxe(Ut,S,Object.assign({},je,{placement:tt,onFirstUpdate:d,modifiers:Zn}))}function oe(){A.popperInstance&&(A.popperInstance.destroy(),A.popperInstance=null)}function pe(){var ke=A.props.appendTo,je,tt=F();A.props.interactive&&ke===tz||ke==="parent"?je=tt.parentNode:je=nz(ke,[tt]),je.contains(S)||je.appendChild(S),A.state.isMounted=!0,re()}function ue(){return Ex(S.querySelectorAll("[data-tippy-root]"))}function ge(ke){A.clearDelayTimeouts(),ke&&U("onTrigger",[A,ke]),te();var je=I(!0),tt=M(),Rt=tt[0],dt=tt[1];Ql.isTouch&&Rt==="hold"&&dt&&(je=dt),je?r=setTimeout(function(){A.show()},je):A.show()}function Re(ke){if(A.clearDelayTimeouts(),U("onUntrigger",[A,ke]),!A.state.isVisible){j();return}if(!(A.props.trigger.indexOf("mouseenter")>=0&&A.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ke.type)>=0&&a)){var je=I(!1);je?i=setTimeout(function(){A.state.isVisible&&A.hide()},je):o=requestAnimationFrame(function(){A.hide()})}}function Ee(){A.state.isEnabled=!0}function Ne(){A.hide(),A.state.isEnabled=!1}function He(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function De(ke){if(!A.state.isDestroyed){U("onBeforeUpdate",[A,ke]),le();var je=A.props,tt=xX(e,Object.assign({},je,yX(ke),{ignoreAttributes:!0}));A.props=tt,fe(),je.interactiveDebounce!==tt.interactiveDebounce&&(B(),p=gX(X,tt.interactiveDebounce)),je.triggerTarget&&!tt.triggerTarget?Ap(je.triggerTarget).forEach(function(Rt){Rt.removeAttribute("aria-expanded")}):tt.triggerTarget&&e.removeAttribute("aria-expanded"),ne(),W(),T&&T(je,tt),A.popperInstance&&(re(),ue().forEach(function(Rt){requestAnimationFrame(Rt._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[A,ke])}}function we(ke){A.setProps({content:ke})}function me(){var ke=A.state.isVisible,je=A.state.isDestroyed,tt=!A.state.isEnabled,Rt=Ql.isTouch&&!A.props.touch,dt=L5(A.props.duration,0,ul.duration);if(!(ke||je||tt||Rt)&&!F().hasAttribute("disabled")&&(U("onShow",[A],!1),A.props.onShow(A)!==!1)){if(A.state.isVisible=!0,k()&&(S.style.visibility="visible"),W(),te(),A.state.isMounted||(S.style.transition="none"),k()){var vt=N(),wt=vt.box,Ut=vt.content;T5([wt,Ut],0)}d=function(){var Zn;if(!(!A.state.isVisible||u)){if(u=!0,S.offsetHeight,S.style.transition=A.props.moveTransition,k()&&A.props.animation){var Es=N(),Sl=Es.box,Ji=Es.content;T5([Sl,Ji],dt),AX([Sl,Ji],"visible")}Z(),ne(),mX(O5,A),(Zn=A.popperInstance)==null||Zn.forceUpdate(),U("onMount",[A]),A.props.animation&&k()&&G(dt,function(){A.state.isShown=!0,U("onShown",[A])})}},pe()}}function Me(){var ke=!A.state.isVisible,je=A.state.isDestroyed,tt=!A.state.isEnabled,Rt=L5(A.props.duration,1,ul.duration);if(!(ke||je||tt)&&(U("onHide",[A],!1),A.props.onHide(A)!==!1)){if(A.state.isVisible=!1,A.state.isShown=!1,u=!1,a=!1,k()&&(S.style.visibility="hidden"),B(),j(),W(!0),k()){var dt=N(),vt=dt.box,wt=dt.content;A.props.animation&&(T5([vt,wt],Rt),AX([vt,wt],"hidden"))}Z(),ne(),A.props.animation?k()&&de(Rt,A.unmount):A.unmount()}}function Ce(ke){C().addEventListener("mousemove",p),mX(ZA,p),p(ke)}function Qe(){A.state.isVisible&&A.hide(),A.state.isMounted&&(oe(),ue().forEach(function(ke){ke._tippy.unmount()}),S.parentNode&&S.parentNode.removeChild(S),O5=O5.filter(function(ke){return ke!==A}),A.state.isMounted=!1,U("onHidden",[A]))}function ot(){A.state.isDestroyed||(A.clearDelayTimeouts(),A.unmount(),le(),delete e._tippy,A.state.isDestroyed=!0,U("onDestroy",[A]))}}function h0(e,t){t===void 0&&(t={});var n=ul.plugins.concat(t.plugins||[]);iSe();var r=Object.assign({},t,{plugins:n}),i=qxe(e),o=i.reduce(function(a,s){var l=s&&pSe(s,r);return l&&a.push(l),a},[]);return v3(e)?o[0]:o}h0.defaultProps=ul;h0.setDefaultProps=cSe;h0.currentInput=Ql;Object.assign({},ZG,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});h0.setDefaultProps({render:oz});const vSe=We({__name:"Popover",props:{value:{type:Boolean,default:!1},trigger:{default:"click"},placement:{default:"bottom"},appendTo:{},contentStyle:{},center:{type:Boolean,default:!1},offset:{default:8}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=he(),o=he(),a=he(),s=he(!1),l=Se(()=>n.contentStyle||{});return Lt(()=>n.value,()=>{i.value&&(n.value?i.value.show():i.value.hide())}),Fn(()=>{i.value&&i.value.destroy()}),Vt(()=>{i.value=h0(o.value,{content:a.value,allowHTML:!0,trigger:n.trigger,placement:n.placement,interactive:!0,appendTo:n.appendTo||document.body,maxWidth:"none",offset:[0,n.offset],duration:200,animation:"scale",theme:"popover",onShow(){s.value=!0},onShown(){n.value||r("update:value",!0)},onHidden(){n.value&&r("update:value",!1),s.value=!1}})}),(u,c)=>(D(),q("div",{class:ze(["popover",{center:u.center}]),ref_key:"triggerRef",ref:o},[V("div",{class:"popover-content",style:Le(l.value),ref_key:"contentRef",ref:a},[s.value?ar(u.$slots,"content",{key:0},void 0,!0):Ye("",!0)],4),ar(u.$slots,"default",{},void 0,!0)],2))}}),Nt=Be(vSe,[["__scopeId","data-v-6a57fbcf"]]),gSe=We({__name:"PopoverMenuItem",props:{center:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=t;return(r,i)=>(D(),q("div",{class:ze(["popover-menu-item",{center:r.center}]),onClick:i[0]||(i[0]=o=>n("click"))},[ar(r.$slots,"default",{},void 0,!0)],2))}}),Zr=Be(gSe,[["__scopeId","data-v-1f176c16"]]),mSe=e=>(tn("data-v-4bbd9a87"),e=e(),nn(),e),ySe={class:"editor-header"},ASe={class:"left"},RSe={class:"menu-item"},bSe={class:"title"},xSe=["title"],SSe={class:"right"},wSe={class:"group-menu-item"},MSe={class:"arrow-btn"},LSe=mSe(()=>V("span",{class:"text ai"},"AI",-1)),TSe=[LSe],_Se={class:"github-link",href:"https://github.com/pipipi-pikachu/PPTist",target:"_blank"},OSe={class:"menu-item"},kSe=We({__name:"index",setup(e){const t=pt(),n=lt(),{title:r}=Ve(n),{enterScreening:i,enterScreeningFromStart:o}=ld(),{importSpecificFile:a,importPPTXFile:s,exporting:l}=ybe(),{resetSlides:u}=gc(),c=he(!1),f=he(!1),d=he(!1),h=he(),p=he(""),v=()=>{p.value=r.value,d.value=!0,Rr(()=>{var x;return(x=h.value)==null?void 0:x.focus()})},g=()=>{n.setTitle(p.value),d.value=!1},m=x=>{window.open(x),c.value=!1},y=x=>{t.setDialogForExport(x),c.value=!1},R=()=>{t.setMarkupPanelState(!0)},A=()=>{t.setAIPPTDialogState(!0)};return(x,S)=>{const T=xe("IconHamburgerButton"),L=xe("IconPpt"),w=xe("IconDown"),M=xe("IconDownload"),P=xe("IconGithub"),k=Tn("tooltip");return D(),q("div",ySe,[V("div",ASe,[O(Nt,{trigger:"click",placement:"bottom-start",value:c.value,"onUpdate:value":S[9]||(S[9]=F=>c.value=F)},{content:ie(()=>[O(Zr,{onClick:S[0]||(S[0]=F=>{A(),c.value=!1})},{default:ie(()=>[Ue("AI 生成 PPT(测试版)")]),_:1}),O($h,{accept:"application/vnd.openxmlformats-officedocument.presentationml.presentation",onChange:S[1]||(S[1]=F=>{z(s)(F),c.value=!1})},{default:ie(()=>[O(Zr,null,{default:ie(()=>[Ue("导入 pptx 文件(测试版)")]),_:1})]),_:1}),O($h,{accept:".pptist",onChange:S[2]||(S[2]=F=>{z(a)(F),c.value=!1})},{default:ie(()=>[O(Zr,null,{default:ie(()=>[Ue("导入 pptist 文件")]),_:1})]),_:1}),O(Zr,{onClick:S[3]||(S[3]=F=>y("pptx"))},{default:ie(()=>[Ue("导出文件")]),_:1}),O(Zr,{onClick:S[4]||(S[4]=F=>{z(u)(),c.value=!1})},{default:ie(()=>[Ue("重置幻灯片")]),_:1}),O(Zr,{onClick:S[5]||(S[5]=F=>{R(),c.value=!1})},{default:ie(()=>[Ue("幻灯片类型标注")]),_:1}),O(Zr,{onClick:S[6]||(S[6]=F=>m("https://github.com/pipipi-pikachu/PPTist/issues"))},{default:ie(()=>[Ue("意见反馈")]),_:1}),O(Zr,{onClick:S[7]||(S[7]=F=>m("https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md"))},{default:ie(()=>[Ue("常见问题")]),_:1}),O(Zr,{onClick:S[8]||(S[8]=F=>{c.value=!1,f.value=!0})},{default:ie(()=>[Ue("快捷操作")]),_:1})]),default:ie(()=>[V("div",RSe,[O(T,{class:"icon"})])]),_:1},8,["value"]),V("div",bSe,[d.value?(D(),_e(hu,{key:0,class:"title-input",ref_key:"titleInputRef",ref:h,value:p.value,"onUpdate:value":S[10]||(S[10]=F=>p.value=F),onBlur:S[11]||(S[11]=F=>g())},null,8,["value"])):(D(),q("div",{key:1,class:"title-text",onClick:S[12]||(S[12]=F=>v()),title:z(r)},ht(z(r)),9,xSe))])]),V("div",SSe,[V("div",wSe,[Ge((D(),q("div",{class:"menu-item",onClick:S[13]||(S[13]=F=>z(i)())},[O(L,{class:"icon"})])),[[k,"幻灯片放映(F5)"]]),O(Nt,{trigger:"click",center:""},{content:ie(()=>[O(Zr,{onClick:S[14]||(S[14]=F=>z(o)())},{default:ie(()=>[Ue("从头开始")]),_:1}),O(Zr,{onClick:S[15]||(S[15]=F=>z(i)())},{default:ie(()=>[Ue("从当前页开始")]),_:1})]),default:ie(()=>[V("div",MSe,[O(w,{class:"arrow"})])]),_:1})]),Ge((D(),q("div",{class:"menu-item",onClick:S[16]||(S[16]=F=>{A(),c.value=!1})},TSe)),[[k,"AI生成PPT"]]),Ge((D(),q("div",{class:"menu-item",onClick:S[17]||(S[17]=F=>y("pptx"))},[O(M,{class:"icon"})])),[[k,"导出"]]),Ge((D(),q("a",_Se,[V("div",OSe,[O(P,{class:"icon"})])])),[[k,"Copyright © 2020-PRESENT pipipi-pikachu"]])]),O(Fbe,{width:320,visible:f.value,"onUpdate:visible":S[18]||(S[18]=F=>f.value=F),placement:"right"},{title:ie(()=>[Ue("快捷操作")]),default:ie(()=>[O(Mbe)]),_:1},8,["visible"]),O(ey,{loading:z(l),tip:"正在导入..."},null,8,["loading"])])}}}),PSe=Be(kSe,[["__scopeId","data-v-4bbd9a87"]]),ry=Symbol(),Rk=Symbol(),az=Symbol(),CSe=()=>{const e=window.getSelection();e&&e.removeAllRanges()},ISe=e=>{const t=he(0),n=he(0),r=pt(),{canvasPercentage:i,canvasDragged:o}=Ve(r),{viewportRatio:a,viewportSize:s}=Ve(lt()),l=()=>{if(!e.value)return;const h=e.value.clientWidth,p=e.value.clientHeight;if(p/h>a.value){const v=h*(i.value/100);r.setCanvasScale(v/s.value),t.value=(h-v)/2,n.value=(p-v*a.value)/2}else{const v=p*(i.value/100);r.setCanvasScale(v/(s.value*a.value)),t.value=(h-v/a.value)/2,n.value=(p-v)/2}};Lt(i,(h,p)=>{if(!e.value)return;const v=e.value.clientWidth,g=e.value.clientHeight;if(g/v>a.value){const m=v*(h/100),y=v*(p/100),R=m*a.value,A=y*a.value;r.setCanvasScale(m/s.value),t.value=t.value-(m-y)/2,n.value=n.value-(R-A)/2}else{const m=g*(h/100),y=g*(p/100),R=m/a.value,A=y/a.value;r.setCanvasScale(m/(s.value*a.value)),t.value=t.value-(R-A)/2,n.value=n.value-(m-y)/2}}),Lt(a,l),Lt(s,l),Lt(o,()=>{o.value||l()});const c=Se(()=>({width:s.value,height:s.value*a.value,left:t.value,top:n.value})),f=new ResizeObserver(l);return Vt(()=>{e.value&&f.observe(e.value)}),Fn(()=>{e.value&&f.unobserve(e.value)}),{viewportStyles:c,dragViewport:h=>{let p=!0;const v=h.pageX,g=h.pageY,m=t.value,y=n.value;document.onmousemove=R=>{if(!p)return;const A=R.pageX,x=R.pageY;t.value=m+(A-v),n.value=y+(x-g)},document.onmouseup=()=>{p=!1,document.onmousemove=null,document.onmouseup=null,r.setCanvasDragged(!0)}}}},NSe=(e,t)=>{const n=pt(),{canvasScale:r,hiddenElementIdList:i}=Ve(n),o=he(!1),a=he(1),s=he({top:0,left:0,width:0,height:0});return{mouseSelection:s,mouseSelectionVisible:o,mouseSelectionQuadrant:a,updateMouseSelection:u=>{if(!t.value)return;let c=!0;const f=t.value.getBoundingClientRect(),d=5,h=u.pageX,p=u.pageY,v=(h-f.x)/r.value,g=(p-f.y)/r.value;s.value={top:g,left:v,width:0,height:0},o.value=!1,a.value=4,document.onmousemove=m=>{if(!c)return;const y=m.pageX,R=m.pageY,A=(y-h)/r.value,x=(R-p)/r.value,S=Math.abs(A),T=Math.abs(x);if(S0&&x>0?L=4:A<0&&x<0?L=2:A>0&&x<0?L=1:A<0&&x>0&&(L=3),s.value={...s.value,width:S,height:T},o.value=!0,a.value=L},document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,c=!1;let m=[];for(let R=0;Rx&&MS&&kx-T&&MS-L&&kx&&MS-L&&kx-T&&MS&&k{if(R.groupId){const A=m.map(S=>S.id);return e.value.filter(S=>S.groupId===R.groupId).every(S=>A.includes(S.id))}return!0});const y=m.map(R=>R.id);n.setActiveElementIdList(y),o.value=!1}}}},FSe=e=>{const{disableHotkeys:t}=Ve(pt()),{createImageElement:n,createTextElement:r}=c0(),i=o=>{if(!o.dataTransfer||o.dataTransfer.items.length===0)return;const a=o.dataTransfer.items,s=a[0];let l=!1;for(const u of a)if(u.kind==="file"&&u.type.indexOf("image")!==-1){const c=u.getAsFile();c&&sd(c).then(f=>n(f)),l=!0}l||s.kind==="string"&&s.type==="text/plain"&&s.getAsString(u=>{if(t.value)return;const c=xx(u);r({left:0,top:0,width:600,height:50},{content:c})})};Vt(()=>{e.value&&e.value.addEventListener("drop",i),document.ondragleave=o=>o.preventDefault(),document.ondrop=o=>o.preventDefault(),document.ondragenter=o=>o.preventDefault(),document.ondragover=o=>o.preventDefault()}),Fn(()=>{e.value&&e.value.removeEventListener("drop",i),document.ondragleave=null,document.ondrop=null,document.ondragenter=null,document.ondragover=null})},ESe=(e,t)=>{const n=Math.atan2(e,t);return 180/Math.PI*n},sz=(e,t,n)=>{const r=lt(),{addHistorySnapshot:i}=rn();return{rotateElement:(a,s)=>{const l=!(a instanceof MouseEvent);if(l&&(!a.changedTouches||!a.changedTouches[0]))return;let u=!0,c=0;const f=s.rotate||0,d=s.left,h=s.top,p=s.width,v=s.height,g=d+p/2,m=h+v/2;if(!t.value)return;const y=t.value.getBoundingClientRect(),R=x=>{if(!u)return;const S=x instanceof MouseEvent?x.pageX:x.changedTouches[0].pageX,T=x instanceof MouseEvent?x.pageY:x.changedTouches[0].pageY,L=(S-y.left)/n.value,w=(T-y.top)/n.value,M=L-g,P=m-w;c=ESe(M,P);const k=5;Math.abs(c)<=k?c=0:c>0&&Math.abs(c-45)<=k?c-=c-45:c<0&&Math.abs(c+45)<=k?c-=c+45:c>0&&Math.abs(c-90)<=k?c-=c-90:c<0&&Math.abs(c+90)<=k?c-=c+90:c>0&&Math.abs(c-135)<=k?c-=c-135:c<0&&Math.abs(c+135)<=k?c-=c+135:c>0&&Math.abs(c-180)<=k?c-=c-180:c<0&&Math.abs(c+180)<=k&&(c-=c+180),e.value=e.value.map(F=>s.id===F.id?{...F,rotate:c}:F)},A=()=>{u=!1,document.onmousemove=null,document.onmouseup=null,f!==c&&(r.updateSlide({elements:e.value}),i())};l?(document.ontouchmove=R,document.ontouchend=A):(document.onmousemove=R,document.onmouseup=A)}}},Lg={text:"文本",image:"图片",shape:"形状",line:"线条",chart:"图表",table:"表格",video:"视频",audio:"音频",latex:"公式"},lz={text:40,image:20,shape:20,chart:200,table:30,video:250,audio:20,latex:20},MX=(e,t)=>{const{left:n,top:r,width:i,height:o}=e,a=Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/2,s=Math.atan(o/i)*180/Math.PI,l=(180-t-s)*Math.PI/180,u=(s-t)*Math.PI/180,c=(90-t)*Math.PI/180,f=t*Math.PI/180,d=i/2,h=o/2,p=n+d,v=r+h,g={left:p+a*Math.cos(l),top:v-a*Math.sin(l)},m={left:p+h*Math.cos(c),top:v-h*Math.sin(c)},y={left:p+a*Math.cos(u),top:v-a*Math.sin(u)},R={left:p+d*Math.cos(f),top:v+d*Math.sin(f)},A={left:p-a*Math.cos(l),top:v+a*Math.sin(l)},x={left:p-h*Math.sin(f),top:v+h*Math.cos(f)},S={left:p-a*Math.cos(u),top:v+a*Math.sin(u)},T={left:p-d*Math.cos(f),top:v-d*Math.sin(f)};return{leftTopPoint:g,topPoint:m,rightTopPoint:y,rightPoint:R,rightBottomPoint:A,bottomPoint:x,leftBottomPoint:S,leftPoint:T}},LX=(e,t)=>({[bt.RIGHT_BOTTOM]:t.leftTopPoint,[bt.LEFT_BOTTOM]:t.rightTopPoint,[bt.LEFT_TOP]:t.rightBottomPoint,[bt.RIGHT_TOP]:t.leftBottomPoint,[bt.TOP]:t.bottomPoint,[bt.BOTTOM]:t.topPoint,[bt.LEFT]:t.rightPoint,[bt.RIGHT]:t.leftPoint})[e],uz=(e,t,n)=>{const r=pt(),i=lt(),{activeElementIdList:o,activeGroupElementId:a}=Ve(r),{viewportRatio:s,viewportSize:l}=Ve(i),{ctrlOrShiftKeyActive:u}=Ve(vl()),{addHistorySnapshot:c}=rn();return{scaleElement:(h,p,v)=>{const g=!(h instanceof MouseEvent);if(g&&(!h.changedTouches||!h.changedTouches[0]))return;let m=!0;r.setScalingState(!0);const y=p.left,R=p.top,A=p.width,x=p.height,S=p.type==="table"?p.cellMinHeight:0,T="rotate"in p&&p.rotate?p.rotate:0,L=Math.PI*T/180,w=u.value||"fixedRatio"in p&&p.fixedRatio,M=A/x,P=g?h.changedTouches[0].pageX:h.pageX,k=g?h.changedTouches[0].pageY:h.pageY,F=lz[p.type]||20,C=(Q,K)=>{if(!w)return Q1&&(te=F*de),K==="width"?Q{const j=[];let de=!1,G=!1;const Ae={offsetX:0,offsetY:0};if(K||K===0)for(let ce=0;ce{if(!m)return;const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY,j=K-P,de=te-k;let G=A,Ae=x,ce=y,fe=R;if(T){const le=(Math.cos(L)*j+Math.sin(L)*de)/n.value;let $=(Math.cos(L)*de-Math.sin(L)*j)/n.value;w&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&($=le/M),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&($=-le/M)),v===bt.RIGHT_BOTTOM?(G=C(A+le,"width"),Ae=C(x+$,"height")):v===bt.LEFT_BOTTOM?(G=C(A-le,"width"),Ae=C(x+$,"height"),ce=y-(G-A)):v===bt.LEFT_TOP?(G=C(A-le,"width"),Ae=C(x-$,"height"),ce=y-(G-A),fe=R-(Ae-x)):v===bt.RIGHT_TOP?(G=C(A+le,"width"),Ae=C(x-$,"height"),fe=R-(Ae-x)):v===bt.TOP?(Ae=C(x-$,"height"),fe=R-(Ae-x)):v===bt.BOTTOM?Ae=C(x+$,"height"):v===bt.LEFT?(G=C(A-le,"width"),ce=y-(G-A)):v===bt.RIGHT&&(G=C(A+le,"width"));const X=MX({width:G,height:Ae,left:ce,top:fe},T),J=LX(v,X),se=J.left,ee=J.top,re=se-I,oe=ee-W;ce=ce-re,fe=fe-oe}else{let le=j/n.value,$=de/n.value;if(w&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&($=le/M),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&($=-le/M)),v===bt.RIGHT_BOTTOM){const{offsetX:X,offsetY:J}=ne(y+A+le,R+x+$);le=le-X,$=$-J,w&&(J?le=$*M:$=le/M),G=C(A+le,"width"),Ae=C(x+$,"height")}else if(v===bt.LEFT_BOTTOM){const{offsetX:X,offsetY:J}=ne(y+le,R+x+$);le=le-X,$=$-J,w&&(J?le=-$*M:$=-le/M),G=C(A-le,"width"),Ae=C(x+$,"height"),ce=y-(G-A)}else if(v===bt.LEFT_TOP){const{offsetX:X,offsetY:J}=ne(y+le,R+$);le=le-X,$=$-J,w&&(J?le=$*M:$=le/M),G=C(A-le,"width"),Ae=C(x-$,"height"),ce=y-(G-A),fe=R-(Ae-x)}else if(v===bt.RIGHT_TOP){const{offsetX:X,offsetY:J}=ne(y+A+le,R+$);le=le-X,$=$-J,w&&(J?le=-$*M:$=-le/M),G=C(A+le,"width"),Ae=C(x-$,"height"),fe=R-(Ae-x)}else if(v===bt.LEFT){const{offsetX:X}=ne(y+le,null);le=le-X,G=C(A-le,"width"),ce=y-(G-A)}else if(v===bt.RIGHT){const{offsetX:X}=ne(y+A+le,null);le=le-X,G=C(A+le,"width")}else if(v===bt.TOP){const{offsetY:X}=ne(null,R+$);$=$-X,Ae=C(x-$,"height"),fe=R-(Ae-x)}else if(v===bt.BOTTOM){const{offsetY:X}=ne(null,R+x+$);$=$-X,Ae=C(x+$,"height")}}e.value=e.value.map(le=>{if(p.id!==le.id)return le;if(le.type==="shape"&&"pathFormula"in le&&le.pathFormula){const $=u0[le.pathFormula];let X="";return"editable"in $?X=$.formula(G,Ae,le.keypoints):X=$.formula(G,Ae),{...le,left:ce,top:fe,width:G,height:Ae,viewBox:[G,Ae],path:X}}if(le.type==="table"){let $=S+(Ae-x)/le.data.length;return $=$<36?36:$,$===S?{...le,left:ce,width:G}:{...le,left:ce,top:fe,width:G,height:Ae,cellMinHeight:$<36?36:$}}return{...le,left:ce,top:fe,width:G,height:Ae}})},Y=Q=>{m=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;P===K&&k===te||(i.updateSlide({elements:e.value}),r.setScalingState(!1),c())};g?(document.ontouchmove=B,document.ontouchend=Y):(document.onmousemove=B,document.onmouseup=Y)},scaleMultiElement:(h,p,v)=>{let g=!0;const{minX:m,maxX:y,minY:R,maxY:A}=p,x=y-m,S=A-R,T=x/S,L=h.pageX,w=h.pageY,M=JSON.parse(JSON.stringify(e.value));document.onmousemove=P=>{if(!g)return;const k=P.pageX,F=P.pageY,C=(k-L)/n.value;let N=(F-w)/n.value;u.value&&((v===bt.RIGHT_BOTTOM||v===bt.LEFT_TOP)&&(N=C/T),(v===bt.LEFT_BOTTOM||v===bt.RIGHT_TOP)&&(N=-C/T));let I=m,W=y,U=R,Z=A;v===bt.RIGHT_BOTTOM?(W=y+C,Z=A+N):v===bt.LEFT_BOTTOM?(I=m+C,Z=A+N):v===bt.LEFT_TOP?(I=m+C,U=R+N):v===bt.RIGHT_TOP?(W=y+C,U=R+N):v===bt.TOP?U=R+N:v===bt.BOTTOM?Z=A+N:v===bt.LEFT?I=m+C:v===bt.RIGHT&&(W=y+C);const ne=W-I,B=Z-U;let Y=ne/x,Q=B/S;Y<=0&&(Y=0),Q<=0&&(Q=0),e.value=e.value.map(K=>{if((K.type==="image"||K.type==="shape")&&o.value.includes(K.id)){const te=M.find(j=>j.id===K.id);return{...K,width:te.width*Y,height:te.height*Q,left:I+(te.left-m)*Y,top:U+(te.top-R)*Q}}return K})},document.onmouseup=P=>{g=!1,document.onmousemove=null,document.onmouseup=null,!(L===P.pageX&&w===P.pageY)&&(i.updateSlide({elements:e.value}),c())}}}},XSe=(e,t)=>{const n=pt(),{activeElementIdList:r,activeGroupElementId:i,handleElementId:o,editorAreaFocus:a}=Ve(n),{ctrlOrShiftKeyActive:s}=Ve(vl());return{selectElement:(u,c,f=!0)=>{if(a.value||n.setEditorareaFocus(!0),r.value.includes(c.id)){if(s.value){let d=[];if(c.groupId){const h=[];e.value.forEach(p=>{p.groupId===c.groupId&&h.push(p.id)}),d=r.value.filter(p=>!h.includes(p))}else d=r.value.filter(h=>h!==c.id);d.length>0&&n.setActiveElementIdList(d)}else if(o.value!==c.id)n.setHandleElementId(c.id);else if(i.value!==c.id){const d=u instanceof MouseEvent?u.pageX:u.changedTouches[0].pageX,h=u instanceof MouseEvent?u.pageY:u.changedTouches[0].pageY;u.target.onmouseup=p=>{const v=p.pageX,g=p.pageY;d===v&&h===g&&(n.setActiveGroupElementId(c.id),p.target.onmouseup=null)}}}else{let d=[];if(s.value?d=[...r.value,c.id]:d=[c.id],c.groupId){const h=[];e.value.forEach(p=>{p.groupId===c.groupId&&h.push(p.id)}),d=[...d,...h]}n.setActiveElementIdList(Yn.uniq(d)),n.setHandleElementId(c.id)}f&&t(u,c)}}},cz=(e,t,n)=>{const r=lt(),{activeElementIdList:i,activeGroupElementId:o}=Ve(pt()),{shiftKeyState:a}=Ve(vl()),{viewportRatio:s,viewportSize:l}=Ve(r),{addHistorySnapshot:u}=rn();return{dragElement:(f,d)=>{const h=!(f instanceof MouseEvent);if(h&&(!f.changedTouches||!f.changedTouches[0])||!i.value.includes(d.id))return;let p=!0;const v=l.value,g=l.value*s.value,m=5,R=JSON.parse(JSON.stringify(e.value)).filter(Q=>i.value.includes(Q.id)),A=d.left,x=d.top,S=d.width,T="height"in d&&d.height?d.height:0,L="rotate"in d&&d.rotate?d.rotate:0,w=h?f.changedTouches[0].pageX:f.pageX,M=h?f.changedTouches[0].pageY:f.pageY;let P=null;const k=d.id===o.value;let F=[],C=[];for(const Q of e.value){if(Q.type==="line"||k&&Q.id===d.id||!k&&i.value.includes(Q.id))continue;let K,te,j,de;if("rotate"in Q&&Q.rotate){const{xRange:re,yRange:oe}=ev({left:Q.left,top:Q.top,width:Q.width,height:Q.height,rotate:Q.rotate});K=re[0],te=oe[0],j=re[1]-re[0],de=oe[1]-oe[0]}else K=Q.left,te=Q.top,j=Q.width,de=Q.height;const G=K+j,Ae=te+de,ce=te+de/2,fe=K+j/2,le={value:te,range:[K,G]},$={value:Ae,range:[K,G]},X={value:ce,range:[K,G]},J={value:K,range:[te,Ae]},se={value:G,range:[te,Ae]},ee={value:fe,range:[te,Ae]};F.push(le,$,X),C.push(J,se,ee)}const N={value:0,range:[0,v]},I={value:g,range:[0,v]},W={value:g/2,range:[0,v]},U={value:0,range:[0,g]},Z={value:v,range:[0,g]},ne={value:v/2,range:[0,g]};F.push(N,I,W),C.push(U,Z,ne),F=bx(F),C=bx(C);const B=Q=>{const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;if(P!==!1&&(P=Math.abs(w-K)Math.abs(de)&&(de=0),Math.abs(j)oe.id===d.id?{...oe,left:G,top:Ae}:oe);else{const oe=e.value.find(pe=>pe.id===d.id);if(!oe)return;e.value=e.value.map(pe=>i.value.includes(pe.id)?pe.id===d.id?{...pe,left:G,top:Ae}:{...pe,left:pe.left+(G-oe.left),top:pe.top+(Ae-oe.top)}:pe)}},Y=Q=>{p=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null,t.value=[];const K=Q instanceof MouseEvent?Q.pageX:Q.changedTouches[0].pageX,te=Q instanceof MouseEvent?Q.pageY:Q.changedTouches[0].pageY;w===K&&M===te||(r.updateSlide({elements:e.value}),u())};h?(document.ontouchmove=B,document.ontouchend=Y):(document.onmousemove=B,document.onmouseup=Y)}}},WSe=e=>{const t=lt(),{canvasScale:n}=Ve(pt()),{ctrlOrShiftKeyActive:r}=Ve(vl()),{addHistorySnapshot:i}=rn();return{dragLineElement:(a,s,l)=>{let u=!0;const c=8,f=a.pageX,d=a.pageY,h=[];for(let p=0;p{if(!u)return;const v=p.pageX,g=p.pageY,m=(v-f)/n.value,y=(g-d)/n.value;let R=s.left+s.start[0],A=s.top+s.start[1],x=s.left+s.end[0],S=s.top+s.end[1];const T=s.broken||s.broken2||s.curve||[0,0];let L=s.left+T[0],w=s.top+T[1];const[M,P]=s.cubic||[[0,0],[0,0]];let k=s.left+M[0],F=s.top+M[1],C=s.left+P[0],N=s.top+P[1];if(l===Ho.START){R=R+m,A=A+y,Math.abs(R-x)x&&(ne[0]=U-I,B[0]=0),A>S&&(ne[1]=Z-W,B[1]=0),e.value=e.value.map(Y=>{if(Y.id===s.id){const Q={...Y,left:I,top:W,start:ne,end:B};return l===Ho.START||l===Ho.END?(r.value?(s.broken&&(Q.broken=[L-I,w-W]),s.curve&&(Q.curve=[L-I,w-W]),s.cubic&&(Q.cubic=[[k-I,F-W],[C-I,N-W]])):(s.broken&&(Q.broken=[(ne[0]+B[0])/2,(ne[1]+B[1])/2]),s.curve&&(Q.curve=[(ne[0]+B[0])/2,(ne[1]+B[1])/2]),s.cubic&&(Q.cubic=[[(ne[0]+B[0])/2,(ne[1]+B[1])/2],[(ne[0]+B[0])/2,(ne[1]+B[1])/2]])),s.broken2&&(Q.broken2=[(ne[0]+B[0])/2,(ne[1]+B[1])/2])):l===Ho.C?(s.broken&&(Q.broken=[L-I,w-W]),s.curve&&(Q.curve=[L-I,w-W]),s.broken2&&(U-I>=Z-W?Q.broken2=[L-I,Q.broken2[1]]:Q.broken2=[Q.broken2[0],w-W])):s.cubic&&(Q.cubic=[[k-I,F-W],[C-I,N-W]]),Q}return Y})},document.onmouseup=p=>{u=!1,document.onmousemove=null,document.onmouseup=null;const v=p.pageX,g=p.pageY;f===v&&d===g||(t.updateSlide({elements:e.value}),i())}}}},VSe=(e,t)=>{const n=lt(),{addHistorySnapshot:r}=rn();return{moveShapeKeypoint:(o,a,s=0)=>{const l=!(o instanceof MouseEvent);if(l&&(!o.changedTouches||!o.changedTouches[0]))return;let u=!0;const c=l?o.changedTouches[0].pageX:o.pageX,f=l?o.changedTouches[0].pageY:o.pageY,d=a.keypoints,h=u0[a.pathFormula];let p=null;if("editable"in h&&h.editable){const m=h.getBaseSize[s],y=h.range[s],R=h.relative[s],A=d[s],x=m(a.width,a.height),S=x*A,[T,L]=y;p={baseSize:x,originPos:S,min:T,max:L,relative:R}}const v=m=>{if(!u)return;const y=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,R=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY,A=(y-c)/t.value,x=(R-f)/t.value;e.value=e.value.map(S=>{if(S.id===a.id&&p){const{baseSize:T,originPos:L,min:w,max:M,relative:P}=p,k=S;let F=0;P==="center"?F=(L-A*2)/T:P==="left"?F=(L+A)/T:P==="right"?F=(L-A)/T:P==="top"?F=(L+x)/T:P==="bottom"?F=(L-x)/T:P==="left_bottom"?F=(L+A)/T:P==="right_bottom"?F=(L-A)/T:P==="top_right"?F=(L+x)/T:P==="bottom_right"&&(F=(L-x)/T),FM&&(F=M);let C=[];return Array.isArray(d)?(C=[...d],C[s]=F):C=[F],{...S,keypoints:C,path:h.formula(k.width,k.height,C)}}return S})},g=m=>{u=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;const y=m instanceof MouseEvent?m.pageX:m.changedTouches[0].pageX,R=m instanceof MouseEvent?m.pageY:m.changedTouches[0].pageY;c===y&&f===R||(n.updateSlide({elements:e.value}),r())};l?(document.ontouchmove=v,document.ontouchend=g):(document.onmousemove=v,document.onmouseup=g)}}},DSe=e=>{const t=pt(),{canvasScale:n,creatingElement:r}=Ve(t),i=c=>{const{start:f,end:d}=c;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,v]=f,[g,m]=d,y=Math.min(p,g),R=Math.max(p,g),A=Math.min(v,m),x=Math.max(v,m),S=(y-h.x)/n.value,T=(A-h.y)/n.value,L=(R-y)/n.value,w=(x-A)/n.value;return{left:S,top:T,width:L,height:w}},o=c=>{const{start:f,end:d}=c;if(!e.value)return;const h=e.value.getBoundingClientRect(),[p,v]=f,[g,m]=d,y=Math.min(p,g),R=Math.max(p,g),A=Math.min(v,m),x=Math.max(v,m),S=(y-h.x)/n.value,T=(A-h.y)/n.value,L=(R-y)/n.value,w=(x-A)/n.value;return{left:S,top:T,start:[p===y?0:L,v===A?0:w],end:[g===y?0:L,m===A?0:w]}},{createTextElement:a,createShapeElement:s,createLineElement:l}=c0();return{formatCreateSelection:i,insertElementFromCreateSelection:c=>{if(!r.value)return;const f=r.value.type;if(f==="text"){const d=i(c);d&&a(d,{vertical:r.value.vertical})}else if(f==="shape"){const d=i(c);d&&s(d,r.value.data)}else if(f==="line"){const d=o(c);d&&l(d,r.value.data)}t.setCreatingElement(null)}}},g3=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=Ve(pt()),{currentSlide:r,viewportRatio:i,viewportSize:o}=Ve(e),{addHistorySnapshot:a}=rn();return{alignElementToCanvas:l=>{const u=o.value,c=o.value*i.value,{minX:f,maxX:d,minY:h,maxY:p}=qu(n.value),v=JSON.parse(JSON.stringify(r.value.elements));for(const g of v)if(t.value.includes(g.id)){if(l===vn.CENTER){const m=h+(p-h)/2-c/2,y=f+(d-f)/2-u/2;g.top=g.top-m,g.left=g.left-y}if(l===vn.TOP){const m=h-0;g.top=g.top-m}else if(l===vn.VERTICAL){const m=h+(p-h)/2-c/2;g.top=g.top-m}else if(l===vn.BOTTOM){const m=p-c;g.top=g.top-m}else if(l===vn.LEFT){const m=f-0;g.left=g.left-m}else if(l===vn.HORIZONTAL){const m=f+(d-f)/2-u/2;g.left=g.left-m}else if(l===vn.RIGHT){const m=d-u;g.left=g.left-m}}e.updateSlide({elements:v}),a()}}},fd=e=>({shadowStyle:Se(()=>{if(e.value){const{h:n,v:r,blur:i,color:o}=e.value;return`${n}px ${r}px ${i}px ${o}`}return""})}),m3=(e,t)=>({flipStyle:Se(()=>{let r="";return e.value&&t.value?r="rotateX(180deg) rotateY(180deg)":t.value?r="rotateX(180deg)":e.value&&(r="rotateY(180deg)"),r})});var fz=(e=>(e.RECT="rect",e.ELLIPSE="ellipse",e.POLYGON="polygon",e))(fz||{});const a6={rect:{name:"矩形",type:"rect",radius:"0",style:""},rect2:{name:"矩形2",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L 0 ${t} Z`},rect3:{name:"矩形3",type:"polygon",style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:(e,t)=>`M 0 0 L ${e*.8} 0 L ${e} ${t*.2} L ${e} ${t} L ${e*.2} ${t} L 0 ${t*.8} Z`},roundRect:{name:"圆角矩形",type:"rect",radius:"10px",style:"inset(0 round 10px)"},ellipse:{name:"圆形",type:"ellipse",style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:"polygon",style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M ${e*.5} 0 L 0 ${t} L ${e} ${t} Z`},triangle2:{name:"三角形2",type:"polygon",style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:(e,t)=>`M ${e*.5} ${t} L 0 0 L ${e} 0 Z`},triangle3:{name:"三角形3",type:"polygon",style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:(e,t)=>`M 0 0 L 0 ${t} L ${e} ${t} Z`},rhombus:{name:"菱形",type:"polygon",style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${t*.5} L ${e*.5} ${t} L 0 ${t*.5} Z`},pentagon:{name:"五边形",type:"polygon",style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e} ${.38*t} L ${.82*e} ${t} L ${.18*e} ${t} L 0 ${.38*t} Z`},hexagon:{name:"六边形",type:"polygon",style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:(e,t)=>`M ${e*.2} 0 L ${e*.8} 0 L ${e} ${t*.5} L ${e*.8} ${t} L ${e*.2} ${t} L 0 ${t*.5} Z`},heptagon:{name:"七边形",type:"polygon",style:"polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%)",createPath:(e,t)=>`M ${e*.5} 0 L ${e*.9} ${t*.2} L ${e} ${t*.6} L ${e*.75} ${t} L ${e*.25} ${t} L 0 ${t*.6} L ${e*.1} ${t*.2} Z`},octagon:{name:"八边形",type:"polygon",style:"polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e*.7} 0 L ${e} ${t*.3} L ${e} ${t*.7} L ${e*.7} ${t} L ${e*.3} ${t} L 0 ${t*.7} L 0 ${t*.3} Z`},chevron:{name:"V形",type:"polygon",style:"polygon(75% 0%, 100% 50%, 75% 100%, 0% 100%, 25% 50%, 0% 0%)",createPath:(e,t)=>`M ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} L ${e*.25} ${t*.5} L 0 0 Z`},point:{name:"点",type:"polygon",style:"polygon(0% 0%, 75% 0%, 100% 50%, 75% 100%, 0% 100%)",createPath:(e,t)=>`M 0 0 L ${e*.75} 0 L ${e} ${t*.5} L ${e*.75} ${t} L 0 ${t} Z`},arrow:{name:"箭头",type:"polygon",style:"polygon(0% 20%, 60% 20%, 60% 0%, 100% 50%, 60% 100%, 60% 80%, 0% 80%)",createPath:(e,t)=>`M 0 ${t*.2} L ${e*.6} ${t*.2} L ${e*.6} 0 L ${e} ${t*.5} L ${e*.6} ${t} L ${e*.6} ${t*.8} L 0 ${t*.8} Z`},parallelogram:{name:"平行四边形",type:"polygon",style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.3} 0 L ${e} 0 L ${e*.7} ${t} L 0 ${t} Z`},parallelogram2:{name:"平行四边形2",type:"polygon",style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:(e,t)=>`M ${e*.3} ${t} L ${e} ${t} L ${e*.7} 0 L 0 0 Z`},trapezoid:{name:"梯形",type:"polygon",style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:(e,t)=>`M ${e*.25} 0 L ${e*.75} 0 L ${e} ${t} L 0 ${t} Z`},trapezoid2:{name:"梯形2",type:"polygon",style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:(e,t)=>`M 0 0 L ${e} 0 L ${e*.75} ${t} L ${e*.25} ${t} Z`}},bk=e=>{const t=Se(()=>{let r=a6.rect;if(e.value.clip){const i=e.value.clip.shape||fz.RECT;r=a6[i]}return r.radius!==void 0&&e.value.radius&&(r={...r,radius:`${e.value.radius}px`,style:`inset(0 round ${e.value.radius}px)`}),r}),n=Se(()=>{if(!e.value.clip)return{top:"0",left:"0",width:"100%",height:"100%"};const[r,i]=e.value.clip.range,o=(i[0]-r[0])/100,a=(i[1]-r[1])/100,s=r[0]/o,l=r[1]/a;return{left:-s+"%",top:-l+"%",width:100/o+"%",height:100/a+"%"}});return{clipShape:t,imgPosition:n}},dz=e=>({filter:Se(()=>{if(!e.value)return"";let n="";const r=Object.keys(e.value);for(const i of r)n+=`${i}(${e.value[i]}) `;return n})}),jv=e=>{const t=Se(()=>{var o;return((o=e.value)==null?void 0:o.width)??0}),n=Se(()=>{var o;return((o=e.value)==null?void 0:o.style)||"solid"}),r=Se(()=>{var o;return((o=e.value)==null?void 0:o.color)||"#d14424"}),i=Se(()=>{const o=t.value;return n.value==="dashed"?o<=6?`${o*4.5} ${o*2}`:`${o*4} ${o*1.5}`:n.value==="dotted"?o<=6?`${o*1.8} ${o*1.6}`:`${o*1.5} ${o*1.2}`:"0 0"});return{outlineWidth:t,outlineStyle:n,outlineColor:r,strokeDashArray:i}},USe=["width","height"],BSe=["rx","ry","width","height","stroke","stroke-width","stroke-dasharray"],YSe=We({__name:"ImageRectOutline",props:{width:{},height:{},outline:{},radius:{default:"0"}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-rect-outline",overflow:"visible",width:o.width,height:o.height},[V("rect",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",rx:o.radius,ry:o.radius,width:o.width,height:o.height,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,BSe)],8,USe)):Ye("",!0)}}),ZSe=Be(YSe,[["__scopeId","data-v-09a0319c"]]),QSe=["width","height"],HSe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],KSe=We({__name:"ImageEllipseOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-ellipse-outline",overflow:"visible",width:o.width,height:o.height},[V("ellipse",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",cx:o.width/2,cy:o.height/2,rx:o.width/2,ry:o.height/2,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,HSe)],8,QSe)):Ye("",!0)}}),GSe=Be(KSe,[["__scopeId","data-v-19e68d74"]]),zSe=["width","height"],JSe=["d","stroke","stroke-width","stroke-dasharray"],$Se=We({__name:"ImagePolygonOutline",props:{width:{},height:{},createPath:{type:Function},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"image-polygon-outline",overflow:"visible",width:o.width,height:o.height},[V("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:o.createPath(o.width,o.height),stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,JSe)],8,zSe)):Ye("",!0)}}),jSe=Be($Se,[["__scopeId","data-v-a036b0a3"]]),qSe={class:"image-outline"},hz=We({__name:"index",props:{elementInfo:{}},setup(e){const t=e,n=Se(()=>t.elementInfo),{clipShape:r}=bk(n);return(i,o)=>(D(),q("div",qSe,[z(r).type==="rect"?(D(),_e(ZSe,{key:0,width:i.elementInfo.width,height:i.elementInfo.height,radius:z(r).radius,outline:i.elementInfo.outline},null,8,["width","height","radius","outline"])):z(r).type==="ellipse"?(D(),_e(GSe,{key:1,width:i.elementInfo.width,height:i.elementInfo.height,outline:i.elementInfo.outline},null,8,["width","height","outline"])):z(r).type==="polygon"?(D(),_e(jSe,{key:2,width:i.elementInfo.width,height:i.elementInfo.height,outline:i.elementInfo.outline,createPath:z(r).createPath},null,8,["width","height","outline","createPath"])):Ye("",!0)]))}}),pz=e=>(tn("data-v-31b3b0f9"),e=e(),nn(),e),e3e=["src"],t3e=["src"],n3e=["onMousedown"],r3e=pz(()=>V("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[V("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z"})],-1)),i3e=[r3e],o3e=["onMousedown"],a3e=pz(()=>V("svg",{width:"16",height:"16",fill:"#fff",stroke:"#333"},[V("path",{"stroke-width":"0.3","shape-rendering":"crispEdges",d:"M 16 0 L 0 0 L 0 4 L 16 4 Z"})],-1)),s3e=[a3e],l3e=We({__name:"ImageClipHandler",props:{src:{},clipPath:{},width:{},height:{},top:{},left:{},rotate:{},clipData:{}},emits:["clip"],setup(e,{emit:t}){const n=e,r=t,{canvasScale:i}=Ve(pt()),{ctrlOrShiftKeyActive:o}=Ve(vl()),a=he({top:"0",left:"0"}),s=he(!1),l=he(null),u=()=>{const[L,w]=n.clipData?n.clipData.range:[[0,0],[100,100]],M=(w[0]-L[0])/100,P=(w[1]-L[1])/100,k=L[0]/M,F=L[1]/P;return{widthScale:M,heightScale:P,left:k,top:F}},c=Se(()=>{const{widthScale:L,heightScale:w,left:M,top:P}=u();return{left:-M,top:-P,width:100/L,height:100/w}}),f=Se(()=>({top:c.value.top+"%",left:c.value.left+"%",width:c.value.width+"%",height:c.value.height+"%"})),d=he({top:0,left:0,width:0,height:0}),h=Se(()=>{const{top:L,left:w,width:M,height:P}=d.value;return{top:L+"%",left:w+"%",width:M+"%",height:P+"%"}}),p=Se(()=>{const L=c.value.width,w=c.value.height,{top:M,left:P,width:k,height:F}=d.value;return{left:-P*(100/k)+"%",top:-M*(100/F)+"%",width:L/k*100+"%",height:w/F*100+"%"}}),v=()=>{const{left:L,top:w}=u();d.value={left:L,top:w,width:100,height:100},a.value={top:-w+"%",left:-L+"%"}},g=()=>{if(s.value)return;if(!l.value){r("clip",null);return}const{left:L,top:w}=u(),M={left:(d.value.left-L)/100*n.width,top:(d.value.top-w)/100*n.height,width:(d.value.width-100)/100*n.width,height:(d.value.height-100)/100*n.height},P={range:l.value,position:M};r("clip",P)},m=L=>{L.key.toUpperCase()===At.ENTER&&g()};Vt(()=>{v(),document.addEventListener("keydown",m)}),Fn(()=>{document.removeEventListener("keydown",m)});const y=()=>{const L={left:parseInt(p.value.left),top:parseInt(p.value.top),width:parseInt(p.value.width),height:parseInt(p.value.height)},w=100/L.width,M=100/L.height,P=[-L.left*w,-L.top*M],k=[w*100+P[0],M*100+P[1]];l.value=[P,k]},R=L=>{s.value=!0;let w=!0;const M=L.pageX,P=L.pageY,k=c.value,F={...d.value};document.onmousemove=C=>{if(!w)return;const N=C.pageX,I=C.pageY,W=(N-M)/i.value,U=(I-P)/i.value,Z=Math.sqrt(W*W+U*U),B=Math.atan2(U,W)-n.rotate/180*Math.PI,Y=Z*Math.cos(B)/n.width*100,Q=Z*Math.sin(B)/n.height*100;let K=F.left+Y,te=F.top+Q;K<0?K=0:K+F.width>k.width&&(K=k.width-F.width),te<0?te=0:te+F.height>k.height&&(te=k.height-F.height),d.value={...d.value,left:K,top:te}},document.onmouseup=()=>{w=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>{s.value=!1},0)}},A=(L,w)=>{s.value=!0;let M=!0;const P=50/n.width*100,k=50/n.height*100,F=L.pageX,C=L.pageY,N=c.value,I={...d.value},W=d.value.width/d.value.height;document.onmousemove=U=>{if(!M)return;const Z=U.pageX,ne=U.pageY,B=(Z-F)/i.value,Y=(ne-C)/i.value,Q=Math.sqrt(B*B+Y*Y),te=Math.atan2(Y,B)-n.rotate/180*Math.PI;let j=Q*Math.cos(te)/n.width*100,de=Q*Math.sin(te)/n.height*100;o.value&&((w===bt.RIGHT_BOTTOM||w===bt.LEFT_TOP)&&(de=j/W),(w===bt.LEFT_BOTTOM||w===bt.RIGHT_TOP)&&(de=-j/W));let G,Ae,ce,fe;w===bt.LEFT_TOP?(I.left+j<0&&(j=-I.left),I.top+de<0&&(de=-I.top),I.width-jN.width&&(j=N.width-(I.left+I.width)),I.top+de<0&&(de=-I.top),I.width+j
N.height&&(de=N.height-(I.top+I.height)),I.width-j
N.width&&(j=N.width-(I.left+I.width)),I.top+I.height+de>N.height&&(de=N.height-(I.top+I.height)),I.width+j
N.height&&(de=N.height-(I.top+I.height)),I.height+deN.width&&(j=N.width-(I.left+I.width)),I.width+j{M=!1,document.onmousemove=null,document.onmouseup=null,y(),setTimeout(()=>s.value=!1,0)}},x=Se(()=>{const L="rotate-",w=n.rotate;return w>-22.5&&w<=22.5?L+0:w>22.5&&w<=67.5?L+45:w>67.5&&w<=112.5?L+90:w>112.5&&w<=157.5?L+135:w>157.5||w<=-157.5?L+0:w>-157.5&&w<=-112.5?L+45:w>-112.5&&w<=-67.5?L+90:w>-67.5&&w<=-22.5?L+135:L+0}),S=[bt.LEFT_TOP,bt.RIGHT_TOP,bt.LEFT_BOTTOM,bt.RIGHT_BOTTOM],T=[bt.TOP,bt.BOTTOM,bt.LEFT,bt.RIGHT];return(L,w)=>{const M=Tn("click-outside");return Ge((D(),q("div",{class:"image-clip-handler",style:Le(a.value)},[V("img",{class:"bottom-img",src:L.src,draggable:!1,alt:"",style:Le(f.value)},null,12,e3e),V("div",{class:"top-image-content",style:Le({...h.value,clipPath:L.clipPath})},[V("img",{class:"top-img",src:L.src,draggable:!1,alt:"",style:Le(p.value)},null,12,t3e)],4),V("div",{class:"operate",style:Le(h.value),onMousedown:w[0]||(w[0]=Ft(P=>R(P),["stop"]))},[(D(),q(Xe,null,nt(S,P=>V("div",{class:ze(["clip-point",P,x.value]),key:P,onMousedown:Ft(k=>A(k,P),["stop"])},i3e,42,n3e)),64)),(D(),q(Xe,null,nt(T,P=>V("div",{class:ze(["clip-point",P,x.value]),key:P,onMousedown:Ft(k=>A(k,P),["stop"])},s3e,42,o3e)),64))],36)],4)),[[M,g]])}}}),u3e=Be(l3e,[["__scopeId","data-v-31b3b0f9"]]),c3e=["src"],f3e=We({__name:"index",props:{elementInfo:{},selectElement:{type:Function},contextmenus:{type:Function}},setup(e){const t=e,n=pt(),r=lt(),{clipingImageElementId:i}=Ve(n),o=Se(()=>i.value===t.elementInfo.id),{addHistorySnapshot:a}=rn(),s=Se(()=>t.elementInfo.shadow),{shadowStyle:l}=fd(s),u=Se(()=>t.elementInfo.flipH),c=Se(()=>t.elementInfo.flipV),{flipStyle:f}=m3(u,c),d=Se(()=>t.elementInfo),{clipShape:h,imgPosition:p}=bk(d),v=Se(()=>t.elementInfo.filters),{filter:g}=dz(v),m=R=>{t.elementInfo.lock||(R.stopPropagation(),t.selectElement(R,t.elementInfo))},y=R=>{if(n.setClipingImageElementId(""),!R)return;const{range:A,position:x}=R,S=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},T=t.elementInfo.left+x.left,L=t.elementInfo.top+x.top,w=t.elementInfo.width+x.width,M=t.elementInfo.height+x.height;let P=0,k=0;if(t.elementInfo.rotate){const C=T+w/2-(t.elementInfo.left+t.elementInfo.width/2),N=-(L+M/2-(t.elementInfo.top+t.elementInfo.height/2)),I=-t.elementInfo.rotate*Math.PI/180,W=C*Math.cos(I)-N*Math.sin(I),U=C*Math.sin(I)+N*Math.cos(I);P=W-C,k=-(U-N)}const F={clip:{...S,range:A},left:T+P,top:L+k,width:w,height:M};r.updateElement({id:t.elementInfo.id,props:F}),a()};return(R,A)=>{const x=Tn("contextmenu");return D(),q("div",{class:ze(["editable-element-image",{lock:R.elementInfo.lock}]),style:Le({top:R.elementInfo.top+"px",left:R.elementInfo.left+"px",width:R.elementInfo.width+"px",height:R.elementInfo.height+"px"})},[V("div",{class:"rotate-wrapper",style:Le({transform:`rotate(${R.elementInfo.rotate}deg)`})},[o.value?(D(),_e(u3e,{key:0,src:R.elementInfo.src,clipData:R.elementInfo.clip,width:R.elementInfo.width,height:R.elementInfo.height,top:R.elementInfo.top,left:R.elementInfo.left,rotate:R.elementInfo.rotate,clipPath:z(h).style,onClip:A[0]||(A[0]=S=>y(S))},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Ge((D(),q("div",{key:1,class:"element-content",style:Le({filter:z(l)?`drop-shadow(${z(l)})`:"",transform:z(f)}),onMousedown:A[2]||(A[2]=S=>m(S)),onTouchstart:A[3]||(A[3]=S=>m(S))},[O(hz,{elementInfo:R.elementInfo},null,8,["elementInfo"]),V("div",{class:"image-content",style:Le({clipPath:z(h).style})},[V("img",{src:R.elementInfo.src,draggable:!1,style:Le({top:z(p).top,left:z(p).left,width:z(p).width,height:z(p).height,filter:z(g)}),onDragstart:A[1]||(A[1]=Ft(()=>{},["prevent"])),alt:""},null,44,c3e),R.elementInfo.colorMask?(D(),q("div",{key:0,class:"color-mask",style:Le({backgroundColor:R.elementInfo.colorMask})},null,4)):Ye("",!0)],4)],36)),[[x,R.contextmenus]])],4)],6)}}}),vz=Be(f3e,[["__scopeId","data-v-86b9f3af"]]),d3e=["width","height"],h3e=["d","stroke","stroke-width","stroke-dasharray"],p3e=We({__name:"ElementOutline",props:{width:{},height:{},outline:{}},setup(e){const t=e,{outlineWidth:n,outlineColor:r,strokeDashArray:i}=jv(Wv(t,"outline"));return(o,a)=>o.outline?(D(),q("svg",{key:0,class:"element-outline",overflow:"visible",width:o.width,height:o.height},[V("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:`M0,0 L${o.width},0 L${o.width},${o.height} L0,${o.height} Z`,stroke:z(r),"stroke-width":z(n),"stroke-dasharray":z(i)},null,8,h3e)],8,d3e)):Ye("",!0)}}),y3=Be(p3e,[["__scopeId","data-v-e2ef58f5"]]),Yi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},r2=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let s6=null;const Hu=function(e,t,n){let r=s6||(s6=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},v3e=function(){s6=null},qh=function(e,t,n,r){return n&&(TX(e,t,n,r,-1)||TX(e,t,n,r,1))},g3e=/^(img|br|input|textarea|hr)$/i;function TX(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Jl(e))){let o=e.parentNode;if(!o||o.nodeType!=1||iy(e)||g3e.test(e.nodeName)||e.contentEditable=="false")return!1;t=Yi(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Jl(e):0}else return!1}}function Jl(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function m3e(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Jl(e)}else if(e.parentNode&&!iy(e))t=Yi(e),e=e.parentNode;else return null}}function y3e(e,t){for(;;){if(e.nodeType==3&&t2),ds=Tv||(vu?/Mac/.test(vu.platform):!1),x3e=vu?/Win/.test(vu.platform):!1,il=/Android \d/.test(dd),oy=!!_X&&"webkitFontSmoothing"in _X.documentElement.style,S3e=oy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function w3e(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Du(e,t){return typeof e=="number"?e:e[t]}function M3e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function OX(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=r2(a)){if(a.nodeType!=1)continue;let s=a,l=s==o.body,u=l?w3e(o):M3e(s),c=0,f=0;if(t.topu.bottom-Du(r,"bottom")&&(f=t.bottom-t.top>u.bottom-u.top?t.top+Du(i,"top")-u.top:t.bottom-u.bottom+Du(i,"bottom")),t.leftu.right-Du(r,"right")&&(c=t.right-u.right+Du(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);let p=s.scrollLeft-d,v=s.scrollTop-h;t={left:t.left-p,top:t.top-v,right:t.right-p,bottom:t.bottom-v}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function L3e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a=n-20){r=s,i=l.top;break}}return{refDOM:r,refTop:i,stack:yz(e.dom)}}function yz(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=r2(r));return t}function T3e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Az(n,r==0?0:r-t)}function Az(e,t){for(let n=0;n=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);let v=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?O3e(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:Rz(n,i)}function O3e(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function xk(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function k3e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function C3e(e,t,n,r){let i=-1;for(let o=t,a=!1;o!=e.dom;){let s=e.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)){let l=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&(!a&&l.left>r.left||l.top>r.top?i=s.posBefore:(!a&&l.right-1?i:e.docView.posFromDOM(t,n,-1)}function bz(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let u;oy&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=C3e(e,r,i,t))}s==null&&(s=P3e(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function kX(e){return e.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,P1(tf(Hu(r,l,u),c),c<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Jl(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return k5(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Jl(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Hu(l,Jl(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return P1(tf(u,1),!1)}if(o==null&&i=0)}function P1(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function k5(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Sz(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function F3e(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Sz(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let s=e.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=xz(e,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Hu(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?a.top-c.top>(c.bottom-a.top)*2:c.bottom-a.bottom>(a.bottom-c.top)*2))return!1}}return!0})}const E3e=/[\u0590-\u08ac]/;function X3e(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=e.domSelection();return!E3e.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?o:a:Sz(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=e.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:v}=e.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==v;try{s.collapse(c,f),l&&(l!=c||u!=f)&&s.extend&&s.extend(l,u)}catch{}return d!=null&&(s.caretBidiLevel=d),g})}let PX=null,CX=null,IX=!1;function W3e(e,t,n){return PX==t&&CX==n?IX:(PX=t,CX=n,IX=n=="up"||n=="down"?F3e(e,t,n):X3e(e,t,n))}const ws=0,NX=1,gh=2,gu=3;class ay{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=ws,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nYi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||a instanceof Mz){i=t-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof wz&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Yi(o.dom)+1:0}}else{let o,a=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=a;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Yi(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||s==this.children.length-1)){n=u;for(let c=s+1;ch&&an){let h=s;s=l,l=h}let d=document.createRange();d.setEnd(l.node,l.offset),d.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i=r:tr){let s=r+o.border,l=a-o.border;if(t>=s&&n<=l){this.dirty=t==r||n==a?gh:NX,t==s&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=gu:o.markDirty(t-s,n-s);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?gh:gu}r=a}this.dirty=gh}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?gh:NX;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==ws&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class V3e extends ay{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class e0 extends ay{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return(!a||!a.dom)&&(a=Dv.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e0(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&gu||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=gu&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=ws){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=h6(o,0,t,r));for(let s=0;s{if(!l)return a;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=Dv.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=_z(c,r,n),u?l=new D3e(t,n,r,i,c,f||null,d,u,o,a+1):n.isText?new R3(t,n,r,i,c,d,o):new If(t,n,r,i,c,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>ft.empty)}return t}matchesNode(t,n,r){return this.dirty==ws&&t.eq(this.node)&&d6(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new B3e(this,a&&a.node,t);Q3e(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,t):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?Gn.none:this.node.child(c).marks,r,t),l.placeWidget(u,t,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,t);let h;l.findNodeMatch(u,c,f,d)||s&&t.state.selection.from>i&&t.state.selection.to-1&&l.updateNodeAt(u,c,f,h,t)||l.updateNextNode(u,c,f,t,d,i)||l.addNode(u,c,f,t,i),i+=u.nodeSize}),l.syncToMarks([],r,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==gh)&&(a&&this.protectLocalComposition(t,a),Lz(this.contentDOM,this.children,t),Tv&&H3e(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof er)||rn+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let a=o.nodeValue,s=K3e(this.node.content,a,r-n,i-n);return s<0?null:{node:o,pos:s,text:a}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new V3e(this,o,n,i);t.input.compositionNodes.push(a),this.children=h6(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==gu||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=ws}updateOuterDeco(t){if(d6(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Tz(this.dom,this.nodeDOM,f6(this.outerDeco,this.node,n),f6(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function FX(e,t,n,r,i){_z(r,t,e);let o=new If(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class R3 extends If{constructor(t,n,r,i,o,a,s){super(t,n,r,i,o,null,a,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==gu||this.dirty!=ws&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ws||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=ws,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new R3(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=gu)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Mz extends ay{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==ws&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class D3e extends If{constructor(t,n,r,i,o,a,s,l,u,c){super(t,n,r,i,o,a,s,u,c),this.spec=l}update(t,n,r,i){if(this.dirty==gu)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Lz(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o>1,a=Math.min(o,t.length);for(;i-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let l=e0.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s0;){let s;for(;;)if(r){let u=n.children[r-1];if(u instanceof e0)n=u,r=u.children.length;else{s=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=s.node;if(l){if(l!=e.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function Z3e(e,t){return e.type.side-t.type.side}function Q3e(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let u=0;uo;)s.push(i[a++]);let p=o+d.nodeSize;if(d.isText){let g=p;a!g.inline):s.slice();r(d,v,t.forChild(o,d),h),o=p}}function H3e(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function K3e(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-t.length-s,r-s)==t)return r-t.length;let u=s=0&&u+t.length+s>=n)return s+u;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}return-1}function h6(e,t,n,r,i){let o=[];for(let a=0,s=0;a=n||c<=t?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function Sk(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s=r.resolve(a),l,u;if(A3(n)){for(l=s;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&Jt.isSelectable(c)&&i.parent&&!(c.isInline&&A3e(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new Jt(a==f?s:r.resolve(f))}}else{let c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;l=r.resolve(c)}if(!u){let c=t=="pointer"||e.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Oz(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function z3e(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Yi(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&aa&&Cf<=11&&(r.disabled=!0,r.disabled=!1)}function kz(e,t){if(t instanceof Jt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(DX(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else DX(e)}function DX(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function wk(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||er.between(t,n,r)}function UX(e){return e.editable&&!e.hasFocus()?!1:Pz(e)}function Pz(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function J3e(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qh(t.node,t.offset,n.anchorNode,n.anchorOffset)}function p6(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Nn.findFrom(o,t)}function ff(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function BX(e,t,n){let r=e.state.selection;if(r instanceof er)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return ff(e,new er(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=p6(e.state,t);return i&&i instanceof Jt?ff(e,i):!1}else if(!(ds&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(s))&&!a.contentDOM?Jt.isSelectable(o)?ff(e,new Jt(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):oy?ff(e,new er(e.state.doc.resolve(t<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Jt&&r.node.isInline)return ff(e,new er(t>0?r.$to:r.$from));{let i=p6(e.state,t);return i?ff(e,i):!1}}}function Xx(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fm(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function B0(e,t){return t<0?$3e(e):j3e(e)}function $3e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(hl&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let s=n.childNodes[r-1];if(fm(s,-1))i=n,o=--r;else if(s.nodeType==3)n=s,r=n.nodeValue.length;else break}}else{if(Cz(n))break;{let s=n.previousSibling;for(;s&&fm(s,-1);)i=n.parentNode,o=Yi(s),s=s.previousSibling;if(s)n=s,r=Xx(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?v6(e,n,r):i&&v6(e,i,o)}function j3e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Xx(n),o,a;for(;;)if(r{e.state==i&&ac(e)},50)}function YX(e,t){let n=e.state.doc.resolve(t);if(!(ho||x3e)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),a=(o.top+o.bottom)/2;if(a>i.top&&a1)return o.lefti.top&&a1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function ZX(e,t,n){let r=e.state.selection;if(r instanceof er&&!r.empty||n.indexOf("s")>-1||ds&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=p6(e.state,t);if(a&&a instanceof Jt)return ff(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,s=r instanceof na?Nn.near(a,t):Nn.findFrom(a,t);return s?ff(e,s):!1}return!1}function QX(e,t){if(!(e.state.selection instanceof er))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function HX(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function t4e(e){if(!Io||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;HX(e,r,"true"),setTimeout(()=>HX(e,r,"false"),20)}return!1}function n4e(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function r4e(e,t){let n=t.keyCode,r=n4e(t);if(n==8||ds&&n==72&&r=="c")return QX(e,-1)||B0(e,-1);if(n==46&&!t.shiftKey||ds&&n==68&&r=="c")return QX(e,1)||B0(e,1);if(n==13||n==27)return!0;if(n==37||ds&&n==66&&r=="c"){let i=n==37?YX(e,e.state.selection.from)=="ltr"?-1:1:-1;return BX(e,i,r)||B0(e,i)}else if(n==39||ds&&n==70&&r=="c"){let i=n==39?YX(e,e.state.selection.from)=="ltr"?1:-1:1;return BX(e,i,r)||B0(e,i)}else{if(n==38||ds&&n==80&&r=="c")return ZX(e,-1,r)||B0(e,-1);if(n==40||ds&&n==78&&r=="c")return t4e(e)||ZX(e,1,r)||B0(e,1);if(r==(ds?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Iz(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=e.someProp("clipboardSerializer")||Dv.fromSchema(e.state.schema),s=Vz(),l=s.createElement("div");l.appendChild(a.serializeFragment(r,{document:s}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=Wz[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=s.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
`);return{dom:l,text:d,slice:t}}function Nz(e,t,n,r,i){let o=i.parent.type.spec.code,a,s;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return t?new Mt(ft.from(e.state.schema.text(t.replace(/\r\n?/g,`
@@ -357,4 +357,4 @@ https://github.com/nodeca/pako/blob/main/LICENSE