@whcecw/maotu 0.0.33 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/maotu.umd.js
CHANGED
|
@@ -48,7 +48,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:Ig,cur
|
|
|
48
48
|
m 0 ${Bg?"":"-"}${Zg}
|
|
49
49
|
a ${Zg} ${Zg} 0 1 1 0 ${Bg?"-":""}${Zg*2}
|
|
50
50
|
a ${Zg} ${Zg} 0 1 1 0 ${Bg?"":"-"}${Zg*2}
|
|
51
|
-
`}),lg=vue.computed(()=>2*Math.PI*ig.value),og=vue.computed(()=>eg.type==="dashboard"?.75:1),sg=vue.computed(()=>`${-1*lg.value*(1-og.value)/2}px`),rg=vue.computed(()=>({strokeDasharray:`${lg.value*og.value}px, ${lg.value}px`,strokeDashoffset:sg.value})),cg=vue.computed(()=>({strokeDasharray:`${lg.value*og.value*(eg.percentage/100)}px, ${lg.value}px`,strokeDashoffset:sg.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),ag=vue.computed(()=>{let Zg;return eg.color?Zg=mg(eg.percentage):Zg=gg[eg.status]||gg.default,Zg}),ug=vue.computed(()=>eg.status==="warning"?warning_filled_default:eg.type==="line"?eg.status==="success"?circle_check_default:circle_close_default:eg.status==="success"?check_default:close_default),dg=vue.computed(()=>eg.type==="line"?12+eg.strokeWidth*.4:eg.width*.111111+2),hg=vue.computed(()=>eg.format(eg.percentage));function bg(Zg){const Bg=100/Zg.length;return Zg.map((Gg,pg)=>isString(Gg)?{color:Gg,percentage:(pg+1)*Bg}:Gg).sort((Gg,pg)=>Gg.percentage-pg.percentage)}const mg=Zg=>{var Gg;const{color:Bg}=eg;if(isFunction$1(Bg))return Bg(Zg);if(isString(Bg))return Bg;{const pg=bg(Bg);for(const fg of pg)if(fg.percentage>Zg)return fg.color;return(Gg=pg[pg.length-1])==null?void 0:Gg.color}};return(Zg,Bg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Ig).b(),vue.unref(Ig).m(Ag.type),vue.unref(Ig).is(Ag.status),{[vue.unref(Ig).m("without-text")]:!Ag.showText,[vue.unref(Ig).m("text-inside")]:Ag.textInside}]),role:"progressbar","aria-valuenow":Ag.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[Ag.type==="line"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(Ig).b("bar"))},[vue.createElementVNode("div",{class:vue.normalizeClass(vue.unref(Ig).be("bar","outer")),style:vue.normalizeStyle({height:`${Ag.strokeWidth}px`})},[vue.createElementVNode("div",{class:vue.normalizeClass([vue.unref(Ig).be("bar","inner"),{[vue.unref(Ig).bem("bar","inner","indeterminate")]:Ag.indeterminate},{[vue.unref(Ig).bem("bar","inner","striped")]:Ag.striped},{[vue.unref(Ig).bem("bar","inner","striped-flow")]:Ag.stripedFlow}]),style:vue.normalizeStyle(Cg.value)},[(Ag.showText||Zg.$slots.default)&&Ag.textInside?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(Ig).be("bar","innerText"))},[vue.renderSlot(Zg.$slots,"default",{percentage:Ag.percentage},()=>[vue.createElementVNode("span",null,vue.toDisplayString(hg.value),1)])],2)):vue.createCommentVNode("v-if",!0)],6)],6)],2)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(Ig).b("circle")),style:vue.normalizeStyle({height:`${Ag.width}px`,width:`${Ag.width}px`})},[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_2$s,[vue.createElementVNode("path",{class:vue.normalizeClass(vue.unref(Ig).be("circle","track")),d:ng.value,stroke:`var(${vue.unref(Ig).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":Ag.strokeLinecap,"stroke-width":tg.value,fill:"none",style:vue.normalizeStyle(rg.value)},null,14,_hoisted_3$l),vue.createElementVNode("path",{class:vue.normalizeClass(vue.unref(Ig).be("circle","path")),d:ng.value,stroke:ag.value,fill:"none",opacity:Ag.percentage?1:0,"stroke-linecap":Ag.strokeLinecap,"stroke-width":tg.value,style:vue.normalizeStyle(cg.value)},null,14,_hoisted_4$e)]))],6)),(Ag.showText||Zg.$slots.default)&&!Ag.textInside?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(vue.unref(Ig).e("text")),style:vue.normalizeStyle({fontSize:`${dg.value}px`})},[vue.renderSlot(Zg.$slots,"default",{percentage:Ag.percentage},()=>[Ag.status?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ug.value)))]),_:1})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$c,vue.toDisplayString(hg.value),1))])],6)):vue.createCommentVNode("v-if",!0)],10,_hoisted_1$E))}}),progress_default=progress_vue_vue_type_script_setup_true_lang_default;const ElProgress=withInstall(progress_default),isValidComponentSize=Ag=>["",...componentSizes].includes(Ag),switchProps=buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:iconPropType},activeActionIcon:{type:iconPropType},activeIcon:{type:iconPropType},inactiveIcon:{type:iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:definePropType(Function)},id:String,tabindex:{type:[String,Number]},...useAriaProps(["ariaLabel"])}),switchEmits={[UPDATE_MODEL_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag),[CHANGE_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag),[INPUT_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag)},_hoisted_1$D=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],_hoisted_2$r=["aria-hidden"],_hoisted_3$k={key:1},_hoisted_4$d={key:1},_hoisted_5$b=["aria-hidden"],COMPONENT_NAME$1="ElSwitch";var switch_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:COMPONENT_NAME$1,__name:"switch",props:switchProps,emits:switchEmits,setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,{formItem:tg}=useFormItem(),ig=useFormSize(),ng=useNamespace("switch"),{inputId:lg}=useFormItemInputId(Ig,{formItemContext:tg}),og=useFormDisabled(vue.computed(()=>{if(Ig.loading)return!0})),sg=vue.ref(Ig.modelValue!==!1),rg=vue.shallowRef(),cg=vue.computed(()=>[ng.b(),ng.m(ig.value),ng.is("disabled",og.value),ng.is("checked",bg.value)]),ag=vue.computed(()=>[ng.e("label"),ng.em("label","left"),ng.is("active",!bg.value)]),ug=vue.computed(()=>[ng.e("label"),ng.em("label","right"),ng.is("active",bg.value)]),dg=vue.computed(()=>({width:addUnit(Ig.width)}));vue.watch(()=>Ig.modelValue,()=>{sg.value=!0});const hg=vue.computed(()=>sg.value?Ig.modelValue:!1),bg=vue.computed(()=>hg.value===Ig.activeValue);[Ig.activeValue,Ig.inactiveValue].includes(hg.value)||(Cg(UPDATE_MODEL_EVENT,Ig.inactiveValue),Cg(CHANGE_EVENT,Ig.inactiveValue),Cg(INPUT_EVENT,Ig.inactiveValue)),vue.watch(bg,Gg=>{var pg;rg.value.checked=Gg,Ig.validateEvent&&((pg=tg==null?void 0:tg.validate)==null||pg.call(tg,"change").catch(fg=>debugWarn(fg)))});const mg=()=>{const Gg=bg.value?Ig.inactiveValue:Ig.activeValue;Cg(UPDATE_MODEL_EVENT,Gg),Cg(CHANGE_EVENT,Gg),Cg(INPUT_EVENT,Gg),vue.nextTick(()=>{rg.value.checked=bg.value})},Zg=()=>{if(og.value)return;const{beforeChange:Gg}=Ig;if(!Gg){mg();return}const pg=Gg();[isPromise(pg),isBoolean(pg)].includes(!0)||throwError(COMPONENT_NAME$1,"beforeChange must return type `Promise<boolean>` or `boolean`"),isPromise(pg)?pg.then(fg=>{fg&&mg()}).catch(fg=>{debugWarn(COMPONENT_NAME$1,`some error occurred: ${fg}`)}):pg&&mg()},Bg=()=>{var Gg,pg;(pg=(Gg=rg.value)==null?void 0:Gg.focus)==null||pg.call(Gg)};return vue.onMounted(()=>{rg.value.checked=bg.value}),gg({focus:Bg,checked:bg}),(Gg,pg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(cg.value),onClick:vue.withModifiers(Zg,["prevent"])},[vue.createElementVNode("input",{id:vue.unref(lg),ref_key:"input",ref:rg,class:vue.normalizeClass(vue.unref(ng).e("input")),type:"checkbox",role:"switch","aria-checked":bg.value,"aria-disabled":vue.unref(og),"aria-label":Ag.ariaLabel,name:Ag.name,"true-value":Ag.activeValue,"false-value":Ag.inactiveValue,disabled:vue.unref(og),tabindex:Ag.tabindex,onChange:mg,onKeydown:vue.withKeys(Zg,["enter"])},null,42,_hoisted_1$D),!Ag.inlinePrompt&&(Ag.inactiveIcon||Ag.inactiveText||Gg.$slots.inactive)?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(ag.value)},[vue.renderSlot(Gg.$slots,"inactive",{},()=>[Ag.inactiveIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.inactiveIcon&&Ag.inactiveText?(vue.openBlock(),vue.createElementBlock("span",{key:1,"aria-hidden":bg.value},vue.toDisplayString(Ag.inactiveText),9,_hoisted_2$r)):vue.createCommentVNode("v-if",!0)])],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(ng).e("core")),style:vue.normalizeStyle(dg.value)},[Ag.inlinePrompt?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ng).e("inner"))},[bg.value?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(ng).e("inner-wrapper"))},[vue.renderSlot(Gg.$slots,"active",{},()=>[Ag.activeIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.activeIcon&&Ag.activeText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$d,vue.toDisplayString(Ag.activeText),1)):vue.createCommentVNode("v-if",!0)])],2)):(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ng).e("inner-wrapper"))},[vue.renderSlot(Gg.$slots,"inactive",{},()=>[Ag.inactiveIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.inactiveIcon&&Ag.inactiveText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$k,vue.toDisplayString(Ag.inactiveText),1)):vue.createCommentVNode("v-if",!0)])],2))],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{class:vue.normalizeClass(vue.unref(ng).e("action"))},[Ag.loading?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(ng).is("loading"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(loading_default))]),_:1},8,["class"])):bg.value?vue.renderSlot(Gg.$slots,"active-action",{key:1},()=>[Ag.activeActionIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeActionIcon)))]),_:1})):vue.createCommentVNode("v-if",!0)]):bg.value?vue.createCommentVNode("v-if",!0):vue.renderSlot(Gg.$slots,"inactive-action",{key:2},()=>[Ag.inactiveActionIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveActionIcon)))]),_:1})):vue.createCommentVNode("v-if",!0)])],2)],6),!Ag.inlinePrompt&&(Ag.activeIcon||Ag.activeText||Gg.$slots.active)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(ug.value)},[vue.renderSlot(Gg.$slots,"active",{},()=>[Ag.activeIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.activeIcon&&Ag.activeText?(vue.openBlock(),vue.createElementBlock("span",{key:1,"aria-hidden":!bg.value},vue.toDisplayString(Ag.activeText),9,_hoisted_5$b)):vue.createCommentVNode("v-if",!0)])],2)):vue.createCommentVNode("v-if",!0)],2))}}),switch_default=switch_vue_vue_type_script_setup_true_lang_default;const ElSwitch=withInstall(switch_default),textProps=buildProps({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:componentSizes,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var text_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElText",__name:"text",props:textProps,setup(Ag){const gg=Ag,eg=vue.ref(),Ig=useFormSize(),Cg=useNamespace("text"),tg=vue.computed(()=>[Cg.b(),Cg.m(gg.type),Cg.m(Ig.value),Cg.is("truncated",gg.truncated),Cg.is("line-clamp",!isUndefined(gg.lineClamp))]),ig=()=>{var og,sg,rg,cg,ag,ug,dg;if(vue.useAttrs().title)return;let ng=!1;const lg=((og=eg.value)==null?void 0:og.textContent)||"";if(gg.truncated){const hg=(sg=eg.value)==null?void 0:sg.offsetWidth,bg=(rg=eg.value)==null?void 0:rg.scrollWidth;hg&&bg&&bg>hg&&(ng=!0)}else if(!isUndefined(gg.lineClamp)){const hg=(cg=eg.value)==null?void 0:cg.offsetHeight,bg=(ag=eg.value)==null?void 0:ag.scrollHeight;hg&&bg&&bg>hg&&(ng=!0)}ng?(ug=eg.value)==null||ug.setAttribute("title",lg):(dg=eg.value)==null||dg.removeAttribute("title")};return vue.onMounted(ig),vue.onUpdated(ig),(ng,lg)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.tag),{ref_key:"textRef",ref:eg,class:vue.normalizeClass(tg.value),style:vue.normalizeStyle({"-webkit-line-clamp":Ag.lineClamp})},{default:vue.withCtx(()=>[vue.renderSlot(ng.$slots,"default")]),_:3},8,["class","style"]))}}),text_default=text_vue_vue_type_script_setup_true_lang_default;const ElText=withInstall(text_default),ROOT_TREE_INJECTION_KEY="RootTree",NODE_INSTANCE_INJECTION_KEY="NodeInstance",TREE_NODE_MAP_INJECTION_KEY="TreeNodeMap",treeProps=buildProps({data:{type:definePropType(Array),default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkOnClickLeaf:{type:Boolean,default:!0},checkDescendants:Boolean,autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array},defaultExpandedKeys:{type:Array},currentNodeKey:{type:[String,Number]},renderContent:{type:definePropType(Function)},showCheckbox:Boolean,draggable:Boolean,allowDrag:{type:definePropType(Function)},allowDrop:{type:definePropType(Function)},props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:Boolean,highlightCurrent:Boolean,load:{type:Function},filterNodeMethod:{type:Function},accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}}),treeEmits={"check-change":(Ag,gg,eg)=>Ag&&isBoolean(gg)&&isBoolean(eg),"current-change":(Ag,gg)=>!0,"node-click":(Ag,gg,eg,Ig)=>Ag&&gg&&Ig instanceof Event,"node-contextmenu":(Ag,gg,eg,Ig)=>Ag instanceof Event&&gg&&eg,"node-collapse":(Ag,gg,eg)=>Ag&&gg,"node-expand":(Ag,gg,eg)=>Ag&&gg,check:(Ag,gg)=>Ag&&gg,"node-drag-start":(Ag,gg)=>Ag&&gg,"node-drag-end":(Ag,gg,eg,Ig)=>Ag&&Ig,"node-drop":(Ag,gg,eg,Ig)=>Ag&&gg&&Ig,"node-drag-leave":(Ag,gg,eg)=>Ag&&gg&&eg,"node-drag-enter":(Ag,gg,eg)=>Ag&&gg&&eg,"node-drag-over":(Ag,gg,eg)=>Ag&&gg&&eg},NODE_KEY="$treeNodeId",markNodeData=function(Ag,gg){!gg||gg[NODE_KEY]||Object.defineProperty(gg,NODE_KEY,{value:Ag.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=(Ag,gg)=>gg==null?void 0:gg[Ag||NODE_KEY],handleCurrentChange=(Ag,gg,eg)=>{const Ig=Ag.value.currentNode;eg();const Cg=Ag.value.currentNode;Ig!==Cg&&gg("current-change",Cg?Cg.data:null,Cg)},getChildState=Ag=>{let gg=!0,eg=!0,Ig=!0,Cg=!0;for(let tg=0,ig=Ag.length;tg<ig;tg++){const ng=Ag[tg];(ng.checked!==!0||ng.indeterminate)&&(gg=!1,ng.disabled||(Ig=!1)),(ng.checked!==!1||ng.indeterminate)&&(eg=!1),ng.isEffectivelyChecked||(Cg=!1)}return{all:gg,none:eg,allWithoutDisable:Ig,half:!gg&&!eg,isEffectivelyChecked:Cg}},reInitChecked=function(Ag){if(Ag.childNodes.length===0||Ag.loading){Ag.isEffectivelyChecked=Ag.disabled||Ag.checked;return}const{all:gg,none:eg,half:Ig,isEffectivelyChecked:Cg}=getChildState(Ag.childNodes);Ag.isEffectivelyChecked=Cg,gg?(Ag.checked=!0,Ag.indeterminate=!1):Ig?(Ag.checked=!1,Ag.indeterminate=!0):eg&&(Ag.checked=!1,Ag.indeterminate=!1);const tg=Ag.parent;!tg||tg.level===0||Ag.store.checkStrictly||reInitChecked(tg)},getPropertyFromData=function(Ag,gg){const eg=Ag.store.props,Ig=Ag.data||{},Cg=eg[gg];if(isFunction$1(Cg))return Cg(Ig,Ag);if(isString(Cg))return Ig[Cg];if(isUndefined(Cg)){const tg=Ig[gg];return isUndefined(tg)?"":tg}},setCanFocus=function(Ag,gg){Ag.forEach(eg=>{eg.canFocus=gg,setCanFocus(eg.childNodes,gg)})};let nodeIdSeed=0;var Node$1=class Rl{constructor(gg){this.isLeafByUser=void 0,this.isLeaf=void 0,this.isEffectivelyChecked=!1,this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const eg in gg)hasOwn$b(gg,eg)&&(this[eg]=gg[eg]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){var tg;const gg=this.store;if(!gg)throw new Error("[Node]store is required!");gg.registerNode(this);const eg=gg.props;if(eg&&typeof eg.isLeaf<"u"){const ig=getPropertyFromData(this,"isLeaf");isBoolean(ig)&&(this.isLeafByUser=ig)}if(gg.lazy!==!0&&this.data?(this.setData(this.data),gg.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&gg.lazy&&gg.defaultExpandAll&&!this.isLeafByUser&&this.expand(),isArray$4(this.data)||markNodeData(this,this.data),!this.data)return;const Ig=gg.defaultExpandedKeys,Cg=gg.key;Cg&&!isNil(this.key)&&Ig&&Ig.includes(this.key)&&this.expand(null,gg.autoExpandParent),Cg&&gg.currentNodeKey!==void 0&&this.key===gg.currentNodeKey&&(gg.currentNode&&(gg.currentNode.isCurrent=!1),gg.currentNode=this,gg.currentNode.isCurrent=!0),gg.lazy&&gg._initDefaultCheckedNode(this),this.updateLeafState(),(this.level===1||((tg=this.parent)==null?void 0:tg.expanded)===!0)&&(this.canFocus=!0)}setData(gg){isArray$4(gg)||markNodeData(this,gg),this.data=gg,this.childNodes=[];let eg;this.level===0&&isArray$4(this.data)?eg=this.data:eg=getPropertyFromData(this,"children")||[];for(let Ig=0,Cg=eg.length;Ig<Cg;Ig++)this.insertChild({data:eg[Ig]})}get label(){return getPropertyFromData(this,"label")}get key(){const gg=this.store.key;return this.data?this.data[gg]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const gg=this.parent;if(gg){const eg=gg.childNodes.indexOf(this);if(eg>-1)return gg.childNodes[eg+1]}return null}get previousSibling(){const gg=this.parent;if(gg){const eg=gg.childNodes.indexOf(this);if(eg>-1)return eg>0?gg.childNodes[eg-1]:null}return null}contains(gg,eg=!0){return(this.childNodes||[]).some(Ig=>Ig===gg||eg&&Ig.contains(gg))}remove(){const gg=this.parent;gg&&gg.removeChild(this)}insertChild(gg,eg,Ig){if(!gg)throw new Error("InsertChild error: child is required.");if(!(gg instanceof Rl)){if(!Ig){const Cg=this.getChildren(!0);Cg!=null&&Cg.includes(gg.data)||(isUndefined(eg)||eg<0?Cg==null||Cg.push(gg.data):Cg==null||Cg.splice(eg,0,gg.data))}Object.assign(gg,{parent:this,store:this.store}),gg=vue.reactive(new Rl(gg)),gg instanceof Rl&&gg.initialize()}gg.level=this.level+1,isUndefined(eg)||eg<0?this.childNodes.push(gg):this.childNodes.splice(eg,0,gg),this.updateLeafState()}insertBefore(gg,eg){let Ig;eg&&(Ig=this.childNodes.indexOf(eg)),this.insertChild(gg,Ig)}insertAfter(gg,eg){let Ig;eg&&(Ig=this.childNodes.indexOf(eg),Ig!==-1&&(Ig+=1)),this.insertChild(gg,Ig)}removeChild(gg){const eg=this.getChildren()||[],Ig=eg.indexOf(gg.data);Ig>-1&&eg.splice(Ig,1);const Cg=this.childNodes.indexOf(gg);Cg>-1&&(this.store&&this.store.deregisterNode(gg),gg.parent=null,this.childNodes.splice(Cg,1)),this.updateLeafState()}removeChildByData(gg){const eg=this.childNodes.find(Ig=>Ig.data===gg);eg&&this.removeChild(eg)}expand(gg,eg){const Ig=()=>{if(eg){let Cg=this.parent;for(;Cg&&Cg.level>0;)Cg.expanded=!0,Cg=Cg.parent}this.expanded=!0,gg&&gg(),setCanFocus(this.childNodes,!0)};this.shouldLoadData()?this.loadData(Cg=>{isArray$4(Cg)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),Ig())}):Ig()}doCreateChildren(gg,eg={}){gg.forEach(Ig=>{this.insertChild(Object.assign({data:Ig},eg),void 0,!0)})}collapse(){this.expanded=!1,setCanFocus(this.childNodes,!1)}shouldLoadData(){return!!(this.store.lazy===!0&&this.store.load&&!this.loaded)}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}const gg=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!gg||gg.length===0,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}this.isLeaf=!1}setChecked(gg,eg,Ig,Cg){if(this.indeterminate=gg==="half",this.checked=gg===!0,this.isEffectivelyChecked=!this.childNodes.length&&(this.disabled||this.checked),this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const ig=()=>{if(eg){const ng=this.childNodes;for(let rg=0,cg=ng.length;rg<cg;rg++){const ag=ng[rg];Cg=Cg||gg!==!1;const ug=ag.disabled&&ag.isLeaf?ag.checked:Cg;ag.setChecked(ug,eg,!0,Cg)}const{half:lg,all:og,isEffectivelyChecked:sg}=getChildState(ng);og||(this.checked=og,this.indeterminate=lg),this.isEffectivelyChecked=this.childNodes.length?sg:this.disabled||this.checked}};if(this.shouldLoadData()){this.loadData(()=>{ig(),reInitChecked(this)},{checked:gg!==!1});return}else ig()}const tg=this.parent;!tg||tg.level===0||Ig||reInitChecked(tg)}getChildren(gg=!1){if(this.level===0)return this.data;const eg=this.data;if(!eg)return null;const Ig=this.store.props;let Cg="children";return Ig&&(Cg=Ig.children||"children"),isUndefined(eg[Cg])&&(eg[Cg]=null),gg&&!eg[Cg]&&(eg[Cg]=[]),eg[Cg]}updateChildren(){const gg=this.getChildren()||[],eg=this.childNodes.map(tg=>tg.data),Ig={},Cg=[];gg.forEach((tg,ig)=>{const ng=tg[NODE_KEY];ng&&eg.some(lg=>(lg==null?void 0:lg[NODE_KEY])===ng)?Ig[ng]={index:ig,data:tg}:Cg.push({index:ig,data:tg})}),this.store.lazy||eg.forEach(tg=>{Ig[tg==null?void 0:tg[NODE_KEY]]||this.removeChildByData(tg)}),Cg.forEach(({index:tg,data:ig})=>{this.insertChild({data:ig},tg)}),this.updateLeafState()}loadData(gg,eg={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(eg).length)){this.loading=!0;const Ig=tg=>{this.childNodes=[],this.doCreateChildren(tg,eg),this.loaded=!0,this.loading=!1,this.updateLeafState(),gg&&gg.call(this,tg)},Cg=()=>{this.loading=!1};this.store.load(this,Ig,Cg)}else gg&&gg.call(this)}eachNode(gg){const eg=[this];for(;eg.length;){const Ig=eg.shift();eg.unshift(...Ig.childNodes),gg(Ig)}}reInitChecked(){this.store.checkStrictly||reInitChecked(this)}},TreeStore=class{constructor(Ag){this.lazy=!1,this.checkStrictly=!1,this.autoExpandParent=!1,this.defaultExpandAll=!1,this.checkDescendants=!1,this.currentNode=null,this.currentNodeKey=null;for(const gg in Ag)hasOwn$b(Ag,gg)&&(this[gg]=Ag[gg]);this.nodesMap={}}initialize(){if(this.root=new Node$1({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const Ag=this.load;Ag(this.root,gg=>{this.root.doCreateChildren(gg),this._initDefaultCheckedNodes()},NOOP)}else this._initDefaultCheckedNodes()}filter(Ag){const gg=this.filterNodeMethod,eg=this.lazy,Ig=async function(Cg){const tg=Cg.root?Cg.root.childNodes:Cg.childNodes;for(const[ig,ng]of tg.entries())ng.visible=!!(gg!=null&&gg.call(ng,Ag,ng.data,ng)),ig%80===0&&ig>0&&await vue.nextTick(),await Ig(ng);if(!Cg.visible&&tg.length){let ig=!0;ig=!tg.some(ng=>ng.visible),Cg.root?Cg.root.visible=ig===!1:Cg.visible=ig===!1}Ag&&Cg.visible&&!Cg.isLeaf&&(!eg||Cg.loaded)&&Cg.expand()};Ig(this)}setData(Ag){Ag!==this.root.data?(this.nodesMap={},this.root.setData(Ag),this._initDefaultCheckedNodes(),this.setCurrentNodeKey(this.currentNodeKey)):this.root.updateChildren()}getNode(Ag){if(Ag instanceof Node$1)return Ag;const gg=isObject$h(Ag)?getNodeKey(this.key,Ag):Ag;return this.nodesMap[gg]||null}insertBefore(Ag,gg){var Ig;const eg=this.getNode(gg);(Ig=eg.parent)==null||Ig.insertBefore({data:Ag},eg)}insertAfter(Ag,gg){var Ig;const eg=this.getNode(gg);(Ig=eg.parent)==null||Ig.insertAfter({data:Ag},eg)}remove(Ag){const gg=this.getNode(Ag);gg&&gg.parent&&(gg===this.currentNode&&(this.currentNode=null),gg.parent.removeChild(gg))}append(Ag,gg){const eg=isPropAbsent(gg)?this.root:this.getNode(gg);eg&&eg.insertChild({data:Ag})}_initDefaultCheckedNodes(){const Ag=this.defaultCheckedKeys||[],gg=this.nodesMap;Ag.forEach(eg=>{const Ig=gg[eg];Ig&&Ig.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(Ag){const gg=this.defaultCheckedKeys||[];!isNil(Ag.key)&&gg.includes(Ag.key)&&Ag.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(Ag){Ag!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=Ag,this._initDefaultCheckedNodes())}registerNode(Ag){const gg=this.key;if(!(!Ag||!Ag.data))if(!gg)this.nodesMap[Ag.id]=Ag;else{const eg=Ag.key;isNil(eg)||(this.nodesMap[eg]=Ag)}}deregisterNode(Ag){!this.key||!Ag||!Ag.data||(Ag.childNodes.forEach(gg=>{this.deregisterNode(gg)}),delete this.nodesMap[Ag.key])}getCheckedNodes(Ag=!1,gg=!1){const eg=[],Ig=function(Cg){(Cg.root?Cg.root.childNodes:Cg.childNodes).forEach(tg=>{(tg.checked||gg&&tg.indeterminate)&&(!Ag||Ag&&tg.isLeaf)&&eg.push(tg.data),Ig(tg)})};return Ig(this),eg}getCheckedKeys(Ag=!1){return this.getCheckedNodes(Ag).map(gg=>(gg||{})[this.key])}getHalfCheckedNodes(){const Ag=[],gg=function(eg){(eg.root?eg.root.childNodes:eg.childNodes).forEach(Ig=>{Ig.indeterminate&&Ag.push(Ig.data),gg(Ig)})};return gg(this),Ag}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(Ag=>(Ag||{})[this.key])}_getAllNodes(){const Ag=[],gg=this.nodesMap;for(const eg in gg)hasOwn$b(gg,eg)&&Ag.push(gg[eg]);return Ag}updateChildren(Ag,gg){const eg=this.nodesMap[Ag];if(!eg)return;const Ig=eg.childNodes;for(let Cg=Ig.length-1;Cg>=0;Cg--){const tg=Ig[Cg];this.remove(tg.data)}for(let Cg=0,tg=gg.length;Cg<tg;Cg++){const ig=gg[Cg];this.append(ig,eg.data)}}_setCheckedKeys(Ag,gg=!1,eg){const Ig=this._getAllNodes().sort((ng,lg)=>ng.level-lg.level),Cg=Object.create(null),tg=Object.keys(eg);Ig.forEach(ng=>ng.setChecked(!1,!1));const ig=ng=>{ng.childNodes.forEach(lg=>{var og;Cg[lg.data[Ag]]=!0,(og=lg.childNodes)!=null&&og.length&&ig(lg)})};for(let ng=0,lg=Ig.length;ng<lg;ng++){const og=Ig[ng],sg=og.data[Ag].toString();if(!tg.includes(sg)){og.checked&&!Cg[sg]&&og.setChecked(!1,!1);continue}if(og.childNodes.length&&ig(og),og.isLeaf||this.checkStrictly){og.setChecked(!0,!1);continue}if(og.setChecked(!0,!0),gg){og.setChecked(!1,!1,!0);const rg=function(cg){cg.childNodes.forEach(ag=>{ag.isLeaf||ag.setChecked(!1,!1,!0),rg(ag)}),cg.reInitChecked()};rg(og)}}}setCheckedNodes(Ag,gg=!1){const eg=this.key,Ig={};Ag.forEach(Cg=>{Ig[(Cg||{})[eg]]=!0}),this._setCheckedKeys(eg,gg,Ig)}setCheckedKeys(Ag,gg=!1){this.defaultCheckedKeys=Ag;const eg=this.key,Ig={};Ag.forEach(Cg=>{Ig[Cg]=!0}),this._setCheckedKeys(eg,gg,Ig)}setDefaultExpandedKeys(Ag){Ag=Ag||[],this.defaultExpandedKeys=Ag,Ag.forEach(gg=>{const eg=this.getNode(gg);eg&&eg.expand(null,this.autoExpandParent)})}setChecked(Ag,gg,eg){const Ig=this.getNode(Ag);Ig&&Ig.setChecked(!!gg,eg)}getCurrentNode(){return this.currentNode}setCurrentNode(Ag){const gg=this.currentNode;gg&&(gg.isCurrent=!1),this.currentNode=Ag,this.currentNode.isCurrent=!0}setUserCurrentNode(Ag,gg=!0){var Cg;const eg=Ag[this.key],Ig=this.nodesMap[eg];this.setCurrentNode(Ig),gg&&this.currentNode&&this.currentNode.level>1&&((Cg=this.currentNode.parent)==null||Cg.expand(null,!0))}setCurrentNodeKey(Ag,gg=!0){var Ig;if(this.currentNodeKey=Ag,isPropAbsent(Ag)){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const eg=this.getNode(Ag);eg&&(this.setCurrentNode(eg),gg&&this.currentNode&&this.currentNode.level>1&&((Ig=this.currentNode.parent)==null||Ig.expand(null,!0)))}};function useNodeExpandEventBroadcast(Ag){const gg=vue.inject(TREE_NODE_MAP_INJECTION_KEY,null);let eg={treeNodeExpand:Ig=>{var Cg;Ag.node!==Ig&&((Cg=Ag.node)==null||Cg.collapse())},children:new Set};return gg&&gg.children.add(eg),vue.onBeforeUnmount(()=>{gg&&gg.children.delete(eg),eg=null}),vue.provide(TREE_NODE_MAP_INJECTION_KEY,eg),{broadcastExpanded:Ig=>{if(Ag.accordion)for(const Cg of eg.children)Cg.treeNodeExpand(Ig)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:Ag,ctx:gg,el$:eg,dropIndicator$:Ig,store:Cg}){const tg=useNamespace("tree"),ig=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),ng=({event:sg,treeNode:rg})=>{if(sg.dataTransfer){if(isFunction$1(Ag.allowDrag)&&!Ag.allowDrag(rg.node))return sg.preventDefault(),!1;sg.dataTransfer.effectAllowed="move";try{sg.dataTransfer.setData("text/plain","")}catch{}ig.value.draggingNode=rg,gg.emit("node-drag-start",rg.node,sg)}},lg=({event:sg,treeNode:rg})=>{if(!sg.dataTransfer)return;const cg=rg,ag=ig.value.dropNode;ag&&ag.node.id!==cg.node.id&&removeClass(ag.$el,tg.is("drop-inner"));const ug=ig.value.draggingNode;if(!ug||!cg)return;let dg=!0,hg=!0,bg=!0,mg=!0;isFunction$1(Ag.allowDrop)&&(dg=Ag.allowDrop(ug.node,cg.node,"prev"),mg=hg=Ag.allowDrop(ug.node,cg.node,"inner"),bg=Ag.allowDrop(ug.node,cg.node,"next")),sg.dataTransfer.dropEffect=hg||dg||bg?"move":"none",(dg||hg||bg)&&(ag==null?void 0:ag.node.id)!==cg.node.id&&(ag&&gg.emit("node-drag-leave",ug.node,ag.node,sg),gg.emit("node-drag-enter",ug.node,cg.node,sg)),dg||hg||bg?ig.value.dropNode=cg:ig.value.dropNode=null,cg.node.nextSibling===ug.node&&(bg=!1),cg.node.previousSibling===ug.node&&(dg=!1),cg.node.contains(ug.node,!1)&&(hg=!1),(ug.node===cg.node||ug.node.contains(cg.node))&&(dg=!1,hg=!1,bg=!1);const Zg=cg.$el,Bg=Zg.querySelector(`.${tg.be("node","content")}`).getBoundingClientRect(),Gg=eg.value.getBoundingClientRect(),pg=eg.value.scrollTop;let fg;const Vg=dg?hg?.25:bg?.45:1:Number.NEGATIVE_INFINITY,Wg=bg?hg?.75:dg?.55:0:Number.POSITIVE_INFINITY;let Hg=-9999;const Sg=sg.clientY-Bg.top;Sg<Bg.height*Vg?fg="before":Sg>Bg.height*Wg?fg="after":hg?fg="inner":fg="none";const wg=Zg.querySelector(`.${tg.be("node","expand-icon")}`).getBoundingClientRect(),Xg=Ig.value;fg==="before"?Hg=wg.top-Gg.top+pg:fg==="after"&&(Hg=wg.bottom-Gg.top+pg),Xg.style.top=`${Hg}px`,Xg.style.left=`${wg.right-Gg.left}px`,fg==="inner"?addClass(Zg,tg.is("drop-inner")):removeClass(Zg,tg.is("drop-inner")),ig.value.showDropIndicator=fg==="before"||fg==="after",ig.value.allowDrop=ig.value.showDropIndicator||mg,ig.value.dropType=fg,gg.emit("node-drag-over",ug.node,cg.node,sg)},og=sg=>{var ug,dg;const{draggingNode:rg,dropType:cg,dropNode:ag}=ig.value;if(sg.preventDefault(),sg.dataTransfer&&(sg.dataTransfer.dropEffect="move"),rg!=null&&rg.node.data&&ag){const hg={data:rg.node.data};cg!=="none"&&rg.node.remove(),cg==="before"?(ug=ag.node.parent)==null||ug.insertBefore(hg,ag.node):cg==="after"?(dg=ag.node.parent)==null||dg.insertAfter(hg,ag.node):cg==="inner"&&ag.node.insertChild(hg),cg!=="none"&&(Cg.value.registerNode(hg),Cg.value.key&&rg.node.eachNode(bg=>{var mg;(mg=Cg.value.nodesMap[bg.data[Cg.value.key]])==null||mg.setChecked(bg.checked,!Cg.value.checkStrictly)})),removeClass(ag.$el,tg.is("drop-inner")),gg.emit("node-drag-end",rg.node,ag.node,cg,sg),cg!=="none"&&gg.emit("node-drop",rg.node,ag.node,cg,sg)}rg&&!ag&&gg.emit("node-drag-end",rg.node,null,cg,sg),ig.value.showDropIndicator=!1,ig.value.draggingNode=null,ig.value.dropNode=null,ig.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:ng,treeNodeDragOver:lg,treeNodeDragEnd:og}),{dragState:ig}}var tree_node_content_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(Ag){const gg=useNamespace("tree"),eg=vue.inject(NODE_INSTANCE_INJECTION_KEY),Ig=vue.inject(ROOT_TREE_INJECTION_KEY);return()=>{const Cg=Ag.node,{data:tg,store:ig}=Cg;return Ag.renderContent?Ag.renderContent(vue.h,{_self:eg,node:Cg,data:tg,store:ig}):vue.renderSlot(Ig.ctx.slots,"default",{node:Cg,data:tg},()=>[vue.h(ElText,{tag:"span",truncated:!0,class:gg.be("node","label")},()=>[Cg.label])])}}}),tree_node_content_default=tree_node_content_vue_vue_type_script_lang_default,tree_node_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition,ElCheckbox,NodeContent:tree_node_content_default,ElIcon,Loading:loading_default},props:{node:{type:Node$1,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:Boolean},emits:["node-expand"],setup(Ag,gg){const eg=useNamespace("tree"),{broadcastExpanded:Ig}=useNodeExpandEventBroadcast(Ag),Cg=vue.inject(ROOT_TREE_INJECTION_KEY),tg=vue.ref(!1),ig=vue.ref(!1),ng=vue.ref(),lg=vue.ref(),og=vue.ref(),sg=vue.inject(dragEventsKey),rg=vue.getCurrentInstance();vue.provide(NODE_INSTANCE_INJECTION_KEY,rg),Cg||debugWarn("Tree","Can not find node's tree."),Ag.node.expanded&&(tg.value=!0,ig.value=!0);const cg=Cg.props.props.children||"children";vue.watch(()=>{var Hg;const Wg=(Hg=Ag.node.data)==null?void 0:Hg[cg];return Wg&&[...Wg]},()=>{Ag.node.updateChildren()}),vue.watch(()=>Ag.node.indeterminate,Wg=>{dg(Ag.node.checked,Wg)}),vue.watch(()=>Ag.node.checked,Wg=>{dg(Wg,Ag.node.indeterminate)}),vue.watch(()=>Ag.node.childNodes.length,()=>Ag.node.reInitChecked()),vue.watch(()=>Ag.node.expanded,Wg=>{vue.nextTick(()=>tg.value=Wg),Wg&&(ig.value=!0)});const ag=Wg=>Cg.props.nodeKey?getNodeKey(Cg.props.nodeKey,Wg.data):Wg.id,ug=Wg=>{const Hg=Ag.props.class;if(!Hg)return{};let Sg;if(isFunction$1(Hg)){const{data:wg}=Wg;Sg=Hg(wg,Wg)}else Sg=Hg;return isString(Sg)?{[Sg]:!0}:Sg},dg=(Wg,Hg)=>{(ng.value!==Wg||lg.value!==Hg)&&Cg.ctx.emit("check-change",Ag.node.data,Wg,Hg),ng.value=Wg,lg.value=Hg},hg=Wg=>{handleCurrentChange(Cg.store,Cg.ctx.emit,()=>{var Hg;if((Hg=Cg==null?void 0:Cg.props)!=null&&Hg.nodeKey){const Sg=ag(Ag.node);Cg.store.value.setCurrentNodeKey(Sg)}else Cg.store.value.setCurrentNode(Ag.node)}),Cg.currentNode.value=Ag.node,Cg.props.expandOnClickNode&&mg(),(Cg.props.checkOnClickNode||Ag.node.isLeaf&&Cg.props.checkOnClickLeaf&&Ag.showCheckbox)&&!Ag.node.disabled&&Zg(!Ag.node.checked),Cg.ctx.emit("node-click",Ag.node.data,Ag.node,rg,Wg)},bg=Wg=>{var Hg;(Hg=Cg.instance.vnode.props)!=null&&Hg.onNodeContextmenu&&(Wg.stopPropagation(),Wg.preventDefault()),Cg.ctx.emit("node-contextmenu",Wg,Ag.node.data,Ag.node,rg)},mg=()=>{Ag.node.isLeaf||(tg.value?(Cg.ctx.emit("node-collapse",Ag.node.data,Ag.node,rg),Ag.node.collapse()):Ag.node.expand(()=>{gg.emit("node-expand",Ag.node.data,Ag.node,rg)}))},Zg=Wg=>{const Hg=Cg==null?void 0:Cg.props.checkStrictly,Sg=Ag.node.childNodes;!Hg&&Sg.length&&(Wg=Sg.some(wg=>!wg.isEffectivelyChecked)),Ag.node.setChecked(Wg,!Hg),vue.nextTick(()=>{const wg=Cg.store.value;Cg.ctx.emit("check",Ag.node.data,{checkedNodes:wg.getCheckedNodes(),checkedKeys:wg.getCheckedKeys(),halfCheckedNodes:wg.getHalfCheckedNodes(),halfCheckedKeys:wg.getHalfCheckedKeys()})})};return{ns:eg,node$:og,tree:Cg,expanded:tg,childNodeRendered:ig,oldChecked:ng,oldIndeterminate:lg,getNodeKey:ag,getNodeClass:ug,handleSelectChange:dg,handleClick:hg,handleContextMenu:bg,handleExpandIconClick:mg,handleCheckChange:Zg,handleChildNodeExpand:(Wg,Hg,Sg)=>{Ig(Hg),Cg.ctx.emit("node-expand",Wg,Hg,Sg)},handleDragStart:Wg=>{Cg.props.draggable&&sg.treeNodeDragStart({event:Wg,treeNode:Ag})},handleDragOver:Wg=>{Wg.preventDefault(),Cg.props.draggable&&sg.treeNodeDragOver({event:Wg,treeNode:{$el:og.value,node:Ag.node}})},handleDrop:Wg=>{Wg.preventDefault()},handleDragEnd:Wg=>{Cg.props.draggable&&sg.treeNodeDragEnd(Wg)},CaretRight:caret_right_default}}});const _hoisted_1$C=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$q=["aria-expanded"];function _sfc_render$2(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-icon"),ng=vue.resolveComponent("el-checkbox"),lg=vue.resolveComponent("loading"),og=vue.resolveComponent("node-content"),sg=vue.resolveComponent("el-tree-node"),rg=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([Ag.ns.b("node"),Ag.ns.is("expanded",Ag.expanded),Ag.ns.is("current",Ag.node.isCurrent),Ag.ns.is("hidden",!Ag.node.visible),Ag.ns.is("focusable",!Ag.node.disabled),Ag.ns.is("checked",!Ag.node.disabled&&Ag.node.checked),Ag.getNodeClass(Ag.node)]),role:"treeitem",tabindex:"-1","aria-expanded":Ag.expanded,"aria-disabled":Ag.node.disabled,"aria-checked":Ag.node.checked,draggable:Ag.tree.props.draggable,"data-key":Ag.getNodeKey(Ag.node),onClick:gg[2]||(gg[2]=vue.withModifiers((...cg)=>Ag.handleClick&&Ag.handleClick(...cg),["stop"])),onContextmenu:gg[3]||(gg[3]=(...cg)=>Ag.handleContextMenu&&Ag.handleContextMenu(...cg)),onDragstart:gg[4]||(gg[4]=vue.withModifiers((...cg)=>Ag.handleDragStart&&Ag.handleDragStart(...cg),["stop"])),onDragover:gg[5]||(gg[5]=vue.withModifiers((...cg)=>Ag.handleDragOver&&Ag.handleDragOver(...cg),["stop"])),onDragend:gg[6]||(gg[6]=vue.withModifiers((...cg)=>Ag.handleDragEnd&&Ag.handleDragEnd(...cg),["stop"])),onDrop:gg[7]||(gg[7]=vue.withModifiers((...cg)=>Ag.handleDrop&&Ag.handleDrop(...cg),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(Ag.node.level-1)*Ag.tree.props.indent+"px"})},[Ag.tree.props.icon||Ag.CaretRight?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.be("node","expand-icon"),Ag.ns.is("leaf",Ag.node.isLeaf),{expanded:!Ag.node.isLeaf&&Ag.expanded}]),onClick:vue.withModifiers(Ag.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.tree.props.icon||Ag.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),Ag.showCheckbox?(vue.openBlock(),vue.createBlock(ng,{key:1,"model-value":Ag.node.checked,indeterminate:Ag.node.indeterminate,disabled:!!Ag.node.disabled,onClick:gg[0]||(gg[0]=vue.withModifiers(()=>{},["stop"])),onChange:Ag.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),Ag.node.loading?(vue.openBlock(),vue.createBlock(ig,{key:2,class:vue.normalizeClass([Ag.ns.be("node","loading-icon"),Ag.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(lg)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(og,{node:Ag.node,"render-content":Ag.renderContent},null,8,["node","render-content"])],6),vue.createVNode(rg,null,{default:vue.withCtx(()=>[!Ag.renderAfterExpand||Ag.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(Ag.ns.be("node","children")),role:"group","aria-expanded":Ag.expanded,onClick:gg[1]||(gg[1]=vue.withModifiers(()=>{},["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.node.childNodes,cg=>(vue.openBlock(),vue.createBlock(sg,{key:Ag.getNodeKey(cg),"render-content":Ag.renderContent,"render-after-expand":Ag.renderAfterExpand,"show-checkbox":Ag.showCheckbox,node:cg,accordion:Ag.accordion,props:Ag.props,onNodeExpand:Ag.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$q)),[[vue.vShow,Ag.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$C)),[[vue.vShow,Ag.node.visible]])}var tree_node_default=_plugin_vue_export_helper_default(tree_node_vue_vue_type_script_lang_default,[["render",_sfc_render$2]]);function useKeydown({el$:Ag},gg){const eg=useNamespace("tree");vue.onMounted(()=>{tg()}),vue.onUpdated(()=>{var ig;(ig=Ag.value)==null||ig.querySelectorAll("input[type=checkbox]").forEach(ng=>{ng.setAttribute("tabindex","-1")})});function Ig(ig,ng){var og,sg;const lg=gg.value.getNode(ig[ng].dataset.key);return lg.canFocus&&lg.visible&&(((og=lg.parent)==null?void 0:og.expanded)||((sg=lg.parent)==null?void 0:sg.level)===0)}useEventListener(Ag,"keydown",ig=>{const ng=ig.target;if(!ng.className.includes(eg.b("node")))return;const lg=getEventCode(ig),og=Array.from(Ag.value.querySelectorAll(`.${eg.is("focusable")}[role=treeitem]`)),sg=og.indexOf(ng);let rg;if([EVENT_CODE.up,EVENT_CODE.down].includes(lg)){if(ig.preventDefault(),lg===EVENT_CODE.up){rg=sg===-1?0:sg!==0?sg-1:og.length-1;const ag=rg;for(;!Ig(og,rg);){if(rg--,rg===ag){rg=-1;break}rg<0&&(rg=og.length-1)}}else{rg=sg===-1?0:sg<og.length-1?sg+1:0;const ag=rg;for(;!Ig(og,rg);){if(rg++,rg===ag){rg=-1;break}rg>=og.length&&(rg=0)}}rg!==-1&&og[rg].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(lg)&&(ig.preventDefault(),ng.click());const cg=ng.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space].includes(lg)&&cg&&(ig.preventDefault(),cg.click())});const tg=()=>{var lg;if(!Ag.value)return;const ig=Array.from(Ag.value.querySelectorAll(`.${eg.is("focusable")}[role=treeitem]`));Array.from(Ag.value.querySelectorAll("input[type=checkbox]")).forEach(og=>{og.setAttribute("tabindex","-1")});const ng=Ag.value.querySelectorAll(`.${eg.is("checked")}[role=treeitem]`);if(ng.length){ng[0].setAttribute("tabindex","0");return}(lg=ig[0])==null||lg.setAttribute("tabindex","0")}}var tree_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTree",components:{ElTreeNode:tree_node_default},props:treeProps,emits:treeEmits,setup(Ag,gg){const{t:eg}=useLocale(),Ig=useNamespace("tree"),Cg=vue.ref(new TreeStore({key:Ag.nodeKey,data:Ag.data,lazy:Ag.lazy,props:Ag.props,load:Ag.load,currentNodeKey:Ag.currentNodeKey,checkStrictly:Ag.checkStrictly,checkDescendants:Ag.checkDescendants,defaultCheckedKeys:Ag.defaultCheckedKeys,defaultExpandedKeys:Ag.defaultExpandedKeys,autoExpandParent:Ag.autoExpandParent,defaultExpandAll:Ag.defaultExpandAll,filterNodeMethod:Ag.filterNodeMethod}));Cg.value.initialize();const tg=vue.ref(Cg.value.root),ig=vue.ref(null),ng=vue.ref(null),lg=vue.ref(null),{broadcastExpanded:og}=useNodeExpandEventBroadcast(Ag),{dragState:sg}=useDragNodeHandler({props:Ag,ctx:gg,el$:ng,dropIndicator$:lg,store:Cg});useKeydown({el$:ng},Cg);const rg=vue.getCurrentInstance(),cg=vue.computed(()=>{let Ug=rg==null?void 0:rg.parent;for(;Ug;){if(Ug.type.name==="ElTreeSelect")return!0;Ug=Ug.parent}return!1}),ag=vue.computed(()=>{const{childNodes:Ug}=tg.value;return(!Ug||Ug.length===0||Ug.every(({visible:Qg})=>!Qg))&&!cg.value});vue.watch(()=>Ag.currentNodeKey,Ug=>{Cg.value.setCurrentNodeKey(Ug??null)}),vue.watch(()=>Ag.defaultCheckedKeys,(Ug,Qg)=>{isEqual(Ug,Qg)||Cg.value.setDefaultCheckedKey(Ug??[])}),vue.watch(()=>Ag.defaultExpandedKeys,Ug=>{Cg.value.setDefaultExpandedKeys(Ug??[])}),vue.watch(()=>Ag.data,Ug=>{Cg.value.setData(Ug)},{deep:!0}),vue.watch(()=>Ag.checkStrictly,Ug=>{Cg.value.checkStrictly=Ug});const ug=Ug=>{if(!Ag.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");Cg.value.filter(Ug)},dg=Ug=>Ag.nodeKey?getNodeKey(Ag.nodeKey,Ug.data):Ug.id,hg=Ug=>{if(!Ag.nodeKey)throw new Error(`[Tree] nodeKey is required in ${Ug}`)},bg=Ug=>{hg("getNodePath");const Qg=Cg.value.getNode(Ug);if(!Qg)return[];const xg=[Qg.data];let Tg=Qg.parent;for(;Tg&&Tg!==tg.value;)xg.push(Tg.data),Tg=Tg.parent;return xg.reverse()},mg=(Ug,Qg)=>Cg.value.getCheckedNodes(Ug,Qg),Zg=Ug=>Cg.value.getCheckedKeys(Ug),Bg=()=>{const Ug=Cg.value.getCurrentNode();return Ug?Ug.data:null},Gg=()=>{hg("getCurrentKey");const Ug=Bg();return Ug?Ug[Ag.nodeKey]:null},pg=(Ug,Qg)=>{hg("setCheckedNodes"),Cg.value.setCheckedNodes(Ug,Qg)},fg=(Ug,Qg)=>{hg("setCheckedKeys"),Cg.value.setCheckedKeys(Ug,Qg)},Vg=(Ug,Qg,xg)=>{Cg.value.setChecked(Ug,Qg,xg)},Wg=()=>Cg.value.getHalfCheckedNodes(),Hg=()=>Cg.value.getHalfCheckedKeys(),Sg=(Ug,Qg=!0)=>{hg("setCurrentNode"),handleCurrentChange(Cg,gg.emit,()=>{og(Ug),Cg.value.setUserCurrentNode(Ug,Qg)})},wg=(Ug=null,Qg=!0)=>{hg("setCurrentKey"),handleCurrentChange(Cg,gg.emit,()=>{og(),Cg.value.setCurrentNodeKey(Ug,Qg)})},Xg=Ug=>Cg.value.getNode(Ug),vg=Ug=>{Cg.value.remove(Ug)},yg=(Ug,Qg)=>{Cg.value.append(Ug,Qg)},Ng=(Ug,Qg)=>{Cg.value.insertBefore(Ug,Qg)},Yg=(Ug,Qg)=>{Cg.value.insertAfter(Ug,Qg)},Kg=(Ug,Qg,xg)=>{og(Qg),gg.emit("node-expand",Ug,Qg,xg)},Jg=(Ug,Qg)=>{hg("updateKeyChildren"),Cg.value.updateChildren(Ug,Qg)};return vue.provide(ROOT_TREE_INJECTION_KEY,{ctx:gg,props:Ag,store:Cg,root:tg,currentNode:ig,instance:rg}),vue.provide(formItemContextKey,void 0),{ns:Ig,store:Cg,root:tg,currentNode:ig,dragState:sg,el$:ng,dropIndicator$:lg,isEmpty:ag,filter:ug,getNodeKey:dg,getNodePath:bg,getCheckedNodes:mg,getCheckedKeys:Zg,getCurrentNode:Bg,getCurrentKey:Gg,setCheckedNodes:pg,setCheckedKeys:fg,setChecked:Vg,getHalfCheckedNodes:Wg,getHalfCheckedKeys:Hg,setCurrentNode:Sg,setCurrentKey:wg,t:eg,getNode:Xg,remove:vg,append:yg,insertBefore:Ng,insertAfter:Yg,handleNodeExpand:Kg,updateKeyChildren:Jg}}});function _sfc_render$1(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([Ag.ns.b(),Ag.ns.is("dragging",!!Ag.dragState.draggingNode),Ag.ns.is("drop-not-allow",!Ag.dragState.allowDrop),Ag.ns.is("drop-inner",Ag.dragState.dropType==="inner"),{[Ag.ns.m("highlight-current")]:Ag.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.root.childNodes,ng=>(vue.openBlock(),vue.createBlock(ig,{key:Ag.getNodeKey(ng),node:ng,props:Ag.props,accordion:Ag.accordion,"render-after-expand":Ag.renderAfterExpand,"show-checkbox":Ag.showCheckbox,"render-content":Ag.renderContent,onNodeExpand:Ag.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),Ag.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(Ag.ns.e("empty-block"))},[vue.renderSlot(Ag.$slots,"empty",{},()=>[vue.createElementVNode("span",{class:vue.normalizeClass(Ag.ns.e("empty-text"))},vue.toDisplayString(Ag.emptyText??Ag.t("el.tree.emptyText")),3)])],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(Ag.ns.e("drop-indicator"))},null,2),[[vue.vShow,Ag.dragState.showDropIndicator]])],2)}var tree_default=_plugin_vue_export_helper_default(tree_vue_vue_type_script_lang_default,[["render",_sfc_render$1]]);const ElTree=withInstall(tree_default),SCOPE$1="ElUpload";var UploadAjaxError=class extends Error{constructor(Ag,gg,eg,Ig){super(Ag),this.name="UploadAjaxError",this.status=gg,this.method=eg,this.url=Ig}};function getError(Ag,gg,eg){let Ig;return eg.response?Ig=`${eg.response.error||eg.response}`:eg.responseText?Ig=`${eg.responseText}`:Ig=`fail to ${gg.method} ${Ag} ${eg.status}`,new UploadAjaxError(Ig,eg.status,gg.method,Ag)}function getBody(Ag){const gg=Ag.responseText||Ag.response;if(!gg)return gg;try{return JSON.parse(gg)}catch{return gg}}const ajaxUpload=Ag=>{typeof XMLHttpRequest>"u"&&throwError(SCOPE$1,"XMLHttpRequest is undefined");const gg=new XMLHttpRequest,eg=Ag.action;gg.upload&&gg.upload.addEventListener("progress",tg=>{const ig=tg;ig.percent=tg.total>0?tg.loaded/tg.total*100:0,Ag.onProgress(ig)});const Ig=new FormData;if(Ag.data)for(const[tg,ig]of Object.entries(Ag.data))isArray$4(ig)?ig.length===2&&ig[0]instanceof Blob&&isString(ig[1])?Ig.append(tg,ig[0],ig[1]):ig.forEach(ng=>{Ig.append(tg,ng)}):Ig.append(tg,ig);Ig.append(Ag.filename,Ag.file,Ag.file.name),gg.addEventListener("error",()=>{Ag.onError(getError(eg,Ag,gg))}),gg.addEventListener("load",()=>{if(gg.status<200||gg.status>=300)return Ag.onError(getError(eg,Ag,gg));Ag.onSuccess(getBody(gg))}),gg.open(Ag.method,eg,!0),Ag.withCredentials&&"withCredentials"in gg&&(gg.withCredentials=!0);const Cg=Ag.headers||{};if(Cg instanceof Headers)Cg.forEach((tg,ig)=>gg.setRequestHeader(ig,tg));else for(const[tg,ig]of Object.entries(Cg))isNil(ig)||gg.setRequestHeader(tg,String(ig));return gg.send(Ig),gg},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:definePropType([Object,Function,Promise]),default:()=>mutable({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:{type:Boolean,default:void 0},limit:Number,directory:Boolean}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP},crossorigin:{type:definePropType(String)}}),uploadContextKey=Symbol("uploadContextKey"),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:void 0},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"},crossorigin:{type:definePropType(String)}}),uploadListEmits={remove:Ag=>!!Ag},uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadDraggerProps=buildProps({disabled:{type:Boolean,default:void 0},directory:Boolean}),uploadDraggerEmits={file:Ag=>isArray$4(Ag)},_hoisted_1$B=["tabindex","aria-disabled","onKeydown"],_hoisted_2$p=["src","crossorigin"],_hoisted_3$j=["onClick"],_hoisted_4$c=["title"],_hoisted_5$a=["onClick"],_hoisted_6$9=["onClick"];var upload_list_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUploadList",__name:"upload-list",props:uploadListProps,emits:uploadListEmits,setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,{t:Cg}=useLocale(),tg=useNamespace("upload"),ig=useNamespace("icon"),ng=useNamespace("list"),lg=useFormDisabled(),og=vue.ref(!1),sg=vue.computed(()=>[tg.b("list"),tg.bm("list",eg.listType),tg.is("disabled",lg.value)]),rg=cg=>{Ig("remove",cg)};return(cg,ag)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass(sg.value),name:vue.unref(ng).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.files,(ug,dg)=>(vue.openBlock(),vue.createElementBlock("li",{key:ug.uid||ug.name,class:vue.normalizeClass([vue.unref(tg).be("list","item"),vue.unref(tg).is(ug.status),{focusing:og.value}]),tabindex:vue.unref(lg)?void 0:0,"aria-disabled":vue.unref(lg),role:"button",onKeydown:vue.withKeys(hg=>!vue.unref(lg)&&rg(ug),["delete"]),onFocus:ag[0]||(ag[0]=hg=>og.value=!0),onBlur:ag[1]||(ag[1]=hg=>og.value=!1),onClick:ag[2]||(ag[2]=hg=>og.value=!1)},[vue.renderSlot(cg.$slots,"default",{file:ug,index:dg},()=>[Ag.listType==="picture"||ug.status!=="uploading"&&Ag.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(tg).be("list","item-thumbnail")),src:ug.url,crossorigin:Ag.crossorigin,alt:""},null,10,_hoisted_2$p)):vue.createCommentVNode("v-if",!0),ug.status==="uploading"||Ag.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(tg).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(tg).be("list","item-name")),onClick:vue.withModifiers(hg=>Ag.handlePreview(ug),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(tg).be("list","item-file-name")),title:ug.name},vue.toDisplayString(ug.name),11,_hoisted_4$c)],10,_hoisted_3$j),ug.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ag.listType==="picture-card"?"circle":"line","stroke-width":Ag.listType==="picture-card"?6:2,percentage:Number(ug.percentage),style:vue.normalizeStyle(Ag.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(tg).be("list","item-status-label"))},[Ag.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(ig).m("upload-success"),vue.unref(ig).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ag.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(ig).m("upload-success"),vue.unref(ig).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(ig).m("close")),"aria-label":vue.unref(Cg)("el.upload.delete"),role:"button",tabindex:"0",onClick:hg=>rg(ug),onKeydown:vue.withKeys(vue.withModifiers(hg=>rg(ug),["prevent"]),["enter","space"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","aria-label","onClick","onKeydown"])),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(ig).m("close-tip"))},vue.toDisplayString(vue.unref(Cg)("el.upload.deleteTip")),3)),Ag.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(tg).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(tg).be("list","item-preview")),onClick:hg=>Ag.handlePreview(ug)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(tg).be("list","item-delete")),onClick:hg=>rg(ug)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$9))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$B))),128)),vue.renderSlot(cg.$slots,"append")]),_:3},8,["class","name"]))}}),upload_list_default=upload_list_vue_vue_type_script_setup_true_lang_default;const COMPONENT_NAME="ElUploadDrag";var upload_dragger_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:COMPONENT_NAME,__name:"upload-dragger",props:uploadDraggerProps,emits:uploadDraggerEmits,setup(Ag,{emit:gg}){const eg=Ag,Ig=gg;vue.inject(uploadContextKey)||throwError(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const Cg=useNamespace("upload"),tg=vue.ref(!1),ig=useFormDisabled(),ng=cg=>new Promise((ag,ug)=>cg.file(ag,ug)),lg=async cg=>{try{if(cg.isFile){const ag=await ng(cg);return ag.isDirectory=!1,[ag]}if(cg.isDirectory){const ag=cg.createReader(),ug=()=>new Promise((mg,Zg)=>ag.readEntries(mg,Zg)),dg=[];let hg=await ug();for(;hg.length>0;)dg.push(...hg),hg=await ug();const bg=dg.map(mg=>lg(mg).catch(()=>[]));return flatten(await Promise.all(bg))}}catch{return[]}return[]},og=async cg=>{if(ig.value)return;tg.value=!1,cg.stopPropagation();const ag=Array.from(cg.dataTransfer.files),ug=cg.dataTransfer.items||[];if(eg.directory){const dg=Array.from(ug).map(hg=>{var bg;return(bg=hg==null?void 0:hg.webkitGetAsEntry)==null?void 0:bg.call(hg)}).filter(hg=>hg);Ig("file",flatten(await Promise.all(dg.map(lg))));return}ag.forEach((dg,hg)=>{var mg,Zg;const bg=(Zg=(mg=ug[hg])==null?void 0:mg.webkitGetAsEntry)==null?void 0:Zg.call(mg);bg&&(dg.isDirectory=bg.isDirectory)}),Ig("file",ag)},sg=()=>{ig.value||(tg.value=!0)},rg=cg=>{cg.currentTarget.contains(cg.relatedTarget)||(tg.value=!1)};return(cg,ag)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Cg).b("dragger"),vue.unref(Cg).is("dragover",tg.value)]),onDrop:vue.withModifiers(og,["prevent"]),onDragover:vue.withModifiers(sg,["prevent"]),onDragleave:vue.withModifiers(rg,["prevent"])},[vue.renderSlot(cg.$slots,"default")],34))}}),upload_dragger_default=upload_dragger_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$A=["tabindex","aria-disabled","onKeydown"],_hoisted_2$o=["name","disabled","multiple","accept","webkitdirectory"];var upload_content_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1,__name:"upload-content",props:uploadContentProps,setup(Ag,{expose:gg}){const eg=Ag,Ig=useNamespace("upload"),Cg=useFormDisabled(),tg=vue.shallowRef({}),ig=vue.shallowRef(),ng=dg=>{if(dg.length===0)return;const{autoUpload:hg,limit:bg,fileList:mg,multiple:Zg,onStart:Bg,onExceed:Gg}=eg;if(bg&&mg.length+dg.length>bg){Gg(dg,mg);return}Zg||(dg=dg.slice(0,1));for(const pg of dg){const fg=pg;fg.uid=genFileId(),Bg(fg),hg&&lg(fg)}},lg=async dg=>{if(ig.value.value="",!eg.beforeUpload)return sg(dg);let hg,bg={};try{const Zg=eg.data,Bg=eg.beforeUpload(dg);bg=isPlainObject$1(eg.data)?cloneDeep(eg.data):eg.data,hg=await Bg,isPlainObject$1(eg.data)&&isEqual(Zg,bg)&&(bg=cloneDeep(eg.data))}catch{hg=!1}if(hg===!1){eg.onRemove(dg);return}let mg=dg;hg instanceof Blob&&(hg instanceof File?mg=hg:mg=new File([hg],dg.name,{type:dg.type})),sg(Object.assign(mg,{uid:dg.uid}),bg)},og=async(dg,hg)=>isFunction$1(dg)?dg(hg):dg,sg=async(dg,hg)=>{const{headers:bg,data:mg,method:Zg,withCredentials:Bg,name:Gg,action:pg,onProgress:fg,onSuccess:Vg,onError:Wg,httpRequest:Hg}=eg;try{hg=await og(hg??mg,dg)}catch{eg.onRemove(dg);return}const{uid:Sg}=dg,wg={headers:bg||{},withCredentials:Bg,file:dg,data:hg,method:Zg,filename:Gg,action:pg,onProgress:vg=>{fg(vg,dg)},onSuccess:vg=>{Vg(vg,dg),delete tg.value[Sg]},onError:vg=>{Wg(vg,dg),delete tg.value[Sg]}},Xg=Hg(wg);tg.value[Sg]=Xg,Xg instanceof Promise&&Xg.then(wg.onSuccess,wg.onError)},rg=dg=>{const hg=dg.target.files;hg&&ng(Array.from(hg))},cg=()=>{Cg.value||(ig.value.value="",ig.value.click())},ag=()=>{cg()};return gg({abort:dg=>{entriesOf(tg.value).filter(dg?([hg])=>String(dg.uid)===hg:()=>!0).forEach(([hg,bg])=>{bg instanceof XMLHttpRequest&&bg.abort(),delete tg.value[hg]})},upload:lg}),(dg,hg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Ig).b(),vue.unref(Ig).m(Ag.listType),vue.unref(Ig).is("drag",Ag.drag),vue.unref(Ig).is("disabled",vue.unref(Cg))]),tabindex:vue.unref(Cg)?void 0:0,"aria-disabled":vue.unref(Cg),role:"button",onClick:cg,onKeydown:vue.withKeys(vue.withModifiers(ag,["self"]),["enter","space"])},[Ag.drag?(vue.openBlock(),vue.createBlock(upload_dragger_default,{key:0,disabled:vue.unref(Cg),directory:Ag.directory,onFile:ng},{default:vue.withCtx(()=>[vue.renderSlot(dg.$slots,"default")]),_:3},8,["disabled","directory"])):vue.renderSlot(dg.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:ig,class:vue.normalizeClass(vue.unref(Ig).e("input")),name:Ag.name,disabled:vue.unref(Cg),multiple:Ag.multiple,accept:Ag.accept,webkitdirectory:Ag.directory||void 0,type:"file",onChange:rg,onClick:hg[0]||(hg[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$o)],42,_hoisted_1$A))}}),upload_content_default=upload_content_vue_vue_type_script_setup_true_lang_default;const SCOPE="ElUpload",revokeFileObjectURL=Ag=>{var gg;(gg=Ag.url)!=null&&gg.startsWith("blob:")&&URL.revokeObjectURL(Ag.url)},useHandlers=(Ag,gg)=>{const eg=useVModel(Ag,"fileList",void 0,{passive:!0}),Ig=ug=>eg.value.find(dg=>dg.uid===ug.uid);function Cg(ug){var dg;(dg=gg.value)==null||dg.abort(ug)}function tg(ug=["ready","uploading","success","fail"]){eg.value=eg.value.filter(dg=>!ug.includes(dg.status))}function ig(ug){eg.value=eg.value.filter(dg=>dg.uid!==ug.uid)}const ng=ug=>{vue.nextTick(()=>Ag.onChange(ug,eg.value))},lg=(ug,dg)=>{const hg=Ig(dg);hg&&(console.error(ug),hg.status="fail",ig(hg),Ag.onError(ug,hg,eg.value),ng(hg))},og=(ug,dg)=>{const hg=Ig(dg);hg&&(Ag.onProgress(ug,hg,eg.value),hg.status="uploading",hg.percentage=Math.round(ug.percent))},sg=(ug,dg)=>{const hg=Ig(dg);hg&&(hg.status="success",hg.response=ug,Ag.onSuccess(ug,hg,eg.value),ng(hg))},rg=ug=>{isNil(ug.uid)&&(ug.uid=genFileId());const dg={name:ug.name,percentage:0,status:"ready",size:ug.size,raw:ug,uid:ug.uid};if(Ag.listType==="picture-card"||Ag.listType==="picture")try{dg.url=URL.createObjectURL(ug)}catch(hg){debugWarn(SCOPE,hg.message),Ag.onError(hg,dg,eg.value)}eg.value=[...eg.value,dg],ng(dg)},cg=async ug=>{const dg=ug instanceof File?Ig(ug):ug;dg||throwError(SCOPE,"file to be removed not found");const hg=bg=>{Cg(bg),ig(bg),Ag.onRemove(bg,eg.value),revokeFileObjectURL(bg)};Ag.beforeRemove?await Ag.beforeRemove(dg,eg.value)!==!1&&hg(dg):hg(dg)};function ag(){eg.value.filter(({status:ug})=>ug==="ready").forEach(({raw:ug})=>{var dg;return ug&&((dg=gg.value)==null?void 0:dg.upload(ug))})}return vue.watch(()=>Ag.listType,ug=>{ug!=="picture-card"&&ug!=="picture"||(eg.value=eg.value.map(dg=>{const{raw:hg,url:bg}=dg;if(!bg&&hg)try{dg.url=URL.createObjectURL(hg)}catch(mg){Ag.onError(mg,dg,eg.value)}return dg}))}),vue.watch(eg,ug=>{for(const dg of ug)dg.uid||(dg.uid=genFileId()),dg.status||(dg.status="success")},{immediate:!0,deep:!0}),{uploadFiles:eg,abort:Cg,clearFiles:tg,handleError:lg,handleProgress:og,handleStart:rg,handleSuccess:sg,handleRemove:cg,submit:ag,revokeFileObjectURL}};var upload_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUpload",__name:"upload",props:uploadProps,setup(Ag,{expose:gg}){const eg=Ag,Ig=useFormDisabled(),Cg=vue.shallowRef(),{abort:tg,submit:ig,clearFiles:ng,uploadFiles:lg,handleStart:og,handleError:sg,handleRemove:rg,handleSuccess:cg,handleProgress:ag,revokeFileObjectURL:ug}=useHandlers(eg,Cg),dg=vue.computed(()=>eg.listType==="picture-card"),hg=vue.computed(()=>({...eg,fileList:lg.value,onStart:og,onProgress:ag,onSuccess:cg,onError:sg,onRemove:rg}));return vue.onBeforeUnmount(()=>{lg.value.forEach(ug)}),vue.provide(uploadContextKey,{accept:vue.toRef(eg,"accept")}),gg({abort:tg,submit:ig,clearFiles:ng,handleStart:og,handleRemove:rg}),(bg,mg)=>(vue.openBlock(),vue.createElementBlock("div",null,[dg.value&&Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_list_default,{key:0,disabled:vue.unref(Ig),"list-type":Ag.listType,files:vue.unref(lg),crossorigin:Ag.crossorigin,"handle-preview":Ag.onPreview,onRemove:vue.unref(rg)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(upload_content_default,vue.mergeProps({ref_key:"uploadRef",ref:Cg},hg.value),{default:vue.withCtx(()=>[bg.$slots.trigger?vue.renderSlot(bg.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!bg.$slots.trigger&&bg.$slots.default?vue.renderSlot(bg.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[bg.$slots.file?{name:"default",fn:vue.withCtx(({file:Zg,index:Bg})=>[vue.renderSlot(bg.$slots,"file",{file:Zg,index:Bg})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!dg.value||dg.value&&!Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_content_default,vue.mergeProps({key:1,ref_key:"uploadRef",ref:Cg},hg.value),{default:vue.withCtx(()=>[bg.$slots.trigger?vue.renderSlot(bg.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!bg.$slots.trigger&&bg.$slots.default?vue.renderSlot(bg.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),bg.$slots.trigger?vue.renderSlot(bg.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(bg.$slots,"tip"),!dg.value&&Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_list_default,{key:3,disabled:vue.unref(Ig),"list-type":Ag.listType,files:vue.unref(lg),crossorigin:Ag.crossorigin,"handle-preview":Ag.onPreview,onRemove:vue.unref(rg)},vue.createSlots({_:2},[bg.$slots.file?{name:"default",fn:vue.withCtx(({file:Zg,index:Bg})=>[vue.renderSlot(bg.$slots,"file",{file:Zg,index:Bg})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}}),upload_default=upload_vue_vue_type_script_setup_true_lang_default;const ElUpload=withInstall(upload_default),messageTypes=["primary","success","info","warning","error"],messagePlacement=["top","top-left","top-right","bottom","bottom-left","bottom-right"],MESSAGE_DEFAULT_PLACEMENT="top",messageDefaults=mutable({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),default:messageDefaults.onClose},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},plain:{type:Boolean,default:messageDefaults.plain},offset:{type:Number,default:messageDefaults.offset},placement:{type:String,values:messagePlacement,default:messageDefaults.placement},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},placementInstances=vue.shallowReactive({}),getOrCreatePlacementInstances=Ag=>(placementInstances[Ag]||(placementInstances[Ag]=vue.shallowReactive([])),placementInstances[Ag]),getInstance=(Ag,gg)=>{const eg=placementInstances[gg]||[],Ig=eg.findIndex(ig=>ig.id===Ag),Cg=eg[Ig];let tg;return Ig>0&&(tg=eg[Ig-1]),{current:Cg,prev:tg}},getLastOffset=(Ag,gg)=>{const{prev:eg}=getInstance(Ag,gg);return eg?eg.vm.exposed.bottom.value:0},getOffsetOrSpace=(Ag,gg,eg)=>(placementInstances[eg]||[]).findIndex(Ig=>Ig.id===Ag)>0?16:gg,_hoisted_1$z=["id"],_hoisted_2$n=["innerHTML"];var message_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElMessage",__name:"message",props:messageProps,emits:messageEmits,setup(Ag,{expose:gg,emit:eg}){const{Close:Ig}=TypeComponents,Cg=Ag,tg=eg,ig=vue.ref(!1),{ns:ng,zIndex:lg}=useGlobalComponentSettings("message"),{currentZIndex:og,nextZIndex:sg}=lg,rg=vue.ref(),cg=vue.ref(!1),ag=vue.ref(0);let ug;const dg=vue.computed(()=>Cg.type?Cg.type==="error"?"danger":Cg.type:"info"),hg=vue.computed(()=>{const Xg=Cg.type;return{[ng.bm("icon",Xg)]:Xg&&TypeComponentsMap[Xg]}}),bg=vue.computed(()=>Cg.icon||TypeComponentsMap[Cg.type]||""),mg=vue.computed(()=>Cg.placement||MESSAGE_DEFAULT_PLACEMENT),Zg=vue.computed(()=>getLastOffset(Cg.id,mg.value)),Bg=vue.computed(()=>getOffsetOrSpace(Cg.id,Cg.offset,mg.value)+Zg.value),Gg=vue.computed(()=>ag.value+Bg.value),pg=vue.computed(()=>mg.value.includes("left")?ng.is("left"):mg.value.includes("right")?ng.is("right"):ng.is("center")),fg=vue.computed(()=>mg.value.startsWith("top")?"top":"bottom"),Vg=vue.computed(()=>({[fg.value]:`${Bg.value}px`,zIndex:og.value}));function Wg(){Cg.duration!==0&&({stop:ug}=useTimeoutFn(()=>{Sg()},Cg.duration))}function Hg(){ug==null||ug()}function Sg(){cg.value=!1,vue.nextTick(()=>{var Xg;ig.value||((Xg=Cg.onClose)==null||Xg.call(Cg),tg("destroy"))})}function wg(Xg){getEventCode(Xg)===EVENT_CODE.esc&&Sg()}return vue.onMounted(()=>{Wg(),sg(),cg.value=!0}),vue.watch(()=>Cg.repeatNum,()=>{Hg(),Wg()}),useEventListener(document,"keydown",wg),useResizeObserver(rg,()=>{ag.value=rg.value.getBoundingClientRect().height}),gg({visible:cg,bottom:Gg,close:Sg}),(Xg,vg)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(ng).b("fade"),onBeforeEnter:vg[0]||(vg[0]=yg=>ig.value=!0),onBeforeLeave:Ag.onClose,onAfterLeave:vg[1]||(vg[1]=yg=>Xg.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Ag.id,ref_key:"messageRef",ref:rg,class:vue.normalizeClass([vue.unref(ng).b(),{[vue.unref(ng).m(Ag.type)]:Ag.type},vue.unref(ng).is("closable",Ag.showClose),vue.unref(ng).is("plain",Ag.plain),vue.unref(ng).is("bottom",fg.value==="bottom"),pg.value,Ag.customClass]),style:vue.normalizeStyle(Vg.value),role:"alert",onMouseenter:Hg,onMouseleave:Wg},[Ag.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Ag.repeatNum,type:dg.value,class:vue.normalizeClass(vue.unref(ng).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),bg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(ng).e("icon"),hg.value])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(bg.value)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Xg.$slots,"default",{},()=>[Ag.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(ng).e("content")),innerHTML:Ag.message},null,10,_hoisted_2$n)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(ng).e("content"))},vue.toDisplayString(Ag.message),3))]),Ag.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(ng).e("closeBtn")),onClick:vue.withModifiers(Sg,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(Ig))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$z),[[vue.vShow,cg.value]])]),_:3},8,["name","onBeforeLeave"]))}}),message_default=message_vue_vue_type_script_setup_true_lang_default;let seed=1;const normalizeAppendTo=Ag=>{if(!Ag.appendTo)Ag.appendTo=document.body;else if(isString(Ag.appendTo)){let gg=document.querySelector(Ag.appendTo);isElement(gg)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),gg=document.body),Ag.appendTo=gg}},normalizePlacement=Ag=>{!Ag.placement&&isString(messageConfig.placement)&&messageConfig.placement&&(Ag.placement=messageConfig.placement),Ag.placement||(Ag.placement=MESSAGE_DEFAULT_PLACEMENT),messagePlacement.includes(Ag.placement)||(debugWarn("ElMessage",`Invalid placement: ${Ag.placement}. Falling back to '${MESSAGE_DEFAULT_PLACEMENT}'.`),Ag.placement=MESSAGE_DEFAULT_PLACEMENT)},normalizeOptions=Ag=>{const gg=!Ag||isString(Ag)||vue.isVNode(Ag)||isFunction$1(Ag)?{message:Ag}:Ag,eg={...messageDefaults,...gg};return normalizeAppendTo(eg),normalizePlacement(eg),isBoolean(messageConfig.grouping)&&!eg.grouping&&(eg.grouping=messageConfig.grouping),isNumber(messageConfig.duration)&&eg.duration===3e3&&(eg.duration=messageConfig.duration),isNumber(messageConfig.offset)&&eg.offset===16&&(eg.offset=messageConfig.offset),isBoolean(messageConfig.showClose)&&!eg.showClose&&(eg.showClose=messageConfig.showClose),isBoolean(messageConfig.plain)&&!eg.plain&&(eg.plain=messageConfig.plain),eg},closeMessage=Ag=>{const gg=placementInstances[Ag.props.placement||MESSAGE_DEFAULT_PLACEMENT],eg=gg.indexOf(Ag);if(eg===-1)return;gg.splice(eg,1);const{handler:Ig}=Ag;Ig.close()},createMessage=({appendTo:Ag,...gg},eg)=>{const Ig=`message_${seed++}`,Cg=gg.onClose,tg=document.createElement("div"),ig={...gg,id:Ig,onClose:()=>{Cg==null||Cg(),closeMessage(og)},onDestroy:()=>{vue.render(null,tg)}},ng=vue.createVNode(message_default,ig,isFunction$1(ig.message)||vue.isVNode(ig.message)?{default:isFunction$1(ig.message)?ig.message:()=>ig.message}:null);ng.appContext=eg||message._context,vue.render(ng,tg),Ag.appendChild(tg.firstElementChild);const lg=ng.component,og={id:Ig,vnode:ng,vm:lg,handler:{close:()=>{lg.exposed.close()}},props:ng.component.props};return og},message=(Ag={},gg)=>{if(!isClient)return{close:()=>{}};const eg=normalizeOptions(Ag),Ig=getOrCreatePlacementInstances(eg.placement||MESSAGE_DEFAULT_PLACEMENT);if(eg.grouping&&Ig.length){const tg=Ig.find(({vnode:ig})=>{var ng;return((ng=ig.props)==null?void 0:ng.message)===eg.message});if(tg)return tg.props.repeatNum+=1,tg.props.type=eg.type,tg.handler}if(isNumber(messageConfig.max)&&Ig.length>=messageConfig.max)return{close:()=>{}};const Cg=createMessage(eg,gg);return Ig.push(Cg),Cg.handler};messageTypes.forEach(Ag=>{message[Ag]=(gg={},eg)=>message({...normalizeOptions(gg),type:Ag},eg)});function closeAll(Ag){for(const gg in placementInstances)if(hasOwn$b(placementInstances,gg)){const eg=[...placementInstances[gg]];for(const Ig of eg)(!Ag||Ag===Ig.props.type)&&Ig.handler.close()}}function closeAllByPlacement(Ag){placementInstances[Ag]&&[...placementInstances[Ag]].forEach(gg=>gg.handler.close())}message.closeAll=closeAll,message.closeAllByPlacement=closeAllByPlacement,message._context=null;const ElMessage=withInstallFunction(message,"$message");var index_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap:focus_trap_default$1,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(Ag,{emit:gg}){const{locale:eg,zIndex:Ig,ns:Cg,size:tg}=useGlobalComponentSettings("message-box",vue.computed(()=>Ag.buttonSize)),{t:ig}=eg,{nextZIndex:ng}=Ig,lg=vue.ref(!1),og=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:vue.markRaw(loading_default),cancelButtonLoadingIcon:vue.markRaw(loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:ng()}),sg=vue.computed(()=>{const yg=og.type;return{[Cg.bm("icon",yg)]:yg&&TypeComponentsMap[yg]}}),rg=useId(),cg=useId(),ag=vue.computed(()=>{const yg=og.type;return og.icon||yg&&TypeComponentsMap[yg]||""}),ug=vue.computed(()=>!!og.message),dg=vue.ref(),hg=vue.ref(),bg=vue.ref(),mg=vue.ref(),Zg=vue.ref(),Bg=vue.computed(()=>og.confirmButtonClass);vue.watch(()=>og.inputValue,async yg=>{await vue.nextTick(),Ag.boxType==="prompt"&&yg&&Sg()},{immediate:!0}),vue.watch(()=>lg.value,yg=>{var Ng;yg&&(Ag.boxType!=="prompt"&&(og.autofocus?bg.value=((Ng=Zg.value)==null?void 0:Ng.$el)??dg.value:bg.value=dg.value),og.zIndex=ng()),Ag.boxType==="prompt"&&(yg?vue.nextTick().then(()=>{mg.value&&mg.value.$el&&(og.autofocus?bg.value=wg()??dg.value:bg.value=dg.value)}):(og.editorErrorMessage="",og.validateError=!1))});const{isDragging:Gg}=useDraggable(dg,hg,vue.computed(()=>Ag.draggable),vue.computed(()=>Ag.overflow));vue.onMounted(async()=>{await vue.nextTick(),Ag.closeOnHashChange&&window.addEventListener("hashchange",pg)}),vue.onBeforeUnmount(()=>{Ag.closeOnHashChange&&window.removeEventListener("hashchange",pg)});function pg(){lg.value&&(lg.value=!1,vue.nextTick(()=>{og.action&&gg("action",og.action)}))}const fg=()=>{Ag.closeOnClickModal&&Hg(og.distinguishCancelAndClose?"close":"cancel")},Vg=useSameTarget(fg),Wg=yg=>{var Ng;if(og.inputType!=="textarea"&&!((Ng=mg.value)!=null&&Ng.isComposing))return yg.preventDefault(),Hg("confirm")},Hg=yg=>{var Ng;Ag.boxType==="prompt"&&yg==="confirm"&&!Sg()||(og.action=yg,og.beforeClose?(Ng=og.beforeClose)==null||Ng.call(og,yg,og,pg):pg())},Sg=()=>{if(Ag.boxType==="prompt"){const yg=og.inputPattern;if(yg&&!yg.test(og.inputValue||""))return og.editorErrorMessage=og.inputErrorMessage||ig("el.messagebox.error"),og.validateError=!0,!1;const Ng=og.inputValidator;if(isFunction$1(Ng)){const Yg=Ng(og.inputValue);if(Yg===!1)return og.editorErrorMessage=og.inputErrorMessage||ig("el.messagebox.error"),og.validateError=!0,!1;if(isString(Yg))return og.editorErrorMessage=Yg,og.validateError=!0,!1}}return og.editorErrorMessage="",og.validateError=!1,!0},wg=()=>{var Ng;const yg=(Ng=mg.value)==null?void 0:Ng.$refs;return(yg==null?void 0:yg.input)??(yg==null?void 0:yg.textarea)},Xg=()=>{Hg("close")},vg=()=>{Ag.closeOnPressEscape&&Xg()};return Ag.lockScroll&&useLockscreen(lg,{ns:Cg}),{...vue.toRefs(og),ns:Cg,overlayEvent:Vg,visible:lg,hasMessage:ug,typeClass:sg,contentId:rg,inputId:cg,btnSize:tg,iconComponent:ag,confirmButtonClasses:Bg,rootRef:dg,focusStartRef:bg,headerRef:hg,inputRef:mg,isDragging:Gg,confirmRef:Zg,doClose:pg,handleClose:Xg,onCloseRequested:vg,handleWrapperClick:fg,handleInputEnter:Wg,handleAction:Hg,t:ig}}});const _hoisted_1$y=["aria-label","aria-describedby"],_hoisted_2$m=["aria-label"],_hoisted_3$i=["id"];function _sfc_render(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-icon"),ng=vue.resolveComponent("el-input"),lg=vue.resolveComponent("el-button"),og=vue.resolveComponent("el-focus-trap"),sg=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:gg[11]||(gg[11]=rg=>Ag.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(sg,{"z-index":Ag.zIndex,"overlay-class":[Ag.ns.is("message-box"),Ag.modalClass],mask:Ag.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":Ag.title,"aria-modal":"true","aria-describedby":Ag.showInput?void 0:Ag.contentId,class:vue.normalizeClass(`${Ag.ns.namespace.value}-overlay-message-box`),onClick:gg[8]||(gg[8]=(...rg)=>Ag.overlayEvent.onClick&&Ag.overlayEvent.onClick(...rg)),onMousedown:gg[9]||(gg[9]=(...rg)=>Ag.overlayEvent.onMousedown&&Ag.overlayEvent.onMousedown(...rg)),onMouseup:gg[10]||(gg[10]=(...rg)=>Ag.overlayEvent.onMouseup&&Ag.overlayEvent.onMouseup(...rg))},[vue.createVNode(og,{loop:"",trapped:Ag.visible,"focus-trap-el":Ag.rootRef,"focus-start-el":Ag.focusStartRef,onReleaseRequested:Ag.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([Ag.ns.b(),Ag.customClass,Ag.ns.is("draggable",Ag.draggable),Ag.ns.is("dragging",Ag.isDragging),{[Ag.ns.m("center")]:Ag.center}]),style:vue.normalizeStyle(Ag.customStyle),tabindex:"-1",onClick:gg[7]||(gg[7]=vue.withModifiers(()=>{},["stop"]))},[Ag.title!==null&&Ag.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass([Ag.ns.e("header"),{"show-close":Ag.showClose}])},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("title"))},[Ag.iconComponent&&Ag.center?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.e("status"),Ag.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(Ag.title),1)],2),Ag.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(Ag.ns.e("headerbtn")),"aria-label":Ag.t("el.messagebox.close"),onClick:gg[0]||(gg[0]=rg=>Ag.handleAction(Ag.distinguishCancelAndClose?"close":"cancel")),onKeydown:gg[1]||(gg[1]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction(Ag.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode(ig,{class:vue.normalizeClass(Ag.ns.e("close"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.closeIcon||"close")))]),_:1},8,["class"])],42,_hoisted_2$m)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:Ag.contentId,class:vue.normalizeClass(Ag.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("container"))},[Ag.iconComponent&&!Ag.center&&Ag.hasMessage?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.e("status"),Ag.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),Ag.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(Ag.ns.e("message"))},[vue.renderSlot(Ag.$slots,"default",{},()=>[Ag.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.showInput?"label":"p"),{key:1,for:Ag.showInput?Ag.inputId:void 0,innerHTML:Ag.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.showInput?"label":"p"),{key:0,for:Ag.showInput?Ag.inputId:void 0,textContent:vue.toDisplayString(Ag.message)},null,8,["for","textContent"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("input"))},[vue.createVNode(ng,{id:Ag.inputId,ref:"inputRef",modelValue:Ag.inputValue,"onUpdate:modelValue":gg[2]||(gg[2]=rg=>Ag.inputValue=rg),type:Ag.inputType,placeholder:Ag.inputPlaceholder,"aria-invalid":Ag.validateError,class:vue.normalizeClass({invalid:Ag.validateError}),onKeydown:vue.withKeys(Ag.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("errormsg")),style:vue.normalizeStyle({visibility:Ag.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(Ag.editorErrorMessage),7)],2),[[vue.vShow,Ag.showInput]])],10,_hoisted_3$i),vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("btns"))},[Ag.showCancelButton?(vue.openBlock(),vue.createBlock(lg,{key:0,type:Ag.cancelButtonType==="text"?"":Ag.cancelButtonType,text:Ag.cancelButtonType==="text",loading:Ag.cancelButtonLoading,"loading-icon":Ag.cancelButtonLoadingIcon,class:vue.normalizeClass([Ag.cancelButtonClass]),round:Ag.roundButton,size:Ag.btnSize,onClick:gg[3]||(gg[3]=rg=>Ag.handleAction("cancel")),onKeydown:gg[4]||(gg[4]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ag.cancelButtonText||Ag.t("el.messagebox.cancel")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(lg,{ref:"confirmRef",type:Ag.confirmButtonType==="text"?"":Ag.confirmButtonType,text:Ag.confirmButtonType==="text",loading:Ag.confirmButtonLoading,"loading-icon":Ag.confirmButtonLoadingIcon,class:vue.normalizeClass([Ag.confirmButtonClasses]),round:Ag.roundButton,disabled:Ag.confirmButtonDisabled,size:Ag.btnSize,onClick:gg[5]||(gg[5]=rg=>Ag.handleAction("confirm")),onKeydown:gg[6]||(gg[6]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ag.confirmButtonText||Ag.t("el.messagebox.confirm")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[vue.vShow,Ag.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$y)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,Ag.visible]])]),_:3})}var src_default=_plugin_vue_export_helper_default(index_vue_vue_type_script_lang_default,[["render",_sfc_render]]);const messageInstance=new Map,getAppendToElement=Ag=>{let gg=document.body;return Ag.appendTo&&(isString(Ag.appendTo)&&(gg=document.querySelector(Ag.appendTo)),isElement(Ag.appendTo)&&(gg=Ag.appendTo),isElement(gg)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),gg=document.body)),gg},initInstance=(Ag,gg,eg=null)=>{const Ig=vue.createVNode(src_default,Ag,isFunction$1(Ag.message)||vue.isVNode(Ag.message)?{default:isFunction$1(Ag.message)?Ag.message:()=>Ag.message}:null);return Ig.appContext=eg,vue.render(Ig,gg),getAppendToElement(Ag).appendChild(gg.firstElementChild),Ig.component},genContainer=()=>document.createElement("div"),showMessage=(Ag,gg)=>{const eg=genContainer();Ag.onVanish=()=>{vue.render(null,eg),messageInstance.delete(Cg)},Ag.onAction=tg=>{const ig=messageInstance.get(Cg);let ng;Ag.showInput?ng={value:Cg.inputValue,action:tg}:ng=tg,Ag.callback?Ag.callback(ng,Ig.proxy):tg==="cancel"||tg==="close"?Ag.distinguishCancelAndClose&&tg!=="cancel"?ig.reject("close"):ig.reject("cancel"):ig.resolve(ng)};const Ig=initInstance(Ag,eg,gg),Cg=Ig.proxy;for(const tg in Ag)hasOwn$b(Ag,tg)&&!hasOwn$b(Cg.$props,tg)&&(tg==="closeIcon"&&isObject$h(Ag[tg])?Cg[tg]=vue.markRaw(Ag[tg]):Cg[tg]=Ag[tg]);return Cg.visible=!0,Cg};function MessageBox(Ag,gg=null){if(!isClient)return Promise.reject();let eg;return isString(Ag)||vue.isVNode(Ag)?Ag={message:Ag}:eg=Ag.callback,new Promise((Ig,Cg)=>{const tg=showMessage(Ag,gg??MessageBox._context);messageInstance.set(tg,{options:Ag,callback:eg,resolve:Ig,reject:Cg})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(Ag=>{MessageBox[Ag]=messageBoxFactory(Ag)});function messageBoxFactory(Ag){return(gg,eg,Ig,Cg)=>{let tg="";return isObject$h(eg)?(Ig=eg,tg=""):isUndefined(eg)?tg="":tg=eg,MessageBox(Object.assign({title:tg,message:gg,type:"",...MESSAGE_BOX_DEFAULT_OPTS[Ag]},Ig,{boxType:Ag}),Cg)}}MessageBox.close=()=>{messageInstance.forEach((Ag,gg)=>{gg.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=Ag=>{_MessageBox._context=Ag._context,Ag.config.globalProperties.$msgbox=_MessageBox,Ag.config.globalProperties.$messageBox=_MessageBox,Ag.config.globalProperties.$alert=_MessageBox.alert,Ag.config.globalProperties.$confirm=_MessageBox.confirm,Ag.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,popoverProps=buildProps({trigger:useTooltipTriggerProps.trigger,triggerKeys:useTooltipTriggerProps.triggerKeys,placement:dropdownProps.placement,disabled:useTooltipTriggerProps.disabled,visible:useTooltipContentProps.visible,transition:useTooltipContentProps.transition,popperOptions:dropdownProps.popperOptions,tabindex:dropdownProps.tabindex,content:useTooltipContentProps.content,popperStyle:useTooltipContentProps.popperStyle,popperClass:useTooltipContentProps.popperClass,enterable:{...useTooltipContentProps.enterable,default:!0},effect:{...useTooltipContentProps.effect,default:"light"},teleported:useTooltipContentProps.teleported,appendTo:useTooltipContentProps.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),popoverEmits={"update:visible":Ag=>isBoolean(Ag),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},updateEventKeyRaw="onUpdate:visible";var popover_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElPopover",__name:"popover",props:popoverProps,emits:popoverEmits,setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,tg=vue.computed(()=>Ig[updateEventKeyRaw]),ig=useNamespace("popover"),ng=vue.ref(),lg=vue.computed(()=>{var bg;return(bg=vue.unref(ng))==null?void 0:bg.popperRef}),og=vue.computed(()=>[{width:addUnit(Ig.width)},Ig.popperStyle]),sg=vue.computed(()=>[ig.b(),Ig.popperClass,{[ig.m("plain")]:!!Ig.content}]),rg=vue.computed(()=>Ig.transition===`${ig.namespace.value}-fade-in-linear`),cg=()=>{var bg;(bg=ng.value)==null||bg.hide()},ag=()=>{Cg("before-enter")},ug=()=>{Cg("before-leave")},dg=()=>{Cg("after-enter")},hg=()=>{Cg("update:visible",!1),Cg("after-leave")};return gg({popperRef:lg,hide:cg}),(bg,mg)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),vue.mergeProps({ref_key:"tooltipRef",ref:ng},bg.$attrs,{trigger:Ag.trigger,"trigger-keys":Ag.triggerKeys,placement:Ag.placement,disabled:Ag.disabled,visible:Ag.visible,transition:Ag.transition,"popper-options":Ag.popperOptions,tabindex:Ag.tabindex,content:Ag.content,offset:Ag.offset,"show-after":Ag.showAfter,"hide-after":Ag.hideAfter,"auto-close":Ag.autoClose,"show-arrow":Ag.showArrow,"aria-label":Ag.title,effect:Ag.effect,enterable:Ag.enterable,"popper-class":sg.value,"popper-style":og.value,teleported:Ag.teleported,"append-to":Ag.appendTo,persistent:Ag.persistent,"gpu-acceleration":rg.value,"onUpdate:visible":tg.value,onBeforeShow:ag,onBeforeHide:ug,onShow:dg,onHide:hg}),{content:vue.withCtx(()=>[Ag.title?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ig).e("title")),role:"title"},vue.toDisplayString(Ag.title),3)):vue.createCommentVNode("v-if",!0),vue.renderSlot(bg.$slots,"default",{hide:cg},()=>[vue.createTextVNode(vue.toDisplayString(Ag.content),1)])]),default:vue.withCtx(()=>[bg.$slots.reference?vue.renderSlot(bg.$slots,"reference",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}}),popover_default=popover_vue_vue_type_script_setup_true_lang_default;const attachEvents=(Ag,gg)=>{var Ig;const eg=(Ig=gg.arg||gg.value)==null?void 0:Ig.popperRef;eg&&(eg.triggerRef=Ag)};var directive_default={mounted(Ag,gg){attachEvents(Ag,gg)},updated(Ag,gg){attachEvents(Ag,gg)}};const VPopover="popover",ElPopoverDirective=withInstallDirective(directive_default,VPopover),ElPopover=withInstall(popover_default,{directive:ElPopoverDirective}),_hoisted_1$x={"aria-hidden":"true"},_hoisted_2$l=["xlink:href"],_sfc_main$A=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(Ag){const gg=Ag,eg=vue.computed(()=>`#mt-edit-${gg.name}`);return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$x,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":eg.value},gg.props),null,16,_hoisted_2$l)]))}}),_hoisted_1$w={class:"header-panel flex h-full w-full items-center justify-between"},_hoisted_2$k={class:"header-toolbar-actions flex items-center flex-1 min-w-0"},_hoisted_3$h={class:"flex justify-center"},_hoisted_4$b={class:"header-toolbar-center flex flex-1 min-w-0 items-center justify-center gap-8px px-12px"},_hoisted_5$9={class:"header-toolbar-end flex flex-shrink-0 items-center gap-2px pr-8px"},_sfc_main$z=vue.defineComponent({__name:"index",props:{selectedItemsId:{default:()=>[]},groupEnabled:{type:Boolean},unGroupEnabled:{type:Boolean},alignEnabled:{type:Boolean},deleteEnabled:{type:Boolean},lockState:{type:Boolean},undoEnabled:{type:Boolean},redoEnabled:{type:Boolean},realTimeData:{},useThumbnail:{type:Boolean,default:!1},canvasBackgroundList:{default:()=>[]},selectedCanvasBackgroundId:{default:""}},emits:["onGroupClick","onUngroupClick","onDeleteClick","onExportClick","onTreeClick","alignSelected","update:lockState","onHelpClick","onRedoClick","onUndoClick","onImportClick","onPreviewClick","onReturnClick","onSaveClick","onDrawLineClick","onThumbnailClick","onCanvasBgClick","onCanvasBackgroundSelect","onExportPdfClick","onFullscreenToggle"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=useDark({selector:"#mt-edit"}),{isFullscreen:tg,toggle:ig}=useFullscreen();useToggle(Cg);const ng=vue.ref(!1),lg=vue.ref(!0),og=()=>{Ig("onGroupClick")},sg=()=>{Ig("onUngroupClick")},rg=()=>{Ig("onDeleteClick")},cg=()=>{Ig("onExportClick")},ag=()=>{Ig("onTreeClick")},ug=pg=>{Ig("alignSelected",pg)},dg=()=>{Ig("update:lockState",!eg.lockState)},hg=()=>{Ig("onImportClick")},bg=()=>{ng.value=!ng.value,Ig("onDrawLineClick",ng.value)},mg=()=>{Ig("onCanvasBgClick")},Zg=pg=>{Ig("onCanvasBackgroundSelect",pg??"")},Bg=()=>{Ig("onExportPdfClick")},Gg=async()=>{await ig(),Ig("onFullscreenToggle",tg.value)};return(pg,fg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$w,[vue.createElementVNode("div",_hoisted_2$k,[vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.undoEnabled,onClick:fg[0]||(fg[0]=Vg=>Ig("onUndoClick"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"撤销 Ctrl+Z",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"undo"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.redoEnabled,onClick:fg[1]||(fg[1]=Vg=>Ig("onRedoClick"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"重做 Ctrl+Y",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"redo"})]),_:1})]),_:1},8,["disabled"])]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.deleteEnabled,onClick:rg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"删除 delete",class:vue.normalizeClass(""),size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"delete"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:ag},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"组件树",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"tree-list"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:hg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"import-json"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:cg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"export-json"})]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElPopover),{placement:"bottom",width:240,trigger:"hover",disabled:!eg.alignEnabled},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.alignEnabled},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align"})]),_:1})]),_:1},8,["disabled"])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$h,[vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[2]||(fg[2]=Vg=>ug("left"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"左对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-left"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[3]||(fg[3]=Vg=>ug("horizontally"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"水平居中",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-horizontally"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[4]||(fg[4]=Vg=>ug("right"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"右对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-right"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[5]||(fg[5]=Vg=>ug("top"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"上对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-top"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[6]||(fg[6]=Vg=>ug("vertically"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"垂直居中",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-vertical"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[7]||(fg[7]=Vg=>ug("bottom"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"下对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-bottom"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[8]||(fg[8]=Vg=>ug("horizontal-distribution"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"水平分布",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"horizontal-distribution"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[9]||(fg[9]=Vg=>ug("vertical-distribution"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"垂直分布",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"vertical-distribution"})]),_:1})]),_:1})]),_:1})])]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.groupEnabled,onClick:og},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"组合",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"group"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.unGroupEnabled,onClick:sg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"取消组合",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"ungroup"})]),_:1})]),_:1},8,["disabled"])]),_:1}),lg.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElDivider),{key:0,direction:"vertical"})),lg.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:1,text:"",circle:"",size:"small",onClick:bg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"连线编辑模式",size:20,class:vue.normalizeClass(ng.value?"icon-selected":"")},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"pen-line"})]),_:1},8,["class"])]),_:1})),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:mg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"上传背景图",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"bgupload"})]),_:1})]),_:1}),eg.canvasBackgroundList.length>0?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:2,"model-value":eg.selectedCanvasBackgroundId,class:"header-canvas-bg-select",placeholder:"已上传背景图",size:"small",clearable:"","onUpdate:modelValue":Zg},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.canvasBackgroundList,Vg=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:Vg.id,label:Vg.name,value:Vg.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:Bg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导出 PDF",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"export-pdf"})]),_:1})]),_:1})]),vue.createElementVNode("div",_hoisted_4$b,[eg.realTimeData.show?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(eg.realTimeData.text),1)]),_:1})):vue.createCommentVNode("",!0),fg[10]||(fg[10]=vue.createElementVNode("span",{class:"header-toolbar-hint"},"按住空白处可拖拽平移画布 · 双击图元重命名",-1))]),vue.createElementVNode("div",_hoisted_5$9,[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:dg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:eg.lockState?"解锁画布":"锁定画布",size:20,class:vue.normalizeClass({"header-lock-active":eg.lockState})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:eg.lockState?"lock":"unlock"},null,8,["name"])]),_:1},8,["title","class"])]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:Gg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:vue.unref(tg)?"退出全屏":"全屏",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:vue.unref(tg)?"exit-full-screen":"full-screen"},null,8,["name"])]),_:1},8,["title"])]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_effd7bcb_lang="",HeaderPanel=_export_sfc(_sfc_main$z,[["__scopeId","data-v-effd7bcb"]]),globalStore=vue.reactive({intention:"none",create_item_info:null,selected_items_id:[],done_json:[],canvasCfg:{width:1920,height:1080,scale:1,color:"#ffffff",img:"",guide:!0,adsorp:!0,adsorp_diff:5,transform_origin:{x:0,y:0},drag_offset:{x:0,y:0}},gridCfg:{enabled:!0,align:!0,size:10},guideCfg:{x:{display:!1,top:0},y:{display:!1,left:0}},lock:!1,real_time_data:{show:!1,text:""},adsorp_diff:{x:0,y:0},setIntention:Ag=>{globalStore.intention=Ag},setCreateItemInfo:Ag=>{globalStore.create_item_info=Ag},setGlobalStoreDoneJson:Ag=>{globalStore.done_json=Ag},cancelAllSelect:()=>{const Ag=[...globalStore.done_json].map(gg=>(gg.active&&(gg.active=!1),gg));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},refreshSelectedItemsId:()=>{globalStore.selected_items_id=globalStore.done_json.filter(Ag=>Ag.active).map(Ag=>Ag.id)},deleteSelectedItems:()=>{const Ag=[...globalStore.done_json].filter(gg=>!globalStore.selected_items_id.includes(gg.id));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},softDeleteSelectedItems:()=>{const Ag=[...globalStore.done_json].map(gg=>(globalStore.selected_items_id.includes(gg.id)&&(gg.isDelete=!0),gg));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},restoreItems:Ag=>{const gg=[...globalStore.done_json].map(eg=>(Ag.includes(eg.id)&&(eg.isDelete=!1),eg));globalStore.setGlobalStoreDoneJson(gg)},setSingleSelect:Ag=>{globalStore.done_json.forEach(gg=>{gg.id===Ag?gg.active=!0:gg.active=!1}),globalStore.selected_items_id=[Ag]},setSelectItems:Ag=>{globalStore.done_json.forEach(gg=>{Ag.includes(gg.id)?gg.active=!0:gg.active=!1}),globalStore.selected_items_id=Ag},setRealTimeData:Ag=>{globalStore.real_time_data=Ag}}),useUpdateSysLineRect=(Ag,gg,eg)=>{Ag.forEach(Ig=>{const Cg=document.querySelector(`#${Ig.id} g .real`);if(!Cg)return;const tg=Cg.getBoundingClientRect(),ig=gg.getBoundingClientRect(),ng=((tg==null?void 0:tg.left)-(ig==null?void 0:ig.left))/eg,lg=((tg==null?void 0:tg.top)-(ig==null?void 0:ig.top))/eg,og=ng-Ig.binfo.left,sg=lg-Ig.binfo.top;Ig.binfo.left=ng,Ig.binfo.top=lg,Ig.binfo.width=(tg==null?void 0:tg.width)/eg,Ig.binfo.height=(tg==null?void 0:tg.height)/eg,Ig.props.point_position={...Ig.props.point_position,val:Ig.props.point_position.val.map(rg=>({x:rg.x-og,y:rg.y-sg}))}})},useUpdateSysLine=(Ag,gg,eg,Ig,Cg)=>{const tg=[...gg];Ag.forEach(ig=>{if(!ig.props.bind_anchors.val.start&&!ig.props.bind_anchors.val.end)return;const ng=document.querySelector(`#${ig.id} g .real`);if(!ng)return;const lg=ng.getBoundingClientRect(),og=eg.getBoundingClientRect(),sg=((lg==null?void 0:lg.left)-(og==null?void 0:og.left))/Ig,rg=((lg==null?void 0:lg.top)-(og==null?void 0:og.top))/Ig;if(ig.props.bind_anchors.val.start){const cg=tg.find(ag=>ag.id===ig.props.bind_anchors.val.start.id);if(cg){const ag=cg.id===(Cg==null?void 0:Cg.id)?Cg:cg.binfo,{topLeft:ug,topRight:dg,bottomLeft:hg,bottomRight:bg}=getRectCoordinate(ag),{topCenter:mg,bottomCenter:Zg,leftCenter:Bg,rightCenter:Gg}=getRectCenterCoordinate(ug,dg,hg,bg),pg=mg.x,fg=Bg.y,Vg=Math.PI/180*cg.binfo.angle;if(ig.props.bind_anchors.val.start.type==="tc"){const Sg=rotatePoint(mg.x,mg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="bc"){const Sg=rotatePoint(Zg.x,Zg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="lc"){const Sg=rotatePoint(Bg.x,Bg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="rc"){const Sg=rotatePoint(Gg.x,Gg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}const Wg=sg-ig.binfo.left,Hg=rg-ig.binfo.top;ig.binfo={...ig.binfo,left:sg,top:rg,width:(lg==null?void 0:lg.width)/Ig,height:(lg==null?void 0:lg.height)/Ig},ig.props.point_position={...ig.props.point_position,val:ig.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}else ig.props.bind_anchors.val.start=null}if(ig.props.bind_anchors.val.end){const cg=tg.find(ag=>ag.id===ig.props.bind_anchors.val.end.id);if(cg){const ag=cg.id===(Cg==null?void 0:Cg.id)?Cg:cg.binfo,{topLeft:ug,topRight:dg,bottomLeft:hg,bottomRight:bg}=getRectCoordinate(ag),{topCenter:mg,bottomCenter:Zg,leftCenter:Bg,rightCenter:Gg}=getRectCenterCoordinate(ug,dg,hg,bg),pg=mg.x,fg=Bg.y,Vg=Math.PI/180*cg.binfo.angle;if(ig.props.bind_anchors.val.end.type==="tc"){const Sg=rotatePoint(mg.x,mg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="bc"){const Sg=rotatePoint(Zg.x,Zg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="lc"){const Sg=rotatePoint(Bg.x,Bg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="rc"){const Sg=rotatePoint(Gg.x,Gg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}const Wg=sg-ig.binfo.left,Hg=rg-ig.binfo.top;ig.binfo={...ig.binfo,left:sg,top:rg,width:(lg==null?void 0:lg.width)/Ig,height:(lg==null?void 0:lg.height)/Ig},ig.props.point_position={...ig.props.point_position,val:ig.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}else ig.props.bind_anchors.val.end=null}}),vue.nextTick(()=>{useUpdateSysLineRect(Ag,eg,Ig)})},MAX_CANVAS_BG_EDGE=16384;function loadImageFromDataUrl(Ag){return new Promise((gg,eg)=>{const Ig=new Image;Ig.onload=()=>gg(Ig),Ig.onerror=()=>eg(new Error("图片加载失败")),Ig.src=Ag})}async function rotatePortraitBackgroundToLandscape(Ag){const gg=Ag.naturalWidth,eg=Ag.naturalHeight;if(!gg||!eg||gg>=eg)return{img:Ag,width:gg,height:eg,rotated:!1};const Ig=document.createElement("canvas");Ig.width=eg,Ig.height=gg;const Cg=Ig.getContext("2d");if(!Cg)throw new Error("无法创建画布上下文");Cg.translate(0,Ig.height),Cg.rotate(-Math.PI/2),Cg.drawImage(Ag,0,0,gg,eg);const tg=Ig.toDataURL("image/jpeg",.88);return{img:await loadImageFromDataUrl(tg),width:eg,height:gg,rotated:!0}}function scaleImageToDataUrl(Ag,gg,eg,Ig,Cg,tg){const ig=document.createElement("canvas");ig.width=gg,ig.height=eg;const ng=ig.getContext("2d");if(!ng)throw new Error("无法创建画布上下文");return ng.drawImage(Ag,0,0,gg,eg),{dataUrl:ig.toDataURL("image/jpeg",.88),width:gg,height:eg,originalWidth:Ig,originalHeight:Cg,scaled:tg}}async function processCanvasBackgroundUrl(Ag,gg,eg){if(gg&&eg)return{dataUrl:Ag,width:gg,height:eg,originalWidth:gg,originalHeight:eg,scaled:!1};const Ig=await loadImageFromDataUrl(Ag);let Cg=Ig.naturalWidth,tg=Ig.naturalHeight;if(!Cg||!tg)throw new Error("无法读取背景尺寸");const ig=await rotatePortraitBackgroundToLandscape(Ig);let ng=ig.img,lg=ig.width,og=ig.height,sg=!1;ig.rotated&&(Cg=lg,tg=og);const rg=Math.max(lg,og);if(rg>MAX_CANVAS_BG_EDGE){const cg=MAX_CANVAS_BG_EDGE/rg;lg=Math.max(1,Math.floor(lg*cg)),og=Math.max(1,Math.floor(og*cg)),sg=!0}return!sg&&!ig.rotated?{dataUrl:Ag,width:lg,height:og,originalWidth:Cg,originalHeight:tg,scaled:!1}:scaleImageToDataUrl(ng,lg,og,Cg,tg,sg)}const createGroupInfo=(Ag,gg,eg,Ig)=>{let Cg=1/0,tg=1/0,ig=-1/0,ng=-1/0;const lg=gg.getBoundingClientRect();Ag.forEach(sg=>{const rg=document.getElementById(sg.id);if(!rg)return;const cg=rg.getBoundingClientRect();Cg=Math.min(Cg,(cg.left-lg.left)/eg),ig=Math.max(ig,(cg.right-lg.left)/eg),tg=Math.min(tg,(cg.top-lg.top)/eg),ng=Math.max(ng,(cg.bottom-lg.top)/eg)});const og={left:Cg,top:tg,width:ig-Cg,height:ng-tg,angle:0};return Ag.forEach(sg=>{sg.binfo.left=sg.binfo.left-Cg,sg.binfo.top=sg.binfo.top-tg,sg.binfo={width:100*(sg.binfo.width/og.width),height:100*(sg.binfo.height/og.height),left:100*(sg.binfo.left/og.width),top:100*(sg.binfo.top/og.height),angle:sg.binfo.angle||0},sg.active=!1}),{id:"group-"+randomString(),title:"组合",type:"group",binfo:og,resize:!0,rotate:!0,lock:!1,active:!0,hide:!1,use_proportional_scaling:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},children:[...Ag],events:[],tag:"group",sopId:Ig}},cancelGroup=(Ag,gg,eg,Ig)=>{const Cg=gg.getBoundingClientRect();return Ag.children.map(ig=>{const ng=document.getElementById(ig.id);if(!ng)return null;const lg=ng.getBoundingClientRect(),og={x:lg.left-Cg.left+lg.width/2,y:lg.top-Cg.top+lg.height/2},sg=alignToGrid(Ag.binfo.width*(ig.binfo.width/100),Ig),rg=alignToGrid(Ag.binfo.height*(ig.binfo.height/100),Ig),cg={width:sg,height:rg,left:og.x/eg-sg/2,top:og.y/eg-rg/2,angle:(ig.binfo.angle||0)+(Ag.binfo.angle||0)};return{...ig,active:!0,binfo:cg}}).filter(ig=>ig!==null)},svgToSymbol=(Ag,gg)=>{const eg=new DOMParser().parseFromString(Ag,"image/svg+xml").children[0];let Ig="0",Cg="0";const tg=eg.getAttribute("viewBox"),ig=document.createElementNS("http://www.w3.org/2000/svg","symbol");if(tg){const[,,ng,lg]=tg.split(" ");ig.setAttributeNS(null,"viewBox",tg),Ig=ng,Cg=lg}else Ig=eg.getAttribute("width")||"0",Cg=eg.getAttribute("height")||"0",ig.setAttributeNS(null,"viewBox","0 0 "+Ig+" "+Cg);return ig.setAttributeNS(null,"id",gg),ig.innerHTML=eg.innerHTML.replaceAll("stroke:currentColor","").replaceAll("stroke: currentColor","").replaceAll('stroke="currentColor"',""),{symbol_str:ig.outerHTML,width:Ig,height:Cg}},symbolGenSvg=(Ag,gg,eg,Ig,Cg)=>`<svg
|
|
51
|
+
`}),lg=vue.computed(()=>2*Math.PI*ig.value),og=vue.computed(()=>eg.type==="dashboard"?.75:1),sg=vue.computed(()=>`${-1*lg.value*(1-og.value)/2}px`),rg=vue.computed(()=>({strokeDasharray:`${lg.value*og.value}px, ${lg.value}px`,strokeDashoffset:sg.value})),cg=vue.computed(()=>({strokeDasharray:`${lg.value*og.value*(eg.percentage/100)}px, ${lg.value}px`,strokeDashoffset:sg.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),ag=vue.computed(()=>{let Zg;return eg.color?Zg=mg(eg.percentage):Zg=gg[eg.status]||gg.default,Zg}),ug=vue.computed(()=>eg.status==="warning"?warning_filled_default:eg.type==="line"?eg.status==="success"?circle_check_default:circle_close_default:eg.status==="success"?check_default:close_default),dg=vue.computed(()=>eg.type==="line"?12+eg.strokeWidth*.4:eg.width*.111111+2),hg=vue.computed(()=>eg.format(eg.percentage));function bg(Zg){const Bg=100/Zg.length;return Zg.map((Gg,pg)=>isString(Gg)?{color:Gg,percentage:(pg+1)*Bg}:Gg).sort((Gg,pg)=>Gg.percentage-pg.percentage)}const mg=Zg=>{var Gg;const{color:Bg}=eg;if(isFunction$1(Bg))return Bg(Zg);if(isString(Bg))return Bg;{const pg=bg(Bg);for(const fg of pg)if(fg.percentage>Zg)return fg.color;return(Gg=pg[pg.length-1])==null?void 0:Gg.color}};return(Zg,Bg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Ig).b(),vue.unref(Ig).m(Ag.type),vue.unref(Ig).is(Ag.status),{[vue.unref(Ig).m("without-text")]:!Ag.showText,[vue.unref(Ig).m("text-inside")]:Ag.textInside}]),role:"progressbar","aria-valuenow":Ag.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[Ag.type==="line"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(Ig).b("bar"))},[vue.createElementVNode("div",{class:vue.normalizeClass(vue.unref(Ig).be("bar","outer")),style:vue.normalizeStyle({height:`${Ag.strokeWidth}px`})},[vue.createElementVNode("div",{class:vue.normalizeClass([vue.unref(Ig).be("bar","inner"),{[vue.unref(Ig).bem("bar","inner","indeterminate")]:Ag.indeterminate},{[vue.unref(Ig).bem("bar","inner","striped")]:Ag.striped},{[vue.unref(Ig).bem("bar","inner","striped-flow")]:Ag.stripedFlow}]),style:vue.normalizeStyle(Cg.value)},[(Ag.showText||Zg.$slots.default)&&Ag.textInside?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(Ig).be("bar","innerText"))},[vue.renderSlot(Zg.$slots,"default",{percentage:Ag.percentage},()=>[vue.createElementVNode("span",null,vue.toDisplayString(hg.value),1)])],2)):vue.createCommentVNode("v-if",!0)],6)],6)],2)):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(Ig).b("circle")),style:vue.normalizeStyle({height:`${Ag.width}px`,width:`${Ag.width}px`})},[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_2$s,[vue.createElementVNode("path",{class:vue.normalizeClass(vue.unref(Ig).be("circle","track")),d:ng.value,stroke:`var(${vue.unref(Ig).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":Ag.strokeLinecap,"stroke-width":tg.value,fill:"none",style:vue.normalizeStyle(rg.value)},null,14,_hoisted_3$l),vue.createElementVNode("path",{class:vue.normalizeClass(vue.unref(Ig).be("circle","path")),d:ng.value,stroke:ag.value,fill:"none",opacity:Ag.percentage?1:0,"stroke-linecap":Ag.strokeLinecap,"stroke-width":tg.value,style:vue.normalizeStyle(cg.value)},null,14,_hoisted_4$e)]))],6)),(Ag.showText||Zg.$slots.default)&&!Ag.textInside?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(vue.unref(Ig).e("text")),style:vue.normalizeStyle({fontSize:`${dg.value}px`})},[vue.renderSlot(Zg.$slots,"default",{percentage:Ag.percentage},()=>[Ag.status?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(ug.value)))]),_:1})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_5$c,vue.toDisplayString(hg.value),1))])],6)):vue.createCommentVNode("v-if",!0)],10,_hoisted_1$E))}}),progress_default=progress_vue_vue_type_script_setup_true_lang_default;const ElProgress=withInstall(progress_default),isValidComponentSize=Ag=>["",...componentSizes].includes(Ag),switchProps=buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:iconPropType},activeActionIcon:{type:iconPropType},activeIcon:{type:iconPropType},inactiveIcon:{type:iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:definePropType(Function)},id:String,tabindex:{type:[String,Number]},...useAriaProps(["ariaLabel"])}),switchEmits={[UPDATE_MODEL_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag),[CHANGE_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag),[INPUT_EVENT]:Ag=>isBoolean(Ag)||isString(Ag)||isNumber(Ag)},_hoisted_1$D=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],_hoisted_2$r=["aria-hidden"],_hoisted_3$k={key:1},_hoisted_4$d={key:1},_hoisted_5$b=["aria-hidden"],COMPONENT_NAME$1="ElSwitch";var switch_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:COMPONENT_NAME$1,__name:"switch",props:switchProps,emits:switchEmits,setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,{formItem:tg}=useFormItem(),ig=useFormSize(),ng=useNamespace("switch"),{inputId:lg}=useFormItemInputId(Ig,{formItemContext:tg}),og=useFormDisabled(vue.computed(()=>{if(Ig.loading)return!0})),sg=vue.ref(Ig.modelValue!==!1),rg=vue.shallowRef(),cg=vue.computed(()=>[ng.b(),ng.m(ig.value),ng.is("disabled",og.value),ng.is("checked",bg.value)]),ag=vue.computed(()=>[ng.e("label"),ng.em("label","left"),ng.is("active",!bg.value)]),ug=vue.computed(()=>[ng.e("label"),ng.em("label","right"),ng.is("active",bg.value)]),dg=vue.computed(()=>({width:addUnit(Ig.width)}));vue.watch(()=>Ig.modelValue,()=>{sg.value=!0});const hg=vue.computed(()=>sg.value?Ig.modelValue:!1),bg=vue.computed(()=>hg.value===Ig.activeValue);[Ig.activeValue,Ig.inactiveValue].includes(hg.value)||(Cg(UPDATE_MODEL_EVENT,Ig.inactiveValue),Cg(CHANGE_EVENT,Ig.inactiveValue),Cg(INPUT_EVENT,Ig.inactiveValue)),vue.watch(bg,Gg=>{var pg;rg.value.checked=Gg,Ig.validateEvent&&((pg=tg==null?void 0:tg.validate)==null||pg.call(tg,"change").catch(fg=>debugWarn(fg)))});const mg=()=>{const Gg=bg.value?Ig.inactiveValue:Ig.activeValue;Cg(UPDATE_MODEL_EVENT,Gg),Cg(CHANGE_EVENT,Gg),Cg(INPUT_EVENT,Gg),vue.nextTick(()=>{rg.value.checked=bg.value})},Zg=()=>{if(og.value)return;const{beforeChange:Gg}=Ig;if(!Gg){mg();return}const pg=Gg();[isPromise(pg),isBoolean(pg)].includes(!0)||throwError(COMPONENT_NAME$1,"beforeChange must return type `Promise<boolean>` or `boolean`"),isPromise(pg)?pg.then(fg=>{fg&&mg()}).catch(fg=>{debugWarn(COMPONENT_NAME$1,`some error occurred: ${fg}`)}):pg&&mg()},Bg=()=>{var Gg,pg;(pg=(Gg=rg.value)==null?void 0:Gg.focus)==null||pg.call(Gg)};return vue.onMounted(()=>{rg.value.checked=bg.value}),gg({focus:Bg,checked:bg}),(Gg,pg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(cg.value),onClick:vue.withModifiers(Zg,["prevent"])},[vue.createElementVNode("input",{id:vue.unref(lg),ref_key:"input",ref:rg,class:vue.normalizeClass(vue.unref(ng).e("input")),type:"checkbox",role:"switch","aria-checked":bg.value,"aria-disabled":vue.unref(og),"aria-label":Ag.ariaLabel,name:Ag.name,"true-value":Ag.activeValue,"false-value":Ag.inactiveValue,disabled:vue.unref(og),tabindex:Ag.tabindex,onChange:mg,onKeydown:vue.withKeys(Zg,["enter"])},null,42,_hoisted_1$D),!Ag.inlinePrompt&&(Ag.inactiveIcon||Ag.inactiveText||Gg.$slots.inactive)?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(ag.value)},[vue.renderSlot(Gg.$slots,"inactive",{},()=>[Ag.inactiveIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.inactiveIcon&&Ag.inactiveText?(vue.openBlock(),vue.createElementBlock("span",{key:1,"aria-hidden":bg.value},vue.toDisplayString(Ag.inactiveText),9,_hoisted_2$r)):vue.createCommentVNode("v-if",!0)])],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(ng).e("core")),style:vue.normalizeStyle(dg.value)},[Ag.inlinePrompt?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ng).e("inner"))},[bg.value?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(ng).e("inner-wrapper"))},[vue.renderSlot(Gg.$slots,"active",{},()=>[Ag.activeIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.activeIcon&&Ag.activeText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$d,vue.toDisplayString(Ag.activeText),1)):vue.createCommentVNode("v-if",!0)])],2)):(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ng).e("inner-wrapper"))},[vue.renderSlot(Gg.$slots,"inactive",{},()=>[Ag.inactiveIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.inactiveIcon&&Ag.inactiveText?(vue.openBlock(),vue.createElementBlock("span",_hoisted_3$k,vue.toDisplayString(Ag.inactiveText),1)):vue.createCommentVNode("v-if",!0)])],2))],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{class:vue.normalizeClass(vue.unref(ng).e("action"))},[Ag.loading?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(ng).is("loading"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(loading_default))]),_:1},8,["class"])):bg.value?vue.renderSlot(Gg.$slots,"active-action",{key:1},()=>[Ag.activeActionIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeActionIcon)))]),_:1})):vue.createCommentVNode("v-if",!0)]):bg.value?vue.createCommentVNode("v-if",!0):vue.renderSlot(Gg.$slots,"inactive-action",{key:2},()=>[Ag.inactiveActionIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.inactiveActionIcon)))]),_:1})):vue.createCommentVNode("v-if",!0)])],2)],6),!Ag.inlinePrompt&&(Ag.activeIcon||Ag.activeText||Gg.$slots.active)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(ug.value)},[vue.renderSlot(Gg.$slots,"active",{},()=>[Ag.activeIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.activeIcon)))]),_:1})):vue.createCommentVNode("v-if",!0),!Ag.activeIcon&&Ag.activeText?(vue.openBlock(),vue.createElementBlock("span",{key:1,"aria-hidden":!bg.value},vue.toDisplayString(Ag.activeText),9,_hoisted_5$b)):vue.createCommentVNode("v-if",!0)])],2)):vue.createCommentVNode("v-if",!0)],2))}}),switch_default=switch_vue_vue_type_script_setup_true_lang_default;const ElSwitch=withInstall(switch_default),textProps=buildProps({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:componentSizes,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var text_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElText",__name:"text",props:textProps,setup(Ag){const gg=Ag,eg=vue.ref(),Ig=useFormSize(),Cg=useNamespace("text"),tg=vue.computed(()=>[Cg.b(),Cg.m(gg.type),Cg.m(Ig.value),Cg.is("truncated",gg.truncated),Cg.is("line-clamp",!isUndefined(gg.lineClamp))]),ig=()=>{var og,sg,rg,cg,ag,ug,dg;if(vue.useAttrs().title)return;let ng=!1;const lg=((og=eg.value)==null?void 0:og.textContent)||"";if(gg.truncated){const hg=(sg=eg.value)==null?void 0:sg.offsetWidth,bg=(rg=eg.value)==null?void 0:rg.scrollWidth;hg&&bg&&bg>hg&&(ng=!0)}else if(!isUndefined(gg.lineClamp)){const hg=(cg=eg.value)==null?void 0:cg.offsetHeight,bg=(ag=eg.value)==null?void 0:ag.scrollHeight;hg&&bg&&bg>hg&&(ng=!0)}ng?(ug=eg.value)==null||ug.setAttribute("title",lg):(dg=eg.value)==null||dg.removeAttribute("title")};return vue.onMounted(ig),vue.onUpdated(ig),(ng,lg)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.tag),{ref_key:"textRef",ref:eg,class:vue.normalizeClass(tg.value),style:vue.normalizeStyle({"-webkit-line-clamp":Ag.lineClamp})},{default:vue.withCtx(()=>[vue.renderSlot(ng.$slots,"default")]),_:3},8,["class","style"]))}}),text_default=text_vue_vue_type_script_setup_true_lang_default;const ElText=withInstall(text_default),ROOT_TREE_INJECTION_KEY="RootTree",NODE_INSTANCE_INJECTION_KEY="NodeInstance",TREE_NODE_MAP_INJECTION_KEY="TreeNodeMap",treeProps=buildProps({data:{type:definePropType(Array),default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkOnClickLeaf:{type:Boolean,default:!0},checkDescendants:Boolean,autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array},defaultExpandedKeys:{type:Array},currentNodeKey:{type:[String,Number]},renderContent:{type:definePropType(Function)},showCheckbox:Boolean,draggable:Boolean,allowDrag:{type:definePropType(Function)},allowDrop:{type:definePropType(Function)},props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:Boolean,highlightCurrent:Boolean,load:{type:Function},filterNodeMethod:{type:Function},accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}}),treeEmits={"check-change":(Ag,gg,eg)=>Ag&&isBoolean(gg)&&isBoolean(eg),"current-change":(Ag,gg)=>!0,"node-click":(Ag,gg,eg,Ig)=>Ag&&gg&&Ig instanceof Event,"node-contextmenu":(Ag,gg,eg,Ig)=>Ag instanceof Event&&gg&&eg,"node-collapse":(Ag,gg,eg)=>Ag&&gg,"node-expand":(Ag,gg,eg)=>Ag&&gg,check:(Ag,gg)=>Ag&&gg,"node-drag-start":(Ag,gg)=>Ag&&gg,"node-drag-end":(Ag,gg,eg,Ig)=>Ag&&Ig,"node-drop":(Ag,gg,eg,Ig)=>Ag&&gg&&Ig,"node-drag-leave":(Ag,gg,eg)=>Ag&&gg&&eg,"node-drag-enter":(Ag,gg,eg)=>Ag&&gg&&eg,"node-drag-over":(Ag,gg,eg)=>Ag&&gg&&eg},NODE_KEY="$treeNodeId",markNodeData=function(Ag,gg){!gg||gg[NODE_KEY]||Object.defineProperty(gg,NODE_KEY,{value:Ag.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=(Ag,gg)=>gg==null?void 0:gg[Ag||NODE_KEY],handleCurrentChange=(Ag,gg,eg)=>{const Ig=Ag.value.currentNode;eg();const Cg=Ag.value.currentNode;Ig!==Cg&&gg("current-change",Cg?Cg.data:null,Cg)},getChildState=Ag=>{let gg=!0,eg=!0,Ig=!0,Cg=!0;for(let tg=0,ig=Ag.length;tg<ig;tg++){const ng=Ag[tg];(ng.checked!==!0||ng.indeterminate)&&(gg=!1,ng.disabled||(Ig=!1)),(ng.checked!==!1||ng.indeterminate)&&(eg=!1),ng.isEffectivelyChecked||(Cg=!1)}return{all:gg,none:eg,allWithoutDisable:Ig,half:!gg&&!eg,isEffectivelyChecked:Cg}},reInitChecked=function(Ag){if(Ag.childNodes.length===0||Ag.loading){Ag.isEffectivelyChecked=Ag.disabled||Ag.checked;return}const{all:gg,none:eg,half:Ig,isEffectivelyChecked:Cg}=getChildState(Ag.childNodes);Ag.isEffectivelyChecked=Cg,gg?(Ag.checked=!0,Ag.indeterminate=!1):Ig?(Ag.checked=!1,Ag.indeterminate=!0):eg&&(Ag.checked=!1,Ag.indeterminate=!1);const tg=Ag.parent;!tg||tg.level===0||Ag.store.checkStrictly||reInitChecked(tg)},getPropertyFromData=function(Ag,gg){const eg=Ag.store.props,Ig=Ag.data||{},Cg=eg[gg];if(isFunction$1(Cg))return Cg(Ig,Ag);if(isString(Cg))return Ig[Cg];if(isUndefined(Cg)){const tg=Ig[gg];return isUndefined(tg)?"":tg}},setCanFocus=function(Ag,gg){Ag.forEach(eg=>{eg.canFocus=gg,setCanFocus(eg.childNodes,gg)})};let nodeIdSeed=0;var Node$1=class Rl{constructor(gg){this.isLeafByUser=void 0,this.isLeaf=void 0,this.isEffectivelyChecked=!1,this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const eg in gg)hasOwn$b(gg,eg)&&(this[eg]=gg[eg]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){var tg;const gg=this.store;if(!gg)throw new Error("[Node]store is required!");gg.registerNode(this);const eg=gg.props;if(eg&&typeof eg.isLeaf<"u"){const ig=getPropertyFromData(this,"isLeaf");isBoolean(ig)&&(this.isLeafByUser=ig)}if(gg.lazy!==!0&&this.data?(this.setData(this.data),gg.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&gg.lazy&&gg.defaultExpandAll&&!this.isLeafByUser&&this.expand(),isArray$4(this.data)||markNodeData(this,this.data),!this.data)return;const Ig=gg.defaultExpandedKeys,Cg=gg.key;Cg&&!isNil(this.key)&&Ig&&Ig.includes(this.key)&&this.expand(null,gg.autoExpandParent),Cg&&gg.currentNodeKey!==void 0&&this.key===gg.currentNodeKey&&(gg.currentNode&&(gg.currentNode.isCurrent=!1),gg.currentNode=this,gg.currentNode.isCurrent=!0),gg.lazy&&gg._initDefaultCheckedNode(this),this.updateLeafState(),(this.level===1||((tg=this.parent)==null?void 0:tg.expanded)===!0)&&(this.canFocus=!0)}setData(gg){isArray$4(gg)||markNodeData(this,gg),this.data=gg,this.childNodes=[];let eg;this.level===0&&isArray$4(this.data)?eg=this.data:eg=getPropertyFromData(this,"children")||[];for(let Ig=0,Cg=eg.length;Ig<Cg;Ig++)this.insertChild({data:eg[Ig]})}get label(){return getPropertyFromData(this,"label")}get key(){const gg=this.store.key;return this.data?this.data[gg]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const gg=this.parent;if(gg){const eg=gg.childNodes.indexOf(this);if(eg>-1)return gg.childNodes[eg+1]}return null}get previousSibling(){const gg=this.parent;if(gg){const eg=gg.childNodes.indexOf(this);if(eg>-1)return eg>0?gg.childNodes[eg-1]:null}return null}contains(gg,eg=!0){return(this.childNodes||[]).some(Ig=>Ig===gg||eg&&Ig.contains(gg))}remove(){const gg=this.parent;gg&&gg.removeChild(this)}insertChild(gg,eg,Ig){if(!gg)throw new Error("InsertChild error: child is required.");if(!(gg instanceof Rl)){if(!Ig){const Cg=this.getChildren(!0);Cg!=null&&Cg.includes(gg.data)||(isUndefined(eg)||eg<0?Cg==null||Cg.push(gg.data):Cg==null||Cg.splice(eg,0,gg.data))}Object.assign(gg,{parent:this,store:this.store}),gg=vue.reactive(new Rl(gg)),gg instanceof Rl&&gg.initialize()}gg.level=this.level+1,isUndefined(eg)||eg<0?this.childNodes.push(gg):this.childNodes.splice(eg,0,gg),this.updateLeafState()}insertBefore(gg,eg){let Ig;eg&&(Ig=this.childNodes.indexOf(eg)),this.insertChild(gg,Ig)}insertAfter(gg,eg){let Ig;eg&&(Ig=this.childNodes.indexOf(eg),Ig!==-1&&(Ig+=1)),this.insertChild(gg,Ig)}removeChild(gg){const eg=this.getChildren()||[],Ig=eg.indexOf(gg.data);Ig>-1&&eg.splice(Ig,1);const Cg=this.childNodes.indexOf(gg);Cg>-1&&(this.store&&this.store.deregisterNode(gg),gg.parent=null,this.childNodes.splice(Cg,1)),this.updateLeafState()}removeChildByData(gg){const eg=this.childNodes.find(Ig=>Ig.data===gg);eg&&this.removeChild(eg)}expand(gg,eg){const Ig=()=>{if(eg){let Cg=this.parent;for(;Cg&&Cg.level>0;)Cg.expanded=!0,Cg=Cg.parent}this.expanded=!0,gg&&gg(),setCanFocus(this.childNodes,!0)};this.shouldLoadData()?this.loadData(Cg=>{isArray$4(Cg)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),Ig())}):Ig()}doCreateChildren(gg,eg={}){gg.forEach(Ig=>{this.insertChild(Object.assign({data:Ig},eg),void 0,!0)})}collapse(){this.expanded=!1,setCanFocus(this.childNodes,!1)}shouldLoadData(){return!!(this.store.lazy===!0&&this.store.load&&!this.loaded)}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}const gg=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!gg||gg.length===0,this.isEffectivelyChecked=this.isLeaf&&this.disabled;return}this.isLeaf=!1}setChecked(gg,eg,Ig,Cg){if(this.indeterminate=gg==="half",this.checked=gg===!0,this.isEffectivelyChecked=!this.childNodes.length&&(this.disabled||this.checked),this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const ig=()=>{if(eg){const ng=this.childNodes;for(let rg=0,cg=ng.length;rg<cg;rg++){const ag=ng[rg];Cg=Cg||gg!==!1;const ug=ag.disabled&&ag.isLeaf?ag.checked:Cg;ag.setChecked(ug,eg,!0,Cg)}const{half:lg,all:og,isEffectivelyChecked:sg}=getChildState(ng);og||(this.checked=og,this.indeterminate=lg),this.isEffectivelyChecked=this.childNodes.length?sg:this.disabled||this.checked}};if(this.shouldLoadData()){this.loadData(()=>{ig(),reInitChecked(this)},{checked:gg!==!1});return}else ig()}const tg=this.parent;!tg||tg.level===0||Ig||reInitChecked(tg)}getChildren(gg=!1){if(this.level===0)return this.data;const eg=this.data;if(!eg)return null;const Ig=this.store.props;let Cg="children";return Ig&&(Cg=Ig.children||"children"),isUndefined(eg[Cg])&&(eg[Cg]=null),gg&&!eg[Cg]&&(eg[Cg]=[]),eg[Cg]}updateChildren(){const gg=this.getChildren()||[],eg=this.childNodes.map(tg=>tg.data),Ig={},Cg=[];gg.forEach((tg,ig)=>{const ng=tg[NODE_KEY];ng&&eg.some(lg=>(lg==null?void 0:lg[NODE_KEY])===ng)?Ig[ng]={index:ig,data:tg}:Cg.push({index:ig,data:tg})}),this.store.lazy||eg.forEach(tg=>{Ig[tg==null?void 0:tg[NODE_KEY]]||this.removeChildByData(tg)}),Cg.forEach(({index:tg,data:ig})=>{this.insertChild({data:ig},tg)}),this.updateLeafState()}loadData(gg,eg={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(eg).length)){this.loading=!0;const Ig=tg=>{this.childNodes=[],this.doCreateChildren(tg,eg),this.loaded=!0,this.loading=!1,this.updateLeafState(),gg&&gg.call(this,tg)},Cg=()=>{this.loading=!1};this.store.load(this,Ig,Cg)}else gg&&gg.call(this)}eachNode(gg){const eg=[this];for(;eg.length;){const Ig=eg.shift();eg.unshift(...Ig.childNodes),gg(Ig)}}reInitChecked(){this.store.checkStrictly||reInitChecked(this)}},TreeStore=class{constructor(Ag){this.lazy=!1,this.checkStrictly=!1,this.autoExpandParent=!1,this.defaultExpandAll=!1,this.checkDescendants=!1,this.currentNode=null,this.currentNodeKey=null;for(const gg in Ag)hasOwn$b(Ag,gg)&&(this[gg]=Ag[gg]);this.nodesMap={}}initialize(){if(this.root=new Node$1({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const Ag=this.load;Ag(this.root,gg=>{this.root.doCreateChildren(gg),this._initDefaultCheckedNodes()},NOOP)}else this._initDefaultCheckedNodes()}filter(Ag){const gg=this.filterNodeMethod,eg=this.lazy,Ig=async function(Cg){const tg=Cg.root?Cg.root.childNodes:Cg.childNodes;for(const[ig,ng]of tg.entries())ng.visible=!!(gg!=null&&gg.call(ng,Ag,ng.data,ng)),ig%80===0&&ig>0&&await vue.nextTick(),await Ig(ng);if(!Cg.visible&&tg.length){let ig=!0;ig=!tg.some(ng=>ng.visible),Cg.root?Cg.root.visible=ig===!1:Cg.visible=ig===!1}Ag&&Cg.visible&&!Cg.isLeaf&&(!eg||Cg.loaded)&&Cg.expand()};Ig(this)}setData(Ag){Ag!==this.root.data?(this.nodesMap={},this.root.setData(Ag),this._initDefaultCheckedNodes(),this.setCurrentNodeKey(this.currentNodeKey)):this.root.updateChildren()}getNode(Ag){if(Ag instanceof Node$1)return Ag;const gg=isObject$h(Ag)?getNodeKey(this.key,Ag):Ag;return this.nodesMap[gg]||null}insertBefore(Ag,gg){var Ig;const eg=this.getNode(gg);(Ig=eg.parent)==null||Ig.insertBefore({data:Ag},eg)}insertAfter(Ag,gg){var Ig;const eg=this.getNode(gg);(Ig=eg.parent)==null||Ig.insertAfter({data:Ag},eg)}remove(Ag){const gg=this.getNode(Ag);gg&&gg.parent&&(gg===this.currentNode&&(this.currentNode=null),gg.parent.removeChild(gg))}append(Ag,gg){const eg=isPropAbsent(gg)?this.root:this.getNode(gg);eg&&eg.insertChild({data:Ag})}_initDefaultCheckedNodes(){const Ag=this.defaultCheckedKeys||[],gg=this.nodesMap;Ag.forEach(eg=>{const Ig=gg[eg];Ig&&Ig.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(Ag){const gg=this.defaultCheckedKeys||[];!isNil(Ag.key)&&gg.includes(Ag.key)&&Ag.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(Ag){Ag!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=Ag,this._initDefaultCheckedNodes())}registerNode(Ag){const gg=this.key;if(!(!Ag||!Ag.data))if(!gg)this.nodesMap[Ag.id]=Ag;else{const eg=Ag.key;isNil(eg)||(this.nodesMap[eg]=Ag)}}deregisterNode(Ag){!this.key||!Ag||!Ag.data||(Ag.childNodes.forEach(gg=>{this.deregisterNode(gg)}),delete this.nodesMap[Ag.key])}getCheckedNodes(Ag=!1,gg=!1){const eg=[],Ig=function(Cg){(Cg.root?Cg.root.childNodes:Cg.childNodes).forEach(tg=>{(tg.checked||gg&&tg.indeterminate)&&(!Ag||Ag&&tg.isLeaf)&&eg.push(tg.data),Ig(tg)})};return Ig(this),eg}getCheckedKeys(Ag=!1){return this.getCheckedNodes(Ag).map(gg=>(gg||{})[this.key])}getHalfCheckedNodes(){const Ag=[],gg=function(eg){(eg.root?eg.root.childNodes:eg.childNodes).forEach(Ig=>{Ig.indeterminate&&Ag.push(Ig.data),gg(Ig)})};return gg(this),Ag}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(Ag=>(Ag||{})[this.key])}_getAllNodes(){const Ag=[],gg=this.nodesMap;for(const eg in gg)hasOwn$b(gg,eg)&&Ag.push(gg[eg]);return Ag}updateChildren(Ag,gg){const eg=this.nodesMap[Ag];if(!eg)return;const Ig=eg.childNodes;for(let Cg=Ig.length-1;Cg>=0;Cg--){const tg=Ig[Cg];this.remove(tg.data)}for(let Cg=0,tg=gg.length;Cg<tg;Cg++){const ig=gg[Cg];this.append(ig,eg.data)}}_setCheckedKeys(Ag,gg=!1,eg){const Ig=this._getAllNodes().sort((ng,lg)=>ng.level-lg.level),Cg=Object.create(null),tg=Object.keys(eg);Ig.forEach(ng=>ng.setChecked(!1,!1));const ig=ng=>{ng.childNodes.forEach(lg=>{var og;Cg[lg.data[Ag]]=!0,(og=lg.childNodes)!=null&&og.length&&ig(lg)})};for(let ng=0,lg=Ig.length;ng<lg;ng++){const og=Ig[ng],sg=og.data[Ag].toString();if(!tg.includes(sg)){og.checked&&!Cg[sg]&&og.setChecked(!1,!1);continue}if(og.childNodes.length&&ig(og),og.isLeaf||this.checkStrictly){og.setChecked(!0,!1);continue}if(og.setChecked(!0,!0),gg){og.setChecked(!1,!1,!0);const rg=function(cg){cg.childNodes.forEach(ag=>{ag.isLeaf||ag.setChecked(!1,!1,!0),rg(ag)}),cg.reInitChecked()};rg(og)}}}setCheckedNodes(Ag,gg=!1){const eg=this.key,Ig={};Ag.forEach(Cg=>{Ig[(Cg||{})[eg]]=!0}),this._setCheckedKeys(eg,gg,Ig)}setCheckedKeys(Ag,gg=!1){this.defaultCheckedKeys=Ag;const eg=this.key,Ig={};Ag.forEach(Cg=>{Ig[Cg]=!0}),this._setCheckedKeys(eg,gg,Ig)}setDefaultExpandedKeys(Ag){Ag=Ag||[],this.defaultExpandedKeys=Ag,Ag.forEach(gg=>{const eg=this.getNode(gg);eg&&eg.expand(null,this.autoExpandParent)})}setChecked(Ag,gg,eg){const Ig=this.getNode(Ag);Ig&&Ig.setChecked(!!gg,eg)}getCurrentNode(){return this.currentNode}setCurrentNode(Ag){const gg=this.currentNode;gg&&(gg.isCurrent=!1),this.currentNode=Ag,this.currentNode.isCurrent=!0}setUserCurrentNode(Ag,gg=!0){var Cg;const eg=Ag[this.key],Ig=this.nodesMap[eg];this.setCurrentNode(Ig),gg&&this.currentNode&&this.currentNode.level>1&&((Cg=this.currentNode.parent)==null||Cg.expand(null,!0))}setCurrentNodeKey(Ag,gg=!0){var Ig;if(this.currentNodeKey=Ag,isPropAbsent(Ag)){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const eg=this.getNode(Ag);eg&&(this.setCurrentNode(eg),gg&&this.currentNode&&this.currentNode.level>1&&((Ig=this.currentNode.parent)==null||Ig.expand(null,!0)))}};function useNodeExpandEventBroadcast(Ag){const gg=vue.inject(TREE_NODE_MAP_INJECTION_KEY,null);let eg={treeNodeExpand:Ig=>{var Cg;Ag.node!==Ig&&((Cg=Ag.node)==null||Cg.collapse())},children:new Set};return gg&&gg.children.add(eg),vue.onBeforeUnmount(()=>{gg&&gg.children.delete(eg),eg=null}),vue.provide(TREE_NODE_MAP_INJECTION_KEY,eg),{broadcastExpanded:Ig=>{if(Ag.accordion)for(const Cg of eg.children)Cg.treeNodeExpand(Ig)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:Ag,ctx:gg,el$:eg,dropIndicator$:Ig,store:Cg}){const tg=useNamespace("tree"),ig=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),ng=({event:sg,treeNode:rg})=>{if(sg.dataTransfer){if(isFunction$1(Ag.allowDrag)&&!Ag.allowDrag(rg.node))return sg.preventDefault(),!1;sg.dataTransfer.effectAllowed="move";try{sg.dataTransfer.setData("text/plain","")}catch{}ig.value.draggingNode=rg,gg.emit("node-drag-start",rg.node,sg)}},lg=({event:sg,treeNode:rg})=>{if(!sg.dataTransfer)return;const cg=rg,ag=ig.value.dropNode;ag&&ag.node.id!==cg.node.id&&removeClass(ag.$el,tg.is("drop-inner"));const ug=ig.value.draggingNode;if(!ug||!cg)return;let dg=!0,hg=!0,bg=!0,mg=!0;isFunction$1(Ag.allowDrop)&&(dg=Ag.allowDrop(ug.node,cg.node,"prev"),mg=hg=Ag.allowDrop(ug.node,cg.node,"inner"),bg=Ag.allowDrop(ug.node,cg.node,"next")),sg.dataTransfer.dropEffect=hg||dg||bg?"move":"none",(dg||hg||bg)&&(ag==null?void 0:ag.node.id)!==cg.node.id&&(ag&&gg.emit("node-drag-leave",ug.node,ag.node,sg),gg.emit("node-drag-enter",ug.node,cg.node,sg)),dg||hg||bg?ig.value.dropNode=cg:ig.value.dropNode=null,cg.node.nextSibling===ug.node&&(bg=!1),cg.node.previousSibling===ug.node&&(dg=!1),cg.node.contains(ug.node,!1)&&(hg=!1),(ug.node===cg.node||ug.node.contains(cg.node))&&(dg=!1,hg=!1,bg=!1);const Zg=cg.$el,Bg=Zg.querySelector(`.${tg.be("node","content")}`).getBoundingClientRect(),Gg=eg.value.getBoundingClientRect(),pg=eg.value.scrollTop;let fg;const Vg=dg?hg?.25:bg?.45:1:Number.NEGATIVE_INFINITY,Wg=bg?hg?.75:dg?.55:0:Number.POSITIVE_INFINITY;let Hg=-9999;const Sg=sg.clientY-Bg.top;Sg<Bg.height*Vg?fg="before":Sg>Bg.height*Wg?fg="after":hg?fg="inner":fg="none";const wg=Zg.querySelector(`.${tg.be("node","expand-icon")}`).getBoundingClientRect(),Xg=Ig.value;fg==="before"?Hg=wg.top-Gg.top+pg:fg==="after"&&(Hg=wg.bottom-Gg.top+pg),Xg.style.top=`${Hg}px`,Xg.style.left=`${wg.right-Gg.left}px`,fg==="inner"?addClass(Zg,tg.is("drop-inner")):removeClass(Zg,tg.is("drop-inner")),ig.value.showDropIndicator=fg==="before"||fg==="after",ig.value.allowDrop=ig.value.showDropIndicator||mg,ig.value.dropType=fg,gg.emit("node-drag-over",ug.node,cg.node,sg)},og=sg=>{var ug,dg;const{draggingNode:rg,dropType:cg,dropNode:ag}=ig.value;if(sg.preventDefault(),sg.dataTransfer&&(sg.dataTransfer.dropEffect="move"),rg!=null&&rg.node.data&&ag){const hg={data:rg.node.data};cg!=="none"&&rg.node.remove(),cg==="before"?(ug=ag.node.parent)==null||ug.insertBefore(hg,ag.node):cg==="after"?(dg=ag.node.parent)==null||dg.insertAfter(hg,ag.node):cg==="inner"&&ag.node.insertChild(hg),cg!=="none"&&(Cg.value.registerNode(hg),Cg.value.key&&rg.node.eachNode(bg=>{var mg;(mg=Cg.value.nodesMap[bg.data[Cg.value.key]])==null||mg.setChecked(bg.checked,!Cg.value.checkStrictly)})),removeClass(ag.$el,tg.is("drop-inner")),gg.emit("node-drag-end",rg.node,ag.node,cg,sg),cg!=="none"&&gg.emit("node-drop",rg.node,ag.node,cg,sg)}rg&&!ag&&gg.emit("node-drag-end",rg.node,null,cg,sg),ig.value.showDropIndicator=!1,ig.value.draggingNode=null,ig.value.dropNode=null,ig.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:ng,treeNodeDragOver:lg,treeNodeDragEnd:og}),{dragState:ig}}var tree_node_content_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(Ag){const gg=useNamespace("tree"),eg=vue.inject(NODE_INSTANCE_INJECTION_KEY),Ig=vue.inject(ROOT_TREE_INJECTION_KEY);return()=>{const Cg=Ag.node,{data:tg,store:ig}=Cg;return Ag.renderContent?Ag.renderContent(vue.h,{_self:eg,node:Cg,data:tg,store:ig}):vue.renderSlot(Ig.ctx.slots,"default",{node:Cg,data:tg},()=>[vue.h(ElText,{tag:"span",truncated:!0,class:gg.be("node","label")},()=>[Cg.label])])}}}),tree_node_content_default=tree_node_content_vue_vue_type_script_lang_default,tree_node_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition,ElCheckbox,NodeContent:tree_node_content_default,ElIcon,Loading:loading_default},props:{node:{type:Node$1,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:Boolean},emits:["node-expand"],setup(Ag,gg){const eg=useNamespace("tree"),{broadcastExpanded:Ig}=useNodeExpandEventBroadcast(Ag),Cg=vue.inject(ROOT_TREE_INJECTION_KEY),tg=vue.ref(!1),ig=vue.ref(!1),ng=vue.ref(),lg=vue.ref(),og=vue.ref(),sg=vue.inject(dragEventsKey),rg=vue.getCurrentInstance();vue.provide(NODE_INSTANCE_INJECTION_KEY,rg),Cg||debugWarn("Tree","Can not find node's tree."),Ag.node.expanded&&(tg.value=!0,ig.value=!0);const cg=Cg.props.props.children||"children";vue.watch(()=>{var Hg;const Wg=(Hg=Ag.node.data)==null?void 0:Hg[cg];return Wg&&[...Wg]},()=>{Ag.node.updateChildren()}),vue.watch(()=>Ag.node.indeterminate,Wg=>{dg(Ag.node.checked,Wg)}),vue.watch(()=>Ag.node.checked,Wg=>{dg(Wg,Ag.node.indeterminate)}),vue.watch(()=>Ag.node.childNodes.length,()=>Ag.node.reInitChecked()),vue.watch(()=>Ag.node.expanded,Wg=>{vue.nextTick(()=>tg.value=Wg),Wg&&(ig.value=!0)});const ag=Wg=>Cg.props.nodeKey?getNodeKey(Cg.props.nodeKey,Wg.data):Wg.id,ug=Wg=>{const Hg=Ag.props.class;if(!Hg)return{};let Sg;if(isFunction$1(Hg)){const{data:wg}=Wg;Sg=Hg(wg,Wg)}else Sg=Hg;return isString(Sg)?{[Sg]:!0}:Sg},dg=(Wg,Hg)=>{(ng.value!==Wg||lg.value!==Hg)&&Cg.ctx.emit("check-change",Ag.node.data,Wg,Hg),ng.value=Wg,lg.value=Hg},hg=Wg=>{handleCurrentChange(Cg.store,Cg.ctx.emit,()=>{var Hg;if((Hg=Cg==null?void 0:Cg.props)!=null&&Hg.nodeKey){const Sg=ag(Ag.node);Cg.store.value.setCurrentNodeKey(Sg)}else Cg.store.value.setCurrentNode(Ag.node)}),Cg.currentNode.value=Ag.node,Cg.props.expandOnClickNode&&mg(),(Cg.props.checkOnClickNode||Ag.node.isLeaf&&Cg.props.checkOnClickLeaf&&Ag.showCheckbox)&&!Ag.node.disabled&&Zg(!Ag.node.checked),Cg.ctx.emit("node-click",Ag.node.data,Ag.node,rg,Wg)},bg=Wg=>{var Hg;(Hg=Cg.instance.vnode.props)!=null&&Hg.onNodeContextmenu&&(Wg.stopPropagation(),Wg.preventDefault()),Cg.ctx.emit("node-contextmenu",Wg,Ag.node.data,Ag.node,rg)},mg=()=>{Ag.node.isLeaf||(tg.value?(Cg.ctx.emit("node-collapse",Ag.node.data,Ag.node,rg),Ag.node.collapse()):Ag.node.expand(()=>{gg.emit("node-expand",Ag.node.data,Ag.node,rg)}))},Zg=Wg=>{const Hg=Cg==null?void 0:Cg.props.checkStrictly,Sg=Ag.node.childNodes;!Hg&&Sg.length&&(Wg=Sg.some(wg=>!wg.isEffectivelyChecked)),Ag.node.setChecked(Wg,!Hg),vue.nextTick(()=>{const wg=Cg.store.value;Cg.ctx.emit("check",Ag.node.data,{checkedNodes:wg.getCheckedNodes(),checkedKeys:wg.getCheckedKeys(),halfCheckedNodes:wg.getHalfCheckedNodes(),halfCheckedKeys:wg.getHalfCheckedKeys()})})};return{ns:eg,node$:og,tree:Cg,expanded:tg,childNodeRendered:ig,oldChecked:ng,oldIndeterminate:lg,getNodeKey:ag,getNodeClass:ug,handleSelectChange:dg,handleClick:hg,handleContextMenu:bg,handleExpandIconClick:mg,handleCheckChange:Zg,handleChildNodeExpand:(Wg,Hg,Sg)=>{Ig(Hg),Cg.ctx.emit("node-expand",Wg,Hg,Sg)},handleDragStart:Wg=>{Cg.props.draggable&&sg.treeNodeDragStart({event:Wg,treeNode:Ag})},handleDragOver:Wg=>{Wg.preventDefault(),Cg.props.draggable&&sg.treeNodeDragOver({event:Wg,treeNode:{$el:og.value,node:Ag.node}})},handleDrop:Wg=>{Wg.preventDefault()},handleDragEnd:Wg=>{Cg.props.draggable&&sg.treeNodeDragEnd(Wg)},CaretRight:caret_right_default}}});const _hoisted_1$C=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$q=["aria-expanded"];function _sfc_render$2(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-icon"),ng=vue.resolveComponent("el-checkbox"),lg=vue.resolveComponent("loading"),og=vue.resolveComponent("node-content"),sg=vue.resolveComponent("el-tree-node"),rg=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([Ag.ns.b("node"),Ag.ns.is("expanded",Ag.expanded),Ag.ns.is("current",Ag.node.isCurrent),Ag.ns.is("hidden",!Ag.node.visible),Ag.ns.is("focusable",!Ag.node.disabled),Ag.ns.is("checked",!Ag.node.disabled&&Ag.node.checked),Ag.getNodeClass(Ag.node)]),role:"treeitem",tabindex:"-1","aria-expanded":Ag.expanded,"aria-disabled":Ag.node.disabled,"aria-checked":Ag.node.checked,draggable:Ag.tree.props.draggable,"data-key":Ag.getNodeKey(Ag.node),onClick:gg[2]||(gg[2]=vue.withModifiers((...cg)=>Ag.handleClick&&Ag.handleClick(...cg),["stop"])),onContextmenu:gg[3]||(gg[3]=(...cg)=>Ag.handleContextMenu&&Ag.handleContextMenu(...cg)),onDragstart:gg[4]||(gg[4]=vue.withModifiers((...cg)=>Ag.handleDragStart&&Ag.handleDragStart(...cg),["stop"])),onDragover:gg[5]||(gg[5]=vue.withModifiers((...cg)=>Ag.handleDragOver&&Ag.handleDragOver(...cg),["stop"])),onDragend:gg[6]||(gg[6]=vue.withModifiers((...cg)=>Ag.handleDragEnd&&Ag.handleDragEnd(...cg),["stop"])),onDrop:gg[7]||(gg[7]=vue.withModifiers((...cg)=>Ag.handleDrop&&Ag.handleDrop(...cg),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(Ag.node.level-1)*Ag.tree.props.indent+"px"})},[Ag.tree.props.icon||Ag.CaretRight?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.be("node","expand-icon"),Ag.ns.is("leaf",Ag.node.isLeaf),{expanded:!Ag.node.isLeaf&&Ag.expanded}]),onClick:vue.withModifiers(Ag.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.tree.props.icon||Ag.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),Ag.showCheckbox?(vue.openBlock(),vue.createBlock(ng,{key:1,"model-value":Ag.node.checked,indeterminate:Ag.node.indeterminate,disabled:!!Ag.node.disabled,onClick:gg[0]||(gg[0]=vue.withModifiers(()=>{},["stop"])),onChange:Ag.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),Ag.node.loading?(vue.openBlock(),vue.createBlock(ig,{key:2,class:vue.normalizeClass([Ag.ns.be("node","loading-icon"),Ag.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(lg)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(og,{node:Ag.node,"render-content":Ag.renderContent},null,8,["node","render-content"])],6),vue.createVNode(rg,null,{default:vue.withCtx(()=>[!Ag.renderAfterExpand||Ag.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(Ag.ns.be("node","children")),role:"group","aria-expanded":Ag.expanded,onClick:gg[1]||(gg[1]=vue.withModifiers(()=>{},["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.node.childNodes,cg=>(vue.openBlock(),vue.createBlock(sg,{key:Ag.getNodeKey(cg),"render-content":Ag.renderContent,"render-after-expand":Ag.renderAfterExpand,"show-checkbox":Ag.showCheckbox,node:cg,accordion:Ag.accordion,props:Ag.props,onNodeExpand:Ag.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$q)),[[vue.vShow,Ag.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$C)),[[vue.vShow,Ag.node.visible]])}var tree_node_default=_plugin_vue_export_helper_default(tree_node_vue_vue_type_script_lang_default,[["render",_sfc_render$2]]);function useKeydown({el$:Ag},gg){const eg=useNamespace("tree");vue.onMounted(()=>{tg()}),vue.onUpdated(()=>{var ig;(ig=Ag.value)==null||ig.querySelectorAll("input[type=checkbox]").forEach(ng=>{ng.setAttribute("tabindex","-1")})});function Ig(ig,ng){var og,sg;const lg=gg.value.getNode(ig[ng].dataset.key);return lg.canFocus&&lg.visible&&(((og=lg.parent)==null?void 0:og.expanded)||((sg=lg.parent)==null?void 0:sg.level)===0)}useEventListener(Ag,"keydown",ig=>{const ng=ig.target;if(!ng.className.includes(eg.b("node")))return;const lg=getEventCode(ig),og=Array.from(Ag.value.querySelectorAll(`.${eg.is("focusable")}[role=treeitem]`)),sg=og.indexOf(ng);let rg;if([EVENT_CODE.up,EVENT_CODE.down].includes(lg)){if(ig.preventDefault(),lg===EVENT_CODE.up){rg=sg===-1?0:sg!==0?sg-1:og.length-1;const ag=rg;for(;!Ig(og,rg);){if(rg--,rg===ag){rg=-1;break}rg<0&&(rg=og.length-1)}}else{rg=sg===-1?0:sg<og.length-1?sg+1:0;const ag=rg;for(;!Ig(og,rg);){if(rg++,rg===ag){rg=-1;break}rg>=og.length&&(rg=0)}}rg!==-1&&og[rg].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(lg)&&(ig.preventDefault(),ng.click());const cg=ng.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.numpadEnter,EVENT_CODE.space].includes(lg)&&cg&&(ig.preventDefault(),cg.click())});const tg=()=>{var lg;if(!Ag.value)return;const ig=Array.from(Ag.value.querySelectorAll(`.${eg.is("focusable")}[role=treeitem]`));Array.from(Ag.value.querySelectorAll("input[type=checkbox]")).forEach(og=>{og.setAttribute("tabindex","-1")});const ng=Ag.value.querySelectorAll(`.${eg.is("checked")}[role=treeitem]`);if(ng.length){ng[0].setAttribute("tabindex","0");return}(lg=ig[0])==null||lg.setAttribute("tabindex","0")}}var tree_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElTree",components:{ElTreeNode:tree_node_default},props:treeProps,emits:treeEmits,setup(Ag,gg){const{t:eg}=useLocale(),Ig=useNamespace("tree"),Cg=vue.ref(new TreeStore({key:Ag.nodeKey,data:Ag.data,lazy:Ag.lazy,props:Ag.props,load:Ag.load,currentNodeKey:Ag.currentNodeKey,checkStrictly:Ag.checkStrictly,checkDescendants:Ag.checkDescendants,defaultCheckedKeys:Ag.defaultCheckedKeys,defaultExpandedKeys:Ag.defaultExpandedKeys,autoExpandParent:Ag.autoExpandParent,defaultExpandAll:Ag.defaultExpandAll,filterNodeMethod:Ag.filterNodeMethod}));Cg.value.initialize();const tg=vue.ref(Cg.value.root),ig=vue.ref(null),ng=vue.ref(null),lg=vue.ref(null),{broadcastExpanded:og}=useNodeExpandEventBroadcast(Ag),{dragState:sg}=useDragNodeHandler({props:Ag,ctx:gg,el$:ng,dropIndicator$:lg,store:Cg});useKeydown({el$:ng},Cg);const rg=vue.getCurrentInstance(),cg=vue.computed(()=>{let Ug=rg==null?void 0:rg.parent;for(;Ug;){if(Ug.type.name==="ElTreeSelect")return!0;Ug=Ug.parent}return!1}),ag=vue.computed(()=>{const{childNodes:Ug}=tg.value;return(!Ug||Ug.length===0||Ug.every(({visible:Qg})=>!Qg))&&!cg.value});vue.watch(()=>Ag.currentNodeKey,Ug=>{Cg.value.setCurrentNodeKey(Ug??null)}),vue.watch(()=>Ag.defaultCheckedKeys,(Ug,Qg)=>{isEqual(Ug,Qg)||Cg.value.setDefaultCheckedKey(Ug??[])}),vue.watch(()=>Ag.defaultExpandedKeys,Ug=>{Cg.value.setDefaultExpandedKeys(Ug??[])}),vue.watch(()=>Ag.data,Ug=>{Cg.value.setData(Ug)},{deep:!0}),vue.watch(()=>Ag.checkStrictly,Ug=>{Cg.value.checkStrictly=Ug});const ug=Ug=>{if(!Ag.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");Cg.value.filter(Ug)},dg=Ug=>Ag.nodeKey?getNodeKey(Ag.nodeKey,Ug.data):Ug.id,hg=Ug=>{if(!Ag.nodeKey)throw new Error(`[Tree] nodeKey is required in ${Ug}`)},bg=Ug=>{hg("getNodePath");const Qg=Cg.value.getNode(Ug);if(!Qg)return[];const xg=[Qg.data];let Tg=Qg.parent;for(;Tg&&Tg!==tg.value;)xg.push(Tg.data),Tg=Tg.parent;return xg.reverse()},mg=(Ug,Qg)=>Cg.value.getCheckedNodes(Ug,Qg),Zg=Ug=>Cg.value.getCheckedKeys(Ug),Bg=()=>{const Ug=Cg.value.getCurrentNode();return Ug?Ug.data:null},Gg=()=>{hg("getCurrentKey");const Ug=Bg();return Ug?Ug[Ag.nodeKey]:null},pg=(Ug,Qg)=>{hg("setCheckedNodes"),Cg.value.setCheckedNodes(Ug,Qg)},fg=(Ug,Qg)=>{hg("setCheckedKeys"),Cg.value.setCheckedKeys(Ug,Qg)},Vg=(Ug,Qg,xg)=>{Cg.value.setChecked(Ug,Qg,xg)},Wg=()=>Cg.value.getHalfCheckedNodes(),Hg=()=>Cg.value.getHalfCheckedKeys(),Sg=(Ug,Qg=!0)=>{hg("setCurrentNode"),handleCurrentChange(Cg,gg.emit,()=>{og(Ug),Cg.value.setUserCurrentNode(Ug,Qg)})},wg=(Ug=null,Qg=!0)=>{hg("setCurrentKey"),handleCurrentChange(Cg,gg.emit,()=>{og(),Cg.value.setCurrentNodeKey(Ug,Qg)})},Xg=Ug=>Cg.value.getNode(Ug),vg=Ug=>{Cg.value.remove(Ug)},yg=(Ug,Qg)=>{Cg.value.append(Ug,Qg)},Ng=(Ug,Qg)=>{Cg.value.insertBefore(Ug,Qg)},Yg=(Ug,Qg)=>{Cg.value.insertAfter(Ug,Qg)},Kg=(Ug,Qg,xg)=>{og(Qg),gg.emit("node-expand",Ug,Qg,xg)},Jg=(Ug,Qg)=>{hg("updateKeyChildren"),Cg.value.updateChildren(Ug,Qg)};return vue.provide(ROOT_TREE_INJECTION_KEY,{ctx:gg,props:Ag,store:Cg,root:tg,currentNode:ig,instance:rg}),vue.provide(formItemContextKey,void 0),{ns:Ig,store:Cg,root:tg,currentNode:ig,dragState:sg,el$:ng,dropIndicator$:lg,isEmpty:ag,filter:ug,getNodeKey:dg,getNodePath:bg,getCheckedNodes:mg,getCheckedKeys:Zg,getCurrentNode:Bg,getCurrentKey:Gg,setCheckedNodes:pg,setCheckedKeys:fg,setChecked:Vg,getHalfCheckedNodes:Wg,getHalfCheckedKeys:Hg,setCurrentNode:Sg,setCurrentKey:wg,t:eg,getNode:Xg,remove:vg,append:yg,insertBefore:Ng,insertAfter:Yg,handleNodeExpand:Kg,updateKeyChildren:Jg}}});function _sfc_render$1(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([Ag.ns.b(),Ag.ns.is("dragging",!!Ag.dragState.draggingNode),Ag.ns.is("drop-not-allow",!Ag.dragState.allowDrop),Ag.ns.is("drop-inner",Ag.dragState.dropType==="inner"),{[Ag.ns.m("highlight-current")]:Ag.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.root.childNodes,ng=>(vue.openBlock(),vue.createBlock(ig,{key:Ag.getNodeKey(ng),node:ng,props:Ag.props,accordion:Ag.accordion,"render-after-expand":Ag.renderAfterExpand,"show-checkbox":Ag.showCheckbox,"render-content":Ag.renderContent,onNodeExpand:Ag.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),Ag.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(Ag.ns.e("empty-block"))},[vue.renderSlot(Ag.$slots,"empty",{},()=>[vue.createElementVNode("span",{class:vue.normalizeClass(Ag.ns.e("empty-text"))},vue.toDisplayString(Ag.emptyText??Ag.t("el.tree.emptyText")),3)])],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(Ag.ns.e("drop-indicator"))},null,2),[[vue.vShow,Ag.dragState.showDropIndicator]])],2)}var tree_default=_plugin_vue_export_helper_default(tree_vue_vue_type_script_lang_default,[["render",_sfc_render$1]]);const ElTree=withInstall(tree_default),SCOPE$1="ElUpload";var UploadAjaxError=class extends Error{constructor(Ag,gg,eg,Ig){super(Ag),this.name="UploadAjaxError",this.status=gg,this.method=eg,this.url=Ig}};function getError(Ag,gg,eg){let Ig;return eg.response?Ig=`${eg.response.error||eg.response}`:eg.responseText?Ig=`${eg.responseText}`:Ig=`fail to ${gg.method} ${Ag} ${eg.status}`,new UploadAjaxError(Ig,eg.status,gg.method,Ag)}function getBody(Ag){const gg=Ag.responseText||Ag.response;if(!gg)return gg;try{return JSON.parse(gg)}catch{return gg}}const ajaxUpload=Ag=>{typeof XMLHttpRequest>"u"&&throwError(SCOPE$1,"XMLHttpRequest is undefined");const gg=new XMLHttpRequest,eg=Ag.action;gg.upload&&gg.upload.addEventListener("progress",tg=>{const ig=tg;ig.percent=tg.total>0?tg.loaded/tg.total*100:0,Ag.onProgress(ig)});const Ig=new FormData;if(Ag.data)for(const[tg,ig]of Object.entries(Ag.data))isArray$4(ig)?ig.length===2&&ig[0]instanceof Blob&&isString(ig[1])?Ig.append(tg,ig[0],ig[1]):ig.forEach(ng=>{Ig.append(tg,ng)}):Ig.append(tg,ig);Ig.append(Ag.filename,Ag.file,Ag.file.name),gg.addEventListener("error",()=>{Ag.onError(getError(eg,Ag,gg))}),gg.addEventListener("load",()=>{if(gg.status<200||gg.status>=300)return Ag.onError(getError(eg,Ag,gg));Ag.onSuccess(getBody(gg))}),gg.open(Ag.method,eg,!0),Ag.withCredentials&&"withCredentials"in gg&&(gg.withCredentials=!0);const Cg=Ag.headers||{};if(Cg instanceof Headers)Cg.forEach((tg,ig)=>gg.setRequestHeader(ig,tg));else for(const[tg,ig]of Object.entries(Cg))isNil(ig)||gg.setRequestHeader(tg,String(ig));return gg.send(Ig),gg},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:definePropType([Object,Function,Promise]),default:()=>mutable({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:{type:Boolean,default:void 0},limit:Number,directory:Boolean}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP},crossorigin:{type:definePropType(String)}}),uploadContextKey=Symbol("uploadContextKey"),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:void 0},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"},crossorigin:{type:definePropType(String)}}),uploadListEmits={remove:Ag=>!!Ag},uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadDraggerProps=buildProps({disabled:{type:Boolean,default:void 0},directory:Boolean}),uploadDraggerEmits={file:Ag=>isArray$4(Ag)},_hoisted_1$B=["tabindex","aria-disabled","onKeydown"],_hoisted_2$p=["src","crossorigin"],_hoisted_3$j=["onClick"],_hoisted_4$c=["title"],_hoisted_5$a=["onClick"],_hoisted_6$9=["onClick"];var upload_list_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUploadList",__name:"upload-list",props:uploadListProps,emits:uploadListEmits,setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,{t:Cg}=useLocale(),tg=useNamespace("upload"),ig=useNamespace("icon"),ng=useNamespace("list"),lg=useFormDisabled(),og=vue.ref(!1),sg=vue.computed(()=>[tg.b("list"),tg.bm("list",eg.listType),tg.is("disabled",lg.value)]),rg=cg=>{Ig("remove",cg)};return(cg,ag)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass(sg.value),name:vue.unref(ng).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ag.files,(ug,dg)=>(vue.openBlock(),vue.createElementBlock("li",{key:ug.uid||ug.name,class:vue.normalizeClass([vue.unref(tg).be("list","item"),vue.unref(tg).is(ug.status),{focusing:og.value}]),tabindex:vue.unref(lg)?void 0:0,"aria-disabled":vue.unref(lg),role:"button",onKeydown:vue.withKeys(hg=>!vue.unref(lg)&&rg(ug),["delete"]),onFocus:ag[0]||(ag[0]=hg=>og.value=!0),onBlur:ag[1]||(ag[1]=hg=>og.value=!1),onClick:ag[2]||(ag[2]=hg=>og.value=!1)},[vue.renderSlot(cg.$slots,"default",{file:ug,index:dg},()=>[Ag.listType==="picture"||ug.status!=="uploading"&&Ag.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(tg).be("list","item-thumbnail")),src:ug.url,crossorigin:Ag.crossorigin,alt:""},null,10,_hoisted_2$p)):vue.createCommentVNode("v-if",!0),ug.status==="uploading"||Ag.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(tg).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(tg).be("list","item-name")),onClick:vue.withModifiers(hg=>Ag.handlePreview(ug),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(tg).be("list","item-file-name")),title:ug.name},vue.toDisplayString(ug.name),11,_hoisted_4$c)],10,_hoisted_3$j),ug.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ag.listType==="picture-card"?"circle":"line","stroke-width":Ag.listType==="picture-card"?6:2,percentage:Number(ug.percentage),style:vue.normalizeStyle(Ag.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(tg).be("list","item-status-label"))},[Ag.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(ig).m("upload-success"),vue.unref(ig).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ag.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(ig).m("upload-success"),vue.unref(ig).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(ig).m("close")),"aria-label":vue.unref(Cg)("el.upload.delete"),role:"button",tabindex:"0",onClick:hg=>rg(ug),onKeydown:vue.withKeys(vue.withModifiers(hg=>rg(ug),["prevent"]),["enter","space"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","aria-label","onClick","onKeydown"])),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(ig).m("close-tip"))},vue.toDisplayString(vue.unref(Cg)("el.upload.deleteTip")),3)),Ag.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(tg).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(tg).be("list","item-preview")),onClick:hg=>Ag.handlePreview(ug)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref(lg)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(tg).be("list","item-delete")),onClick:hg=>rg(ug)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(ig).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$9))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$B))),128)),vue.renderSlot(cg.$slots,"append")]),_:3},8,["class","name"]))}}),upload_list_default=upload_list_vue_vue_type_script_setup_true_lang_default;const COMPONENT_NAME="ElUploadDrag";var upload_dragger_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:COMPONENT_NAME,__name:"upload-dragger",props:uploadDraggerProps,emits:uploadDraggerEmits,setup(Ag,{emit:gg}){const eg=Ag,Ig=gg;vue.inject(uploadContextKey)||throwError(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const Cg=useNamespace("upload"),tg=vue.ref(!1),ig=useFormDisabled(),ng=cg=>new Promise((ag,ug)=>cg.file(ag,ug)),lg=async cg=>{try{if(cg.isFile){const ag=await ng(cg);return ag.isDirectory=!1,[ag]}if(cg.isDirectory){const ag=cg.createReader(),ug=()=>new Promise((mg,Zg)=>ag.readEntries(mg,Zg)),dg=[];let hg=await ug();for(;hg.length>0;)dg.push(...hg),hg=await ug();const bg=dg.map(mg=>lg(mg).catch(()=>[]));return flatten(await Promise.all(bg))}}catch{return[]}return[]},og=async cg=>{if(ig.value)return;tg.value=!1,cg.stopPropagation();const ag=Array.from(cg.dataTransfer.files),ug=cg.dataTransfer.items||[];if(eg.directory){const dg=Array.from(ug).map(hg=>{var bg;return(bg=hg==null?void 0:hg.webkitGetAsEntry)==null?void 0:bg.call(hg)}).filter(hg=>hg);Ig("file",flatten(await Promise.all(dg.map(lg))));return}ag.forEach((dg,hg)=>{var mg,Zg;const bg=(Zg=(mg=ug[hg])==null?void 0:mg.webkitGetAsEntry)==null?void 0:Zg.call(mg);bg&&(dg.isDirectory=bg.isDirectory)}),Ig("file",ag)},sg=()=>{ig.value||(tg.value=!0)},rg=cg=>{cg.currentTarget.contains(cg.relatedTarget)||(tg.value=!1)};return(cg,ag)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Cg).b("dragger"),vue.unref(Cg).is("dragover",tg.value)]),onDrop:vue.withModifiers(og,["prevent"]),onDragover:vue.withModifiers(sg,["prevent"]),onDragleave:vue.withModifiers(rg,["prevent"])},[vue.renderSlot(cg.$slots,"default")],34))}}),upload_dragger_default=upload_dragger_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$A=["tabindex","aria-disabled","onKeydown"],_hoisted_2$o=["name","disabled","multiple","accept","webkitdirectory"];var upload_content_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1,__name:"upload-content",props:uploadContentProps,setup(Ag,{expose:gg}){const eg=Ag,Ig=useNamespace("upload"),Cg=useFormDisabled(),tg=vue.shallowRef({}),ig=vue.shallowRef(),ng=dg=>{if(dg.length===0)return;const{autoUpload:hg,limit:bg,fileList:mg,multiple:Zg,onStart:Bg,onExceed:Gg}=eg;if(bg&&mg.length+dg.length>bg){Gg(dg,mg);return}Zg||(dg=dg.slice(0,1));for(const pg of dg){const fg=pg;fg.uid=genFileId(),Bg(fg),hg&&lg(fg)}},lg=async dg=>{if(ig.value.value="",!eg.beforeUpload)return sg(dg);let hg,bg={};try{const Zg=eg.data,Bg=eg.beforeUpload(dg);bg=isPlainObject$1(eg.data)?cloneDeep(eg.data):eg.data,hg=await Bg,isPlainObject$1(eg.data)&&isEqual(Zg,bg)&&(bg=cloneDeep(eg.data))}catch{hg=!1}if(hg===!1){eg.onRemove(dg);return}let mg=dg;hg instanceof Blob&&(hg instanceof File?mg=hg:mg=new File([hg],dg.name,{type:dg.type})),sg(Object.assign(mg,{uid:dg.uid}),bg)},og=async(dg,hg)=>isFunction$1(dg)?dg(hg):dg,sg=async(dg,hg)=>{const{headers:bg,data:mg,method:Zg,withCredentials:Bg,name:Gg,action:pg,onProgress:fg,onSuccess:Vg,onError:Wg,httpRequest:Hg}=eg;try{hg=await og(hg??mg,dg)}catch{eg.onRemove(dg);return}const{uid:Sg}=dg,wg={headers:bg||{},withCredentials:Bg,file:dg,data:hg,method:Zg,filename:Gg,action:pg,onProgress:vg=>{fg(vg,dg)},onSuccess:vg=>{Vg(vg,dg),delete tg.value[Sg]},onError:vg=>{Wg(vg,dg),delete tg.value[Sg]}},Xg=Hg(wg);tg.value[Sg]=Xg,Xg instanceof Promise&&Xg.then(wg.onSuccess,wg.onError)},rg=dg=>{const hg=dg.target.files;hg&&ng(Array.from(hg))},cg=()=>{Cg.value||(ig.value.value="",ig.value.click())},ag=()=>{cg()};return gg({abort:dg=>{entriesOf(tg.value).filter(dg?([hg])=>String(dg.uid)===hg:()=>!0).forEach(([hg,bg])=>{bg instanceof XMLHttpRequest&&bg.abort(),delete tg.value[hg]})},upload:lg}),(dg,hg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(Ig).b(),vue.unref(Ig).m(Ag.listType),vue.unref(Ig).is("drag",Ag.drag),vue.unref(Ig).is("disabled",vue.unref(Cg))]),tabindex:vue.unref(Cg)?void 0:0,"aria-disabled":vue.unref(Cg),role:"button",onClick:cg,onKeydown:vue.withKeys(vue.withModifiers(ag,["self"]),["enter","space"])},[Ag.drag?(vue.openBlock(),vue.createBlock(upload_dragger_default,{key:0,disabled:vue.unref(Cg),directory:Ag.directory,onFile:ng},{default:vue.withCtx(()=>[vue.renderSlot(dg.$slots,"default")]),_:3},8,["disabled","directory"])):vue.renderSlot(dg.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:ig,class:vue.normalizeClass(vue.unref(Ig).e("input")),name:Ag.name,disabled:vue.unref(Cg),multiple:Ag.multiple,accept:Ag.accept,webkitdirectory:Ag.directory||void 0,type:"file",onChange:rg,onClick:hg[0]||(hg[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$o)],42,_hoisted_1$A))}}),upload_content_default=upload_content_vue_vue_type_script_setup_true_lang_default;const SCOPE="ElUpload",revokeFileObjectURL=Ag=>{var gg;(gg=Ag.url)!=null&&gg.startsWith("blob:")&&URL.revokeObjectURL(Ag.url)},useHandlers=(Ag,gg)=>{const eg=useVModel(Ag,"fileList",void 0,{passive:!0}),Ig=ug=>eg.value.find(dg=>dg.uid===ug.uid);function Cg(ug){var dg;(dg=gg.value)==null||dg.abort(ug)}function tg(ug=["ready","uploading","success","fail"]){eg.value=eg.value.filter(dg=>!ug.includes(dg.status))}function ig(ug){eg.value=eg.value.filter(dg=>dg.uid!==ug.uid)}const ng=ug=>{vue.nextTick(()=>Ag.onChange(ug,eg.value))},lg=(ug,dg)=>{const hg=Ig(dg);hg&&(console.error(ug),hg.status="fail",ig(hg),Ag.onError(ug,hg,eg.value),ng(hg))},og=(ug,dg)=>{const hg=Ig(dg);hg&&(Ag.onProgress(ug,hg,eg.value),hg.status="uploading",hg.percentage=Math.round(ug.percent))},sg=(ug,dg)=>{const hg=Ig(dg);hg&&(hg.status="success",hg.response=ug,Ag.onSuccess(ug,hg,eg.value),ng(hg))},rg=ug=>{isNil(ug.uid)&&(ug.uid=genFileId());const dg={name:ug.name,percentage:0,status:"ready",size:ug.size,raw:ug,uid:ug.uid};if(Ag.listType==="picture-card"||Ag.listType==="picture")try{dg.url=URL.createObjectURL(ug)}catch(hg){debugWarn(SCOPE,hg.message),Ag.onError(hg,dg,eg.value)}eg.value=[...eg.value,dg],ng(dg)},cg=async ug=>{const dg=ug instanceof File?Ig(ug):ug;dg||throwError(SCOPE,"file to be removed not found");const hg=bg=>{Cg(bg),ig(bg),Ag.onRemove(bg,eg.value),revokeFileObjectURL(bg)};Ag.beforeRemove?await Ag.beforeRemove(dg,eg.value)!==!1&&hg(dg):hg(dg)};function ag(){eg.value.filter(({status:ug})=>ug==="ready").forEach(({raw:ug})=>{var dg;return ug&&((dg=gg.value)==null?void 0:dg.upload(ug))})}return vue.watch(()=>Ag.listType,ug=>{ug!=="picture-card"&&ug!=="picture"||(eg.value=eg.value.map(dg=>{const{raw:hg,url:bg}=dg;if(!bg&&hg)try{dg.url=URL.createObjectURL(hg)}catch(mg){Ag.onError(mg,dg,eg.value)}return dg}))}),vue.watch(eg,ug=>{for(const dg of ug)dg.uid||(dg.uid=genFileId()),dg.status||(dg.status="success")},{immediate:!0,deep:!0}),{uploadFiles:eg,abort:Cg,clearFiles:tg,handleError:lg,handleProgress:og,handleStart:rg,handleSuccess:sg,handleRemove:cg,submit:ag,revokeFileObjectURL}};var upload_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElUpload",__name:"upload",props:uploadProps,setup(Ag,{expose:gg}){const eg=Ag,Ig=useFormDisabled(),Cg=vue.shallowRef(),{abort:tg,submit:ig,clearFiles:ng,uploadFiles:lg,handleStart:og,handleError:sg,handleRemove:rg,handleSuccess:cg,handleProgress:ag,revokeFileObjectURL:ug}=useHandlers(eg,Cg),dg=vue.computed(()=>eg.listType==="picture-card"),hg=vue.computed(()=>({...eg,fileList:lg.value,onStart:og,onProgress:ag,onSuccess:cg,onError:sg,onRemove:rg}));return vue.onBeforeUnmount(()=>{lg.value.forEach(ug)}),vue.provide(uploadContextKey,{accept:vue.toRef(eg,"accept")}),gg({abort:tg,submit:ig,clearFiles:ng,handleStart:og,handleRemove:rg}),(bg,mg)=>(vue.openBlock(),vue.createElementBlock("div",null,[dg.value&&Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_list_default,{key:0,disabled:vue.unref(Ig),"list-type":Ag.listType,files:vue.unref(lg),crossorigin:Ag.crossorigin,"handle-preview":Ag.onPreview,onRemove:vue.unref(rg)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(upload_content_default,vue.mergeProps({ref_key:"uploadRef",ref:Cg},hg.value),{default:vue.withCtx(()=>[bg.$slots.trigger?vue.renderSlot(bg.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!bg.$slots.trigger&&bg.$slots.default?vue.renderSlot(bg.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[bg.$slots.file?{name:"default",fn:vue.withCtx(({file:Zg,index:Bg})=>[vue.renderSlot(bg.$slots,"file",{file:Zg,index:Bg})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!dg.value||dg.value&&!Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_content_default,vue.mergeProps({key:1,ref_key:"uploadRef",ref:Cg},hg.value),{default:vue.withCtx(()=>[bg.$slots.trigger?vue.renderSlot(bg.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!bg.$slots.trigger&&bg.$slots.default?vue.renderSlot(bg.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),bg.$slots.trigger?vue.renderSlot(bg.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(bg.$slots,"tip"),!dg.value&&Ag.showFileList?(vue.openBlock(),vue.createBlock(upload_list_default,{key:3,disabled:vue.unref(Ig),"list-type":Ag.listType,files:vue.unref(lg),crossorigin:Ag.crossorigin,"handle-preview":Ag.onPreview,onRemove:vue.unref(rg)},vue.createSlots({_:2},[bg.$slots.file?{name:"default",fn:vue.withCtx(({file:Zg,index:Bg})=>[vue.renderSlot(bg.$slots,"file",{file:Zg,index:Bg})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}}),upload_default=upload_vue_vue_type_script_setup_true_lang_default;const ElUpload=withInstall(upload_default),messageTypes=["primary","success","info","warning","error"],messagePlacement=["top","top-left","top-right","bottom","bottom-left","bottom-right"],MESSAGE_DEFAULT_PLACEMENT="top",messageDefaults=mutable({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),default:messageDefaults.onClose},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},plain:{type:Boolean,default:messageDefaults.plain},offset:{type:Number,default:messageDefaults.offset},placement:{type:String,values:messagePlacement,default:messageDefaults.placement},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},placementInstances=vue.shallowReactive({}),getOrCreatePlacementInstances=Ag=>(placementInstances[Ag]||(placementInstances[Ag]=vue.shallowReactive([])),placementInstances[Ag]),getInstance=(Ag,gg)=>{const eg=placementInstances[gg]||[],Ig=eg.findIndex(ig=>ig.id===Ag),Cg=eg[Ig];let tg;return Ig>0&&(tg=eg[Ig-1]),{current:Cg,prev:tg}},getLastOffset=(Ag,gg)=>{const{prev:eg}=getInstance(Ag,gg);return eg?eg.vm.exposed.bottom.value:0},getOffsetOrSpace=(Ag,gg,eg)=>(placementInstances[eg]||[]).findIndex(Ig=>Ig.id===Ag)>0?16:gg,_hoisted_1$z=["id"],_hoisted_2$n=["innerHTML"];var message_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElMessage",__name:"message",props:messageProps,emits:messageEmits,setup(Ag,{expose:gg,emit:eg}){const{Close:Ig}=TypeComponents,Cg=Ag,tg=eg,ig=vue.ref(!1),{ns:ng,zIndex:lg}=useGlobalComponentSettings("message"),{currentZIndex:og,nextZIndex:sg}=lg,rg=vue.ref(),cg=vue.ref(!1),ag=vue.ref(0);let ug;const dg=vue.computed(()=>Cg.type?Cg.type==="error"?"danger":Cg.type:"info"),hg=vue.computed(()=>{const Xg=Cg.type;return{[ng.bm("icon",Xg)]:Xg&&TypeComponentsMap[Xg]}}),bg=vue.computed(()=>Cg.icon||TypeComponentsMap[Cg.type]||""),mg=vue.computed(()=>Cg.placement||MESSAGE_DEFAULT_PLACEMENT),Zg=vue.computed(()=>getLastOffset(Cg.id,mg.value)),Bg=vue.computed(()=>getOffsetOrSpace(Cg.id,Cg.offset,mg.value)+Zg.value),Gg=vue.computed(()=>ag.value+Bg.value),pg=vue.computed(()=>mg.value.includes("left")?ng.is("left"):mg.value.includes("right")?ng.is("right"):ng.is("center")),fg=vue.computed(()=>mg.value.startsWith("top")?"top":"bottom"),Vg=vue.computed(()=>({[fg.value]:`${Bg.value}px`,zIndex:og.value}));function Wg(){Cg.duration!==0&&({stop:ug}=useTimeoutFn(()=>{Sg()},Cg.duration))}function Hg(){ug==null||ug()}function Sg(){cg.value=!1,vue.nextTick(()=>{var Xg;ig.value||((Xg=Cg.onClose)==null||Xg.call(Cg),tg("destroy"))})}function wg(Xg){getEventCode(Xg)===EVENT_CODE.esc&&Sg()}return vue.onMounted(()=>{Wg(),sg(),cg.value=!0}),vue.watch(()=>Cg.repeatNum,()=>{Hg(),Wg()}),useEventListener(document,"keydown",wg),useResizeObserver(rg,()=>{ag.value=rg.value.getBoundingClientRect().height}),gg({visible:cg,bottom:Gg,close:Sg}),(Xg,vg)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(ng).b("fade"),onBeforeEnter:vg[0]||(vg[0]=yg=>ig.value=!0),onBeforeLeave:Ag.onClose,onAfterLeave:vg[1]||(vg[1]=yg=>Xg.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Ag.id,ref_key:"messageRef",ref:rg,class:vue.normalizeClass([vue.unref(ng).b(),{[vue.unref(ng).m(Ag.type)]:Ag.type},vue.unref(ng).is("closable",Ag.showClose),vue.unref(ng).is("plain",Ag.plain),vue.unref(ng).is("bottom",fg.value==="bottom"),pg.value,Ag.customClass]),style:vue.normalizeStyle(Vg.value),role:"alert",onMouseenter:Hg,onMouseleave:Wg},[Ag.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Ag.repeatNum,type:dg.value,class:vue.normalizeClass(vue.unref(ng).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),bg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(ng).e("icon"),hg.value])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(bg.value)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Xg.$slots,"default",{},()=>[Ag.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(ng).e("content")),innerHTML:Ag.message},null,10,_hoisted_2$n)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(ng).e("content"))},vue.toDisplayString(Ag.message),3))]),Ag.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(ng).e("closeBtn")),onClick:vue.withModifiers(Sg,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(Ig))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$z),[[vue.vShow,cg.value]])]),_:3},8,["name","onBeforeLeave"]))}}),message_default=message_vue_vue_type_script_setup_true_lang_default;let seed=1;const normalizeAppendTo=Ag=>{if(!Ag.appendTo)Ag.appendTo=document.body;else if(isString(Ag.appendTo)){let gg=document.querySelector(Ag.appendTo);isElement(gg)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),gg=document.body),Ag.appendTo=gg}},normalizePlacement=Ag=>{!Ag.placement&&isString(messageConfig.placement)&&messageConfig.placement&&(Ag.placement=messageConfig.placement),Ag.placement||(Ag.placement=MESSAGE_DEFAULT_PLACEMENT),messagePlacement.includes(Ag.placement)||(debugWarn("ElMessage",`Invalid placement: ${Ag.placement}. Falling back to '${MESSAGE_DEFAULT_PLACEMENT}'.`),Ag.placement=MESSAGE_DEFAULT_PLACEMENT)},normalizeOptions=Ag=>{const gg=!Ag||isString(Ag)||vue.isVNode(Ag)||isFunction$1(Ag)?{message:Ag}:Ag,eg={...messageDefaults,...gg};return normalizeAppendTo(eg),normalizePlacement(eg),isBoolean(messageConfig.grouping)&&!eg.grouping&&(eg.grouping=messageConfig.grouping),isNumber(messageConfig.duration)&&eg.duration===3e3&&(eg.duration=messageConfig.duration),isNumber(messageConfig.offset)&&eg.offset===16&&(eg.offset=messageConfig.offset),isBoolean(messageConfig.showClose)&&!eg.showClose&&(eg.showClose=messageConfig.showClose),isBoolean(messageConfig.plain)&&!eg.plain&&(eg.plain=messageConfig.plain),eg},closeMessage=Ag=>{const gg=placementInstances[Ag.props.placement||MESSAGE_DEFAULT_PLACEMENT],eg=gg.indexOf(Ag);if(eg===-1)return;gg.splice(eg,1);const{handler:Ig}=Ag;Ig.close()},createMessage=({appendTo:Ag,...gg},eg)=>{const Ig=`message_${seed++}`,Cg=gg.onClose,tg=document.createElement("div"),ig={...gg,id:Ig,onClose:()=>{Cg==null||Cg(),closeMessage(og)},onDestroy:()=>{vue.render(null,tg)}},ng=vue.createVNode(message_default,ig,isFunction$1(ig.message)||vue.isVNode(ig.message)?{default:isFunction$1(ig.message)?ig.message:()=>ig.message}:null);ng.appContext=eg||message._context,vue.render(ng,tg),Ag.appendChild(tg.firstElementChild);const lg=ng.component,og={id:Ig,vnode:ng,vm:lg,handler:{close:()=>{lg.exposed.close()}},props:ng.component.props};return og},message=(Ag={},gg)=>{if(!isClient)return{close:()=>{}};const eg=normalizeOptions(Ag),Ig=getOrCreatePlacementInstances(eg.placement||MESSAGE_DEFAULT_PLACEMENT);if(eg.grouping&&Ig.length){const tg=Ig.find(({vnode:ig})=>{var ng;return((ng=ig.props)==null?void 0:ng.message)===eg.message});if(tg)return tg.props.repeatNum+=1,tg.props.type=eg.type,tg.handler}if(isNumber(messageConfig.max)&&Ig.length>=messageConfig.max)return{close:()=>{}};const Cg=createMessage(eg,gg);return Ig.push(Cg),Cg.handler};messageTypes.forEach(Ag=>{message[Ag]=(gg={},eg)=>message({...normalizeOptions(gg),type:Ag},eg)});function closeAll(Ag){for(const gg in placementInstances)if(hasOwn$b(placementInstances,gg)){const eg=[...placementInstances[gg]];for(const Ig of eg)(!Ag||Ag===Ig.props.type)&&Ig.handler.close()}}function closeAllByPlacement(Ag){placementInstances[Ag]&&[...placementInstances[Ag]].forEach(gg=>gg.handler.close())}message.closeAll=closeAll,message.closeAllByPlacement=closeAllByPlacement,message._context=null;const ElMessage=withInstallFunction(message,"$message");var index_vue_vue_type_script_lang_default=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap:focus_trap_default$1,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(Ag,{emit:gg}){const{locale:eg,zIndex:Ig,ns:Cg,size:tg}=useGlobalComponentSettings("message-box",vue.computed(()=>Ag.buttonSize)),{t:ig}=eg,{nextZIndex:ng}=Ig,lg=vue.ref(!1),og=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:vue.markRaw(loading_default),cancelButtonLoadingIcon:vue.markRaw(loading_default),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:ng()}),sg=vue.computed(()=>{const yg=og.type;return{[Cg.bm("icon",yg)]:yg&&TypeComponentsMap[yg]}}),rg=useId(),cg=useId(),ag=vue.computed(()=>{const yg=og.type;return og.icon||yg&&TypeComponentsMap[yg]||""}),ug=vue.computed(()=>!!og.message),dg=vue.ref(),hg=vue.ref(),bg=vue.ref(),mg=vue.ref(),Zg=vue.ref(),Bg=vue.computed(()=>og.confirmButtonClass);vue.watch(()=>og.inputValue,async yg=>{await vue.nextTick(),Ag.boxType==="prompt"&&yg&&Sg()},{immediate:!0}),vue.watch(()=>lg.value,yg=>{var Ng;yg&&(Ag.boxType!=="prompt"&&(og.autofocus?bg.value=((Ng=Zg.value)==null?void 0:Ng.$el)??dg.value:bg.value=dg.value),og.zIndex=ng()),Ag.boxType==="prompt"&&(yg?vue.nextTick().then(()=>{mg.value&&mg.value.$el&&(og.autofocus?bg.value=wg()??dg.value:bg.value=dg.value)}):(og.editorErrorMessage="",og.validateError=!1))});const{isDragging:Gg}=useDraggable(dg,hg,vue.computed(()=>Ag.draggable),vue.computed(()=>Ag.overflow));vue.onMounted(async()=>{await vue.nextTick(),Ag.closeOnHashChange&&window.addEventListener("hashchange",pg)}),vue.onBeforeUnmount(()=>{Ag.closeOnHashChange&&window.removeEventListener("hashchange",pg)});function pg(){lg.value&&(lg.value=!1,vue.nextTick(()=>{og.action&&gg("action",og.action)}))}const fg=()=>{Ag.closeOnClickModal&&Hg(og.distinguishCancelAndClose?"close":"cancel")},Vg=useSameTarget(fg),Wg=yg=>{var Ng;if(og.inputType!=="textarea"&&!((Ng=mg.value)!=null&&Ng.isComposing))return yg.preventDefault(),Hg("confirm")},Hg=yg=>{var Ng;Ag.boxType==="prompt"&&yg==="confirm"&&!Sg()||(og.action=yg,og.beforeClose?(Ng=og.beforeClose)==null||Ng.call(og,yg,og,pg):pg())},Sg=()=>{if(Ag.boxType==="prompt"){const yg=og.inputPattern;if(yg&&!yg.test(og.inputValue||""))return og.editorErrorMessage=og.inputErrorMessage||ig("el.messagebox.error"),og.validateError=!0,!1;const Ng=og.inputValidator;if(isFunction$1(Ng)){const Yg=Ng(og.inputValue);if(Yg===!1)return og.editorErrorMessage=og.inputErrorMessage||ig("el.messagebox.error"),og.validateError=!0,!1;if(isString(Yg))return og.editorErrorMessage=Yg,og.validateError=!0,!1}}return og.editorErrorMessage="",og.validateError=!1,!0},wg=()=>{var Ng;const yg=(Ng=mg.value)==null?void 0:Ng.$refs;return(yg==null?void 0:yg.input)??(yg==null?void 0:yg.textarea)},Xg=()=>{Hg("close")},vg=()=>{Ag.closeOnPressEscape&&Xg()};return Ag.lockScroll&&useLockscreen(lg,{ns:Cg}),{...vue.toRefs(og),ns:Cg,overlayEvent:Vg,visible:lg,hasMessage:ug,typeClass:sg,contentId:rg,inputId:cg,btnSize:tg,iconComponent:ag,confirmButtonClasses:Bg,rootRef:dg,focusStartRef:bg,headerRef:hg,inputRef:mg,isDragging:Gg,confirmRef:Zg,doClose:pg,handleClose:Xg,onCloseRequested:vg,handleWrapperClick:fg,handleInputEnter:Wg,handleAction:Hg,t:ig}}});const _hoisted_1$y=["aria-label","aria-describedby"],_hoisted_2$m=["aria-label"],_hoisted_3$i=["id"];function _sfc_render(Ag,gg,eg,Ig,Cg,tg){const ig=vue.resolveComponent("el-icon"),ng=vue.resolveComponent("el-input"),lg=vue.resolveComponent("el-button"),og=vue.resolveComponent("el-focus-trap"),sg=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:gg[11]||(gg[11]=rg=>Ag.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(sg,{"z-index":Ag.zIndex,"overlay-class":[Ag.ns.is("message-box"),Ag.modalClass],mask:Ag.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":Ag.title,"aria-modal":"true","aria-describedby":Ag.showInput?void 0:Ag.contentId,class:vue.normalizeClass(`${Ag.ns.namespace.value}-overlay-message-box`),onClick:gg[8]||(gg[8]=(...rg)=>Ag.overlayEvent.onClick&&Ag.overlayEvent.onClick(...rg)),onMousedown:gg[9]||(gg[9]=(...rg)=>Ag.overlayEvent.onMousedown&&Ag.overlayEvent.onMousedown(...rg)),onMouseup:gg[10]||(gg[10]=(...rg)=>Ag.overlayEvent.onMouseup&&Ag.overlayEvent.onMouseup(...rg))},[vue.createVNode(og,{loop:"",trapped:Ag.visible,"focus-trap-el":Ag.rootRef,"focus-start-el":Ag.focusStartRef,onReleaseRequested:Ag.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([Ag.ns.b(),Ag.customClass,Ag.ns.is("draggable",Ag.draggable),Ag.ns.is("dragging",Ag.isDragging),{[Ag.ns.m("center")]:Ag.center}]),style:vue.normalizeStyle(Ag.customStyle),tabindex:"-1",onClick:gg[7]||(gg[7]=vue.withModifiers(()=>{},["stop"]))},[Ag.title!==null&&Ag.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass([Ag.ns.e("header"),{"show-close":Ag.showClose}])},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("title"))},[Ag.iconComponent&&Ag.center?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.e("status"),Ag.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(Ag.title),1)],2),Ag.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(Ag.ns.e("headerbtn")),"aria-label":Ag.t("el.messagebox.close"),onClick:gg[0]||(gg[0]=rg=>Ag.handleAction(Ag.distinguishCancelAndClose?"close":"cancel")),onKeydown:gg[1]||(gg[1]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction(Ag.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode(ig,{class:vue.normalizeClass(Ag.ns.e("close"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.closeIcon||"close")))]),_:1},8,["class"])],42,_hoisted_2$m)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:Ag.contentId,class:vue.normalizeClass(Ag.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("container"))},[Ag.iconComponent&&!Ag.center&&Ag.hasMessage?(vue.openBlock(),vue.createBlock(ig,{key:0,class:vue.normalizeClass([Ag.ns.e("status"),Ag.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),Ag.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(Ag.ns.e("message"))},[vue.renderSlot(Ag.$slots,"default",{},()=>[Ag.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.showInput?"label":"p"),{key:1,for:Ag.showInput?Ag.inputId:void 0,innerHTML:Ag.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ag.showInput?"label":"p"),{key:0,for:Ag.showInput?Ag.inputId:void 0,textContent:vue.toDisplayString(Ag.message)},null,8,["for","textContent"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("input"))},[vue.createVNode(ng,{id:Ag.inputId,ref:"inputRef",modelValue:Ag.inputValue,"onUpdate:modelValue":gg[2]||(gg[2]=rg=>Ag.inputValue=rg),type:Ag.inputType,placeholder:Ag.inputPlaceholder,"aria-invalid":Ag.validateError,class:vue.normalizeClass({invalid:Ag.validateError}),onKeydown:vue.withKeys(Ag.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("errormsg")),style:vue.normalizeStyle({visibility:Ag.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(Ag.editorErrorMessage),7)],2),[[vue.vShow,Ag.showInput]])],10,_hoisted_3$i),vue.createElementVNode("div",{class:vue.normalizeClass(Ag.ns.e("btns"))},[Ag.showCancelButton?(vue.openBlock(),vue.createBlock(lg,{key:0,type:Ag.cancelButtonType==="text"?"":Ag.cancelButtonType,text:Ag.cancelButtonType==="text",loading:Ag.cancelButtonLoading,"loading-icon":Ag.cancelButtonLoadingIcon,class:vue.normalizeClass([Ag.cancelButtonClass]),round:Ag.roundButton,size:Ag.btnSize,onClick:gg[3]||(gg[3]=rg=>Ag.handleAction("cancel")),onKeydown:gg[4]||(gg[4]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ag.cancelButtonText||Ag.t("el.messagebox.cancel")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(lg,{ref:"confirmRef",type:Ag.confirmButtonType==="text"?"":Ag.confirmButtonType,text:Ag.confirmButtonType==="text",loading:Ag.confirmButtonLoading,"loading-icon":Ag.confirmButtonLoadingIcon,class:vue.normalizeClass([Ag.confirmButtonClasses]),round:Ag.roundButton,disabled:Ag.confirmButtonDisabled,size:Ag.btnSize,onClick:gg[5]||(gg[5]=rg=>Ag.handleAction("confirm")),onKeydown:gg[6]||(gg[6]=vue.withKeys(vue.withModifiers(rg=>Ag.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ag.confirmButtonText||Ag.t("el.messagebox.confirm")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[vue.vShow,Ag.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$y)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,Ag.visible]])]),_:3})}var src_default=_plugin_vue_export_helper_default(index_vue_vue_type_script_lang_default,[["render",_sfc_render]]);const messageInstance=new Map,getAppendToElement=Ag=>{let gg=document.body;return Ag.appendTo&&(isString(Ag.appendTo)&&(gg=document.querySelector(Ag.appendTo)),isElement(Ag.appendTo)&&(gg=Ag.appendTo),isElement(gg)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),gg=document.body)),gg},initInstance=(Ag,gg,eg=null)=>{const Ig=vue.createVNode(src_default,Ag,isFunction$1(Ag.message)||vue.isVNode(Ag.message)?{default:isFunction$1(Ag.message)?Ag.message:()=>Ag.message}:null);return Ig.appContext=eg,vue.render(Ig,gg),getAppendToElement(Ag).appendChild(gg.firstElementChild),Ig.component},genContainer=()=>document.createElement("div"),showMessage=(Ag,gg)=>{const eg=genContainer();Ag.onVanish=()=>{vue.render(null,eg),messageInstance.delete(Cg)},Ag.onAction=tg=>{const ig=messageInstance.get(Cg);let ng;Ag.showInput?ng={value:Cg.inputValue,action:tg}:ng=tg,Ag.callback?Ag.callback(ng,Ig.proxy):tg==="cancel"||tg==="close"?Ag.distinguishCancelAndClose&&tg!=="cancel"?ig.reject("close"):ig.reject("cancel"):ig.resolve(ng)};const Ig=initInstance(Ag,eg,gg),Cg=Ig.proxy;for(const tg in Ag)hasOwn$b(Ag,tg)&&!hasOwn$b(Cg.$props,tg)&&(tg==="closeIcon"&&isObject$h(Ag[tg])?Cg[tg]=vue.markRaw(Ag[tg]):Cg[tg]=Ag[tg]);return Cg.visible=!0,Cg};function MessageBox(Ag,gg=null){if(!isClient)return Promise.reject();let eg;return isString(Ag)||vue.isVNode(Ag)?Ag={message:Ag}:eg=Ag.callback,new Promise((Ig,Cg)=>{const tg=showMessage(Ag,gg??MessageBox._context);messageInstance.set(tg,{options:Ag,callback:eg,resolve:Ig,reject:Cg})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(Ag=>{MessageBox[Ag]=messageBoxFactory(Ag)});function messageBoxFactory(Ag){return(gg,eg,Ig,Cg)=>{let tg="";return isObject$h(eg)?(Ig=eg,tg=""):isUndefined(eg)?tg="":tg=eg,MessageBox(Object.assign({title:tg,message:gg,type:"",...MESSAGE_BOX_DEFAULT_OPTS[Ag]},Ig,{boxType:Ag}),Cg)}}MessageBox.close=()=>{messageInstance.forEach((Ag,gg)=>{gg.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=Ag=>{_MessageBox._context=Ag._context,Ag.config.globalProperties.$msgbox=_MessageBox,Ag.config.globalProperties.$messageBox=_MessageBox,Ag.config.globalProperties.$alert=_MessageBox.alert,Ag.config.globalProperties.$confirm=_MessageBox.confirm,Ag.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,popoverProps=buildProps({trigger:useTooltipTriggerProps.trigger,triggerKeys:useTooltipTriggerProps.triggerKeys,placement:dropdownProps.placement,disabled:useTooltipTriggerProps.disabled,visible:useTooltipContentProps.visible,transition:useTooltipContentProps.transition,popperOptions:dropdownProps.popperOptions,tabindex:dropdownProps.tabindex,content:useTooltipContentProps.content,popperStyle:useTooltipContentProps.popperStyle,popperClass:useTooltipContentProps.popperClass,enterable:{...useTooltipContentProps.enterable,default:!0},effect:{...useTooltipContentProps.effect,default:"light"},teleported:useTooltipContentProps.teleported,appendTo:useTooltipContentProps.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),popoverEmits={"update:visible":Ag=>isBoolean(Ag),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},updateEventKeyRaw="onUpdate:visible";var popover_vue_vue_type_script_setup_true_lang_default=vue.defineComponent({name:"ElPopover",__name:"popover",props:popoverProps,emits:popoverEmits,setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,tg=vue.computed(()=>Ig[updateEventKeyRaw]),ig=useNamespace("popover"),ng=vue.ref(),lg=vue.computed(()=>{var bg;return(bg=vue.unref(ng))==null?void 0:bg.popperRef}),og=vue.computed(()=>[{width:addUnit(Ig.width)},Ig.popperStyle]),sg=vue.computed(()=>[ig.b(),Ig.popperClass,{[ig.m("plain")]:!!Ig.content}]),rg=vue.computed(()=>Ig.transition===`${ig.namespace.value}-fade-in-linear`),cg=()=>{var bg;(bg=ng.value)==null||bg.hide()},ag=()=>{Cg("before-enter")},ug=()=>{Cg("before-leave")},dg=()=>{Cg("after-enter")},hg=()=>{Cg("update:visible",!1),Cg("after-leave")};return gg({popperRef:lg,hide:cg}),(bg,mg)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),vue.mergeProps({ref_key:"tooltipRef",ref:ng},bg.$attrs,{trigger:Ag.trigger,"trigger-keys":Ag.triggerKeys,placement:Ag.placement,disabled:Ag.disabled,visible:Ag.visible,transition:Ag.transition,"popper-options":Ag.popperOptions,tabindex:Ag.tabindex,content:Ag.content,offset:Ag.offset,"show-after":Ag.showAfter,"hide-after":Ag.hideAfter,"auto-close":Ag.autoClose,"show-arrow":Ag.showArrow,"aria-label":Ag.title,effect:Ag.effect,enterable:Ag.enterable,"popper-class":sg.value,"popper-style":og.value,teleported:Ag.teleported,"append-to":Ag.appendTo,persistent:Ag.persistent,"gpu-acceleration":rg.value,"onUpdate:visible":tg.value,onBeforeShow:ag,onBeforeHide:ug,onShow:dg,onHide:hg}),{content:vue.withCtx(()=>[Ag.title?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(ig).e("title")),role:"title"},vue.toDisplayString(Ag.title),3)):vue.createCommentVNode("v-if",!0),vue.renderSlot(bg.$slots,"default",{hide:cg},()=>[vue.createTextVNode(vue.toDisplayString(Ag.content),1)])]),default:vue.withCtx(()=>[bg.$slots.reference?vue.renderSlot(bg.$slots,"reference",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}}),popover_default=popover_vue_vue_type_script_setup_true_lang_default;const attachEvents=(Ag,gg)=>{var Ig;const eg=(Ig=gg.arg||gg.value)==null?void 0:Ig.popperRef;eg&&(eg.triggerRef=Ag)};var directive_default={mounted(Ag,gg){attachEvents(Ag,gg)},updated(Ag,gg){attachEvents(Ag,gg)}};const VPopover="popover",ElPopoverDirective=withInstallDirective(directive_default,VPopover),ElPopover=withInstall(popover_default,{directive:ElPopoverDirective}),_hoisted_1$x={"aria-hidden":"true"},_hoisted_2$l=["xlink:href"],_sfc_main$A=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(Ag){const gg=Ag,eg=vue.computed(()=>`#mt-edit-${gg.name}`);return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$x,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":eg.value},gg.props),null,16,_hoisted_2$l)]))}}),_hoisted_1$w={class:"header-panel flex h-full w-full items-center justify-between"},_hoisted_2$k={class:"header-toolbar-actions flex items-center flex-1 min-w-0"},_hoisted_3$h={class:"flex justify-center"},_hoisted_4$b={class:"header-toolbar-center flex flex-1 min-w-0 items-center justify-center gap-8px px-12px"},_hoisted_5$9={class:"header-toolbar-end flex flex-shrink-0 items-center gap-2px pr-8px"},_sfc_main$z=vue.defineComponent({__name:"index",props:{selectedItemsId:{default:()=>[]},groupEnabled:{type:Boolean},unGroupEnabled:{type:Boolean},alignEnabled:{type:Boolean},deleteEnabled:{type:Boolean},lockState:{type:Boolean},undoEnabled:{type:Boolean},redoEnabled:{type:Boolean},realTimeData:{},useThumbnail:{type:Boolean,default:!1},canvasBackgroundList:{default:()=>[]},selectedCanvasBackgroundId:{default:""}},emits:["onGroupClick","onUngroupClick","onDeleteClick","onExportClick","onTreeClick","alignSelected","update:lockState","onHelpClick","onRedoClick","onUndoClick","onImportClick","onPreviewClick","onReturnClick","onSaveClick","onDrawLineClick","onThumbnailClick","onCanvasBgClick","onCanvasBackgroundSelect","onExportPdfClick","onFullscreenToggle"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=useDark({selector:"#mt-edit"}),{isFullscreen:tg,toggle:ig}=useFullscreen();useToggle(Cg);const ng=vue.ref(!1),lg=vue.ref(!0),og=()=>{Ig("onGroupClick")},sg=()=>{Ig("onUngroupClick")},rg=()=>{Ig("onDeleteClick")},cg=()=>{Ig("onExportClick")},ag=()=>{Ig("onTreeClick")},ug=pg=>{Ig("alignSelected",pg)},dg=()=>{Ig("update:lockState",!eg.lockState)},hg=()=>{Ig("onImportClick")},bg=()=>{ng.value=!ng.value,Ig("onDrawLineClick",ng.value)},mg=()=>{Ig("onCanvasBgClick")},Zg=pg=>{Ig("onCanvasBackgroundSelect",pg??"")},Bg=()=>{Ig("onExportPdfClick")},Gg=async()=>{await ig(),Ig("onFullscreenToggle",tg.value)};return(pg,fg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$w,[vue.createElementVNode("div",_hoisted_2$k,[vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.undoEnabled,onClick:fg[0]||(fg[0]=Vg=>Ig("onUndoClick"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"撤销 Ctrl+Z",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"undo"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.redoEnabled,onClick:fg[1]||(fg[1]=Vg=>Ig("onRedoClick"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"重做 Ctrl+Y",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"redo"})]),_:1})]),_:1},8,["disabled"])]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.deleteEnabled,onClick:rg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"删除 delete",class:vue.normalizeClass(""),size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"delete"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:ag},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"组件树",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"tree-list"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:hg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"import-json"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:cg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"export-json"})]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElPopover),{placement:"bottom",width:240,trigger:"hover",disabled:!eg.alignEnabled},{reference:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.alignEnabled},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align"})]),_:1})]),_:1},8,["disabled"])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$h,[vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[2]||(fg[2]=Vg=>ug("left"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"左对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-left"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[3]||(fg[3]=Vg=>ug("horizontally"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"水平居中",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-horizontally"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[4]||(fg[4]=Vg=>ug("right"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"右对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-right"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[5]||(fg[5]=Vg=>ug("top"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"上对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-top"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[6]||(fg[6]=Vg=>ug("vertically"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"垂直居中",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-vertical"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[7]||(fg[7]=Vg=>ug("bottom"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"下对齐",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"align-bottom"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[8]||(fg[8]=Vg=>ug("horizontal-distribution"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"水平分布",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"horizontal-distribution"})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:fg[9]||(fg[9]=Vg=>ug("vertical-distribution"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"垂直分布",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"vertical-distribution"})]),_:1})]),_:1})]),_:1})])]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButtonGroup),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.groupEnabled,onClick:og},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"组合",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"group"})]),_:1})]),_:1},8,["disabled"]),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",disabled:!eg.unGroupEnabled,onClick:sg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"取消组合",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"ungroup"})]),_:1})]),_:1},8,["disabled"])]),_:1}),lg.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElDivider),{key:0,direction:"vertical"})),lg.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:1,text:"",circle:"",size:"small",onClick:bg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"连线编辑模式",size:20,class:vue.normalizeClass(ng.value?"icon-selected":"")},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"pen-line"})]),_:1},8,["class"])]),_:1})),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:mg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"上传背景图",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"bgupload"})]),_:1})]),_:1}),eg.canvasBackgroundList.length>0?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:2,"model-value":eg.selectedCanvasBackgroundId,class:"header-canvas-bg-select",placeholder:"已上传背景图",size:"small",clearable:"","onUpdate:modelValue":Zg},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.canvasBackgroundList,Vg=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:Vg.id,label:Vg.name,value:Vg.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:Bg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:"导出 PDF",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"export-pdf"})]),_:1})]),_:1})]),vue.createElementVNode("div",_hoisted_4$b,[eg.realTimeData.show?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(eg.realTimeData.text),1)]),_:1})):vue.createCommentVNode("",!0),fg[10]||(fg[10]=vue.createElementVNode("span",{class:"header-toolbar-hint"},"按住空白处可拖拽平移画布",-1))]),vue.createElementVNode("div",_hoisted_5$9,[vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:dg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:eg.lockState?"解锁画布":"锁定画布",size:20,class:vue.normalizeClass({"header-lock-active":eg.lockState})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:eg.lockState?"lock":"unlock"},null,8,["name"])]),_:1},8,["title","class"])]),_:1}),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",onClick:Gg},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:vue.unref(tg)?"退出全屏":"全屏",size:20},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:vue.unref(tg)?"exit-full-screen":"full-screen"},null,8,["name"])]),_:1},8,["title"])]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_77388377_lang="",HeaderPanel=_export_sfc(_sfc_main$z,[["__scopeId","data-v-77388377"]]),globalStore=vue.reactive({intention:"none",create_item_info:null,selected_items_id:[],done_json:[],canvasCfg:{width:1920,height:1080,scale:1,color:"#ffffff",img:"",guide:!0,adsorp:!0,adsorp_diff:5,transform_origin:{x:0,y:0},drag_offset:{x:0,y:0}},gridCfg:{enabled:!0,align:!0,size:10},guideCfg:{x:{display:!1,top:0},y:{display:!1,left:0}},lock:!1,real_time_data:{show:!1,text:""},adsorp_diff:{x:0,y:0},setIntention:Ag=>{globalStore.intention=Ag},setCreateItemInfo:Ag=>{globalStore.create_item_info=Ag},setGlobalStoreDoneJson:Ag=>{globalStore.done_json=Ag},cancelAllSelect:()=>{const Ag=[...globalStore.done_json].map(gg=>(gg.active&&(gg.active=!1),gg));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},refreshSelectedItemsId:()=>{globalStore.selected_items_id=globalStore.done_json.filter(Ag=>Ag.active).map(Ag=>Ag.id)},deleteSelectedItems:()=>{const Ag=[...globalStore.done_json].filter(gg=>!globalStore.selected_items_id.includes(gg.id));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},softDeleteSelectedItems:()=>{const Ag=[...globalStore.done_json].map(gg=>(globalStore.selected_items_id.includes(gg.id)&&(gg.isDelete=!0),gg));globalStore.setGlobalStoreDoneJson(Ag),globalStore.selected_items_id=[]},restoreItems:Ag=>{const gg=[...globalStore.done_json].map(eg=>(Ag.includes(eg.id)&&(eg.isDelete=!1),eg));globalStore.setGlobalStoreDoneJson(gg)},setSingleSelect:Ag=>{globalStore.done_json.forEach(gg=>{gg.id===Ag?gg.active=!0:gg.active=!1}),globalStore.selected_items_id=[Ag]},setSelectItems:Ag=>{globalStore.done_json.forEach(gg=>{Ag.includes(gg.id)?gg.active=!0:gg.active=!1}),globalStore.selected_items_id=Ag},setRealTimeData:Ag=>{globalStore.real_time_data=Ag}}),useUpdateSysLineRect=(Ag,gg,eg)=>{Ag.forEach(Ig=>{const Cg=document.querySelector(`#${Ig.id} g .real`);if(!Cg)return;const tg=Cg.getBoundingClientRect(),ig=gg.getBoundingClientRect(),ng=((tg==null?void 0:tg.left)-(ig==null?void 0:ig.left))/eg,lg=((tg==null?void 0:tg.top)-(ig==null?void 0:ig.top))/eg,og=ng-Ig.binfo.left,sg=lg-Ig.binfo.top;Ig.binfo.left=ng,Ig.binfo.top=lg,Ig.binfo.width=(tg==null?void 0:tg.width)/eg,Ig.binfo.height=(tg==null?void 0:tg.height)/eg,Ig.props.point_position={...Ig.props.point_position,val:Ig.props.point_position.val.map(rg=>({x:rg.x-og,y:rg.y-sg}))}})},useUpdateSysLine=(Ag,gg,eg,Ig,Cg)=>{const tg=[...gg];Ag.forEach(ig=>{if(!ig.props.bind_anchors.val.start&&!ig.props.bind_anchors.val.end)return;const ng=document.querySelector(`#${ig.id} g .real`);if(!ng)return;const lg=ng.getBoundingClientRect(),og=eg.getBoundingClientRect(),sg=((lg==null?void 0:lg.left)-(og==null?void 0:og.left))/Ig,rg=((lg==null?void 0:lg.top)-(og==null?void 0:og.top))/Ig;if(ig.props.bind_anchors.val.start){const cg=tg.find(ag=>ag.id===ig.props.bind_anchors.val.start.id);if(cg){const ag=cg.id===(Cg==null?void 0:Cg.id)?Cg:cg.binfo,{topLeft:ug,topRight:dg,bottomLeft:hg,bottomRight:bg}=getRectCoordinate(ag),{topCenter:mg,bottomCenter:Zg,leftCenter:Bg,rightCenter:Gg}=getRectCenterCoordinate(ug,dg,hg,bg),pg=mg.x,fg=Bg.y,Vg=Math.PI/180*cg.binfo.angle;if(ig.props.bind_anchors.val.start.type==="tc"){const Sg=rotatePoint(mg.x,mg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="bc"){const Sg=rotatePoint(Zg.x,Zg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="lc"){const Sg=rotatePoint(Bg.x,Bg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.start.type==="rc"){const Sg=rotatePoint(Gg.x,Gg.y,pg,fg,Vg);ig.props.point_position.val[0]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}const Wg=sg-ig.binfo.left,Hg=rg-ig.binfo.top;ig.binfo={...ig.binfo,left:sg,top:rg,width:(lg==null?void 0:lg.width)/Ig,height:(lg==null?void 0:lg.height)/Ig},ig.props.point_position={...ig.props.point_position,val:ig.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}else ig.props.bind_anchors.val.start=null}if(ig.props.bind_anchors.val.end){const cg=tg.find(ag=>ag.id===ig.props.bind_anchors.val.end.id);if(cg){const ag=cg.id===(Cg==null?void 0:Cg.id)?Cg:cg.binfo,{topLeft:ug,topRight:dg,bottomLeft:hg,bottomRight:bg}=getRectCoordinate(ag),{topCenter:mg,bottomCenter:Zg,leftCenter:Bg,rightCenter:Gg}=getRectCenterCoordinate(ug,dg,hg,bg),pg=mg.x,fg=Bg.y,Vg=Math.PI/180*cg.binfo.angle;if(ig.props.bind_anchors.val.end.type==="tc"){const Sg=rotatePoint(mg.x,mg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="bc"){const Sg=rotatePoint(Zg.x,Zg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="lc"){const Sg=rotatePoint(Bg.x,Bg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}else if(ig.props.bind_anchors.val.end.type==="rc"){const Sg=rotatePoint(Gg.x,Gg.y,pg,fg,Vg);ig.props.point_position.val[ig.props.point_position.val.length-1]={x:Sg.x-ig.binfo.left,y:Sg.y-ig.binfo.top}}const Wg=sg-ig.binfo.left,Hg=rg-ig.binfo.top;ig.binfo={...ig.binfo,left:sg,top:rg,width:(lg==null?void 0:lg.width)/Ig,height:(lg==null?void 0:lg.height)/Ig},ig.props.point_position={...ig.props.point_position,val:ig.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}else ig.props.bind_anchors.val.end=null}}),vue.nextTick(()=>{useUpdateSysLineRect(Ag,eg,Ig)})};function loadImageFromDataUrl(Ag){return new Promise((gg,eg)=>{const Ig=new Image;Ig.onload=()=>gg(Ig),Ig.onerror=()=>eg(new Error("图片加载失败")),Ig.src=Ag})}async function processCanvasBackgroundUrl(Ag,gg,eg){if(gg&&eg)return{dataUrl:Ag,width:gg,height:eg,originalWidth:gg,originalHeight:eg,scaled:!1};const Ig=await loadImageFromDataUrl(Ag),Cg=Ig.naturalWidth,tg=Ig.naturalHeight;if(!Cg||!tg)throw new Error("无法读取背景尺寸");return{dataUrl:Ag,width:Cg,height:tg,originalWidth:Cg,originalHeight:tg,scaled:!1}}const createGroupInfo=(Ag,gg,eg,Ig)=>{let Cg=1/0,tg=1/0,ig=-1/0,ng=-1/0;const lg=gg.getBoundingClientRect();Ag.forEach(sg=>{const rg=document.getElementById(sg.id);if(!rg)return;const cg=rg.getBoundingClientRect();Cg=Math.min(Cg,(cg.left-lg.left)/eg),ig=Math.max(ig,(cg.right-lg.left)/eg),tg=Math.min(tg,(cg.top-lg.top)/eg),ng=Math.max(ng,(cg.bottom-lg.top)/eg)});const og={left:Cg,top:tg,width:ig-Cg,height:ng-tg,angle:0};return Ag.forEach(sg=>{sg.binfo.left=sg.binfo.left-Cg,sg.binfo.top=sg.binfo.top-tg,sg.binfo={width:100*(sg.binfo.width/og.width),height:100*(sg.binfo.height/og.height),left:100*(sg.binfo.left/og.width),top:100*(sg.binfo.top/og.height),angle:sg.binfo.angle||0},sg.active=!1}),{id:"group-"+randomString(),title:"组合",type:"group",binfo:og,resize:!0,rotate:!0,lock:!1,active:!0,hide:!1,use_proportional_scaling:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},children:[...Ag],events:[],tag:"group",sopId:Ig}},cancelGroup=(Ag,gg,eg,Ig)=>{const Cg=gg.getBoundingClientRect();return Ag.children.map(ig=>{const ng=document.getElementById(ig.id);if(!ng)return null;const lg=ng.getBoundingClientRect(),og={x:lg.left-Cg.left+lg.width/2,y:lg.top-Cg.top+lg.height/2},sg=alignToGrid(Ag.binfo.width*(ig.binfo.width/100),Ig),rg=alignToGrid(Ag.binfo.height*(ig.binfo.height/100),Ig),cg={width:sg,height:rg,left:og.x/eg-sg/2,top:og.y/eg-rg/2,angle:(ig.binfo.angle||0)+(Ag.binfo.angle||0)};return{...ig,active:!0,binfo:cg}}).filter(ig=>ig!==null)},svgToSymbol=(Ag,gg)=>{const eg=new DOMParser().parseFromString(Ag,"image/svg+xml").children[0];let Ig="0",Cg="0";const tg=eg.getAttribute("viewBox"),ig=document.createElementNS("http://www.w3.org/2000/svg","symbol");if(tg){const[,,ng,lg]=tg.split(" ");ig.setAttributeNS(null,"viewBox",tg),Ig=ng,Cg=lg}else Ig=eg.getAttribute("width")||"0",Cg=eg.getAttribute("height")||"0",ig.setAttributeNS(null,"viewBox","0 0 "+Ig+" "+Cg);return ig.setAttributeNS(null,"id",gg),ig.innerHTML=eg.innerHTML.replaceAll("stroke:currentColor","").replaceAll("stroke: currentColor","").replaceAll('stroke="currentColor"',""),{symbol_str:ig.outerHTML,width:Ig,height:Cg}},symbolGenSvg=(Ag,gg,eg,Ig,Cg)=>`<svg
|
|
52
52
|
xmlns="http://www.w3.org/2000/svg"
|
|
53
53
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
54
54
|
version="1.1"
|
|
@@ -63,14 +63,14 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:Ig,cur
|
|
|
63
63
|
y="0"
|
|
64
64
|
></use>
|
|
65
65
|
</svg>
|
|
66
|
-
`,svgToImgSrc=Ag=>"data:image/svg+xml;utf8,"+encodeURIComponent(Ag),genDomPropstr=Ag=>{let gg="";for(const eg in Ag)gg+=` ${eg}="${Ag[eg].val}"`;return gg},randomString=Ag=>{Ag=Ag||10;const gg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",eg=gg.length;let Ig="";for(let Cg=0;Cg<Ag;Cg++)Ig+=gg.charAt(Math.floor(Math.random()*eg));return Ig};function isTouchEvent(Ag){const gg=Object.prototype.toString.call(Ag);return gg.substring(8,gg.length-1)==="TouchEvent"}function getRealityXY(Ag,gg){let eg=0,Ig=0;if(isTouchEvent(Ag)){const Cg=Ag.targetTouches[0];eg=gg?Cg.pageX-gg.x:0,Ig=gg?Cg.pageY-gg.y:0}else eg=gg?Ag.clientX-gg.x:Ag.clientX,Ig=gg?Ag.clientY-gg.y:Ag.clientY;return{realityX:eg,realityY:Ig}}const blobToBase64=Ag=>new Promise(function(gg,eg){const Ig=new FileReader;let Cg="";Ig.readAsDataURL(Ag),Ig.onload=function(){Cg=Ig.result??""},Ig.onerror=function(tg){eg(tg)},Ig.onloadend=function(){gg(Cg)}}),alignToGrid=(Ag,gg=1)=>{const eg=Math.floor(Ag/gg);return Ag%gg>=gg/2?(eg+1)*gg:eg*gg},objectDeepClone=(Ag,gg={})=>Ag?JSON.parse(JSON.stringify(Ag)):gg,prosToVBind=Ag=>{let gg={};for(const eg in Ag)gg={...gg,[eg]:Ag[eg].val};return gg},calculateGuideY=(Ag,gg,eg,Ig,Cg)=>{for(let tg=0;tg<eg.length;tg++){const{left:ig,right:ng,width:lg}=eg[tg],og=Ag.find(mg=>Math.abs(mg.left-ig)<gg),sg=Ag.find(mg=>Math.abs(mg.left-(ig+lg/2))<gg),rg=Ag.find(mg=>Math.abs(mg.left-ng)<gg),cg=Ag.find(mg=>Math.abs(mg.left+mg.width/2-ig)<gg),ag=Ag.find(mg=>Math.abs(mg.left+mg.width/2-(ig+lg/2))<gg),ug=Ag.find(mg=>Math.abs(mg.left+mg.width/2-ng)<gg),dg=Ag.find(mg=>Math.abs(mg.right-ng)<gg),hg=Ag.find(mg=>Math.abs(mg.right-(ig+lg/2))<gg),bg=Ag.find(mg=>Math.abs(mg.right-ig)<gg);if(og)return{y_info:{display:!0,left:(og.left-Ig.left)/Cg},move_x:og.left-ig};if(sg)return{y_info:{display:!0,left:(sg.left-Ig.left)/Cg},move_x:sg.left-(ig+lg/2)};if(rg)return{y_info:{display:!0,left:(rg.left-Ig.left)/Cg},move_x:rg.left-ng};if(cg)return{y_info:{display:!0,left:(cg.left+cg.width/2-Ig.left)/Cg},move_x:cg.left+cg.width/2-ig};if(ag)return{y_info:{display:!0,left:(ag.left+ag.width/2-Ig.left)/Cg},move_x:ag.left+ag.width/2-(ig+lg/2)};if(ug)return{y_info:{display:!0,left:(ug.left+ug.width/2-Ig.left)/Cg},move_x:ug.left+ug.width/2-ng};if(bg)return{y_info:{display:!0,left:(bg.right-Ig.left)/Cg},move_x:bg.right-ig};if(hg)return{y_info:{display:!0,left:(hg.right-Ig.left)/Cg},move_x:hg.right-(ig+lg/2)};if(dg)return{y_info:{display:!0,left:(dg.right-Ig.left)/Cg},move_x:dg.right-ng}}return{y_info:{display:!1,left:0},move_x:0}},calculateGuideX=(Ag,gg,eg,Ig,Cg)=>{for(let tg=0;tg<eg.length;tg++){const{top:ig,bottom:ng,height:lg}=eg[tg],og=Ag.find(mg=>Math.abs(mg.top-ig)<gg),sg=Ag.find(mg=>Math.abs(mg.top-(ig+lg/2))<gg),rg=Ag.find(mg=>Math.abs(mg.top-ng)<gg),cg=Ag.find(mg=>Math.abs(mg.top+mg.height/2-ig)<gg),ag=Ag.find(mg=>Math.abs(mg.top+mg.height/2-(ig+lg/2))<gg),ug=Ag.find(mg=>Math.abs(mg.top+mg.height/2-ng)<gg),dg=Ag.find(mg=>Math.abs(mg.bottom-ng)<gg),hg=Ag.find(mg=>Math.abs(mg.bottom-(ig+lg/2))<gg),bg=Ag.find(mg=>Math.abs(mg.bottom-ig)<gg);if(og)return{x_info:{display:!0,top:(og.top-Ig.top)/Cg},move_y:og.top-ig};if(sg)return{x_info:{display:!0,top:(sg.top-Ig.top)/Cg},move_y:sg.top-(ig+lg/2)};if(rg)return{x_info:{display:!0,top:(rg.top-Ig.top)/Cg},move_y:rg.top-ng};if(cg)return{x_info:{display:!0,top:(cg.top+cg.height/2-Ig.top)/Cg},move_y:cg.top+cg.height/2-ig};if(ag)return{x_info:{display:!0,top:(ag.top+ag.height/2-Ig.top)/Cg},move_y:ag.top+ag.height/2-(ig+lg/2)};if(ug)return{x_info:{display:!0,top:(ug.top+ug.height/2-Ig.top)/Cg},move_y:ug.top+ug.height/2-ng};if(bg)return{x_info:{display:!0,top:(bg.bottom-Ig.top)/Cg},move_y:bg.bottom-ig};if(hg)return{x_info:{display:!0,top:(hg.bottom-Ig.top)/Cg},move_y:hg.bottom-(ig+lg/2)};if(dg)return{x_info:{display:!0,top:(dg.bottom-Ig.top)/Cg},move_y:dg.bottom-ng}}return{x_info:{display:!1,top:0},move_y:0}},positionArrarToPath=(Ag,gg=0,eg=0)=>{let Ig="";for(let Cg=0;Cg<Ag.length;Cg++)Cg===0?Ig+=`M ${Ag[Cg].x+gg} ${Ag[Cg].y+eg}`:Ig+=` L ${Ag[Cg].x+gg} ${Ag[Cg].y+eg}`;return Ig},getCenterXY=(Ag,gg,eg,Ig)=>({x:(Ag+eg)/2,y:(gg+Ig)/2}),rotatePoint=(Ag,gg,eg,Ig,Cg)=>{const tg=eg+(Ag-eg)*Math.cos(Cg)-(gg-Ig)*Math.sin(Cg),ig=Ig+(Ag-eg)*Math.sin(Cg)+(gg-Ig)*Math.cos(Cg);return{x:tg,y:ig}},getRectCoordinate=Ag=>{const gg={x:Ag.left,y:Ag.top},eg={x:Ag.left+Ag.width,y:Ag.top},Ig={x:Ag.left,y:Ag.top+Ag.height},Cg={x:Ag.left+Ag.width,y:Ag.top+Ag.height};return{topLeft:gg,topRight:eg,bottomLeft:Ig,bottomRight:Cg}},getRectCenterCoordinate=(Ag,gg,eg,Ig)=>{const Cg={x:(Ag.x+gg.x)/2,y:(Ag.y+gg.y)/2},tg={x:(eg.x+Ig.x)/2,y:(eg.y+Ig.y)/2},ig={x:(Ag.x+eg.x)/2,y:(Ag.y+eg.y)/2},ng={x:(gg.x+Ig.x)/2,y:(gg.y+Ig.y)/2};return{topCenter:Cg,bottomCenter:tg,leftCenter:ig,rightCenter:ng}},handleAlign=(Ag,gg,eg,Ig,Cg)=>{switch(Ag){case"left":{const ig=Math.min(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.left));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig});break}case"horizontally":{const ig=gg.filter(ng=>ng.type!=="sys-line")[0].binfo.left+gg[0].binfo.width/2;gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig-ng.binfo.width/2});break}case"right":{const ig=Math.max(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.left+ng.binfo.width));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig-ng.binfo.width});break}case"top":{const ig=Math.min(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.top));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig});break}case"vertically":{const ig=gg.filter(ng=>ng.type!=="sys-line")[0].binfo.top+gg[0].binfo.height/2;gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig-ng.binfo.height/2});break}case"bottom":{const ig=Math.max(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.top+ng.binfo.height));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig-ng.binfo.height});break}case"horizontal-distribution":{gg.sort((og,sg)=>og.binfo.left+og.binfo.width/2-sg.binfo.left+sg.binfo.width/2);const ig=gg[gg.length-1],ng=gg[0],lg=(ig.binfo.left+ig.binfo.width/2-(ng.binfo.left+ng.binfo.width/2))/(gg.length-1);gg.forEach((og,sg)=>{if(sg==0||sg==gg.length-1)return;const rg=ng.binfo.left+ng.binfo.width/2+lg*sg;og.binfo={...og.binfo,left:rg-og.binfo.width/2}});break}case"vertical-distribution":{gg.sort((og,sg)=>og.binfo.top+og.binfo.height/2-sg.binfo.top+sg.binfo.height/2);const ig=gg[gg.length-1],ng=gg[0],lg=(ig.binfo.top+ig.binfo.height/2-(ng.binfo.top+ng.binfo.height/2))/(gg.length-1);gg.forEach((og,sg)=>{if(sg==0||sg==gg.length-1)return;const rg=ng.binfo.top+ng.binfo.height/2+lg*sg;og.binfo={...og.binfo,top:rg-og.binfo.height/2}});break}}const tg=Cg.filter(ig=>ig.type==="sys-line");return useUpdateSysLine(tg,gg,eg,Ig),gg},setItemAttr=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(Ag=>Ag.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getItemAttr=(id,key,json_arr)=>{const find_item=json_arr.find(Ag=>Ag.id===id);return find_item?eval(`find_item.${key}`):null},previewCompareVal=(Ag,gg,eg)=>gg==="="?String(Ag)==String(eg):gg===">"?Number(Ag)>Number(eg):gg==="<"?Number(Ag)<Number(eg):gg==="!="?String(Ag)!=String(eg):!1,eventToVOn=Ag=>{const gg={};Ag.events.forEach(Ig=>{let Cg="";if(Ig.action==="changeAttr"){if(Ig.change_attr.length<1)return;Ig.change_attr.forEach(tg=>{!tg.target_id||!tg.target_attr||tg.target_value===void 0||(!Ig.trigger_rule||!Ig.trigger_rule.trigger_id||!Ig.trigger_rule.trigger_attr||Ig.trigger_rule.value===void 0||!Ig.trigger_rule.operator?typeof tg.target_value=="boolean"?Cg+=`$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', ${tg.target_value});`:Cg+=`$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', '${tg.target_value}');`:typeof tg.target_value=="boolean"?Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', ${tg.target_value})};`:Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', '${tg.target_value}')};`)})}else Ig.action==="customCode"&&(!Ig.trigger_rule||!Ig.trigger_rule.trigger_id||!Ig.trigger_rule.trigger_attr||Ig.trigger_rule.value===void 0||!Ig.trigger_rule.operator?Cg+=Ig.custom_code+";":Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){${Ig.custom_code}};`);Object.prototype.hasOwnProperty.call(gg,Ig.type)?gg[Ig.type]+=Cg:gg[Ig.type]=Cg});let eg={};for(const Ig in gg)eg={...eg,[Ig]:()=>dynamicEvent(gg[Ig])(Ag)};return eg},dynamicEvent=Ag=>{try{return new Function("$item_info",Ag)}catch(gg){return console.error(gg),new Function("$item_info",`console.error('${gg}')`)}},_hoisted_1$v={id:"mt-left-aside",class:"left-aside-root"},_hoisted_2$j={class:"left-aside-head"},_hoisted_3$g={class:"left-aside-list-wrap"},_hoisted_4$a={class:"left-aside-collapse-title"},_hoisted_5$8={class:"left-aside-collapse-label"},_hoisted_6$8={class:"left-aside-collapse-count"},_hoisted_7$6={class:"left-aside-card-grid"},_hoisted_8$5=["onDragstart","onTouchstartPassive"],_hoisted_9$5={class:"left-aside-card-thumb"},_hoisted_10$4=["src","alt"],_hoisted_11$4=["title"],_hoisted_12$2={class:"left-aside-card-sub"},_hoisted_13$1={class:"flex"},_hoisted_14$1={class:"flex justify-center"},_hoisted_15$1={key:0},_hoisted_16={class:"flex flex-wrap"},_hoisted_17=["onMouseenter"],_hoisted_18={class:"w-60px h-60px flex justify-center items-center"},_hoisted_19={key:0,class:"absolute w-160px h-160px left-0 top-0 opacity-80 bg-light-300 flex justify-center items-center"},_sfc_main$y=vue.defineComponent({__name:"index",props:{leftAsideConfig:{default:()=>new Map}},setup(Ag){const gg=Ag,eg=useDark({selector:"#mt-edit"}),Ig=vue.ref(),Cg=vue.ref(),tg=useLocalStorage("mt-disable-classify",[]),ig=useLocalStorage("mt-local-file",[]);gg.leftAsideConfig.set("我定义的设备",ig.value);const ng=vue.ref(),lg=vue.ref([]),og=vue.ref(""),sg=vue.ref(!1),rg=vue.ref([]),cg=vue.ref([]),ag=vue.ref(null),ug=vue.computed(()=>[...gg.leftAsideConfig.keys()].map(vg=>({label:vg}))),dg=vue.ref([]),hg=vue.ref(),bg=vue.computed(()=>[...gg.leftAsideConfig.keys()].filter(yg=>!tg.value.includes(yg)&&dg.value.includes(yg))),mg=()=>{const vg=[...gg.leftAsideConfig.keys()],yg=vg.filter(Yg=>!tg.value.includes(Yg));for(const Yg of yg)dg.value.includes(Yg)||dg.value.push(Yg);dg.value=dg.value.filter(Yg=>vg.includes(Yg));const Ng=new Set(lg.value);for(const Yg of yg)Ng.add(Yg);lg.value=[...Ng]};vue.watch(()=>[...gg.leftAsideConfig.keys()],mg,{immediate:!0}),vue.watch(tg,mg,{deep:!0});const Zg=vue.computed({get:()=>ug.value.length==dg.value.length,set:vg=>{var yg;vg?dg.value=ug.value.map(Ng=>Ng.label):(dg.value=[],(yg=ng.value)==null||yg.setCheckedNodes([]))}}),Bg=vue.computed(()=>dg.value.length>0&&dg.value.length<ug.value.length),Gg=vg=>{var yg;return vg?(yg=og.value)!=null&&yg.trim()?vg.filter(Ng=>Ng.title.includes(og.value.trim())):vg:[]},pg=(vg,yg)=>vg==="我定义的设备"?"补充":vg.includes("复合")||vg.includes("电气")?"已有":yg.type==="img"?"图元":"已有",fg=(vg,yg)=>{if(!vg||!yg){console.error("拖拽初始化失败",vg,yg);return}globalStore.setIntention("create"),globalStore.setCreateItemInfo({config_key:vg,item_id:yg})},Vg=()=>{sg.value=!0},Wg=(vg,yg)=>{yg&&!dg.value.includes(vg.label)?dg.value.push(vg.label):yg||(dg.value=dg.value.filter(Ng=>Ng!==vg.label)),tg.value=ug.value.filter(Ng=>!dg.value.includes(Ng.label)).map(Ng=>Ng.label)},Hg=({label:vg})=>{hg.value=vg},Sg=()=>{var vg,yg;(vg=Ig.value)==null||vg.clearFiles(),(yg=Cg.value)==null||yg.clearFiles(),rg.value=[],cg.value=[]},wg=vg=>{if(vg.raw.type.includes("image/")){if(vg.raw.size/1024/1024>20)return ElMessage.error("不能上传超过20MB的图像!"),Sg(),!1}else return ElMessage.error("只能上传图片!"),Sg(),!1;blobToBase64(vg.raw).then(yg=>{var Jg;const Ng=vg.name.split(".")[0],Yg={id:Ng,title:Ng,type:"img",thumbnail:yg,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},Kg=ig.value.findIndex(Ug=>Ug.id==Ng);Kg!=-1&&(ElMessage.info("存在同名文件,已覆盖!"),ig.value.splice(Kg,1)),ig.value.push(Yg),gg.leftAsideConfig.set("我定义的设备",ig.value),Sg(),hg.value="我定义的设备",(Jg=ng.value)==null||Jg.setCurrentKey("我定义的设备"),dg.value.includes("我定义的设备")||dg.value.push("我定义的设备"),lg.value.includes("我定义的设备")||lg.value.push("我定义的设备"),ElMessage.success("上传成功")})},Xg=({id:vg})=>{const yg=ig.value.findIndex(Ng=>Ng.id==vg);yg!=-1&&ig.value.splice(yg,1),gg.leftAsideConfig.set("我定义的设备",ig.value)};return(vg,yg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$v,[vue.createElementVNode("div",_hoisted_2$j,[yg[8]||(yg[8]=vue.createElementVNode("h2",{class:"left-aside-heading"},"图元库",-1)),vue.createVNode(vue.unref(ElButton),{class:"left-aside-manage-link",link:"",type:"primary",onClick:Vg},{default:vue.withCtx(()=>[...yg[7]||(yg[7]=[vue.createTextVNode(" 管理 ",-1)])]),_:1})]),vue.createVNode(vue.unref(ElInput),{modelValue:og.value,"onUpdate:modelValue":yg[0]||(yg[0]=Ng=>og.value=Ng),class:"left-aside-search",placeholder:"请输入关键字进行搜索",clearable:""},{prefix:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{class:"left-aside-search-icon",size:16},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"search"})]),_:1})]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElUpload),{ref_key:"sidebarUploadRef",ref:Cg,class:"left-aside-upload","file-list":cg.value,"onUpdate:fileList":yg[1]||(yg[1]=Ng=>cg.value=Ng),"auto-upload":!1,limit:1,"show-file-list":!1,"on-change":wg,accept:"image/*"},{default:vue.withCtx(()=>[...yg[9]||(yg[9]=[vue.createElementVNode("div",{class:"left-aside-upload-trigger"},"+ 上传本地图元",-1)])]),_:1},8,["file-list"]),vue.createElementVNode("div",_hoisted_3$g,[vue.createVNode(vue.unref(ElScrollbar),{class:"left-aside-scrollbar"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:lg.value,"onUpdate:modelValue":yg[2]||(yg[2]=Ng=>lg.value=Ng)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(bg.value,Ng=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{key:Ng,name:Ng},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$a,[yg[10]||(yg[10]=vue.createElementVNode("span",{class:"left-aside-triangle","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",_hoisted_5$8,vue.toDisplayString(Ng),1),vue.createElementVNode("span",_hoisted_6$8,vue.toDisplayString(Gg(gg.leftAsideConfig.get(Ng)).length)+" 项 ",1)])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Gg(gg.leftAsideConfig.get(Ng)),Yg=>(vue.openBlock(),vue.createElementBlock("div",{key:Yg.id,class:"left-aside-card",draggable:"true",onDragstart:Kg=>fg(Ng,Yg.id),onTouchstartPassive:Kg=>fg(Ng,Yg.id)},[vue.createElementVNode("div",_hoisted_9$5,[vue.createElementVNode("img",{draggable:"false",class:"left-aside-card-image select-none",src:Yg.thumbnail,alt:Yg.title,loading:"lazy"},null,8,_hoisted_10$4)]),vue.createElementVNode("div",{class:"left-aside-card-title",title:Yg.title},vue.toDisplayString(Yg.title),9,_hoisted_11$4),vue.createElementVNode("div",_hoisted_12$2,vue.toDisplayString(pg(Ng,Yg)),1)],40,_hoisted_8$5))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1})]),vue.createVNode(vue.unref(ElDialog),{modelValue:sg.value,"onUpdate:modelValue":yg[6]||(yg[6]=Ng=>sg.value=Ng),title:"图库管理",width:"80%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_13$1,[vue.createElementVNode("div",null,[vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_14$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:Zg.value,"onUpdate:modelValue":yg[3]||(yg[3]=Ng=>Zg.value=Ng),indeterminate:Bg.value},{default:vue.withCtx(()=>[...yg[11]||(yg[11]=[vue.createTextVNode("全选",-1)])]),_:1},8,["modelValue","indeterminate"])]),vue.createVNode(vue.unref(ElScrollbar),{height:"50vh"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTree),{ref_key:"treeRef",ref:ng,data:ug.value,"highlight-current":!0,"show-checkbox":"",onCheckChange:Wg,"node-key":"label","default-checked-keys":dg.value,onNodeClick:Hg},null,8,["data","default-checked-keys"])]),_:1}),vue.createVNode(vue.unref(ElUpload),{ref_key:"uploadRef",ref:Ig,class:"w-24px h-24px","file-list":rg.value,"onUpdate:fileList":yg[4]||(yg[4]=Ng=>rg.value=Ng),"auto-upload":!1,limit:1,"show-file-list":!1,"on-change":wg,accept:"image/*"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary"},{default:vue.withCtx(()=>[...yg[12]||(yg[12]=[vue.createTextVNode("本地上传",-1)])]),_:1})]),_:1},8,["file-list"])])]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical",class:"h-50vh ml-40px"}),hg.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$1,[vue.createVNode(vue.unref(ElScrollbar),{height:"50vh"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(gg.leftAsideConfig.get(hg.value),Ng=>(vue.openBlock(),vue.createElementBlock("div",{key:Ng.id,class:"w-160px h-160px flex flex-wrap justify-center items-center cursor-pointer relative",onMouseenter:Yg=>ag.value=Ng.id,onMouseleave:yg[5]||(yg[5]=Yg=>ag.value=null)},[vue.createVNode(vue.unref(ElTooltip),{effect:vue.unref(eg)?"dark":"light",content:Ng.title,placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(ElImage),{class:vue.normalizeClass(["w-60px h-60px",vue.unref(eg)?"bg-amber-50":""]),src:Ng.thumbnail},null,8,["class","src"]),vue.createElementVNode("div",_hoisted_18,[vue.createVNode(vue.unref(ElText),{truncated:""},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ng.title),1)]),_:2},1024)]),hg.value=="我定义的设备"&&ag.value==Ng.id?(vue.openBlock(),vue.createElementBlock("div",_hoisted_19,[vue.createVNode(vue.unref(ElButton),{type:"danger",onClick:Yg=>Xg(Ng)},{default:vue.withCtx(()=>[...yg[13]||(yg[13]=[vue.createTextVNode("删除",-1)])]),_:1},8,["onClick"])])):vue.createCommentVNode("",!0)])]),_:2},1032,["effect","content"])],40,_hoisted_17))),128))])]),_:1})])):vue.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_ef0506a4_lang="",index_vue_vue_type_style_index_1_lang="",LeftAside=_export_sfc(_sfc_main$y,[["__scopeId","data-v-ef0506a4"]]),sysComponentItems=[{id:"sys-line",title:"自由连线",type:"sys-line",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTQgMThhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTE2IDZhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTcuNSAxNi41bDktOSIvPjwvc3ZnPg==",props:{stroke:{title:"线条颜色",type:"color",val:"#ff0000"},"stroke-width":{title:"线条宽度",type:"number",val:2},"marker-start":{title:"起点箭头",type:"switch",val:!1},"marker-end":{title:"终点箭头",type:"switch",val:!0},point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:100,y:0}],disabled:!0},ani_type:{title:"动画类型",type:"select",val:"none",options:[{label:"无",value:"none"}],disabled:!0},bind_anchors:{title:"锚点绑定",type:"jsonEdit",val:{start:null,end:null},disabled:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"sys-line-vertical",title:"自由连线-竖线",type:"sys-line",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTQgMThhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTE2IDZhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTcuNSAxNi41bDktOSIvPjwvc3ZnPg==",props:{stroke:{title:"线条颜色",type:"color",val:"#ff0000"},"stroke-width":{title:"线条宽度",type:"number",val:2},"marker-start":{title:"起点箭头",type:"switch",val:!1},"marker-end":{title:"终点箭头",type:"switch",val:!0},point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:0,y:100}],disabled:!0},ani_type:{title:"动画类型",type:"select",val:"none",options:[{label:"无",value:"none"}],disabled:!0},bind_anchors:{title:"锚点绑定",type:"jsonEdit",val:{start:null,end:null},disabled:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"text-vue",title:"文字",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIzMiIgZD0ibTMyIDQxNS41bDEyMC0zMjBsMTIwIDMyMG0tNDItMTEySDc0bTI1Mi02NGMxMi4xOS0yOC42OSA0MS00OCA3NC00OGgwYzQ2IDAgODAgMzIgODAgODB2MTQ0Ii8+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIzMiIgZD0iTTMyMCAzNTguNWMwIDM2IDI2Ljg2IDU4IDYwIDU4YzU0IDAgMTAwLTI3IDEwMC0xMDZ2LTE1Yy0yMCAwLTU4IDEtOTIgNWMtMzIuNzcgMy44Ni02OCAxOS02OCA1OCIvPjwvc3ZnPg==",props:{text:{title:"文字内容",type:"input",val:"文字"},fontFamily:{title:"字体",type:"select",val:"黑体",options:[{value:"黑体",label:"黑体"},{value:"宋体",label:"宋体"}]},fontSize:{title:"文字大小",type:"number",val:18},fill:{title:"文字颜色",type:"color",val:"#FF0000"},vertical:{title:"竖排展示",type:"switch",val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"card-vue",title:"卡片",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxnIGZpbGw9ImN1cnJlbnRDb2xvciI+PHBhdGggZD0iTTE0LjUgM2EuNS41IDAgMCAxIC41LjV2OWEuNS41IDAgMCAxLS41LjVoLTEzYS41LjUgMCAwIDEtLjUtLjV2LTlhLjUuNSAwIDAgMSAuNS0uNXptLTEzLTFBMS41IDEuNSAwIDAgMCAwIDMuNXY5QTEuNSAxLjUgMCAwIDAgMS41IDE0aDEzYTEuNSAxLjUgMCAwIDAgMS41LTEuNHYtOUExLjUgMS41IDAgMCAwIDE0LjUgMnoiLz48cGF0aCBkPSJNMyA1LjVhLjUuNSAwIDAgMSAuNS0uNWg5YS41LjUgMCAwIDEgMCAxaC05YS41LjUgMCAwIDEtLjUtLjVNMyA4YS41LjUgMCAwIDEgLjUtLjVoOWEuNS41IDAgMCAxIDAgMWgtOUEuNS41IDAgMCAxIDMgOG0wIDIuNWEuNS41IDAgMCAxIC41LS41aDZhLjUuNSAwIDAgMSAwIDFoLTZhLjUuNSAwIDAgMS0uNS0uNSIvPjwvZz48L3N2Zz4=",props:{shadow:{title:"阴影显示时机",type:"select",val:"always",options:[{label:"总是显示",value:"always"},{label:"鼠标悬浮",value:"hover"},{label:"不显示",value:"never"}]},backGroundColor:{title:"背景颜色",type:"color",val:"#ffffff"},boxShadow:{title:"阴影颜色",type:"color",val:"#ffffff"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"kv-vue",title:"键值对",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjAgMjAiPjxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0iTTMgNmEzIDMgMCAwIDEgMy0zaDhhMyAzIDAgMCAxIDMgM3Y4YTMgMyAwIDAgMS0zIDNINmEzIDMgMCAwIDEtMy0zem0zLTJhMiAyIDAgMCAwLTIgMnYzLjVoNS41VjR6bTMuNSA2LjVINFYxNGEyIDIgMCAwIDAgMiAyaDMuNXptMSAwVjE2SDE0YTIgMiAwIDAgMCAyLTJ2LTMuNXptNS41LTFWNmEyIDIgMCAwIDAtMi0yaC0zLjV2NS41eiIvPjwvc3ZnPg==",props:{border:{title:"边框",type:"switch",val:!0},fontFamily:{title:"字体",type:"select",val:"黑体",options:[{value:"黑体",label:"黑体"},{value:"宋体",label:"宋体"}]},fontSize:{title:"文字大小",type:"number",val:18},label:{title:"键名",type:"input",val:"键名"},labelWidth:{title:"键名宽度",type:"number",val:50},value:{title:"键值",type:"input",val:"键值"},valueWidth:{title:"键值宽度",type:"number",val:50},color:{title:"文字颜色",type:"color",val:"#FF0000"},borderColor:{title:"边框颜色",type:"color",val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"recttext-vue",title:"矩形文本",type:"vue",thumbnail:"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNDMwIiBoZWlnaHQ9IjQzMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiPgogPGcgY2xhc3M9ImxheWVyIj4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHJlY3QgZmlsbD0iIzAwMDAwMCIgZmlsbC1vcGFjaXR5PSIwIiBoZWlnaHQ9IjQxMCIgaWQ9InN2Z18xMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjE3IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkgbWF0cml4KDYuMTIzMjNlLTE3IDEgLTEgNi4xMjMyM2UtMTcgNDk1IDEpIG1hdHJpeCgxIDAgMCAxIDEzMSAwKSIgd2lkdGg9IjE0OSIgeD0iNy41IiB5PSI3NSIvPgogIDx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSI1OC43NiIgZm9udC13ZWlnaHQ9Im5vcm1hbCIgaWQ9InN2Z18yIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iNCIgc3R5bGU9ImN1cnNvcjogbW92ZTsiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMCAxMzEpIiB4PSIyMTciIHhtbDpzcGFjZT0icHJlc2VydmUiIHk9IjEwMy4yOCI+5paHIOacrDwvdGV4dD4KIDwvZz4KPC9zdmc+",props:{text:{title:"文字内容",type:"input",val:"文本"},backgroundColor:{title:"背景颜色",type:"color",val:"#ffffff"},borderColor:{title:"边框颜色",type:"color",val:"#000000"},borderWidth:{title:"边框宽度",type:"number",val:2},borderStyle:{title:"边框样式",type:"select",val:"solid",options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"}]},textColor:{title:"文字颜色",type:"color",val:"#000000"},fontSize:{title:"文字大小",type:"number",val:14},borderRadius:{title:"圆角半径",type:"number",val:4}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}],configStore=vue.reactive({sysComponent:sysComponentItems,lineRenderOffset:10}),leftAsideStore=vue.reactive({config:new Map([["我定义的设备",[]],["系统组件",configStore.sysComponent]]),registerConfig:(Ag,gg)=>{if(Ag=="我定义的设备"||Ag=="系统组件"){ElMessage.info(`title:${Ag}已被系统占用,请更换名称!`);return}leftAsideStore.config.has(Ag)&&console.log(`title:${Ag}已存在,已经将其配置覆盖`);const eg=gg.map(Ig=>{if(Ig.type=="svg"){const{symbol_str:Cg,width:tg,height:ig}=svgToSymbol(Ig.svg,Ig.id);return{...Ig,symbol:{symbol_id:Ig.id,symbol_str:Cg,width:tg,height:ig},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}}return{...Ig,common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}});leftAsideStore.config.set(Ag,eg)}}),_hoisted_1$u=["src"],_sfc_main$x=vue.defineComponent({__name:"index",props:{symbolId:{},symbolStr:{},width:{},height:{},props:{}},setup(Ag){const gg=Ag,eg=vue.computed(()=>svgToImgSrc(symbolGenSvg(gg.symbolId,gg.symbolStr,gg.width,gg.height,genDomPropstr(gg.props))));return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("img",{class:"w-1/1 h-1/1",src:eg.value},null,8,_hoisted_1$u))}}),_hoisted_1$t={class:"mt-group"},_hoisted_2$i=["id"],_sfc_main$w=vue.defineComponent({__name:"index",props:{itemJson:{},grid:{},canvasCfg:{},canvasDom:{}},setup(Ag){vue.useCssVars(eg=>({cebe1efc:gg.itemJson.binfo.left+"px",v233fe8b0:gg.itemJson.binfo.top+"px",v37317152:gg.itemJson.binfo.width+"px",v39c959e2:gg.itemJson.binfo.height+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$t,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(gg.itemJson.children,Cg=>(vue.openBlock(),vue.createElementBlock("div",{class:"absolute",key:Cg.id,id:Cg.id,style:vue.normalizeStyle({left:Cg.binfo.left+"%",top:Cg.binfo.top+"%",width:Cg.binfo.width+"%",height:Cg.binfo.height+"%",transform:`rotate(${Cg.binfo.angle}deg)`})},[vue.createVNode(_sfc_main$t,{"item-json":Cg,grid:gg.grid,"canvas-cfg":gg.canvasCfg,"canvas-dom":gg.canvasDom,"lock-state":!1},null,8,["item-json","grid","canvas-cfg","canvas-dom"])],12,_hoisted_2$i))),128))]))}}),index_vue_vue_type_style_index_0_scoped_d359f9ac_lang="",GroupRender=_export_sfc(_sfc_main$w,[["__scopeId","data-v-d359f9ac"]]),_hoisted_1$s=["id"],_hoisted_2$h=["fill"],_hoisted_3$f=["id"],_hoisted_4$9=["fill"],_hoisted_5$7=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],_hoisted_6$7=["from","to","dur"],_hoisted_7$5=["d","stroke-width","marker-start","marker-end"],_hoisted_8$4=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_9$4=["from","to","dur"],_hoisted_10$3=["r","fill"],_hoisted_11$3=["path","dur"],_hoisted_12$1={key:2},_hoisted_13=["cx","cy","stroke","onMousedown","onTouchstartPassive"],_hoisted_14={key:3},_hoisted_15=["id","cx","cy","stroke","onMousedown","onTouchstartPassive"],_sfc_main$v=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},doneJson:{},lockState:{type:Boolean},mode:{default:"normal"}},emits:["update:itemJson","setIntention","lineMouseUp"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=configStore.lineRenderOffset;vue.computed(()=>!eg.grid.align||!eg.grid.enabled?1:eg.grid.size);const tg=vue.ref(),ig=(lg,og,sg,rg)=>{if(eg.lockState)return;if(lg.stopPropagation(),eg.mode==="line-edit"&&sg=="edit"&&og!==0&&og!==eg.itemJson.props.point_position.val.length-1){const Gg=eg.itemJson.props.point_position.val;Gg.splice(og,1),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Gg}}});return}const{x:cg,y:ag}=rg,ug=lg instanceof MouseEvent?lg.clientX:lg.touches[0].pageX,dg=lg instanceof MouseEvent?lg.clientY:lg.touches[0].pageY;let hg=0,bg=0,mg=!0;const Zg=Gg=>{const pg=Gg instanceof MouseEvent?Gg.clientX:Gg.touches[0].pageX,fg=Gg instanceof MouseEvent?Gg.clientY:Gg.touches[0].pageY,Vg=lg.ctrlKey?0:alignToGrid((pg-ug)/eg.canvasCfg.scale,1),Wg=lg.shiftKey?0:alignToGrid((fg-dg)/eg.canvasCfg.scale,1);if(hg=cg+Vg,bg=ag+Wg,sg==="add")if(rg.x=hg,rg.y=bg,mg){const Hg=eg.itemJson.props.point_position.val;Hg.splice(og+1,0,{x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}}),mg=!1}else{const Hg=eg.itemJson.props.point_position.val;Hg[og+1]={x:hg,y:bg},Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}})}if(sg==="edit"){const Hg=eg.itemJson.props.point_position.val;if(og===0){if(Ig("setIntention","adsorbStart"),eg.mode==="line-edit"&&mg){const Sg=eg.itemJson.props.point_position.val;Sg.unshift({x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Sg}}}),mg=!1;return}}else if(og===Hg.length-1&&(Ig("setIntention","adsorbEnd"),eg.mode==="line-edit"&&mg)){const Sg=eg.itemJson.props.point_position.val;Sg.push({x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Sg}}}),og+=1,mg=!1;return}Hg[og].x=hg,Hg[og].y=bg,Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}})}},Bg=()=>{document.removeEventListener("mousemove",Zg),document.removeEventListener("mouseup",Bg),document.removeEventListener("touchmove",Zg),document.removeEventListener("touchend",Bg);const Gg=document.querySelector(`#${eg.itemJson.id} g .real`).getBoundingClientRect(),pg=eg.canvasDom.getBoundingClientRect(),fg=((Gg==null?void 0:Gg.left)-(pg==null?void 0:pg.left))/eg.canvasCfg.scale,Vg=((Gg==null?void 0:Gg.top)-(pg==null?void 0:pg.top))/eg.canvasCfg.scale,Wg=fg-eg.itemJson.binfo.left,Hg=Vg-eg.itemJson.binfo.top;Ig("setIntention","none"),Ig("update:itemJson",{...eg.itemJson,binfo:{...eg.itemJson.binfo,left:fg,top:Vg,width:(Gg==null?void 0:Gg.width)/eg.canvasCfg.scale,height:(Gg==null?void 0:Gg.height)/eg.canvasCfg.scale},props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:eg.itemJson.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}})};document.addEventListener("mousemove",Zg),document.addEventListener("mouseup",Bg),document.addEventListener("touchmove",Zg),document.addEventListener("touchend",Bg),Ig("lineMouseUp")},ng=lg=>{const og=[];return lg.forEach((sg,rg)=>{if(rg===lg.length-1)return;const cg=getCenterXY(sg.x,sg.y,lg[rg+1].x,lg[rg+1].y);og.push(cg)}),og};return vue.watch(()=>eg.itemJson.props.point_position.val,lg=>{tg.value=ng(lg)},{immediate:!0,deep:!0}),(lg,og)=>{var sg,rg,cg,ag,ug,dg,hg,bg;return vue.openBlock(),vue.createElementBlock("svg",{class:"mt-line-render",style:vue.normalizeStyle({position:"absolute",left:`${-eg.itemJson.binfo.left-vue.unref(Cg)}px`,top:`${-eg.itemJson.binfo.top-vue.unref(Cg)}px`,width:`${eg.canvasCfg.width+vue.unref(Cg)}px`,height:`${eg.canvasCfg.height+vue.unref(Cg)}px`}),version:"1.1",xmlns:"http://www.w3.org/2000/svg","pointer-events":"none"},[vue.createElementVNode("g",null,[vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"markerArrowStart"+eg.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:eg.itemJson.props.stroke.val},null,8,_hoisted_2$h)],8,_hoisted_1$s),vue.createElementVNode("marker",{id:"markerArrowEnd"+eg.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:eg.itemJson.props.stroke.val},null,8,_hoisted_4$9)],8,_hoisted_3$f)]),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),"pointer-events":"visibleStroke",fill:"none",stroke:eg.itemJson.props.ani_type.val==="electricity"?eg.itemJson.props.ani_color.val:eg.itemJson.props.stroke.val,"stroke-width":eg.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":eg.itemJson.props.ani_type.val==="electricity"?eg.itemJson.props["stroke-width"].val*3:0,"marker-start":(rg=(sg=eg.itemJson.props)==null?void 0:sg["marker-start"])!=null&&rg.val?`url(#markerArrowStart${eg.itemJson.id})`:"","marker-end":(ag=(cg=eg.itemJson.props)==null?void 0:cg["marker-end"])!=null&&ag.val?`url(#markerArrowEnd${eg.itemJson.id})`:"",class:"real"},[eg.itemJson.props.ani_type.val==="electricity"?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:eg.itemJson.props.ani_reverse.val?0:1e3,to:eg.itemJson.props.ani_reverse.val?eg.itemJson.props.ani_play.val?1e3:0:eg.itemJson.props.ani_play.val?0:1e3,dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_6$7)):vue.createCommentVNode("",!0)],8,_hoisted_5$7),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),"pointer-events":"visibleStroke",fill:"none",stroke:"transparent","stroke-width":eg.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","marker-start":(dg=(ug=eg.itemJson.props)==null?void 0:ug["marker-start"])!=null&&dg.val?`url(#markerArrowStart${eg.itemJson.id})`:"","marker-end":(bg=(hg=eg.itemJson.props)==null?void 0:hg["marker-end"])!=null&&bg.val?`url(#markerArrowEnd${eg.itemJson.id})`:""},null,8,_hoisted_7$5),eg.itemJson.props.ani_type.val==="waterdrop"?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),fill:"none","fill-opacity":"0",stroke:eg.itemJson.props.ani_color.val,"stroke-width":eg.itemJson.props["stroke-width"].val,"stroke-dasharray":eg.itemJson.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:eg.itemJson.props.ani_reverse.val?0:1e3,to:eg.itemJson.props.ani_reverse.val?eg.itemJson.props.ani_play.val?1e3:0:eg.itemJson.props.ani_play.val?0:1e3,dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite",fill:"freeze"},null,8,_hoisted_9$4)],8,_hoisted_8$4)):eg.itemJson.props.ani_type.val==="track"?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:eg.itemJson.props["stroke-width"].val*2,fill:eg.itemJson.props.ani_color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_11$3)],8,_hoisted_10$3)):vue.createCommentVNode("",!0),eg.itemJson.active?(vue.openBlock(),vue.createElementBlock("g",_hoisted_12$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,(mg,Zg)=>(vue.openBlock(),vue.createElementBlock("circle",{key:Zg,"pointer-events":"fill",cx:mg.x+eg.itemJson.binfo.left+vue.unref(Cg),cy:mg.y+eg.itemJson.binfo.top+vue.unref(Cg),r:"4","stroke-width":"2",stroke:eg.itemJson.props.stroke.val,fill:"transparent",class:"cursor-crosshair opacity-30",onMousedown:Bg=>ig(Bg,Zg,"add",mg),onTouchstartPassive:Bg=>ig(Bg,Zg,"add",mg)},null,40,_hoisted_13))),128))])):vue.createCommentVNode("",!0),eg.itemJson.active?(vue.openBlock(),vue.createElementBlock("g",_hoisted_14,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.itemJson.props.point_position.val,(mg,Zg)=>(vue.openBlock(),vue.createElementBlock("circle",{key:Zg,"pointer-events":"fill",id:`point-${eg.itemJson.id}-${Zg}`,cx:mg.x+eg.itemJson.binfo.left+vue.unref(Cg),cy:mg.y+eg.itemJson.binfo.top+vue.unref(Cg),r:"4","stroke-width":"1",stroke:eg.itemJson.props.stroke.val,fill:"#fff",class:vue.normalizeClass(eg.mode==="line-edit"&&Zg!==0&&Zg!==eg.itemJson.props.point_position.val.length-1?"cursor-remove":"cursor-pointer"),onMousedown:Bg=>ig(Bg,Zg,"edit",mg),onTouchstartPassive:Bg=>ig(Bg,Zg,"edit",mg)},null,42,_hoisted_15))),128))])):vue.createCommentVNode("",!0)])],4)}}}),index_vue_vue_type_style_index_0_scoped_d5d8fc1c_lang="",LineRender=_export_sfc(_sfc_main$v,[["__scopeId","data-v-d5d8fc1c"]]);/**
|
|
66
|
+
`,svgToImgSrc=Ag=>"data:image/svg+xml;utf8,"+encodeURIComponent(Ag),genDomPropstr=Ag=>{let gg="";for(const eg in Ag)gg+=` ${eg}="${Ag[eg].val}"`;return gg},randomString=Ag=>{Ag=Ag||10;const gg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",eg=gg.length;let Ig="";for(let Cg=0;Cg<Ag;Cg++)Ig+=gg.charAt(Math.floor(Math.random()*eg));return Ig};function isTouchEvent(Ag){const gg=Object.prototype.toString.call(Ag);return gg.substring(8,gg.length-1)==="TouchEvent"}function getRealityXY(Ag,gg){let eg=0,Ig=0;if(isTouchEvent(Ag)){const Cg=Ag.targetTouches[0];eg=gg?Cg.pageX-gg.x:0,Ig=gg?Cg.pageY-gg.y:0}else eg=gg?Ag.clientX-gg.x:Ag.clientX,Ig=gg?Ag.clientY-gg.y:Ag.clientY;return{realityX:eg,realityY:Ig}}const blobToBase64=Ag=>new Promise(function(gg,eg){const Ig=new FileReader;let Cg="";Ig.readAsDataURL(Ag),Ig.onload=function(){Cg=Ig.result??""},Ig.onerror=function(tg){eg(tg)},Ig.onloadend=function(){gg(Cg)}}),alignToGrid=(Ag,gg=1)=>{const eg=Math.floor(Ag/gg);return Ag%gg>=gg/2?(eg+1)*gg:eg*gg},objectDeepClone=(Ag,gg={})=>Ag?JSON.parse(JSON.stringify(Ag)):gg,prosToVBind=Ag=>{let gg={};for(const eg in Ag)gg={...gg,[eg]:Ag[eg].val};return gg},calculateGuideY=(Ag,gg,eg,Ig,Cg)=>{for(let tg=0;tg<eg.length;tg++){const{left:ig,right:ng,width:lg}=eg[tg],og=Ag.find(mg=>Math.abs(mg.left-ig)<gg),sg=Ag.find(mg=>Math.abs(mg.left-(ig+lg/2))<gg),rg=Ag.find(mg=>Math.abs(mg.left-ng)<gg),cg=Ag.find(mg=>Math.abs(mg.left+mg.width/2-ig)<gg),ag=Ag.find(mg=>Math.abs(mg.left+mg.width/2-(ig+lg/2))<gg),ug=Ag.find(mg=>Math.abs(mg.left+mg.width/2-ng)<gg),dg=Ag.find(mg=>Math.abs(mg.right-ng)<gg),hg=Ag.find(mg=>Math.abs(mg.right-(ig+lg/2))<gg),bg=Ag.find(mg=>Math.abs(mg.right-ig)<gg);if(og)return{y_info:{display:!0,left:(og.left-Ig.left)/Cg},move_x:og.left-ig};if(sg)return{y_info:{display:!0,left:(sg.left-Ig.left)/Cg},move_x:sg.left-(ig+lg/2)};if(rg)return{y_info:{display:!0,left:(rg.left-Ig.left)/Cg},move_x:rg.left-ng};if(cg)return{y_info:{display:!0,left:(cg.left+cg.width/2-Ig.left)/Cg},move_x:cg.left+cg.width/2-ig};if(ag)return{y_info:{display:!0,left:(ag.left+ag.width/2-Ig.left)/Cg},move_x:ag.left+ag.width/2-(ig+lg/2)};if(ug)return{y_info:{display:!0,left:(ug.left+ug.width/2-Ig.left)/Cg},move_x:ug.left+ug.width/2-ng};if(bg)return{y_info:{display:!0,left:(bg.right-Ig.left)/Cg},move_x:bg.right-ig};if(hg)return{y_info:{display:!0,left:(hg.right-Ig.left)/Cg},move_x:hg.right-(ig+lg/2)};if(dg)return{y_info:{display:!0,left:(dg.right-Ig.left)/Cg},move_x:dg.right-ng}}return{y_info:{display:!1,left:0},move_x:0}},calculateGuideX=(Ag,gg,eg,Ig,Cg)=>{for(let tg=0;tg<eg.length;tg++){const{top:ig,bottom:ng,height:lg}=eg[tg],og=Ag.find(mg=>Math.abs(mg.top-ig)<gg),sg=Ag.find(mg=>Math.abs(mg.top-(ig+lg/2))<gg),rg=Ag.find(mg=>Math.abs(mg.top-ng)<gg),cg=Ag.find(mg=>Math.abs(mg.top+mg.height/2-ig)<gg),ag=Ag.find(mg=>Math.abs(mg.top+mg.height/2-(ig+lg/2))<gg),ug=Ag.find(mg=>Math.abs(mg.top+mg.height/2-ng)<gg),dg=Ag.find(mg=>Math.abs(mg.bottom-ng)<gg),hg=Ag.find(mg=>Math.abs(mg.bottom-(ig+lg/2))<gg),bg=Ag.find(mg=>Math.abs(mg.bottom-ig)<gg);if(og)return{x_info:{display:!0,top:(og.top-Ig.top)/Cg},move_y:og.top-ig};if(sg)return{x_info:{display:!0,top:(sg.top-Ig.top)/Cg},move_y:sg.top-(ig+lg/2)};if(rg)return{x_info:{display:!0,top:(rg.top-Ig.top)/Cg},move_y:rg.top-ng};if(cg)return{x_info:{display:!0,top:(cg.top+cg.height/2-Ig.top)/Cg},move_y:cg.top+cg.height/2-ig};if(ag)return{x_info:{display:!0,top:(ag.top+ag.height/2-Ig.top)/Cg},move_y:ag.top+ag.height/2-(ig+lg/2)};if(ug)return{x_info:{display:!0,top:(ug.top+ug.height/2-Ig.top)/Cg},move_y:ug.top+ug.height/2-ng};if(bg)return{x_info:{display:!0,top:(bg.bottom-Ig.top)/Cg},move_y:bg.bottom-ig};if(hg)return{x_info:{display:!0,top:(hg.bottom-Ig.top)/Cg},move_y:hg.bottom-(ig+lg/2)};if(dg)return{x_info:{display:!0,top:(dg.bottom-Ig.top)/Cg},move_y:dg.bottom-ng}}return{x_info:{display:!1,top:0},move_y:0}},positionArrarToPath=(Ag,gg=0,eg=0)=>{let Ig="";for(let Cg=0;Cg<Ag.length;Cg++)Cg===0?Ig+=`M ${Ag[Cg].x+gg} ${Ag[Cg].y+eg}`:Ig+=` L ${Ag[Cg].x+gg} ${Ag[Cg].y+eg}`;return Ig},getCenterXY=(Ag,gg,eg,Ig)=>({x:(Ag+eg)/2,y:(gg+Ig)/2}),rotatePoint=(Ag,gg,eg,Ig,Cg)=>{const tg=eg+(Ag-eg)*Math.cos(Cg)-(gg-Ig)*Math.sin(Cg),ig=Ig+(Ag-eg)*Math.sin(Cg)+(gg-Ig)*Math.cos(Cg);return{x:tg,y:ig}},getRectCoordinate=Ag=>{const gg={x:Ag.left,y:Ag.top},eg={x:Ag.left+Ag.width,y:Ag.top},Ig={x:Ag.left,y:Ag.top+Ag.height},Cg={x:Ag.left+Ag.width,y:Ag.top+Ag.height};return{topLeft:gg,topRight:eg,bottomLeft:Ig,bottomRight:Cg}},getRectCenterCoordinate=(Ag,gg,eg,Ig)=>{const Cg={x:(Ag.x+gg.x)/2,y:(Ag.y+gg.y)/2},tg={x:(eg.x+Ig.x)/2,y:(eg.y+Ig.y)/2},ig={x:(Ag.x+eg.x)/2,y:(Ag.y+eg.y)/2},ng={x:(gg.x+Ig.x)/2,y:(gg.y+Ig.y)/2};return{topCenter:Cg,bottomCenter:tg,leftCenter:ig,rightCenter:ng}},handleAlign=(Ag,gg,eg,Ig,Cg)=>{switch(Ag){case"left":{const ig=Math.min(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.left));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig});break}case"horizontally":{const ig=gg.filter(ng=>ng.type!=="sys-line")[0].binfo.left+gg[0].binfo.width/2;gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig-ng.binfo.width/2});break}case"right":{const ig=Math.max(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.left+ng.binfo.width));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.left=ig-ng.binfo.width});break}case"top":{const ig=Math.min(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.top));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig});break}case"vertically":{const ig=gg.filter(ng=>ng.type!=="sys-line")[0].binfo.top+gg[0].binfo.height/2;gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig-ng.binfo.height/2});break}case"bottom":{const ig=Math.max(...gg.filter(ng=>ng.type!=="sys-line").map(ng=>ng.binfo.top+ng.binfo.height));gg.filter(ng=>ng.type!=="sys-line").forEach(ng=>{ng.binfo.top=ig-ng.binfo.height});break}case"horizontal-distribution":{gg.sort((og,sg)=>og.binfo.left+og.binfo.width/2-sg.binfo.left+sg.binfo.width/2);const ig=gg[gg.length-1],ng=gg[0],lg=(ig.binfo.left+ig.binfo.width/2-(ng.binfo.left+ng.binfo.width/2))/(gg.length-1);gg.forEach((og,sg)=>{if(sg==0||sg==gg.length-1)return;const rg=ng.binfo.left+ng.binfo.width/2+lg*sg;og.binfo={...og.binfo,left:rg-og.binfo.width/2}});break}case"vertical-distribution":{gg.sort((og,sg)=>og.binfo.top+og.binfo.height/2-sg.binfo.top+sg.binfo.height/2);const ig=gg[gg.length-1],ng=gg[0],lg=(ig.binfo.top+ig.binfo.height/2-(ng.binfo.top+ng.binfo.height/2))/(gg.length-1);gg.forEach((og,sg)=>{if(sg==0||sg==gg.length-1)return;const rg=ng.binfo.top+ng.binfo.height/2+lg*sg;og.binfo={...og.binfo,top:rg-og.binfo.height/2}});break}}const tg=Cg.filter(ig=>ig.type==="sys-line");return useUpdateSysLine(tg,gg,eg,Ig),gg},setItemAttr=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(Ag=>Ag.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getItemAttr=(id,key,json_arr)=>{const find_item=json_arr.find(Ag=>Ag.id===id);return find_item?eval(`find_item.${key}`):null},previewCompareVal=(Ag,gg,eg)=>gg==="="?String(Ag)==String(eg):gg===">"?Number(Ag)>Number(eg):gg==="<"?Number(Ag)<Number(eg):gg==="!="?String(Ag)!=String(eg):!1,eventToVOn=Ag=>{const gg={};Ag.events.forEach(Ig=>{let Cg="";if(Ig.action==="changeAttr"){if(Ig.change_attr.length<1)return;Ig.change_attr.forEach(tg=>{!tg.target_id||!tg.target_attr||tg.target_value===void 0||(!Ig.trigger_rule||!Ig.trigger_rule.trigger_id||!Ig.trigger_rule.trigger_attr||Ig.trigger_rule.value===void 0||!Ig.trigger_rule.operator?typeof tg.target_value=="boolean"?Cg+=`$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', ${tg.target_value});`:Cg+=`$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', '${tg.target_value}');`:typeof tg.target_value=="boolean"?Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', ${tg.target_value})};`:Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){$setItemAttrByID('${tg.target_id}', '${tg.target_attr}', '${tg.target_value}')};`)})}else Ig.action==="customCode"&&(!Ig.trigger_rule||!Ig.trigger_rule.trigger_id||!Ig.trigger_rule.trigger_attr||Ig.trigger_rule.value===void 0||!Ig.trigger_rule.operator?Cg+=Ig.custom_code+";":Cg+=`if($previewCompareVal($getItemAttrByID('${Ig.trigger_rule.trigger_id}', '${Ig.trigger_rule.trigger_attr}'), '${Ig.trigger_rule.operator}', '${Ig.trigger_rule.value}')){${Ig.custom_code}};`);Object.prototype.hasOwnProperty.call(gg,Ig.type)?gg[Ig.type]+=Cg:gg[Ig.type]=Cg});let eg={};for(const Ig in gg)eg={...eg,[Ig]:()=>dynamicEvent(gg[Ig])(Ag)};return eg},dynamicEvent=Ag=>{try{return new Function("$item_info",Ag)}catch(gg){return console.error(gg),new Function("$item_info",`console.error('${gg}')`)}},_hoisted_1$v={id:"mt-left-aside",class:"left-aside-root"},_hoisted_2$j={class:"left-aside-head"},_hoisted_3$g={class:"left-aside-list-wrap"},_hoisted_4$a={class:"left-aside-collapse-title"},_hoisted_5$8={class:"left-aside-collapse-label"},_hoisted_6$8={class:"left-aside-collapse-count"},_hoisted_7$6={class:"left-aside-card-grid"},_hoisted_8$5=["onDragstart","onTouchstartPassive"],_hoisted_9$4={class:"left-aside-card-thumb"},_hoisted_10$4=["src","alt"],_hoisted_11$4=["title"],_hoisted_12$2={class:"left-aside-card-sub"},_hoisted_13$1={class:"flex"},_hoisted_14$1={class:"flex justify-center"},_hoisted_15$1={key:0},_hoisted_16={class:"flex flex-wrap"},_hoisted_17=["onMouseenter"],_hoisted_18={class:"w-60px h-60px flex justify-center items-center"},_hoisted_19={key:0,class:"absolute w-160px h-160px left-0 top-0 opacity-80 bg-light-300 flex justify-center items-center"},_sfc_main$y=vue.defineComponent({__name:"index",props:{leftAsideConfig:{default:()=>new Map}},setup(Ag){const gg=Ag,eg=useDark({selector:"#mt-edit"}),Ig=vue.ref(),Cg=vue.ref(),tg=useLocalStorage("mt-disable-classify",[]),ig=useLocalStorage("mt-local-file",[]);gg.leftAsideConfig.set("我定义的设备",ig.value);const ng=vue.ref(),lg=vue.ref([]),og=vue.ref(""),sg=vue.ref(!1),rg=vue.ref([]),cg=vue.ref([]),ag=vue.ref(null),ug=vue.computed(()=>[...gg.leftAsideConfig.keys()].map(vg=>({label:vg}))),dg=vue.ref([]),hg=vue.ref(),bg=vue.computed(()=>[...gg.leftAsideConfig.keys()].filter(yg=>!tg.value.includes(yg)&&dg.value.includes(yg))),mg=()=>{const vg=[...gg.leftAsideConfig.keys()],yg=vg.filter(Yg=>!tg.value.includes(Yg));for(const Yg of yg)dg.value.includes(Yg)||dg.value.push(Yg);dg.value=dg.value.filter(Yg=>vg.includes(Yg));const Ng=new Set(lg.value);for(const Yg of yg)Ng.add(Yg);lg.value=[...Ng]};vue.watch(()=>[...gg.leftAsideConfig.keys()],mg,{immediate:!0}),vue.watch(tg,mg,{deep:!0});const Zg=vue.computed({get:()=>ug.value.length==dg.value.length,set:vg=>{var yg;vg?dg.value=ug.value.map(Ng=>Ng.label):(dg.value=[],(yg=ng.value)==null||yg.setCheckedNodes([]))}}),Bg=vue.computed(()=>dg.value.length>0&&dg.value.length<ug.value.length),Gg=vg=>{var yg;return vg?(yg=og.value)!=null&&yg.trim()?vg.filter(Ng=>Ng.title.includes(og.value.trim())):vg:[]},pg=(vg,yg)=>vg==="我定义的设备"?"补充":vg.includes("复合")||vg.includes("电气")?"已有":yg.type==="img"?"图元":"已有",fg=(vg,yg)=>{if(!vg||!yg){console.error("拖拽初始化失败",vg,yg);return}globalStore.setIntention("create"),globalStore.setCreateItemInfo({config_key:vg,item_id:yg})},Vg=()=>{sg.value=!0},Wg=(vg,yg)=>{yg&&!dg.value.includes(vg.label)?dg.value.push(vg.label):yg||(dg.value=dg.value.filter(Ng=>Ng!==vg.label)),tg.value=ug.value.filter(Ng=>!dg.value.includes(Ng.label)).map(Ng=>Ng.label)},Hg=({label:vg})=>{hg.value=vg},Sg=()=>{var vg,yg;(vg=Ig.value)==null||vg.clearFiles(),(yg=Cg.value)==null||yg.clearFiles(),rg.value=[],cg.value=[]},wg=vg=>{if(vg.raw.type.includes("image/")){if(vg.raw.size/1024/1024>20)return ElMessage.error("不能上传超过20MB的图像!"),Sg(),!1}else return ElMessage.error("只能上传图片!"),Sg(),!1;blobToBase64(vg.raw).then(yg=>{var Jg;const Ng=vg.name.split(".")[0],Yg={id:Ng,title:Ng,type:"img",thumbnail:yg,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},Kg=ig.value.findIndex(Ug=>Ug.id==Ng);Kg!=-1&&(ElMessage.info("存在同名文件,已覆盖!"),ig.value.splice(Kg,1)),ig.value.push(Yg),gg.leftAsideConfig.set("我定义的设备",ig.value),Sg(),hg.value="我定义的设备",(Jg=ng.value)==null||Jg.setCurrentKey("我定义的设备"),dg.value.includes("我定义的设备")||dg.value.push("我定义的设备"),lg.value.includes("我定义的设备")||lg.value.push("我定义的设备"),ElMessage.success("上传成功")})},Xg=({id:vg})=>{const yg=ig.value.findIndex(Ng=>Ng.id==vg);yg!=-1&&ig.value.splice(yg,1),gg.leftAsideConfig.set("我定义的设备",ig.value)};return(vg,yg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$v,[vue.createElementVNode("div",_hoisted_2$j,[yg[8]||(yg[8]=vue.createElementVNode("h2",{class:"left-aside-heading"},"图元库",-1)),vue.createVNode(vue.unref(ElButton),{class:"left-aside-manage-link",link:"",type:"primary",onClick:Vg},{default:vue.withCtx(()=>[...yg[7]||(yg[7]=[vue.createTextVNode(" 管理 ",-1)])]),_:1})]),vue.createVNode(vue.unref(ElInput),{modelValue:og.value,"onUpdate:modelValue":yg[0]||(yg[0]=Ng=>og.value=Ng),class:"left-aside-search",placeholder:"请输入关键字进行搜索",clearable:""},{prefix:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{class:"left-aside-search-icon",size:16},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:"search"})]),_:1})]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElUpload),{ref_key:"sidebarUploadRef",ref:Cg,class:"left-aside-upload","file-list":cg.value,"onUpdate:fileList":yg[1]||(yg[1]=Ng=>cg.value=Ng),"auto-upload":!1,limit:1,"show-file-list":!1,"on-change":wg,accept:"image/*"},{default:vue.withCtx(()=>[...yg[9]||(yg[9]=[vue.createElementVNode("div",{class:"left-aside-upload-trigger"},"+ 上传本地图元",-1)])]),_:1},8,["file-list"]),vue.createElementVNode("div",_hoisted_3$g,[vue.createVNode(vue.unref(ElScrollbar),{class:"left-aside-scrollbar"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:lg.value,"onUpdate:modelValue":yg[2]||(yg[2]=Ng=>lg.value=Ng)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(bg.value,Ng=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{key:Ng,name:Ng},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$a,[yg[10]||(yg[10]=vue.createElementVNode("span",{class:"left-aside-triangle","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",_hoisted_5$8,vue.toDisplayString(Ng),1),vue.createElementVNode("span",_hoisted_6$8,vue.toDisplayString(Gg(gg.leftAsideConfig.get(Ng)).length)+" 项 ",1)])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Gg(gg.leftAsideConfig.get(Ng)),Yg=>(vue.openBlock(),vue.createElementBlock("div",{key:Yg.id,class:"left-aside-card",draggable:"true",onDragstart:Kg=>fg(Ng,Yg.id),onTouchstartPassive:Kg=>fg(Ng,Yg.id)},[vue.createElementVNode("div",_hoisted_9$4,[vue.createElementVNode("img",{draggable:"false",class:"left-aside-card-image select-none",src:Yg.thumbnail,alt:Yg.title,loading:"lazy"},null,8,_hoisted_10$4)]),vue.createElementVNode("div",{class:"left-aside-card-title",title:Yg.title},vue.toDisplayString(Yg.title),9,_hoisted_11$4),vue.createElementVNode("div",_hoisted_12$2,vue.toDisplayString(pg(Ng,Yg)),1)],40,_hoisted_8$5))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1})]),vue.createVNode(vue.unref(ElDialog),{modelValue:sg.value,"onUpdate:modelValue":yg[6]||(yg[6]=Ng=>sg.value=Ng),title:"图库管理",width:"80%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_13$1,[vue.createElementVNode("div",null,[vue.createElementVNode("div",null,[vue.createElementVNode("div",_hoisted_14$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:Zg.value,"onUpdate:modelValue":yg[3]||(yg[3]=Ng=>Zg.value=Ng),indeterminate:Bg.value},{default:vue.withCtx(()=>[...yg[11]||(yg[11]=[vue.createTextVNode("全选",-1)])]),_:1},8,["modelValue","indeterminate"])]),vue.createVNode(vue.unref(ElScrollbar),{height:"50vh"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTree),{ref_key:"treeRef",ref:ng,data:ug.value,"highlight-current":!0,"show-checkbox":"",onCheckChange:Wg,"node-key":"label","default-checked-keys":dg.value,onNodeClick:Hg},null,8,["data","default-checked-keys"])]),_:1}),vue.createVNode(vue.unref(ElUpload),{ref_key:"uploadRef",ref:Ig,class:"w-24px h-24px","file-list":rg.value,"onUpdate:fileList":yg[4]||(yg[4]=Ng=>rg.value=Ng),"auto-upload":!1,limit:1,"show-file-list":!1,"on-change":wg,accept:"image/*"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary"},{default:vue.withCtx(()=>[...yg[12]||(yg[12]=[vue.createTextVNode("本地上传",-1)])]),_:1})]),_:1},8,["file-list"])])]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical",class:"h-50vh ml-40px"}),hg.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_15$1,[vue.createVNode(vue.unref(ElScrollbar),{height:"50vh"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_16,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(gg.leftAsideConfig.get(hg.value),Ng=>(vue.openBlock(),vue.createElementBlock("div",{key:Ng.id,class:"w-160px h-160px flex flex-wrap justify-center items-center cursor-pointer relative",onMouseenter:Yg=>ag.value=Ng.id,onMouseleave:yg[5]||(yg[5]=Yg=>ag.value=null)},[vue.createVNode(vue.unref(ElTooltip),{effect:vue.unref(eg)?"dark":"light",content:Ng.title,placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("div",null,[vue.createVNode(vue.unref(ElImage),{class:vue.normalizeClass(["w-60px h-60px",vue.unref(eg)?"bg-amber-50":""]),src:Ng.thumbnail},null,8,["class","src"]),vue.createElementVNode("div",_hoisted_18,[vue.createVNode(vue.unref(ElText),{truncated:""},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ng.title),1)]),_:2},1024)]),hg.value=="我定义的设备"&&ag.value==Ng.id?(vue.openBlock(),vue.createElementBlock("div",_hoisted_19,[vue.createVNode(vue.unref(ElButton),{type:"danger",onClick:Yg=>Xg(Ng)},{default:vue.withCtx(()=>[...yg[13]||(yg[13]=[vue.createTextVNode("删除",-1)])]),_:1},8,["onClick"])])):vue.createCommentVNode("",!0)])]),_:2},1032,["effect","content"])],40,_hoisted_17))),128))])]),_:1})])):vue.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_ef0506a4_lang="",index_vue_vue_type_style_index_1_lang="",LeftAside=_export_sfc(_sfc_main$y,[["__scopeId","data-v-ef0506a4"]]),sysComponentItems=[{id:"sys-line",title:"自由连线",type:"sys-line",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTQgMThhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTE2IDZhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTcuNSAxNi41bDktOSIvPjwvc3ZnPg==",props:{stroke:{title:"线条颜色",type:"color",val:"#ff0000"},"stroke-width":{title:"线条宽度",type:"number",val:2},"marker-start":{title:"起点箭头",type:"switch",val:!1},"marker-end":{title:"终点箭头",type:"switch",val:!0},point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:100,y:0}],disabled:!0},ani_type:{title:"动画类型",type:"select",val:"none",options:[{label:"无",value:"none"}],disabled:!0},bind_anchors:{title:"锚点绑定",type:"jsonEdit",val:{start:null,end:null},disabled:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"sys-line-vertical",title:"自由连线-竖线",type:"sys-line",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0iTTQgMThhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTE2IDZhMiAyIDAgMSAwIDQgMGEyIDIgMCAxIDAtNCAwTTcuNSAxNi41bDktOSIvPjwvc3ZnPg==",props:{stroke:{title:"线条颜色",type:"color",val:"#ff0000"},"stroke-width":{title:"线条宽度",type:"number",val:2},"marker-start":{title:"起点箭头",type:"switch",val:!1},"marker-end":{title:"终点箭头",type:"switch",val:!0},point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:0,y:100}],disabled:!0},ani_type:{title:"动画类型",type:"select",val:"none",options:[{label:"无",value:"none"}],disabled:!0},bind_anchors:{title:"锚点绑定",type:"jsonEdit",val:{start:null,end:null},disabled:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"text-vue",title:"文字",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIzMiIgZD0ibTMyIDQxNS41bDEyMC0zMjBsMTIwIDMyMG0tNDItMTEySDc0bTI1Mi02NGMxMi4xOS0yOC42OSA0MS00OCA3NC00OGgwYzQ2IDAgODAgMzIgODAgODB2MTQ0Ii8+PHBhdGggZmlsbD0ibm9uZSIgc3Ryb2tlPSJjdXJyZW50Q29sb3IiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIzMiIgZD0iTTMyMCAzNTguNWMwIDM2IDI2Ljg2IDU4IDYwIDU4YzU0IDAgMTAwLTI3IDEwMC0xMDZ2LTE1Yy0yMCAwLTU4IDEtOTIgNWMtMzIuNzcgMy44Ni02OCAxOS02OCA1OCIvPjwvc3ZnPg==",props:{text:{title:"文字内容",type:"input",val:"文字"},fontFamily:{title:"字体",type:"select",val:"黑体",options:[{value:"黑体",label:"黑体"},{value:"宋体",label:"宋体"}]},fontSize:{title:"文字大小",type:"number",val:40},fill:{title:"文字颜色",type:"color",val:"#FF0000"},vertical:{title:"竖排展示",type:"switch",val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"card-vue",title:"卡片",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxnIGZpbGw9ImN1cnJlbnRDb2xvciI+PHBhdGggZD0iTTE0LjUgM2EuNS41IDAgMCAxIC41LjV2OWEuNS41IDAgMCAxLS41LjVoLTEzYS41LjUgMCAwIDEtLjUtLjV2LTlhLjUuNSAwIDAgMSAuNS0uNXptLTEzLTFBMS41IDEuNSAwIDAgMCAwIDMuNXY5QTEuNSAxLjUgMCAwIDAgMS41IDE0aDEzYTEuNSAxLjUgMCAwIDAgMS41LTEuNHYtOUExLjUgMS41IDAgMCAwIDE0LjUgMnoiLz48cGF0aCBkPSJNMyA1LjVhLjUuNSAwIDAgMSAuNS0uNWg5YS41LjUgMCAwIDEgMCAxaC05YS41LjUgMCAwIDEtLjUtLjVNMyA4YS41LjUgMCAwIDEgLjUtLjVoOWEuNS41IDAgMCAxIDAgMWgtOUEuNS41IDAgMCAxIDMgOG0wIDIuNWEuNS41IDAgMCAxIC41LS41aDZhLjUuNSAwIDAgMSAwIDFoLTZhLjUuNSAwIDAgMS0uNS0uNSIvPjwvZz48L3N2Zz4=",props:{shadow:{title:"阴影显示时机",type:"select",val:"always",options:[{label:"总是显示",value:"always"},{label:"鼠标悬浮",value:"hover"},{label:"不显示",value:"never"}]},backGroundColor:{title:"背景颜色",type:"color",val:"#ffffff"},boxShadow:{title:"阴影颜色",type:"color",val:"#ffffff"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"kv-vue",title:"键值对",type:"vue",thumbnail:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjAgMjAiPjxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0iTTMgNmEzIDMgMCAwIDEgMy0zaDhhMyAzIDAgMCAxIDMgM3Y4YTMgMyAwIDAgMS0zIDNINmEzIDMgMCAwIDEtMy0zem0zLTJhMiAyIDAgMCAwLTIgMnYzLjVoNS41VjR6bTMuNSA2LjVINFYxNGEyIDIgMCAwIDAgMiAyaDMuNXptMSAwVjE2SDE0YTIgMiAwIDAgMCAyLTJ2LTMuNXptNS41LTFWNmEyIDIgMCAwIDAtMi0yaC0zLjV2NS41eiIvPjwvc3ZnPg==",props:{border:{title:"边框",type:"switch",val:!0},fontFamily:{title:"字体",type:"select",val:"黑体",options:[{value:"黑体",label:"黑体"},{value:"宋体",label:"宋体"}]},fontSize:{title:"文字大小",type:"number",val:18},label:{title:"键名",type:"input",val:"键名"},labelWidth:{title:"键名宽度",type:"number",val:50},value:{title:"键值",type:"input",val:"键值"},valueWidth:{title:"键值宽度",type:"number",val:50},color:{title:"文字颜色",type:"color",val:"#FF0000"},borderColor:{title:"边框颜色",type:"color",val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}},{id:"recttext-vue",title:"矩形文本",type:"vue",thumbnail:"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNDMwIiBoZWlnaHQ9IjQzMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiPgogPGcgY2xhc3M9ImxheWVyIj4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHJlY3QgZmlsbD0iIzAwMDAwMCIgZmlsbC1vcGFjaXR5PSIwIiBoZWlnaHQ9IjQxMCIgaWQ9InN2Z18xMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjE3IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAxIDAgMCkgbWF0cml4KDYuMTIzMjNlLTE3IDEgLTEgNi4xMjMyM2UtMTcgNDk1IDEpIG1hdHJpeCgxIDAgMCAxIDEzMSAwKSIgd2lkdGg9IjE0OSIgeD0iNy41IiB5PSI3NSIvPgogIDx0ZXh0IGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSI1OC43NiIgZm9udC13ZWlnaHQ9Im5vcm1hbCIgaWQ9InN2Z18yIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iNCIgc3R5bGU9ImN1cnNvcjogbW92ZTsiIHRleHQtYW5jaG9yPSJtaWRkbGUiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMCAxMzEpIiB4PSIyMTciIHhtbDpzcGFjZT0icHJlc2VydmUiIHk9IjEwMy4yOCI+5paHIOacrDwvdGV4dD4KIDwvZz4KPC9zdmc+",props:{text:{title:"文字内容",type:"input",val:"文本"},backgroundColor:{title:"背景颜色",type:"color",val:"#ffffff"},borderColor:{title:"边框颜色",type:"color",val:"#000000"},borderWidth:{title:"边框宽度",type:"number",val:2},borderStyle:{title:"边框样式",type:"select",val:"solid",options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"}]},textColor:{title:"文字颜色",type:"color",val:"#000000"},fontSize:{title:"文字大小",type:"number",val:14},borderRadius:{title:"圆角半径",type:"number",val:4}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}],configStore=vue.reactive({sysComponent:sysComponentItems,lineRenderOffset:10}),leftAsideStore=vue.reactive({config:new Map([["我定义的设备",[]],["系统组件",configStore.sysComponent]]),registerConfig:(Ag,gg)=>{if(Ag=="我定义的设备"||Ag=="系统组件"){ElMessage.info(`title:${Ag}已被系统占用,请更换名称!`);return}leftAsideStore.config.has(Ag)&&console.log(`title:${Ag}已存在,已经将其配置覆盖`);const eg=gg.map(Ig=>{if(Ig.type=="svg"){const{symbol_str:Cg,width:tg,height:ig}=svgToSymbol(Ig.svg,Ig.id);return{...Ig,symbol:{symbol_id:Ig.id,symbol_str:Cg,width:tg,height:ig},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}}return{...Ig,common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"}}});leftAsideStore.config.set(Ag,eg)}}),_hoisted_1$u=["src"],_sfc_main$x=vue.defineComponent({__name:"index",props:{symbolId:{},symbolStr:{},width:{},height:{},props:{}},setup(Ag){const gg=Ag,eg=vue.computed(()=>svgToImgSrc(symbolGenSvg(gg.symbolId,gg.symbolStr,gg.width,gg.height,genDomPropstr(gg.props))));return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("img",{class:"w-1/1 h-1/1",src:eg.value},null,8,_hoisted_1$u))}}),_hoisted_1$t={class:"mt-group"},_hoisted_2$i=["id"],_sfc_main$w=vue.defineComponent({__name:"index",props:{itemJson:{},grid:{},canvasCfg:{},canvasDom:{}},setup(Ag){vue.useCssVars(eg=>({cebe1efc:gg.itemJson.binfo.left+"px",v233fe8b0:gg.itemJson.binfo.top+"px",v37317152:gg.itemJson.binfo.width+"px",v39c959e2:gg.itemJson.binfo.height+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$t,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(gg.itemJson.children,Cg=>(vue.openBlock(),vue.createElementBlock("div",{class:"absolute",key:Cg.id,id:Cg.id,style:vue.normalizeStyle({left:Cg.binfo.left+"%",top:Cg.binfo.top+"%",width:Cg.binfo.width+"%",height:Cg.binfo.height+"%",transform:`rotate(${Cg.binfo.angle}deg)`})},[vue.createVNode(_sfc_main$t,{"item-json":Cg,grid:gg.grid,"canvas-cfg":gg.canvasCfg,"canvas-dom":gg.canvasDom,"lock-state":!1},null,8,["item-json","grid","canvas-cfg","canvas-dom"])],12,_hoisted_2$i))),128))]))}}),index_vue_vue_type_style_index_0_scoped_d359f9ac_lang="",GroupRender=_export_sfc(_sfc_main$w,[["__scopeId","data-v-d359f9ac"]]),_hoisted_1$s=["id"],_hoisted_2$h=["fill"],_hoisted_3$f=["id"],_hoisted_4$9=["fill"],_hoisted_5$7=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],_hoisted_6$7=["from","to","dur"],_hoisted_7$5=["d","stroke-width","marker-start","marker-end"],_hoisted_8$4=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_9$3=["from","to","dur"],_hoisted_10$3=["r","fill"],_hoisted_11$3=["path","dur"],_hoisted_12$1={key:2},_hoisted_13=["cx","cy","stroke","onMousedown","onTouchstartPassive"],_hoisted_14={key:3},_hoisted_15=["id","cx","cy","stroke","onMousedown","onTouchstartPassive"],_sfc_main$v=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},doneJson:{},lockState:{type:Boolean},mode:{default:"normal"}},emits:["update:itemJson","setIntention","lineMouseUp"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=configStore.lineRenderOffset;vue.computed(()=>!eg.grid.align||!eg.grid.enabled?1:eg.grid.size);const tg=vue.ref(),ig=(lg,og,sg,rg)=>{if(eg.lockState)return;if(lg.stopPropagation(),eg.mode==="line-edit"&&sg=="edit"&&og!==0&&og!==eg.itemJson.props.point_position.val.length-1){const Gg=eg.itemJson.props.point_position.val;Gg.splice(og,1),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Gg}}});return}const{x:cg,y:ag}=rg,ug=lg instanceof MouseEvent?lg.clientX:lg.touches[0].pageX,dg=lg instanceof MouseEvent?lg.clientY:lg.touches[0].pageY;let hg=0,bg=0,mg=!0;const Zg=Gg=>{const pg=Gg instanceof MouseEvent?Gg.clientX:Gg.touches[0].pageX,fg=Gg instanceof MouseEvent?Gg.clientY:Gg.touches[0].pageY,Vg=lg.ctrlKey?0:alignToGrid((pg-ug)/eg.canvasCfg.scale,1),Wg=lg.shiftKey?0:alignToGrid((fg-dg)/eg.canvasCfg.scale,1);if(hg=cg+Vg,bg=ag+Wg,sg==="add")if(rg.x=hg,rg.y=bg,mg){const Hg=eg.itemJson.props.point_position.val;Hg.splice(og+1,0,{x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}}),mg=!1}else{const Hg=eg.itemJson.props.point_position.val;Hg[og+1]={x:hg,y:bg},Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}})}if(sg==="edit"){const Hg=eg.itemJson.props.point_position.val;if(og===0){if(Ig("setIntention","adsorbStart"),eg.mode==="line-edit"&&mg){const Sg=eg.itemJson.props.point_position.val;Sg.unshift({x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Sg}}}),mg=!1;return}}else if(og===Hg.length-1&&(Ig("setIntention","adsorbEnd"),eg.mode==="line-edit"&&mg)){const Sg=eg.itemJson.props.point_position.val;Sg.push({x:hg,y:bg}),Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Sg}}}),og+=1,mg=!1;return}Hg[og].x=hg,Hg[og].y=bg,Ig("update:itemJson",{...eg.itemJson,props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:Hg}}})}},Bg=()=>{document.removeEventListener("mousemove",Zg),document.removeEventListener("mouseup",Bg),document.removeEventListener("touchmove",Zg),document.removeEventListener("touchend",Bg);const Gg=document.querySelector(`#${eg.itemJson.id} g .real`).getBoundingClientRect(),pg=eg.canvasDom.getBoundingClientRect(),fg=((Gg==null?void 0:Gg.left)-(pg==null?void 0:pg.left))/eg.canvasCfg.scale,Vg=((Gg==null?void 0:Gg.top)-(pg==null?void 0:pg.top))/eg.canvasCfg.scale,Wg=fg-eg.itemJson.binfo.left,Hg=Vg-eg.itemJson.binfo.top;Ig("setIntention","none"),Ig("update:itemJson",{...eg.itemJson,binfo:{...eg.itemJson.binfo,left:fg,top:Vg,width:(Gg==null?void 0:Gg.width)/eg.canvasCfg.scale,height:(Gg==null?void 0:Gg.height)/eg.canvasCfg.scale},props:{...eg.itemJson.props,point_position:{...eg.itemJson.props.point_position,val:eg.itemJson.props.point_position.val.map(Sg=>({x:Sg.x-Wg,y:Sg.y-Hg}))}}})};document.addEventListener("mousemove",Zg),document.addEventListener("mouseup",Bg),document.addEventListener("touchmove",Zg),document.addEventListener("touchend",Bg),Ig("lineMouseUp")},ng=lg=>{const og=[];return lg.forEach((sg,rg)=>{if(rg===lg.length-1)return;const cg=getCenterXY(sg.x,sg.y,lg[rg+1].x,lg[rg+1].y);og.push(cg)}),og};return vue.watch(()=>eg.itemJson.props.point_position.val,lg=>{tg.value=ng(lg)},{immediate:!0,deep:!0}),(lg,og)=>{var sg,rg,cg,ag,ug,dg,hg,bg;return vue.openBlock(),vue.createElementBlock("svg",{class:"mt-line-render",style:vue.normalizeStyle({position:"absolute",left:`${-eg.itemJson.binfo.left-vue.unref(Cg)}px`,top:`${-eg.itemJson.binfo.top-vue.unref(Cg)}px`,width:`${eg.canvasCfg.width+vue.unref(Cg)}px`,height:`${eg.canvasCfg.height+vue.unref(Cg)}px`}),version:"1.1",xmlns:"http://www.w3.org/2000/svg","pointer-events":"none"},[vue.createElementVNode("g",null,[vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"markerArrowStart"+eg.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:eg.itemJson.props.stroke.val},null,8,_hoisted_2$h)],8,_hoisted_1$s),vue.createElementVNode("marker",{id:"markerArrowEnd"+eg.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:eg.itemJson.props.stroke.val},null,8,_hoisted_4$9)],8,_hoisted_3$f)]),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),"pointer-events":"visibleStroke",fill:"none",stroke:eg.itemJson.props.ani_type.val==="electricity"?eg.itemJson.props.ani_color.val:eg.itemJson.props.stroke.val,"stroke-width":eg.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":eg.itemJson.props.ani_type.val==="electricity"?eg.itemJson.props["stroke-width"].val*3:0,"marker-start":(rg=(sg=eg.itemJson.props)==null?void 0:sg["marker-start"])!=null&&rg.val?`url(#markerArrowStart${eg.itemJson.id})`:"","marker-end":(ag=(cg=eg.itemJson.props)==null?void 0:cg["marker-end"])!=null&&ag.val?`url(#markerArrowEnd${eg.itemJson.id})`:"",class:"real"},[eg.itemJson.props.ani_type.val==="electricity"?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:eg.itemJson.props.ani_reverse.val?0:1e3,to:eg.itemJson.props.ani_reverse.val?eg.itemJson.props.ani_play.val?1e3:0:eg.itemJson.props.ani_play.val?0:1e3,dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_6$7)):vue.createCommentVNode("",!0)],8,_hoisted_5$7),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),"pointer-events":"visibleStroke",fill:"none",stroke:"transparent","stroke-width":eg.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","marker-start":(dg=(ug=eg.itemJson.props)==null?void 0:ug["marker-start"])!=null&&dg.val?`url(#markerArrowStart${eg.itemJson.id})`:"","marker-end":(bg=(hg=eg.itemJson.props)==null?void 0:hg["marker-end"])!=null&&bg.val?`url(#markerArrowEnd${eg.itemJson.id})`:""},null,8,_hoisted_7$5),eg.itemJson.props.ani_type.val==="waterdrop"?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),fill:"none","fill-opacity":"0",stroke:eg.itemJson.props.ani_color.val,"stroke-width":eg.itemJson.props["stroke-width"].val,"stroke-dasharray":eg.itemJson.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:eg.itemJson.props.ani_reverse.val?0:1e3,to:eg.itemJson.props.ani_reverse.val?eg.itemJson.props.ani_play.val?1e3:0:eg.itemJson.props.ani_play.val?0:1e3,dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite",fill:"freeze"},null,8,_hoisted_9$3)],8,_hoisted_8$4)):eg.itemJson.props.ani_type.val==="track"?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:eg.itemJson.props["stroke-width"].val*2,fill:eg.itemJson.props.ani_color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrarToPath)(eg.itemJson.props.point_position.val,eg.itemJson.binfo.left+vue.unref(Cg),eg.itemJson.binfo.top+vue.unref(Cg)),dur:`${eg.itemJson.props.ani_dur.val<1?1:eg.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_11$3)],8,_hoisted_10$3)):vue.createCommentVNode("",!0),eg.itemJson.active?(vue.openBlock(),vue.createElementBlock("g",_hoisted_12$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,(mg,Zg)=>(vue.openBlock(),vue.createElementBlock("circle",{key:Zg,"pointer-events":"fill",cx:mg.x+eg.itemJson.binfo.left+vue.unref(Cg),cy:mg.y+eg.itemJson.binfo.top+vue.unref(Cg),r:"4","stroke-width":"2",stroke:eg.itemJson.props.stroke.val,fill:"transparent",class:"cursor-crosshair opacity-30",onMousedown:Bg=>ig(Bg,Zg,"add",mg),onTouchstartPassive:Bg=>ig(Bg,Zg,"add",mg)},null,40,_hoisted_13))),128))])):vue.createCommentVNode("",!0),eg.itemJson.active?(vue.openBlock(),vue.createElementBlock("g",_hoisted_14,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.itemJson.props.point_position.val,(mg,Zg)=>(vue.openBlock(),vue.createElementBlock("circle",{key:Zg,"pointer-events":"fill",id:`point-${eg.itemJson.id}-${Zg}`,cx:mg.x+eg.itemJson.binfo.left+vue.unref(Cg),cy:mg.y+eg.itemJson.binfo.top+vue.unref(Cg),r:"4","stroke-width":"1",stroke:eg.itemJson.props.stroke.val,fill:"#fff",class:vue.normalizeClass(eg.mode==="line-edit"&&Zg!==0&&Zg!==eg.itemJson.props.point_position.val.length-1?"cursor-remove":"cursor-pointer"),onMousedown:Bg=>ig(Bg,Zg,"edit",mg),onTouchstartPassive:Bg=>ig(Bg,Zg,"edit",mg)},null,42,_hoisted_15))),128))])):vue.createCommentVNode("",!0)])],4)}}}),index_vue_vue_type_style_index_0_scoped_d5d8fc1c_lang="",LineRender=_export_sfc(_sfc_main$v,[["__scopeId","data-v-d5d8fc1c"]]);/**
|
|
67
67
|
* @vue/server-renderer v3.5.32
|
|
68
68
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
69
69
|
* @license MIT
|
|
70
70
|
**/const shouldIgnoreProp=makeMap(",key,ref,innerHTML,textContent,ref_key,ref_for");function ssrRenderAttrs(Ag,gg){let eg="";for(let Ig in Ag){if(shouldIgnoreProp(Ig)||isOn(Ig)||gg==="textarea"&&Ig==="value"||Ig.startsWith("."))continue;const Cg=Ag[Ig];Ig.startsWith("^")&&(Ig=Ig.slice(1)),Ig==="class"?eg+=` class="${ssrRenderClass(Cg)}"`:Ig==="style"?eg+=` style="${ssrRenderStyle(Cg)}"`:Ig==="className"?Cg!=null&&(eg+=` class="${escapeHtml(String(Cg))}"`):eg+=ssrRenderDynamicAttr(Ig,Cg,gg)}return eg}function ssrRenderDynamicAttr(Ag,gg,eg){if(!isRenderableAttrValue(gg))return"";const Ig=eg&&(eg.indexOf("-")>0||isSVGTag(eg))?Ag:propsToAttrMap[Ag]||Ag.toLowerCase();return isBooleanAttr(Ig)?includeBooleanAttr(gg)?` ${Ig}`:"":isSSRSafeAttrName(Ig)?gg===""?` ${Ig}`:` ${Ig}="${escapeHtml(gg)}"`:(console.warn(`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${Ig}`),"")}function ssrRenderClass(Ag){return escapeHtml(normalizeClass(Ag))}function ssrRenderStyle(Ag){if(!Ag)return"";if(isString(Ag))return escapeHtml(Ag);const gg=normalizeStyle(ssrResetCssVars(Ag));return escapeHtml(stringifyStyle(gg))}function ssrResetCssVars(Ag){if(!isArray$4(Ag)&&isObject$h(Ag)){const gg={};for(const eg in Ag)eg.startsWith(":--")?gg[eg.slice(1)]=normalizeCssVarValue(Ag[eg]):gg[eg]=Ag[eg];return gg}return Ag}function ssrRenderTeleport(Ag,gg,eg,Ig,Cg){Ag("<!--teleport start-->");const tg=Cg.appContext.provides[vue.ssrContextKey],ig=tg.__teleportBuffers||(tg.__teleportBuffers={}),ng=ig[eg]||(ig[eg]=[]),lg=ng.length;let og;if(Ig)gg(Ag),og="<!--teleport start anchor--><!--teleport anchor-->";else{const{getBuffer:sg,push:rg}=createBuffer();rg("<!--teleport start anchor-->"),gg(rg),rg("<!--teleport anchor-->"),og=sg()}ng.splice(lg,0,og),Ag("<!--teleport end-->")}function toRaw(Ag){const gg=Ag&&Ag.__v_raw;return gg?toRaw(gg):Ag}function isRef(Ag){return Ag?Ag.__v_isRef===!0:!1}const stack=[];function pushWarningContext$1(Ag){stack.push(Ag)}function popWarningContext$1(){stack.pop()}let isWarning=!1;function warn$1(Ag,...gg){if(isWarning)return;isWarning=!0;const eg=stack.length?stack[stack.length-1].component:null,Ig=eg&&eg.appContext.config.warnHandler,Cg=getComponentTrace();if(Ig)callWithErrorHandling(Ig,eg,11,[Ag+gg.map(tg=>{var ig,ng;return(ng=(ig=tg.toString)==null?void 0:ig.call(tg))!=null?ng:JSON.stringify(tg)}).join(""),eg&&eg.proxy,Cg.map(({vnode:tg})=>`at <${formatComponentName(eg,tg.type)}>`).join(`
|
|
71
71
|
`),Cg]);else{const tg=[`[Vue warn]: ${Ag}`,...gg];Cg.length&&tg.push(`
|
|
72
72
|
`,...formatTrace(Cg)),console.warn(...tg)}isWarning=!1}function getComponentTrace(){let Ag=stack[stack.length-1];if(!Ag)return[];const gg=[];for(;Ag;){const eg=gg[0];eg&&eg.vnode===Ag?eg.recurseCount++:gg.push({vnode:Ag,recurseCount:0});const Ig=Ag.component&&Ag.component.parent;Ag=Ig&&Ig.vnode}return gg}function formatTrace(Ag){const gg=[];return Ag.forEach((eg,Ig)=>{gg.push(...Ig===0?[]:[`
|
|
73
|
-
`],...formatTraceEntry(eg))}),gg}function formatTraceEntry({vnode:Ag,recurseCount:gg}){const eg=gg>0?`... (${gg} recursive calls)`:"",Ig=Ag.component?Ag.component.parent==null:!1,Cg=` at <${formatComponentName(Ag.component,Ag.type,Ig)}`,tg=">"+eg;return Ag.props?[Cg,...formatProps(Ag.props),tg]:[Cg+tg]}function formatProps(Ag){const gg=[],eg=Object.keys(Ag);return eg.slice(0,3).forEach(Ig=>{gg.push(...formatProp(Ig,Ag[Ig]))}),eg.length>3&&gg.push(" ..."),gg}function formatProp(Ag,gg,eg){return isString(gg)?(gg=JSON.stringify(gg),eg?gg:[`${Ag}=${gg}`]):typeof gg=="number"||typeof gg=="boolean"||gg==null?eg?gg:[`${Ag}=${gg}`]:isRef(gg)?(gg=formatProp(Ag,toRaw(gg.value),!0),eg?gg:[`${Ag}=Ref<`,gg,">"]):isFunction$1(gg)?[`${Ag}=fn${gg.name?`<${gg.name}>`:""}`]:(gg=toRaw(gg),eg?gg:[`${Ag}=`,gg])}const ErrorTypeStrings={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function callWithErrorHandling(Ag,gg,eg,Ig){try{return Ig?Ag(...Ig):Ag()}catch(Cg){handleError(Cg,gg,eg)}}function handleError(Ag,gg,eg,Ig=!0){const Cg=gg?gg.vnode:null,{errorHandler:tg,throwUnhandledErrorInProduction:ig}=gg&&gg.appContext.config||EMPTY_OBJ;if(gg){let ng=gg.parent;const lg=gg.proxy,og=process.env.NODE_ENV!=="production"?ErrorTypeStrings[eg]:`https://vuejs.org/error-reference/#runtime-${eg}`;for(;ng;){const sg=ng.ec;if(sg){for(let rg=0;rg<sg.length;rg++)if(sg[rg](Ag,lg,og)===!1)return}ng=ng.parent}if(tg){callWithErrorHandling(tg,null,10,[Ag,lg,og]);return}}logError(Ag,eg,Cg,Ig,ig)}function logError(Ag,gg,eg,Ig=!0,Cg=!1){if(process.env.NODE_ENV!=="production"){const tg=ErrorTypeStrings[gg];if(eg&&pushWarningContext$1(eg),warn$1(`Unhandled error${tg?` during execution of ${tg}`:""}`),eg&&popWarningContext$1(),Ig)throw Ag;console.error(Ag)}else{if(Cg)throw Ag;console.error(Ag)}}let devtools,buffer=[];function setDevtoolsHook(Ag,gg){var eg,Ig;devtools=Ag,devtools?(devtools.enabled=!0,buffer.forEach(({event:Cg,args:tg})=>devtools.emit(Cg,...tg)),buffer=[]):typeof window<"u"&&window.HTMLElement&&!((Ig=(eg=window.navigator)==null?void 0:eg.userAgent)!=null&&Ig.includes("jsdom"))?((gg.__VUE_DEVTOOLS_HOOK_REPLAY__=gg.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(tg=>{setDevtoolsHook(tg,gg)}),setTimeout(()=>{devtools||(gg.__VUE_DEVTOOLS_HOOK_REPLAY__=null,buffer=[])},3e3)):buffer=[]}{const Ag=getGlobalThis(),gg=(eg,Ig)=>{let Cg;return(Cg=Ag[eg])||(Cg=Ag[eg]=[]),Cg.push(Ig),tg=>{Cg.length>1?Cg.forEach(ig=>ig(tg)):Cg[0](tg)}};gg("__VUE_INSTANCE_SETTERS__",eg=>eg),gg("__VUE_SSR_SETTERS__",eg=>eg)}process.env.NODE_ENV;const classifyRE=/(?:^|[-_])\w/g,classify=Ag=>Ag.replace(classifyRE,gg=>gg.toUpperCase()).replace(/[-_]/g,"");function getComponentName(Ag,gg=!0){return isFunction$1(Ag)?Ag.displayName||Ag.name:Ag.name||gg&&Ag.__name}function formatComponentName(Ag,gg,eg=!1){let Ig=getComponentName(gg);if(!Ig&&gg.__file){const Cg=gg.__file.match(/([^/\\]+)\.\w+$/);Cg&&(Ig=Cg[1])}if(!Ig&&Ag){const Cg=tg=>{for(const ig in tg)if(tg[ig]===gg)return ig};Ig=Cg(Ag.components)||Ag.parent&&Cg(Ag.parent.type.components)||Cg(Ag.appContext.components)}return Ig?classify(Ig):eg?"App":"Anonymous"}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function ssrCompile(Ag,gg){throw new Error("On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.")}const{createComponentInstance,setCurrentRenderingInstance,setupComponent,renderComponentRoot,normalizeVNode,pushWarningContext,popWarningContext}=vue.ssrUtils;function createBuffer(){let Ag=!1;const gg=[];return{getBuffer(){return gg},push(eg){const Ig=isString(eg);if(Ag&&Ig){gg[gg.length-1]+=eg;return}gg.push(eg),Ag=Ig,(isPromise(eg)||isArray$4(eg)&&eg.hasAsync)&&(gg.hasAsync=!0)}}}function renderComponentVNode(Ag,gg=null,eg){const Ig=Ag.component=createComponentInstance(Ag,gg,null);process.env.NODE_ENV!=="production"&&pushWarningContext(Ag);const Cg=setupComponent(Ig,!0);process.env.NODE_ENV!=="production"&&popWarningContext();const tg=isPromise(Cg);let ig=Ig.sp;return tg||ig?Promise.resolve(Cg).then(()=>{if(tg&&(ig=Ig.sp),ig)return Promise.all(ig.map(lg=>lg.call(Ig.proxy)))}).catch(NOOP).then(()=>renderComponentSubTree(Ig,eg)):renderComponentSubTree(Ig,eg)}function renderComponentSubTree(Ag,gg){process.env.NODE_ENV!=="production"&&pushWarningContext(Ag.vnode);const eg=Ag.type,{getBuffer:Ig,push:Cg}=createBuffer();if(isFunction$1(eg)){let tg=renderComponentRoot(Ag);if(!eg.props)for(const ig in Ag.attrs)ig.startsWith("data-v-")&&((tg.props||(tg.props={}))[ig]="");renderVNode(Cg,Ag.subTree=tg,Ag,gg)}else{(!Ag.render||Ag.render===NOOP)&&!Ag.ssrRender&&!eg.ssrRender&&isString(eg.template)&&(eg.ssrRender=ssrCompile(eg.template));const tg=Ag.ssrRender||eg.ssrRender;if(tg){let ig=Ag.inheritAttrs!==!1?Ag.attrs:void 0,ng=!1,lg=Ag;for(;;){const sg=lg.vnode.scopeId;sg&&(ng||(ig={...ig},ng=!0),ig[sg]="");const rg=lg.parent;if(rg&&rg.subTree&&rg.subTree===lg.vnode)lg=rg;else break}if(gg){ng||(ig={...ig});const sg=gg.trim().split(" ");for(let rg=0;rg<sg.length;rg++)ig[sg[rg]]=""}const og=setCurrentRenderingInstance(Ag);try{tg(Ag.proxy,Cg,Ag,ig,Ag.props,Ag.setupState,Ag.data,Ag.ctx)}finally{setCurrentRenderingInstance(og)}}else if(Ag.render&&Ag.render!==NOOP)renderVNode(Cg,Ag.subTree=renderComponentRoot(Ag),Ag,gg);else{const ig=eg.name||eg.__file||"<Anonymous>";vue.warn(`Component ${ig} is missing template or render function.`),Cg("<!---->")}}return process.env.NODE_ENV!=="production"&&popWarningContext(),Ig()}function renderVNode(Ag,gg,eg,Ig){const{type:Cg,shapeFlag:tg,children:ig,dirs:ng,props:lg}=gg;switch(ng&&(gg.props=applySSRDirectives(gg,lg,ng)),Cg){case vue.Text:Ag(escapeHtml(ig));break;case vue.Comment:Ag(ig?`<!--${escapeHtmlComment(ig)}-->`:"<!---->");break;case vue.Static:Ag(ig);break;case vue.Fragment:gg.slotScopeIds&&(Ig=(Ig?Ig+" ":"")+gg.slotScopeIds.join(" ")),Ag("<!--[-->"),renderVNodeChildren(Ag,ig,eg,Ig),Ag("<!--]-->");break;default:tg&1?renderElementVNode(Ag,gg,eg,Ig):tg&6?Ag(renderComponentVNode(gg,eg,Ig)):tg&64?renderTeleportVNode(Ag,gg,eg,Ig):tg&128?renderVNode(Ag,gg.ssContent,eg,Ig):vue.warn("[@vue/server-renderer] Invalid VNode type:",Cg,`(${typeof Cg})`)}}function renderVNodeChildren(Ag,gg,eg,Ig){for(let Cg=0;Cg<gg.length;Cg++)renderVNode(Ag,normalizeVNode(gg[Cg]),eg,Ig)}function renderElementVNode(Ag,gg,eg,Ig){const Cg=gg.type;let{props:tg,children:ig,shapeFlag:ng,scopeId:lg}=gg,og=`<${Cg}`;tg&&(og+=ssrRenderAttrs(tg,Cg)),lg&&(og+=` ${lg}`);let sg=eg,rg=gg;for(;sg&&rg===sg.subTree;)rg=sg.vnode,rg.scopeId&&(og+=` ${rg.scopeId}`),sg=sg.parent;if(Ig&&(og+=` ${Ig}`),Ag(og+">"),!isVoidTag(Cg)){let cg=!1;tg&&(tg.innerHTML?(cg=!0,Ag(tg.innerHTML)):tg.textContent?(cg=!0,Ag(escapeHtml(tg.textContent))):Cg==="textarea"&&tg.value&&(cg=!0,Ag(escapeHtml(tg.value)))),cg||(ng&8?Ag(escapeHtml(ig)):ng&16&&renderVNodeChildren(Ag,ig,eg,Ig)),Ag(`</${Cg}>`)}}function applySSRDirectives(Ag,gg,eg){const Ig=[];for(let Cg=0;Cg<eg.length;Cg++){const tg=eg[Cg],{dir:{getSSRProps:ig}}=tg;if(ig){const ng=ig(tg,Ag);ng&&Ig.push(ng)}}return vue.mergeProps(gg||{},...Ig)}function renderTeleportVNode(Ag,gg,eg,Ig){const Cg=gg.props&&gg.props.to,tg=gg.props&&gg.props.disabled;if(!Cg)return tg||vue.warn("[@vue/server-renderer] Teleport is missing target prop."),[];if(!isString(Cg))return vue.warn("[@vue/server-renderer] Teleport target must be a query selector string."),[];ssrRenderTeleport(Ag,ig=>{renderVNodeChildren(ig,gg.children,eg,Ig)},Cg,tg||tg==="",eg)}const{isVNode:isVNode$1}=vue.ssrUtils;function nestedUnrollBuffer(Ag,gg,eg){if(!Ag.hasAsync)return gg+unrollBufferSync$1(Ag);let Ig=gg;for(let Cg=eg;Cg<Ag.length;Cg+=1){const tg=Ag[Cg];if(isString(tg)){Ig+=tg;continue}if(isPromise(tg))return tg.then(ng=>(Ag[Cg]=ng,nestedUnrollBuffer(Ag,Ig,Cg)));const ig=nestedUnrollBuffer(tg,Ig,0);if(isPromise(ig))return ig.then(ng=>(Ag[Cg]=ng,nestedUnrollBuffer(Ag,"",Cg)));Ig=ig}return Ig}function unrollBuffer$1(Ag){return nestedUnrollBuffer(Ag,"",0)}function unrollBufferSync$1(Ag){let gg="";for(let eg=0;eg<Ag.length;eg++){let Ig=Ag[eg];isString(Ig)?gg+=Ig:gg+=unrollBufferSync$1(Ig)}return gg}async function renderToString(Ag,gg={}){if(isVNode$1(Ag))return renderToString(vue.createApp({render:()=>Ag}),gg);const eg=vue.createVNode(Ag._component,Ag._props);eg.appContext=Ag._context,Ag.provide(vue.ssrContextKey,gg);const Ig=await renderComponentVNode(eg),Cg=await unrollBuffer$1(Ig);if(await resolveTeleports(gg),gg.__watcherHandles)for(const tg of gg.__watcherHandles)tg();return Cg}async function resolveTeleports(Ag){if(Ag.__teleportBuffers){Ag.teleports=Ag.teleports||{};for(const gg in Ag.__teleportBuffers)Ag.teleports[gg]=await unrollBuffer$1(await Promise.all([Ag.__teleportBuffers[gg]]))}}vue.initDirectivesForSSR();const _hoisted_1$r=["src"],_sfc_main$u=vue.defineComponent({__name:"index",setup(Ag){const gg=vue.ref(""),eg=vue.useSlots(),Ig=async()=>{const Cg=eg.default?eg.default():[],tg=await renderToString(Cg[0]);gg.value=svgToImgSrc(tg)};return vue.onMounted(async()=>{await Ig()}),vue.watch(()=>eg.default(),async()=>{await Ig()},{deep:!0}),(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("img",{draggable:"false",class:"w-1/1 h-1/1",src:gg.value},null,8,_hoisted_1$r))}}),_hoisted_1$q={class:"w-1/1 h-1/1"},_hoisted_2$g=["src"],_sfc_main$t=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},doneJson:{default:()=>[]},lockState:{type:Boolean},lineAppendEnable:{type:Boolean,default:!1}},emits:["update:itemJson","setIntention","lineMouseUp"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed({get:()=>eg.itemJson,set:ig=>{Ig("update:itemJson",ig)}}),tg=(ig,ng)=>{ig.modelValue&&Ig("update:itemJson",{...Cg.value,props:{...Cg.value.props,modelValue:{...Cg.value.props.modelValue,val:ng}}})};return(ig,ng)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$q,[Cg.value.type==="svg"?(vue.openBlock(),vue.createBlock(_sfc_main$x,{key:0,draggable:"false","symbol-id":Cg.value.symbol.symbol_id,"symbol-str":Cg.value.symbol.symbol_str,width:Cg.value.symbol.width,height:Cg.value.symbol.height,props:Cg.value.props},null,8,["symbol-id","symbol-str","width","height","props"])):Cg.value.type==="group"?(vue.openBlock(),vue.createBlock(GroupRender,{key:1,"item-json":Cg.value,grid:eg.grid,"canvas-cfg":eg.canvasCfg,"canvas-dom":eg.canvasDom},null,8,["item-json","grid","canvas-cfg","canvas-dom"])):Cg.value.type==="vue"?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Cg.value.tag),vue.mergeProps({key:2,draggable:"false"},vue.unref(prosToVBind)(Cg.value.props),{"onUpdate:modelValue":ng[0]||(ng[0]=lg=>tg(Cg.value.props,lg))}),null,16)):Cg.value.type==="img"?(vue.openBlock(),vue.createElementBlock("img",{key:3,draggable:"false",class:"w-1/1 h-1/1",src:Cg.value.thumbnail},null,8,_hoisted_2$g)):Cg.value.type==="custom-svg"?(vue.openBlock(),vue.createBlock(_sfc_main$u,{key:4},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Cg.value.tag),vue.mergeProps(vue.unref(prosToVBind)(Cg.value.props),{id:Cg.value.id}),null,16,["id"]))]),_:1})):Cg.value.type==="sys-line"?(vue.openBlock(),vue.createBlock(LineRender,{key:5,"item-json":Cg.value,"onUpdate:itemJson":ng[1]||(ng[1]=lg=>Cg.value=lg),"canvas-cfg":eg.canvasCfg,grid:eg.grid,"canvas-dom":eg.canvasDom,"done-json":eg.doneJson,"lock-state":eg.lockState,mode:eg.lineAppendEnable?"line-edit":"normal",onSetIntention:ng[2]||(ng[2]=lg=>Ig("setIntention",lg)),onLineMouseUp:ng[3]||(ng[3]=lg=>Ig("lineMouseUp"))},null,8,["item-json","canvas-cfg","grid","canvas-dom","done-json","lock-state","mode"])):vue.createCommentVNode("",!0)]))}}),cacheStore=vue.reactive({boundingBox:[],setBoundingBox:Ag=>{cacheStore.boundingBox=Ag},adsorbPoint:[],setAdsorbPoint(Ag){cacheStore.adsorbPoint=Ag},copy:[],setCopy(Ag){cacheStore.copy=Ag},history:[[]],historyIndex:0,addHistory(Ag){vue.nextTick(()=>{cacheStore.historyIndex+1<cacheStore.history.length&&cacheStore.history.splice(cacheStore.historyIndex+1),cacheStore.history.push(objectDeepClone(Ag)),cacheStore.historyIndex=cacheStore.history.length-1,cacheStore.history.length>20&&(cacheStore.history.shift(),cacheStore.historyIndex=cacheStore.history.length-1)})}}),_sfc_main$s=vue.defineComponent({__name:"index",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""},vertical:{type:Boolean,default:!1}},setup(Ag){const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("p",{class:vue.normalizeClass(["break-words w-1/1 h-1/1",gg.vertical?"text-vertical":""]),style:vue.normalizeStyle({fontFamily:gg.fontFamily,fontSize:gg.fontSize+"px",color:gg.fill})},vue.toDisplayString(gg.text),7))}}),index_vue_vue_type_style_index_0_scoped_cef6b2df_lang="",TextVue=_export_sfc(_sfc_main$s,[["__scopeId","data-v-cef6b2df"]]),_hoisted_1$p={class:"w-1/1 h-1/1 flex justify-center items-center custom-card"},_sfc_main$r=vue.defineComponent({__name:"index",props:{shadow:{type:String,default:""},backGroundColor:{type:String,default:"#ffffff"},boxShadow:{type:String,default:"#ffffff"}},setup(Ag){vue.useCssVars(eg=>({v138f13ac:`0px 0px 12px ${eg.$props.boxShadow}`}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$p,[vue.createVNode(vue.unref(ElCard),{class:"w-95/100 h-95/100",shadow:gg.shadow,style:vue.normalizeStyle({"background-color":gg.backGroundColor})},null,8,["shadow","style"])]))}}),index_vue_vue_type_style_index_0_lang$1="",_hoisted_1$o={class:"flex"},_sfc_main$q=vue.defineComponent({__name:"index",props:{fontColor:{type:String,default:"#000000"},dateSize:{type:Number,default:12},weekSize:{type:Number,default:12},timeSize:{type:Number,default:24}},setup(Ag){const gg=Ag,eg=vue.ref(new Date),Ig=vue.ref(),Cg=vue.computed(()=>{const ng=eg.value.getFullYear(),lg=eg.value.getMonth()+1,og=eg.value.getDate();return ng.toString()+"年"+lg.toString()+"月"+og.toString()+"日"}),tg=vue.computed(()=>{const ng=eg.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][ng]}),ig=vue.computed(()=>{const ng=eg.value.getHours(),lg=eg.value.getMinutes(),og=eg.value.getSeconds();return(ng<10?"0"+ng.toString():ng.toString())+":"+(lg<10?"0"+lg.toString():lg.toString())+":"+(og<10?"0"+og.toString():og.toString())});return vue.onMounted(()=>{Ig.value=setInterval(()=>{eg.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(Ig.value)}),(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$o,[vue.createElementVNode("div",{class:"font-bold",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.dateSize}px`})},vue.toDisplayString(Cg.value),5),vue.createElementVNode("div",{class:"font-bold ml-5px",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.weekSize}px `})},vue.toDisplayString(tg.value),5)]),vue.createElementVNode("div",{class:"font-bold mt-5px ml-5px",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.timeSize}px `})},vue.toDisplayString(ig.value),5)]))}}),_hoisted_1$n={class:"w-1/1 h-1/1 kvTable"},_hoisted_2$f={class:"kvKey kvKeyValue",colspan:"1"},_hoisted_3$e={class:"kvValue kvKeyValue",colspan:"1"},_sfc_main$p=vue.defineComponent({__name:"index",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},label:{type:String,default:""},labelWidth:{type:Number,default:50},value:{type:String,default:""},valueWidth:{type:Number,default:50},color:{type:String,default:""},border:{type:Boolean,default:!0},borderColor:{type:String,default:""}},setup(Ag){vue.useCssVars(eg=>({v7f505933:`${gg.border?1:0}px solid ${gg.borderColor}`,v52fbad19:`${gg.fontSize}px`,v4f5c51c4:`${gg.fontFamily}`,v2cd2a6f8:`${gg.color}`,v1e69a24a:`${gg.labelWidth}px`,v09d9875d:`${gg.border?1:0}px`,v27cd9bac:`${gg.borderColor}`,v9ea2ce04:`${gg.valueWidth}px`}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("table",_hoisted_1$n,[vue.createElementVNode("tbody",null,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",_hoisted_2$f,vue.toDisplayString(gg.label),1),vue.createElementVNode("td",_hoisted_3$e,vue.toDisplayString(gg.value),1)])])]))}}),index_vue_vue_type_style_index_0_scroped_true_lang="",_hoisted_1$m={style:{width:"100%",height:"100%"}},_sfc_main$o=vue.defineComponent({__name:"index",props:{text:{type:String,default:"按钮文本"},type:{type:String,default:""},round:{type:Boolean,default:!1}},setup(Ag){const gg=Ag,eg=(Ig,Cg)=>{let tg="",ig="4px";return Ig=="primary"?tg="#409eff":Ig=="success"?tg="#67c23a":Ig=="warning"?tg="#e6a23c":Ig=="danger"?tg="#f56c6c":Ig=="info"&&(tg="#909399"),Cg&&(ig="20px"),{backgroundColor:tg,borderRadius:ig}};return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$m,[vue.createElementVNode("button",{class:"w-1/1 h-1/1",style:vue.normalizeStyle(eg(gg.type,gg.round))},[vue.createVNode(vue.unref(ElText),null,{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(gg.text),1)]),_:1})],4)]))}}),_hoisted_1$l={class:"rotor-container"},_hoisted_2$e={class:"rotor-circle"},_hoisted_3$d={class:"rotor-text"},_sfc_main$n=vue.defineComponent({__name:"index",props:{text:{type:String,default:"转子"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:20},borderWidth:{type:Number,default:6}},setup(Ag){vue.useCssVars(eg=>({v7e677b45:gg.borderWidth+"px",v130ce1e1:gg.circleColor,v50bf8f24:gg.textColor,v237eca2b:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$l,[vue.createElementVNode("div",_hoisted_2$e,[Ig[0]||(Ig[0]=vue.createElementVNode("div",{class:"rotor-cross"},[vue.createElementVNode("div",{class:"cross-horizontal"}),vue.createElementVNode("div",{class:"cross-vertical"})],-1)),vue.createElementVNode("span",_hoisted_3$d,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_200211fd_lang="",RotorVue=_export_sfc(_sfc_main$n,[["__scopeId","data-v-200211fd"]]),_hoisted_1$k={class:"cover-container"},_hoisted_2$d={class:"cover-circle"},_hoisted_3$c={class:"cover-text"},_sfc_main$m=vue.defineComponent({__name:"index",props:{text:{type:String,default:"顶盖"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:10},borderWidth:{type:Number,default:4},borderStyle:{type:String,default:"solid"}},setup(Ag){vue.useCssVars(eg=>({c4a87e82:gg.borderWidth+"px",v4bdee219:gg.borderStyle,v1a6271a7:gg.circleColor,v05a2586a:gg.textColor,v625b06f1:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createElementVNode("div",_hoisted_2$d,[vue.createElementVNode("span",_hoisted_3$c,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_f47d1493_lang="",TopcoverVue=_export_sfc(_sfc_main$m,[["__scopeId","data-v-f47d1493"]]),_hoisted_1$j={class:"recttext-container"},_sfc_main$l=vue.defineComponent({__name:"index",props:{text:{type:String,default:"文字"},backgroundColor:{type:String,default:"#ffffff"},borderColor:{type:String,default:"#000000"},borderWidth:{type:Number,default:2},borderStyle:{type:String,default:"solid"},textColor:{type:String,default:"#000000"},fontSize:{type:Number,default:14},borderRadius:{type:Number,default:4}},setup(Ag){const gg=Ag,eg=()=>({backgroundColor:gg.backgroundColor,borderColor:gg.borderColor,borderWidth:`${gg.borderWidth}px`,borderStyle:gg.borderStyle,borderRadius:`${gg.borderRadius}px`}),Ig=()=>({color:gg.textColor,fontSize:`${gg.fontSize}px`});return(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[vue.createElementVNode("div",{class:"recttext-box",style:vue.normalizeStyle(eg())},[vue.createElementVNode("span",{class:"recttext-text",style:vue.normalizeStyle(Ig())},vue.toDisplayString(gg.text),5)],4)]))}}),index_vue_vue_type_style_index_0_scoped_d0feff13_lang="",RecttextVue=_export_sfc(_sfc_main$l,[["__scopeId","data-v-d0feff13"]]),_hoisted_1$i={class:"rotor-container"},_hoisted_2$c={class:"rotor-circle"},_hoisted_3$b={class:"rotor-text"},_sfc_main$k=vue.defineComponent({__name:"index",props:{text:{type:String,default:"机架"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:20},borderWidth:{type:Number,default:6}},setup(Ag){vue.useCssVars(eg=>({v532d7b92:gg.borderWidth+"px",a301b1a2:gg.circleColor,v7efecff2:gg.textColor,f2dc8f0e:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",_hoisted_2$c,[Ig[0]||(Ig[0]=vue.createElementVNode("div",{class:"rotor-cross"},[vue.createElementVNode("div",{class:"cross-horizontal"}),vue.createElementVNode("div",{class:"cross-vertical"})],-1)),vue.createElementVNode("span",_hoisted_3$b,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_b15ecab5_lang="",JijiaVue=_export_sfc(_sfc_main$k,[["__scopeId","data-v-b15ecab5"]]),_hoisted_1$h={class:"panche-container"},_hoisted_2$b={class:"panche-circle"},_hoisted_3$a={class:"panche-text"},_sfc_main$j=vue.defineComponent({__name:"index",props:{text:{type:String,default:"盘车装置"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:10},borderWidth:{type:Number,default:4},borderStyle:{type:String,default:"solid"}},setup(Ag){vue.useCssVars(eg=>({v287a66df:gg.borderWidth+"px",v835e400e:gg.borderStyle,e65720f2:gg.circleColor,v3e3a4e4a:gg.textColor,v2ddb14d1:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$b,[vue.createElementVNode("span",_hoisted_3$a,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_2c60328f_lang="",PancheVue=_export_sfc(_sfc_main$j,[["__scopeId","data-v-2c60328f"]]),_hoisted_1$g={key:0},_sfc_main$i=vue.defineComponent({__name:"index",props:{doneJson:{default:()=>[]},canvasCfg:{},gridCfg:{},showGhostDom:{type:Boolean,default:!0},canvasDom:{},globalLock:{type:Boolean},preivewMode:{type:Boolean,default:!1},lineAppendEnable:{type:Boolean,default:!1},showPopover:{type:Boolean,default:!0}},emits:["update:doneJson","onMouseDown","onItemMove","onMoveMouseUp","onItemMouseEnter","onItemMouseLeave","setIntention","onItemResizeDone","onItemRotateDone","onItemRightClick"],setup(Ag,{emit:gg}){var pg;const eg=vue.getCurrentInstance(),Ig=Object.keys((pg=eg==null?void 0:eg.appContext)==null?void 0:pg.components);Ig.includes("text-vue")||eg==null||eg.appContext.app.component("text-vue",TextVue),Ig.includes("card-vue")||eg==null||eg.appContext.app.component("card-vue",_sfc_main$r),Ig.includes("now-time-vue")||eg==null||eg.appContext.app.component("now-time-vue",_sfc_main$q),Ig.includes("kv-vue")||eg==null||eg.appContext.app.component("kv-vue",_sfc_main$p),Ig.includes("sys-button-vue")||eg==null||eg.appContext.app.component("sys-button-vue",_sfc_main$o),Ig.includes("rotor-vue")||eg==null||eg.appContext.app.component("rotor-vue",RotorVue),Ig.includes("topcover-vue")||eg==null||eg.appContext.app.component("topcover-vue",TopcoverVue),Ig.includes("jijia-vue")||eg==null||eg.appContext.app.component("jijia-vue",JijiaVue),Ig.includes("panche-vue")||eg==null||eg.appContext.app.component("panche-vue",PancheVue),Ig.includes("recttext-vue")||eg==null||eg.appContext.app.component("recttext-vue",RecttextVue);const Cg=Ag,tg=gg,ig=vue.computed(()=>Cg.doneJson.filter(fg=>!fg.isDelete&&!fg.hide)),ng=vue.ref([]),lg=(fg,Vg)=>{ng.value=globalStore.done_json.filter(Wg=>Wg.id!==fg.id).map(Wg=>({id:Wg.id,left:Wg.binfo.left,top:Wg.binfo.top})),Vg.stopPropagation(),tg("onMouseDown",fg,Vg)},og=(fg,Vg)=>{tg("update:doneJson",[...Cg.doneJson.map(Wg=>Wg.id===fg?{...Wg,binfo:Vg}:Wg)])},sg=(fg,Vg)=>{globalStore.setRealTimeData({show:!0,text:`${fg.new_lt.left},${fg.new_lt.top}`}),vue.nextTick(()=>{const Hg={move_item_bounding_info:globalStore.selected_items_id.map(Sg=>{const wg=document.getElementById(Sg);if(!wg)return null;const{left:Xg,top:vg,width:yg,height:Ng,right:Yg,bottom:Kg}=wg.getBoundingClientRect(),Jg=globalStore.done_json.find(Ug=>Ug.id===Sg);return Jg?{id:Sg,type:Jg.type,left:Xg,top:vg,width:yg,height:Ng,right:Yg,bottom:Kg}:null}).filter(Sg=>Sg!==null),move_binfo:fg.move_binfo};if(globalStore.selected_items_id.length>1){const Sg=globalStore.selected_items_id.filter(wg=>wg!==Vg);tg("update:doneJson",[...Cg.doneJson.map(wg=>{if(Sg.includes(wg.id)){const Xg=ng.value.find(vg=>vg.id===wg.id);return{...wg,binfo:{...wg.binfo,left:(Xg==null?void 0:Xg.left)+fg.move_length.x,top:(Xg==null?void 0:Xg.top)+fg.move_length.y}}}return wg})])}tg("onItemMove",Hg)})},rg=()=>{tg("onMoveMouseUp"),globalStore.setRealTimeData({show:!1,text:""})},cg=fg=>!fg.common_animations||!fg.common_animations.val?"":`animate__animated animate__${fg.common_animations.val} animate__${fg.common_animations.speed} animate__${fg.common_animations.repeat} animate__${fg.common_animations.delay}`,ag=(fg,Vg)=>{const Wg=[...Cg.doneJson];Wg[fg]=Vg,tg("update:doneJson",Wg)},ug=(fg,Vg)=>{tg("onItemMouseEnter",fg,Vg)},dg=(fg,Vg)=>{tg("onItemMouseLeave",fg,Vg)},hg=fg=>{globalStore.setRealTimeData({show:!0,text:`${fg==null?void 0:fg.width}x${fg==null?void 0:fg.height}`})},bg=fg=>{tg("onItemResizeDone",fg),globalStore.setRealTimeData({show:!1,text:""})},mg=fg=>{globalStore.setRealTimeData({show:!0,text:`${fg==null?void 0:fg.angle}°`})},Zg=fg=>{globalStore.setRealTimeData({show:!1,text:""}),tg("onItemRotateDone",fg)},Bg=(fg,Vg)=>{tg("onItemRightClick",fg,Vg)},Gg=()=>{setTimeout(()=>{cacheStore.addHistory(globalStore.done_json)},1e3)};return(fg,Vg)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ig.value,(Wg,Hg)=>(vue.openBlock(),vue.createBlock(MtDzr,{id:Wg.id,key:Wg.id,modelValue:Wg.binfo,"onUpdate:modelValue":[Sg=>Wg.binfo=Sg,Sg=>og(Wg.id,Sg)],"scale-ratio":Cg.canvasCfg.scale,grid:Cg.gridCfg,resize:Wg.resize,rotate:Wg.rotate,lock:Cg.globalLock?!0:Wg.lock,active:Cg.preivewMode?!1:Wg.active,useProportionalScaling:Wg.use_proportional_scaling,"show-ghost-dom":Cg.showGhostDom,hide:Wg.hide,disabled:Cg.preivewMode,adsorp_diff:vue.unref(globalStore).adsorp_diff,onMousedown:Sg=>lg(Wg,Sg),onOnItemMove:Sg=>sg(Sg,Wg.id),onMoveMouseUp:Vg[2]||(Vg[2]=Sg=>rg()),onOnMouseEnter:Sg=>ug(Sg,Wg),onOnMouseLeave:Sg=>dg(Sg,Wg),onOnResizeMove:Vg[3]||(Vg[3]=Sg=>hg(Sg)),onOnResizeDone:Sg=>bg(Wg),onOnRotateMove:Vg[4]||(Vg[4]=Sg=>mg(Sg)),onOnRotateDone:Sg=>Zg(Wg),onOnRightClick:Sg=>Bg(Sg,Wg),class:vue.normalizeClass(`${Wg.type=="sys-line"?"pointer-events-none":""} ${cg(Wg)} cursor-pointer`)},{default:vue.withCtx(()=>[Cg.preivewMode&&Cg.showPopover?(vue.openBlock(),vue.createBlock(vue.unref(ElPopover),{key:0,placement:"top-start",title:"属性信息",width:200,trigger:"hover"},{reference:vue.withCtx(()=>[vue.createVNode(_sfc_main$t,vue.mergeProps({"item-json":Wg,"canvas-cfg":Cg.canvasCfg,"canvas-dom":Cg.canvasDom,grid:Cg.gridCfg,"done-json":Cg.doneJson,"lock-state":Cg.globalLock?!0:Wg.lock,"line-append-enable":Cg.lineAppendEnable,"onUpdate:itemJson":Sg=>ag(Hg,Sg),onSetIntention:Vg[0]||(Vg[0]=Sg=>tg("setIntention",Sg)),onLineMouseUp:Gg},vue.toHandlers(Cg.preivewMode?vue.unref(eventToVOn)(Wg):{})),null,16,["item-json","canvas-cfg","canvas-dom","grid","done-json","lock-state","line-append-enable","onUpdate:itemJson"])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Wg.props,(Sg,wg)=>(vue.openBlock(),vue.createElementBlock("div",{key:wg},[Sg.disabled?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$g,vue.toDisplayString(Sg.title)+":"+vue.toDisplayString(Sg.val),1))]))),128))]),_:2},1024)):(vue.openBlock(),vue.createBlock(_sfc_main$t,vue.mergeProps({key:1,"item-json":Wg,"canvas-cfg":Cg.canvasCfg,"canvas-dom":Cg.canvasDom,grid:Cg.gridCfg,"done-json":Cg.doneJson,"lock-state":Cg.globalLock?!0:Wg.lock,"line-append-enable":Cg.lineAppendEnable,"onUpdate:itemJson":Sg=>ag(Hg,Sg),onSetIntention:Vg[1]||(Vg[1]=Sg=>tg("setIntention",Sg)),onLineMouseUp:Gg},vue.toHandlers(Cg.preivewMode?vue.unref(eventToVOn)(Wg):{})),null,16,["item-json","canvas-cfg","canvas-dom","grid","done-json","lock-state","line-append-enable","onUpdate:itemJson"]))]),_:2},1032,["id","modelValue","onUpdate:modelValue","scale-ratio","grid","resize","rotate","lock","active","useProportionalScaling","show-ghost-dom","hide","disabled","adsorp_diff","onMousedown","onOnItemMove","onOnMouseEnter","onOnMouseLeave","onOnResizeDone","onOnRotateDone","onOnRightClick","class"]))),128))}}),_hoisted_1$f={width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$a=["width","height"],_hoisted_3$9=["d","stroke"],_hoisted_4$8=["width","height"],_hoisted_5$6=["width","height"],_hoisted_6$6=["d","stroke"],_sfc_main$h=vue.defineComponent({__name:"index",props:{grid:{type:Number,default:10},gridCount:{type:Number,default:5},showSmall:{type:Boolean,default:!0}},setup(Ag){const gg=useDark({selector:"#mt-edit"}),eg=Ag,Ig=vue.computed(()=>eg.grid*eg.gridCount),Cg=vue.computed(()=>{const ig=[["#e4e4e4","#ebebeb"],["#414141","#363636"]],[ng,lg]=ig[gg?0:1];return{bigGrid:ng,grid:lg}}),tg=vue.computed(()=>({"--border-color":Cg.value.bigGrid}));return(ig,ng)=>(vue.openBlock(),vue.createElementBlock("div",{class:"grid-rect",style:vue.normalizeStyle(tg.value)},[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$f,[vue.createElementVNode("defs",null,[Ag.showSmall?(vue.openBlock(),vue.createElementBlock("pattern",{key:0,id:"smallGrid",width:Ag.grid,height:Ag.grid,patternUnits:"userSpaceOnUse"},[vue.createElementVNode("path",{d:`M ${Ag.grid} 0 L 0 0 0 ${Ag.grid}`,fill:"none",stroke:Cg.value.grid,"stroke-width":"0.5"},null,8,_hoisted_3$9)],8,_hoisted_2$a)):vue.createCommentVNode("",!0),vue.createElementVNode("pattern",{id:"grid",width:Ig.value,height:Ig.value,patternUnits:"userSpaceOnUse"},[Ag.showSmall?(vue.openBlock(),vue.createElementBlock("rect",{key:0,width:Ig.value,height:Ig.value,fill:"url(#smallGrid)"},null,8,_hoisted_5$6)):vue.createCommentVNode("",!0),vue.createElementVNode("path",{d:`M ${Ig.value} 0 L 0 0 0 ${Ig.value}`,fill:"none",stroke:Cg.value.bigGrid,"stroke-width":"1"},null,8,_hoisted_6$6)],8,_hoisted_4$8)]),ng[0]||(ng[0]=vue.createElementVNode("rect",{width:"100%",height:"100%",fill:"url(#grid)"},null,-1))]))],4))}}),index_vue_vue_type_style_index_0_scoped_e248ab51_lang="",PatternGrid=_export_sfc(_sfc_main$h,[["__scopeId","data-v-e248ab51"]]),_hoisted_1$e={class:"mt-selected-area"},_sfc_main$g=vue.defineComponent({__name:"index",props:{scaleRatio:{default:1},targetDom:{default:null}},emits:["selectedAreaMouseUp"],setup(Ag,{expose:gg,emit:eg}){vue.useCssVars(ng=>({v0480acc6:tg.value.width+"px",v533d0e32:tg.value.height+"px",v4ea033d2:tg.value.top+"px",v23204a47:tg.value.left+"px"}));const Ig=Ag,Cg=eg,tg=vue.ref({width:0,height:0,top:0,left:0});return gg({onMouseDown:ng=>{var ug;const{realityX:lg,realityY:og}=getRealityXY(ng,(ug=Ig.targetDom)==null?void 0:ug.getBoundingClientRect()),sg=ng instanceof MouseEvent?ng.clientX:ng.touches[0].pageX,rg=ng instanceof MouseEvent?ng.clientY:ng.touches[0].pageY,cg=dg=>{const hg=dg instanceof MouseEvent?dg.clientX:dg.touches[0].pageX,bg=dg instanceof MouseEvent?dg.clientY:dg.touches[0].pageY,mg=(hg-sg)/Ig.scaleRatio,Zg=(bg-rg)/Ig.scaleRatio;let Bg=lg/Ig.scaleRatio,Gg=og/Ig.scaleRatio,pg=Math.abs(mg),fg=Math.abs(Zg);mg<0&&(Bg=lg/Ig.scaleRatio-pg),Zg<0&&(Gg=og/Ig.scaleRatio-fg),tg.value={width:pg,height:fg,left:Bg,top:Gg}},ag=()=>{document.removeEventListener("mousemove",cg),document.removeEventListener("mouseup",ag),document.removeEventListener("touchmove",cg),document.removeEventListener("touchend",ag),Cg("selectedAreaMouseUp",vue.unref(tg)),tg.value={width:0,height:0,top:0,left:0}};document.addEventListener("mousemove",cg),document.addEventListener("mouseup",ag),document.addEventListener("touchmove",cg),document.addEventListener("touchend",ag)}}),(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e))}}),index_vue_vue_type_style_index_0_scoped_3704de4f_lang="",SelectedArea=_export_sfc(_sfc_main$g,[["__scopeId","data-v-3704de4f"]]),_hoisted_1$d={class:"hidden"},_sfc_main$f=vue.defineComponent({__name:"index",props:{scaleRatio:{default:1}},emits:["dragCanvasMouseDown","dragCanvasMouseMove","dragCanvasMouseUp"],setup(Ag,{expose:gg,emit:eg}){const Ig=eg;return gg({onMouseDown:tg=>{let ig=0,ng=0;const lg=tg instanceof MouseEvent?tg.clientX:tg.touches[0].pageX,og=tg instanceof MouseEvent?tg.clientY:tg.touches[0].pageY;Ig("dragCanvasMouseDown",lg,og);const sg=cg=>{const ag=cg instanceof MouseEvent?cg.clientX:cg.touches[0].pageX,ug=cg instanceof MouseEvent?cg.clientY:cg.touches[0].pageY;ig=(ag-lg)/1,ng=(ug-og)/1,Ig("dragCanvasMouseMove",ig,ng)},rg=()=>{document.removeEventListener("mousemove",sg),document.removeEventListener("mouseup",rg),document.removeEventListener("touchmove",sg),document.removeEventListener("touchend",rg),Ig("dragCanvasMouseUp",ig,ng)};document.addEventListener("mousemove",sg),document.addEventListener("mouseup",rg),document.addEventListener("touchmove",sg),document.addEventListener("touchend",rg)}}),(tg,ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d))}}),_hoisted_1$c={ref:"contextMenuRef",class:"contextMenu"},_hoisted_2$9=["onClick"],_hoisted_3$8={class:"shortcut"},_sfc_main$e=vue.defineComponent({__name:"index",props:{menuInfo:{},show:{type:Boolean}},emits:["onContextMenuClick"],setup(Ag,{emit:gg}){vue.useCssVars(tg=>({d490becc:eg.menuInfo.left+"px",v3f7af964:eg.menuInfo.top+"px"}));const eg=Ag,Ig=gg,Cg=(tg,ig,ng)=>{ig.enable&&Ig("onContextMenuClick",tg,ng)};return(tg,ig)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",_hoisted_1$c,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.menuInfo.info,(ng,lg)=>(vue.openBlock(),vue.createElementBlock("li",{key:ng.title,onClick:og=>Cg(lg,ng,og)},[vue.createElementVNode("p",{class:vue.normalizeClass(ng.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(ng.title)+" ",1),vue.createElementVNode("span",_hoisted_3$8,vue.toDisplayString(ng.hot_key),1)],2)],8,_hoisted_2$9))),128))],512)),[[vue.vShow,Ag.show]])}}),index_vue_vue_type_style_index_0_scoped_e515623d_lang="",ContextMenu=_export_sfc(_sfc_main$e,[["__scopeId","data-v-e515623d"]]),contextMenuStore=vue.reactive({menuInfo:{display:!1,left:0,top:0,info:{selectAll:{title:"全选",hot_key:"Ctrl + A",enable:!1},copy:{title:"复制",hot_key:"Ctrl + C",enable:!1},paste:{title:"粘贴",hot_key:"Ctrl + V",enable:!1},delete:{title:"删除",hot_key:"Delete",enable:!1},group:{title:"组合",hot_key:"Ctrl + G",enable:!1},ungroup:{title:"取消组合",hot_key:"Ctrl + U",enable:!1},moveTop:{title:"置顶",hot_key:"Ctrl + Right",enable:!1},moveUp:{title:"上移",hot_key:"Ctrl + Up",enable:!1},moveDown:{title:"下移",hot_key:"Ctrl + Down",enable:!1},moveBottom:{title:"置底",hot_key:"Ctrl + Left",enable:!1}}},setMenuInfo:Ag=>{contextMenuStore.menuInfo=Ag},setDisplayItem:Ag=>{for(const gg in contextMenuStore.menuInfo.info)contextMenuStore.menuInfo.info[gg].enable=!1;Ag.forEach(gg=>{contextMenuStore.menuInfo.info[gg].enable=!0})}}),_hoisted_1$b=["id"],_hoisted_2$8=["id"],_hoisted_3$7=["fill"],_hoisted_4$7=["id"],_hoisted_5$5=["fill"],_hoisted_6$5=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],_hoisted_7$4=["from","to","dur"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},mode:{default:"pen"}},emits:["drawLineEnd"],setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,tg=configStore.lineRenderOffset;return vue.computed(()=>!Ig.grid.align||!Ig.grid.enabled?1:Ig.grid.size),gg({onMouseDown:(ng,lg,og)=>{ng.stopPropagation();const{x:sg,y:rg}=og,cg=ng instanceof MouseEvent?ng.clientX:ng.touches[0].pageX,ag=ng instanceof MouseEvent?ng.clientY:ng.touches[0].pageY;let ug=0,dg=0;const hg=mg=>{const Zg=mg instanceof MouseEvent?mg.clientX:mg.touches[0].pageX,Bg=mg instanceof MouseEvent?mg.clientY:mg.touches[0].pageY,Gg=ng.ctrlKey?0:alignToGrid((Zg-cg)/Ig.canvasCfg.scale,1),pg=ng.shiftKey?0:alignToGrid((Bg-ag)/Ig.canvasCfg.scale,1);if(ug=sg+Gg,dg=rg+pg,Ig.mode=="pencil"){Ig.itemJson.props.point_position.val.push({x:ug,y:dg});return}else{const fg=Ig.itemJson.props.point_position.val;fg[lg].x=ug,fg[lg].y=dg}},bg=()=>{document.removeEventListener("mousemove",hg),document.removeEventListener("mouseup",bg),document.removeEventListener("touchmove",hg),document.removeEventListener("touchend",bg);const mg=document.querySelector(`#${Ig.itemJson.id} g .real`).getBoundingClientRect(),Zg=Ig.canvasDom.getBoundingClientRect(),Bg=((mg==null?void 0:mg.left)-(Zg==null?void 0:Zg.left))/Ig.canvasCfg.scale,Gg=((mg==null?void 0:mg.top)-(Zg==null?void 0:Zg.top))/Ig.canvasCfg.scale,pg=Bg-Ig.itemJson.binfo.left,fg=Gg-Ig.itemJson.binfo.top,Vg={...Ig.itemJson,binfo:{...Ig.itemJson.binfo,left:Bg,top:Gg,width:(mg==null?void 0:mg.width)/Ig.canvasCfg.scale,height:(mg==null?void 0:mg.height)/Ig.canvasCfg.scale},props:{...Ig.itemJson.props,point_position:{...Ig.itemJson.props.point_position,val:Ig.itemJson.props.point_position.val.map(Wg=>({x:Wg.x-pg,y:Wg.y-fg}))}}};Cg("drawLineEnd",Vg)};document.addEventListener("mousemove",hg),document.addEventListener("mouseup",bg),document.addEventListener("touchmove",hg),document.addEventListener("touchend",bg)}}),(ng,lg)=>{var og,sg,rg,cg;return vue.openBlock(),vue.createElementBlock("svg",{id:Ig.itemJson.id,class:"mt-line-render",style:vue.normalizeStyle({position:"absolute",left:`${-vue.unref(tg)}px`,top:`${-vue.unref(tg)}px`,width:`${Ig.canvasCfg.width+vue.unref(tg)}px`,height:`${Ig.canvasCfg.height+vue.unref(tg)}px`}),version:"1.1",xmlns:"http://www.w3.org/2000/svg","pointer-events":"none"},[vue.createElementVNode("g",null,[vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"markerArrowStart"+Ig.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:Ig.itemJson.props.stroke.val},null,8,_hoisted_3$7)],8,_hoisted_2$8),vue.createElementVNode("marker",{id:"markerArrowEnd"+Ig.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:Ig.itemJson.props.stroke.val},null,8,_hoisted_5$5)],8,_hoisted_4$7)]),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(Ig.itemJson.props.point_position.val,Ig.itemJson.binfo.left+vue.unref(tg),Ig.itemJson.binfo.top+vue.unref(tg)),"pointer-events":"visibleStroke",fill:"none",stroke:Ig.itemJson.props.ani_type.val==="electricity"?Ig.itemJson.props.ani_color.val:Ig.itemJson.props.stroke.val,"stroke-width":Ig.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":Ig.itemJson.props.ani_type.val==="electricity"?Ig.itemJson.props["stroke-width"].val*3:0,"marker-start":(sg=(og=Ig.itemJson.props)==null?void 0:og["marker-start"])!=null&&sg.val?`url(#markerArrowStart${Ig.itemJson.id})`:"","marker-end":(cg=(rg=Ig.itemJson.props)==null?void 0:rg["marker-end"])!=null&&cg.val?`url(#markerArrowEnd${Ig.itemJson.id})`:"",class:"real"},[Ig.itemJson.props.ani_type.val==="electricity"?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:Ig.itemJson.props.ani_reverse.val?0:1e3,to:Ig.itemJson.props.ani_reverse.val?Ig.itemJson.props.ani_play.val?1e3:0:Ig.itemJson.props.ani_play.val?0:1e3,dur:`${Ig.itemJson.props.ani_dur.val<1?1:Ig.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_7$4)):vue.createCommentVNode("",!0)],8,_hoisted_6$5)])],12,_hoisted_1$b)}}}),canvasBackgroundState=vue.reactive({img:"",width:0,height:0,settled:!1});function setCanvasBackground(Ag,gg,eg,Ig){return canvasBackgroundState.img=gg,canvasBackgroundState.width=eg,canvasBackgroundState.height=Ig,canvasBackgroundState.settled=!0,Ag.img=gg,Ag.width=eg,Ag.height=Ig,Ag}function clearCanvasBackground(Ag){return canvasBackgroundState.img="",canvasBackgroundState.width=0,canvasBackgroundState.height=0,canvasBackgroundState.settled=!0,Ag.img="",Ag}function updateCanvasBackgroundSize(Ag,gg){!canvasBackgroundState.settled||!canvasBackgroundState.img||(canvasBackgroundState.width=Ag,canvasBackgroundState.height=gg)}function resetCanvasBackground(){canvasBackgroundState.img="",canvasBackgroundState.width=0,canvasBackgroundState.height=0,canvasBackgroundState.settled=!1}function adoptCanvasBackground(Ag){!(Ag!=null&&Ag.img)||canvasBackgroundState.settled||(canvasBackgroundState.img=Ag.img,canvasBackgroundState.width=Ag.width??0,canvasBackgroundState.height=Ag.height??0,canvasBackgroundState.settled=!0)}function withCanvasBackground(Ag){return canvasBackgroundState.settled?canvasBackgroundState.img?{...Ag,img:canvasBackgroundState.img,width:canvasBackgroundState.width,height:canvasBackgroundState.height}:{...Ag,img:""}:Ag}const SOP_TIMELINE_ORDER=["__default__","sop-001","sop-002","sop-003","sop-004","sop-005","sop-006","sop-007"],DEFAULT_SOP_ID="__default__";let activeSopTimelineOrder=[...SOP_TIMELINE_ORDER];function setSopTimelineOrder(Ag){const gg=["__default__"];for(const eg of Ag)eg&&eg!=="__default__"&&!gg.includes(eg)&&gg.push(eg);activeSopTimelineOrder=gg.length>1?gg:[...SOP_TIMELINE_ORDER]}function getActiveSopTimelineOrder(){return activeSopTimelineOrder}function getSopTimelineIndex(Ag){const gg=activeSopTimelineOrder.indexOf(Ag);if(gg!==-1)return gg;const eg=SOP_TIMELINE_ORDER.indexOf(Ag);if(eg!==-1)return eg;if(Ag==="__default__")return 0;const Ig=Ag.match(/^sop-(\d+)$/i);return Ig?parseInt(Ig[1],10):Number.MAX_SAFE_INTEGER}function compareSopTimeline(Ag,gg){return getSopTimelineIndex(Ag)-getSopTimelineIndex(gg)}function sopIdAtTimelineIndex(Ag){return activeSopTimelineOrder[Ag]??SOP_TIMELINE_ORDER[Ag]??`sop-${String(Ag).padStart(3,"0")}`}function getIntroducedSopId(Ag){return Ag.sopIntroducedAt??DEFAULT_SOP_ID}function isItemVisibleAtSop(Ag,gg){const eg=getIntroducedSopId(Ag);return!(compareSopTimeline(eg,gg)>0||Ag.sopDeletedAt&&compareSopTimeline(Ag.sopDeletedAt,gg)<=0)}const BINFO_RESOLVE_STEP_CAP=1e3;function resolveItemBinfo(Ag,gg,eg){var lg;const Ig=getIntroducedSopId(eg);let Cg=objectDeepClone(eg.binfo);const tg=getSopTimelineIndex(Ig),ig=getSopTimelineIndex(gg),ng=Math.min(ig,tg+BINFO_RESOLVE_STEP_CAP);for(let og=tg;og<=ng;og++){const sg=sopIdAtTimelineIndex(og),rg=(lg=sopCanvasStateStore.layoutBySop[sg])==null?void 0:lg[Ag];rg&&(Cg=objectDeepClone(rg))}return Cg}const sopCanvasStateStore=vue.reactive({masterById:{},layoutBySop:{},activeSopId:DEFAULT_SOP_ID,has(Ag){return Object.prototype.hasOwnProperty.call(this.layoutBySop,Ag)}});let enterSessionBinfoById=null;const BINFO_EPS=.001;function binfoEqual(Ag,gg){return Math.abs(Ag.left-gg.left)<BINFO_EPS&&Math.abs(Ag.top-gg.top)<BINFO_EPS&&Math.abs(Ag.width-gg.width)<BINFO_EPS&&Math.abs(Ag.height-gg.height)<BINFO_EPS&&Math.abs(Ag.angle-gg.angle)<BINFO_EPS}function captureSopEnterSnapshot(Ag){enterSessionBinfoById={};for(const gg of Ag)gg.isDelete||(enterSessionBinfoById[gg.id]=objectDeepClone(gg.binfo))}function isLayoutChangedSinceEnter(Ag,gg,eg){if(enterSessionBinfoById){const tg=enterSessionBinfoById[Ag];return tg?!binfoEqual(tg,gg):!0}const Ig=sopCanvasStateStore.masterById[Ag];if(!Ig)return!0;const Cg=resolveItemBinfo(Ag,eg,Ig);return!binfoEqual(Cg,gg)}function ensureLayoutBucket(Ag){sopCanvasStateStore.layoutBySop[Ag]||(sopCanvasStateStore.layoutBySop[Ag]={})}function propagateItemLayoutFromSop(Ag,gg,eg){const Ig=objectDeepClone(eg);ensureLayoutBucket(Ag),sopCanvasStateStore.layoutBySop[Ag][gg]=objectDeepClone(Ig);const Cg=getSopTimelineIndex(Ag);if(!(Cg>=activeSopTimelineOrder.length))for(let tg=Cg+1;tg<activeSopTimelineOrder.length;tg++){const ig=sopIdAtTimelineIndex(tg);ensureLayoutBucket(ig),sopCanvasStateStore.layoutBySop[ig][gg]=objectDeepClone(Ig)}}function registerNewItemAtSop(Ag,gg){const eg=objectDeepClone(Ag);eg.sopIntroducedAt=gg,eg.sopDeletedAt=Ag.sopDeletedAt,eg.active=!1,eg.isDelete=!1,sopCanvasStateStore.masterById[Ag.id]=eg,propagateItemLayoutFromSop(gg,Ag.id,Ag.binfo),enterSessionBinfoById&&(enterSessionBinfoById[Ag.id]=objectDeepClone(Ag.binfo))}function commitSopEdits(Ag,gg){for(const eg of gg){if(eg.isDelete){const ig=sopCanvasStateStore.masterById[eg.id];ig&&(ig.sopDeletedAt=Ag);continue}const Ig=sopCanvasStateStore.masterById[eg.id],Cg=eg.sopIntroducedAt??(Ig==null?void 0:Ig.sopIntroducedAt)??Ag,tg=objectDeepClone({...Ig??{},...eg,binfo:(Ig==null?void 0:Ig.binfo)??eg.binfo,sopIntroducedAt:Cg,sopDeletedAt:Ig==null?void 0:Ig.sopDeletedAt,active:!1,isDelete:!1});sopCanvasStateStore.masterById[eg.id]=tg,isLayoutChangedSinceEnter(eg.id,eg.binfo,Ag)&&propagateItemLayoutFromSop(Ag,eg.id,eg.binfo)}}function buildCanvasForSop(Ag){return Object.values(sopCanvasStateStore.masterById).filter(gg=>isItemVisibleAtSop(gg,Ag)).map(gg=>{const eg=objectDeepClone(gg);return eg.binfo=resolveItemBinfo(gg.id,Ag,gg),eg.active=!1,eg.isDelete=!1,eg})}function applyCanvasForSop(Ag){const gg=buildCanvasForSop(Ag);globalStore.selected_items_id=[],globalStore.setGlobalStoreDoneJson(gg),sopCanvasStateStore.activeSopId=Ag,captureSopEnterSnapshot(gg)}function markItemsDeletedAtSop(Ag,gg){for(const eg of gg){const Ig=sopCanvasStateStore.masterById[eg];Ig&&(Ig.sopDeletedAt=Ag)}}function deleteItemsAtSop(Ag,gg){if(gg.length!==0){for(const eg of gg){const Ig=sopCanvasStateStore.masterById[eg];Ig&&(Ig.sopDeletedAt=Ag)}applyCanvasForSop(Ag),cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}}function syncMasterFromImportedDoneJson(Ag,gg=DEFAULT_SOP_ID){sopCanvasStateStore.masterById={},sopCanvasStateStore.layoutBySop={};for(const eg of Ag)eg.isDelete||registerNewItemAtSop(eg,eg.sopIntroducedAt??gg)}function mergeMasterFromImportedDoneJson(Ag,gg){for(const eg of Ag){if(eg.isDelete)continue;const Ig=eg.sopIntroducedAt??gg;if(!sopCanvasStateStore.masterById[eg.id]){registerNewItemAtSop(eg,Ig);continue}ensureLayoutBucket(gg),sopCanvasStateStore.layoutBySop[gg][eg.id]=objectDeepClone(eg.binfo)}}function switchSopCanvas(Ag,gg){Ag!==gg&&(commitSopEdits(Ag,globalStore.done_json),applyCanvasForSop(gg),cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0)}const _hoisted_1$a={class:"main-panel-shell w-full h-full flex flex-col overflow-hidden"},_hoisted_2$7=["src"],_hoisted_3$6={key:2},_hoisted_4$6=["data-id","onMouseenter"],DEFAULT_DROP_ITEM_SIZE=150,_sfc_main$c=vue.defineComponent({__name:"index",props:{groupEnabled:{type:Boolean},unGroupEnabled:{type:Boolean},deleteEnabled:{type:Boolean},lineAppendEnable:{type:Boolean,default:!1},sopId:{default:"__default__"}},setup(Ag,{expose:gg}){vue.useCssVars(nA=>({v0cdb94eb:vue.unref(globalStore).canvasCfg.width+"px",v4d38d53c:vue.unref(globalStore).canvasCfg.height+"px",v75ab9dbc:ag.value,c10d7e02:`scale(${vue.unref(globalStore).canvasCfg.scale})`,dd7a0a46:`${vue.unref(globalStore).canvasCfg.transform_origin.x}px ${vue.unref(globalStore).canvasCfg.transform_origin.y}px`,v7bbe4362:vue.unref(globalStore).guideCfg.x.display?"block":"none",v02603008:vue.unref(globalStore).guideCfg.x.top+"px",v77bfd241:vue.unref(globalStore).guideCfg.y.display?"block":"none",ccebea3a:vue.unref(globalStore).guideCfg.y.left+"px"}));const eg=Ag,Ig=vue.computed(()=>eg.sopId||"__default__"),Cg=vue.ref(),tg=vue.ref(),ig=vue.ref(),ng=vue.ref(),lg=vue.ref(),og=vue.ref(!0);let sg=!1;const rg=vue.reactive({left:0,top:0}),cg=vue.computed(()=>!globalStore.gridCfg.align||!globalStore.gridCfg.enabled?1:globalStore.gridCfg.size),ag=vue.computed(()=>{var nA;return((nA=globalStore.canvasCfg.color)==null?void 0:nA.trim())||"#ffffff"}),ug=vue.computed(()=>canvasBackgroundState.img||globalStore.canvasCfg.img),dg=vue.computed({get(){return globalStore.done_json},set(nA){globalStore.setGlobalStoreDoneJson(nA)}}),hg=configStore.sysComponent.find(nA=>nA.type=="sys-line"),bg={id:hg.id+"-"+randomString(),title:hg.title,type:hg.type,binfo:{left:0,top:0,width:100,height:0,angle:0},resize:!1,rotate:!1,lock:!1,active:!0,hide:!1,props:{...hg.props,point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:0,y:0}],disabled:!0}},tag:hg.id,common_animations:hg.common_animations,events:[]},mg=vue.ref(objectDeepClone(bg)),Zg=(nA,oA)=>{var tI,xe,pI,oI,cI,uI;if(xA(),globalStore.lock&&globalStore.intention==="create"){ElMessage.error("画布已锁定,请先解锁!");return}if(nA.preventDefault(),oA&&globalStore.intention!=="create"){if(globalStore.lock){globalStore.setIntention("beginDragCanvas"),(tI=ng.value)==null||tI.onMouseDown(nA);return}if(eg.lineAppendEnable){globalStore.setIntention("drawSysLineStart");const{realityX:hI,realityY:Ie}=getRealityXY(nA,(xe=Cg.value)==null?void 0:xe.getBoundingClientRect());mg.value={...objectDeepClone(bg),binfo:{left:alignToGrid(hI/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(Ie/globalStore.canvasCfg.scale,cg.value),width:0,height:0,angle:0}},(pI=lg.value)==null||pI.onMouseDown(nA,1,{x:0,y:0});return}globalStore.cancelAllSelect(),globalStore.setIntention("beginDragCanvas"),(oI=ng.value)==null||oI.onMouseDown(nA)}if(globalStore.intention!=="create")return;if(!globalStore.create_item_info){console.error("拖拽初始化失败",globalStore.create_item_info);return}globalStore.setSelectItems([]);const ZA=(cI=leftAsideStore.config.get(globalStore.create_item_info.config_key))==null?void 0:cI.find(hI=>hI.id===globalStore.create_item_info.item_id);if(!ZA){console.error("拖拽配置不匹配",globalStore.create_item_info,leftAsideStore.config);return}const GA=objectDeepClone(ZA),zA=GA.type==="sys-line",NA=GA.id==="sys-line",_A=GA.id==="sys-line-vertical",{realityX:Xe,realityY:eI}=getRealityXY(nA,(uI=Cg.value)==null?void 0:uI.getBoundingClientRect()),ze={id:GA.id+"-"+randomString(),title:GA.title,type:GA.type,binfo:{left:alignToGrid(Xe/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(eI/globalStore.canvasCfg.scale,cg.value),width:NA?100:_A?0:DEFAULT_DROP_ITEM_SIZE,height:_A?100:NA?0:DEFAULT_DROP_ITEM_SIZE,angle:0},resize:!zA,rotate:!zA,lock:!1,active:!0,hide:!1,props:GA.props,tag:GA.id,common_animations:GA.common_animations,events:[]};GA.type==="svg"?ze.symbol=GA.symbol:GA.type==="img"&&(ze.thumbnail=GA.thumbnail);const Ue=[...globalStore.done_json];Ue.push(ze),globalStore.setGlobalStoreDoneJson(Ue),registerNewItemAtSop(ze,Ig.value),globalStore.setSingleSelect(ze.id),globalStore.setIntention("none"),globalStore.setCreateItemInfo(null),cacheStore.addHistory(Ue)},Bg=nA=>{nA.preventDefault()},Gg=(nA,oA)=>{if(xA(),!globalStore.lock){if(globalStore.canvasCfg.adsorp||globalStore.canvasCfg.guide){const ZA=globalStore.done_json.filter(GA=>!GA.hide).map(GA=>{const zA=document.getElementById(GA.id);if(!zA)return null;const{left:NA,top:_A,width:Xe,height:eI,right:ze,bottom:Ue}=zA.getBoundingClientRect();return{id:GA.id,type:GA.type,left:NA,top:_A,width:Xe,height:eI,right:ze,bottom:Ue}}).filter(GA=>GA!==null);cacheStore.setBoundingBox(ZA)}if(oA.ctrlKey){if(oA.ctrlKey&&!nA.lock){const ZA=globalStore.done_json.find(GA=>GA.id==nA.id);ZA.active=!ZA.active,globalStore.refreshSelectedItemsId()}}else{if(globalStore.selected_items_id.includes(nA.id))return;globalStore.setSingleSelect(nA.id)}}},pg=nA=>{var oA,ZA,GA,zA;if(xA(),globalStore.cancelAllSelect(),globalStore.lock||nA.button==2){globalStore.setIntention("beginDragCanvas"),(oA=ng.value)==null||oA.onMouseDown(nA);return}if(eg.lineAppendEnable){globalStore.setIntention("drawSysLineStart");const{realityX:NA,realityY:_A}=getRealityXY(nA,(ZA=Cg.value)==null?void 0:ZA.getBoundingClientRect());mg.value={...objectDeepClone(bg),binfo:{left:alignToGrid(NA/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(_A/globalStore.canvasCfg.scale,cg.value),width:0,height:0,angle:0}},(GA=lg.value)==null||GA.onMouseDown(nA,1,{x:0,y:0});return}nA.button===0&&(globalStore.setIntention("beginDragCanvas"),(zA=ng.value)==null||zA.onMouseDown(nA))},fg=nA=>{const oA=[...globalStore.done_json].map(ZA=>{var tI,xe;const GA=(tI=document.getElementById(ZA.id))==null?void 0:tI.getBoundingClientRect(),zA=(xe=Cg.value)==null?void 0:xe.getBoundingClientRect();let{left:NA,top:_A,width:Xe,height:eI}=ZA.binfo;GA&&zA&&(NA=(GA.left-zA.left)/globalStore.canvasCfg.scale,_A=(GA.top-zA.top)/globalStore.canvasCfg.scale,Xe=GA.width/globalStore.canvasCfg.scale,eI=GA.height/globalStore.canvasCfg.scale);const ze=nA.left<NA&&nA.left+nA.width>NA+Xe,Ue=nA.top<_A&&nA.top+nA.height>_A+eI;return ze&&Ue&&!ZA.lock&&!ZA.hide&&(ZA.active=!0),ZA});globalStore.setGlobalStoreDoneJson(oA),globalStore.refreshSelectedItemsId(),globalStore.setIntention("none")},Vg=()=>{const nA=objectDeepClone(globalStore.done_json.filter(zA=>globalStore.selected_items_id.includes(zA.id)));globalStore.done_json.filter(zA=>{var NA,_A;return zA.type==="sys-line"&&(globalStore.selected_items_id.includes((NA=zA.props.bind_anchors.val.start)==null?void 0:NA.id)||globalStore.selected_items_id.includes((_A=zA.props.bind_anchors.val.end)==null?void 0:_A.id))&&!globalStore.selected_items_id.includes(zA.id)}).forEach(zA=>{zA.props.bind_anchors.val={start:null,end:null}});const ZA=createGroupInfo(nA,Cg.value,globalStore.canvasCfg.scale),GA=[...globalStore.done_json].filter(zA=>!globalStore.selected_items_id.includes(zA.id));markItemsDeletedAtSop(Ig.value,[...globalStore.selected_items_id]),registerNewItemAtSop(ZA,Ig.value),GA.push(ZA),globalStore.setGlobalStoreDoneJson(GA),globalStore.setSingleSelect(ZA.id),cacheStore.addHistory(globalStore.done_json)},Wg=()=>{if(globalStore.selected_items_id.length!=1){ElMessage.error("只能解除组合组件!");return}const nA=globalStore.done_json.find(zA=>zA.id===globalStore.selected_items_id[0]);if(!nA){ElMessage.error("未知错误!无法找到解组信息");return}if(nA.type!="group"){ElMessage.error("只能解除组合组件!");return}const oA=cancelGroup(nA,Cg.value,globalStore.canvasCfg.scale,cg.value),ZA=nA.id,GA=[...globalStore.done_json].filter(zA=>!globalStore.selected_items_id.includes(zA.id));markItemsDeletedAtSop(Ig.value,[ZA]),oA.forEach(zA=>registerNewItemAtSop(zA,Ig.value)),globalStore.setGlobalStoreDoneJson([...GA,...oA]),globalStore.setSelectItems(oA.map(zA=>zA.id)),cacheStore.addHistory(globalStore.done_json)},Hg=({move_item_bounding_info:nA,move_binfo:oA})=>{var NA;const ZA=(NA=Cg.value)==null?void 0:NA.getBoundingClientRect();if(globalStore.canvasCfg.adsorp||globalStore.canvasCfg.guide){let _A=cacheStore.boundingBox;globalStore.selected_items_id.length>1&&nA.length>1&&(_A=cacheStore.boundingBox.filter(xe=>!globalStore.selected_items_id.includes(xe.id)));const Xe=nA,{y_info:eI,move_x:ze}=calculateGuideY(_A,globalStore.canvasCfg.adsorp_diff,Xe,ZA,globalStore.canvasCfg.scale),{x_info:Ue,move_y:tI}=calculateGuideX(_A,globalStore.canvasCfg.adsorp_diff,Xe,ZA,globalStore.canvasCfg.scale);globalStore.guideCfg.x=Ue,globalStore.guideCfg.y=eI,ze!=0&&globalStore.canvasCfg.adsorp?globalStore.adsorp_diff.x=ze:globalStore.adsorp_diff.x=0,tI!=0&&globalStore.canvasCfg.adsorp?globalStore.adsorp_diff.y=tI:globalStore.adsorp_diff.y=0}globalStore.done_json.filter(_A=>_A.type=="sys-line"&&globalStore.selected_items_id.includes(_A.id)&&(_A.props.bind_anchors.val.start||_A.props.bind_anchors.val.end)).forEach(_A=>{_A.props.bind_anchors.val.start&&(globalStore.selected_items_id.includes(_A.props.bind_anchors.val.start.id)||(_A.props.bind_anchors.val.start=null)),_A.props.bind_anchors.val.end&&(globalStore.selected_items_id.includes(_A.props.bind_anchors.val.end.id)||(_A.props.bind_anchors.val.end=null))});const zA=globalStore.done_json.filter(_A=>{var Xe,eI;return _A.type=="sys-line"&&(globalStore.selected_items_id.includes((Xe=_A.props.bind_anchors.val.start)==null?void 0:Xe.id)||globalStore.selected_items_id.includes((eI=_A.props.bind_anchors.val.end)==null?void 0:eI.id))&&!globalStore.selected_items_id.includes(_A.id)});useUpdateSysLine(zA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale,oA)},Sg=()=>{globalStore.guideCfg.x.display=!1,globalStore.guideCfg.y.display=!1,cacheStore.addHistory(globalStore.done_json)},wg=nA=>{const{topLeft:oA,topRight:ZA,bottomLeft:GA,bottomRight:zA}=getRectCoordinate(nA.binfo),{topCenter:NA,bottomCenter:_A,leftCenter:Xe,rightCenter:eI}=getRectCenterCoordinate(oA,ZA,GA,zA),ze=NA.x,Ue=Xe.y,tI=Math.PI/180*nA.binfo.angle,xe=rotatePoint(NA.x,NA.y,ze,Ue,tI),pI=rotatePoint(_A.x,_A.y,ze,Ue,tI),oI=rotatePoint(Xe.x,Xe.y,ze,Ue,tI),cI=rotatePoint(eI.x,eI.y,ze,Ue,tI);cacheStore.setAdsorbPoint([{type:"tc",x:xe.x,y:xe.y,id:nA.id},{type:"bc",x:pI.x,y:pI.y,id:nA.id},{type:"lc",x:oI.x,y:oI.y,id:nA.id},{type:"rc",x:cI.x,y:cI.y,id:nA.id}])},Xg=(nA,oA)=>{oA.type!="sys-line"&&wg(oA)},vg=(nA,oA)=>{globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"||cacheStore.setAdsorbPoint([])},yg=nA=>{globalStore.setIntention(nA)},Ng=nA=>{if(globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"){const oA=globalStore.done_json.find(ZA=>ZA.id==globalStore.selected_items_id[0]);oA&&(globalStore.intention=="adsorbStart"?(oA.props.bind_anchors.val={...oA.props.bind_anchors.val,start:{type:nA.type,id:nA.id}},oA.props.point_position.val[0]={x:nA.x-oA.binfo.left,y:nA.y-oA.binfo.top}):globalStore.intention=="adsorbEnd"&&(oA.props.bind_anchors.val={...oA.props.bind_anchors.val,end:{type:nA.type,id:nA.id}},oA.props.point_position.val[oA.props.point_position.val.length-1]={x:nA.x-oA.binfo.left,y:nA.y-oA.binfo.top}))}},Yg=()=>{if(globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"){const nA=globalStore.done_json.find(oA=>oA.id==globalStore.selected_items_id[0]);nA&&(globalStore.intention=="adsorbStart"?nA.props.bind_anchors.val={...nA.props.bind_anchors.val,start:null}:globalStore.intention=="adsorbEnd"&&(nA.props.bind_anchors.val={...nA.props.bind_anchors.val,end:null}))}},Kg=nA=>{const oA=globalStore.done_json.filter(ZA=>{var GA,zA;return ZA.type=="sys-line"&&(((GA=ZA.props.bind_anchors.val.start)==null?void 0:GA.id)==nA.id||((zA=ZA.props.bind_anchors.val.end)==null?void 0:zA.id)==nA.id)});useUpdateSysLine(oA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)},Jg=nA=>{const oA=globalStore.done_json.filter(ZA=>{var GA,zA;return ZA.type=="sys-line"&&(((GA=ZA.props.bind_anchors.val.start)==null?void 0:GA.id)==nA.id||((zA=ZA.props.bind_anchors.val.end)==null?void 0:zA.id)==nA.id)});useUpdateSysLine(oA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)},Ug=nA=>{const oA=globalStore.done_json.filter(ZA=>globalStore.selected_items_id.includes(ZA.id));handleAlign(nA,oA,Cg.value,globalStore.canvasCfg.scale,globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},Qg=()=>{const nA=tg.value;nA&&(rg.left=nA.scrollLeft,rg.top=nA.scrollTop)},xg=(nA,oA)=>{const ZA=tg.value;ZA&&(nA===0&&oA===0||(globalStore.setIntention("runDragCanvas"),ZA.scrollLeft=rg.left-nA,ZA.scrollTop=rg.top-oA))},Tg=()=>{globalStore.intention=="runDragCanvas"?globalStore.setIntention("endDragCanvas"):globalStore.setIntention("none")},Mg=nA=>{if(globalStore.intention=="endDragCanvas")return;const oA=[];cacheStore.copy.length>0&&oA.push("paste"),globalStore.done_json.length>0&&oA.push("selectAll"),contextMenuStore.setDisplayItem(oA),contextMenuStore.setMenuInfo({...contextMenuStore.menuInfo,left:nA.clientX,top:nA.clientY}),globalStore.setIntention("showContextMenu")},Eg=(nA,oA)=>{const ZA=["copy","delete"];eg.groupEnabled&&ZA.push("group"),eg.unGroupEnabled&&ZA.push("ungroup"),eg.deleteEnabled&&ZA.push("delete");const GA=globalStore.done_json.findIndex(zA=>zA.id==oA.id);GA>-1&&GA<globalStore.done_json.length-1&&(ZA.push("moveTop"),ZA.push("moveUp")),GA>-1&&GA>0&&(ZA.push("moveDown"),ZA.push("moveBottom")),contextMenuStore.setDisplayItem(ZA),contextMenuStore.setMenuInfo({...contextMenuStore.menuInfo,left:nA.clientX,top:nA.clientY}),globalStore.setIntention("showContextMenu")},Og=()=>{globalStore.setSelectItems(globalStore.done_json.map(nA=>nA.id))},gA=()=>{globalStore.selected_items_id.length<1||(cacheStore.setCopy(globalStore.done_json.filter(nA=>globalStore.selected_items_id.includes(nA.id))),ElMessage.success("复制成功"))},IA=nA=>(nA.forEach(oA=>{oA.id=oA.tag+"-"+randomString(),oA.type=="sys-line"?oA.props.bind_anchors.val={start:null,end:null}:oA.type=="group"&&oA.children&&(oA.children=IA(oA.children))}),nA),Pg=(nA,oA)=>{if(cacheStore.copy.length<1)return;const ZA=IA(objectDeepClone(cacheStore.copy)).map(GA=>({...GA,binfo:{...GA.binfo,left:GA.binfo.left-nA,top:GA.binfo.top-oA}}));ZA.forEach(GA=>registerNewItemAtSop(GA,Ig.value)),globalStore.setGlobalStoreDoneJson([...globalStore.done_json,...ZA]),globalStore.setSelectItems(ZA.map(GA=>GA.id)),cacheStore.addHistory(globalStore.done_json)},qg=()=>{globalStore.selected_items_id.length<1||deleteItemsAtSop(Ig.value,[...globalStore.selected_items_id])},lA=()=>{globalStore.selected_items_id.length<2||Vg()},pA=()=>{globalStore.selected_items_id.length>1||Wg()},VA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.find(oA=>oA.id===globalStore.selected_items_id[0]);globalStore.setGlobalStoreDoneJson([...globalStore.done_json.filter(oA=>oA.id!==nA.id),nA]),cacheStore.addHistory(globalStore.done_json)},XA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.find(oA=>oA.id===globalStore.selected_items_id[0]);globalStore.setGlobalStoreDoneJson([nA,...globalStore.done_json.filter(oA=>oA.id!==nA.id)]),cacheStore.addHistory(globalStore.done_json)},hA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.findIndex(ZA=>ZA.id===globalStore.selected_items_id[0]);if(nA>=globalStore.done_json.length-1){ElMessage.error("已经是最上层了");return}const oA=globalStore.done_json[nA];globalStore.done_json[nA]=globalStore.done_json[nA+1],globalStore.done_json[nA+1]=oA,globalStore.setGlobalStoreDoneJson(globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},CA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.findIndex(ZA=>ZA.id===globalStore.selected_items_id[0]);if(nA<=0){ElMessage.error("已经是最下层了");return}const oA=globalStore.done_json[nA];globalStore.done_json[nA]=globalStore.done_json[nA-1],globalStore.done_json[nA-1]=oA,globalStore.setGlobalStoreDoneJson(globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},DA=()=>{cacheStore.historyIndex!=0&&(cacheStore.historyIndex-=1,globalStore.setGlobalStoreDoneJson(objectDeepClone(cacheStore.history[cacheStore.historyIndex])),globalStore.setSelectItems([]))},EA=()=>{cacheStore.historyIndex!=cacheStore.history.length-1&&(cacheStore.historyIndex+=1,globalStore.setGlobalStoreDoneJson(objectDeepClone(cacheStore.history[cacheStore.historyIndex])),globalStore.setSelectItems([]))},HA=(nA,oA)=>{var ZA;switch(nA){case"selectAll":Og();break;case"copy":gA();break;case"paste":{if(cacheStore.copy.length<1)return;const{realityX:GA,realityY:zA}=getRealityXY(oA,(ZA=Cg.value)==null?void 0:ZA.getBoundingClientRect()),NA=alignToGrid(GA/globalStore.canvasCfg.scale,1),_A=alignToGrid(zA/globalStore.canvasCfg.scale,1);let Xe="",eI=1/0;cacheStore.copy.forEach(xe=>{xe.binfo.top<eI&&(eI=xe.binfo.top,Xe=xe.id)});const ze=cacheStore.copy.find(xe=>xe.id===Xe),Ue=ze.binfo.left-NA,tI=ze.binfo.top-_A;Pg(Ue,tI);break}case"delete":qg();break;case"group":lA();break;case"ungroup":pA();break;case"moveTop":{VA();break}case"moveBottom":{XA();break}case"moveUp":{hA();break}case"moveDown":{CA();break}}globalStore.setIntention("none")},kA=nA=>{nA.ctrlKey&&nA.key.toLocaleLowerCase()==="a"?(nA.preventDefault(),Og()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="c"?(nA.preventDefault(),gA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="v"?(nA.preventDefault(),Pg(10,10)):nA.key.toLocaleLowerCase()==="delete"?(nA.preventDefault(),qg()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="g"?(nA.preventDefault(),lA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="u"?(nA.preventDefault(),pA()):nA.ctrlKey&&nA.key==="ArrowRight"?(nA.preventDefault(),VA()):nA.ctrlKey&&nA.key==="ArrowLeft"?(nA.preventDefault(),XA()):nA.ctrlKey&&nA.key==="ArrowUp"?(nA.preventDefault(),hA()):nA.ctrlKey&&nA.key==="ArrowDown"?(nA.preventDefault(),CA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="z"?(nA.preventDefault(),DA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="y"?(nA.preventDefault(),EA()):nA.key==="ArrowUp"?(nA.preventDefault(),oA(0,-1)):nA.key==="ArrowDown"?(nA.preventDefault(),oA(0,1)):nA.key==="ArrowLeft"?(nA.preventDefault(),oA(-1,0)):nA.key==="ArrowRight"&&(nA.preventDefault(),oA(1,0));function oA(ZA,GA){if(globalStore.selected_items_id.length<1)return;const zA=[];globalStore.done_json.forEach(NA=>{globalStore.selected_items_id.includes(NA.id)&&(NA.binfo.left+=ZA,NA.binfo.top+=GA,NA.type=="sys-line"?NA.props.bind_anchors.val={start:null,end:null}:zA.push(...globalStore.done_json.filter(_A=>{var Xe,eI;return _A.type=="sys-line"&&(((Xe=_A.props.bind_anchors.val.start)==null?void 0:Xe.id)==NA.id||((eI=_A.props.bind_anchors.val.end)==null?void 0:eI.id)==NA.id)})))}),useUpdateSysLine(zA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)}},xA=()=>{sg||(document.addEventListener("keydown",kA),sg=!0)},rA=()=>{sg&&(document.removeEventListener("keydown",kA),sg=!1)},dA=()=>{og.value=!0},MA=nA=>{const oA=[...globalStore.done_json],ZA={...nA,id:nA.tag+"-"+randomString()};oA.push(ZA),registerNewItemAtSop(ZA,Ig.value),globalStore.setGlobalStoreDoneJson(oA),globalStore.setSingleSelect(ZA.id),globalStore.setIntention("none"),cacheStore.addHistory(oA)},$A=()=>{if(!tg.value)return;const{scrollLeft:nA,scrollTop:oA}=tg.value;globalStore.canvasCfg.drag_offset.x=nA,globalStore.canvasCfg.drag_offset.y=oA};return vue.onMounted(()=>{var nA;xA(),(nA=tg.value)==null||nA.addEventListener("scroll",$A)}),vue.onUnmounted(()=>{var nA;rA(),(nA=tg.value)==null||nA.removeEventListener("scroll",$A)}),gg({createGroupItem:Vg,onUngroup:Wg,onAlignSelected:Ug,onRedo:EA,onUndo:DA,beginListenerKeyDown:xA,stopListenerKeyDown:rA}),(nA,oA)=>{var ZA;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"canvas-scroll-container flex-1 min-h-0",ref_key:"scrollContainerRef",ref:tg},[vue.createElementVNode("div",{id:"mtCanvasArea",ref_key:"canvasAreaRef",ref:Cg,class:vue.normalizeClass(`canvasArea ${vue.unref(globalStore).intention=="runDragCanvas"?"cursor-grab":""}`),onDrop:Zg,onDragover:Bg,onTouchstart:oA[3]||(oA[3]=GA=>Zg(GA,!0)),onMousedown:pg,onMousemove:dA,onContextmenu:vue.withModifiers(Mg,["right","prevent"])},[ug.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"canvas-bg-image",src:ug.value,alt:"",draggable:"false"},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0),vue.unref(globalStore).gridCfg.enabled?(vue.openBlock(),vue.createBlock(PatternGrid,{key:1,class:"canvas-pattern-overlay",grid:vue.unref(globalStore).gridCfg.size},null,8,["grid"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$i,{"done-json":dg.value,"onUpdate:doneJson":oA[0]||(oA[0]=GA=>dg.value=GA),"canvas-cfg":vue.unref(globalStore).canvasCfg,"grid-cfg":vue.unref(globalStore).gridCfg,"show-ghost-dom":!(((ZA=vue.unref(globalStore).selected_items_id)==null?void 0:ZA.length)>1),"canvas-dom":Cg.value,"global-lock":vue.unref(globalStore).lock,"line-append-enable":eg.lineAppendEnable,onOnMouseDown:Gg,onOnItemMove:Hg,onOnMoveMouseUp:Sg,onOnItemMouseEnter:Xg,onOnItemMouseLeave:vg,onSetIntention:yg,onOnItemResizeDone:Kg,onOnItemRotateDone:Jg,onOnItemRightClick:vue.withModifiers(Eg,["stop"])},null,8,["done-json","canvas-cfg","grid-cfg","show-ghost-dom","canvas-dom","global-lock","line-append-enable"]),vue.withDirectives(vue.createVNode(SelectedArea,{ref_key:"selectedAreaRef",ref:ig,"scale-ratio":vue.unref(globalStore).canvasCfg.scale,"target-dom":Cg.value,onSelectedAreaMouseUp:fg},null,8,["scale-ratio","target-dom"]),[[vue.vShow,!1]]),vue.createVNode(_sfc_main$f,{ref_key:"dragCanvasRef",ref:ng,"scale-ratio":vue.unref(globalStore).canvasCfg.scale,onDragCanvasMouseDown:Qg,onDragCanvasMouseMove:xg,onDragCanvasMouseUp:Tg},null,8,["scale-ratio"]),vue.withDirectives(vue.createVNode(_sfc_main$d,{ref_key:"dragLineRenderRef",ref:lg,"item-json":mg.value,"onUpdate:itemJson":oA[1]||(oA[1]=GA=>mg.value=GA),"canvas-cfg":vue.unref(globalStore).canvasCfg,"canvas-dom":Cg.value,grid:vue.unref(globalStore).gridCfg,mode:"pen",onDrawLineEnd:MA},null,8,["item-json","canvas-cfg","canvas-dom","grid"]),[[vue.vShow,vue.unref(globalStore).intention=="drawSysLineStart"]]),vue.unref(globalStore).intention=="adsorbStart"||vue.unref(globalStore).intention=="adsorbEnd"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(cacheStore).adsorbPoint,GA=>(vue.openBlock(),vue.createElementBlock("div",{key:GA.type,class:"adsorb-point touch-none",style:vue.normalizeStyle({left:GA.x+"px",top:GA.y+"px"}),"data-id":GA.type,onMouseenter:zA=>Ng(GA),onMouseout:oA[2]||(oA[2]=zA=>Yg())},null,44,_hoisted_4$6))),128))])):vue.createCommentVNode("",!0),oA[4]||(oA[4]=vue.createElementVNode("div",{id:"guide-x"},null,-1)),oA[5]||(oA[5]=vue.createElementVNode("div",{id:"guide-y"},null,-1))],34)],512),vue.createVNode(ContextMenu,{"menu-info":vue.unref(contextMenuStore).menuInfo,show:vue.unref(globalStore).intention=="showContextMenu",onOnContextMenuClick:HA},null,8,["menu-info","show"])])}}}),index_vue_vue_type_style_index_0_scoped_eba46ced_lang="",MainPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-eba46ced"]]),_hoisted_1$9={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_2$6={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_3$5={class:"right-aside-field"},_hoisted_4$5={class:"flex justify-between items-center px-8px py-8px border-t border-#e4e7ed"},_hoisted_5$4={class:"right-aside-field right-aside-color-field"},_hoisted_6$4={class:"right-aside-color-hex"},_hoisted_7$3={class:"right-aside-field right-aside-switch-field"},_hoisted_8$3={class:"right-aside-field right-aside-switch-field"},_hoisted_9$3={class:"right-aside-field right-aside-switch-field"},_hoisted_10$2={class:"right-aside-field right-aside-switch-field"},_hoisted_11$2={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_sfc_main$b=vue.defineComponent({__name:"page-setting",props:{canvasCfg:{},gridCfg:{},activeCollapse:{default:()=>["design"]},embedded:{type:Boolean,default:!1}},emits:["update:canvasCfg","update:gridCfg","update:activeCollapse"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed({get:()=>eg.activeCollapse,set:bg=>Ig("update:activeCollapse",bg)});vue.ref();const tg=vue.computed({get:()=>eg.canvasCfg.width,set:bg=>{updateCanvasBackgroundSize(bg,eg.canvasCfg.height),Ig("update:canvasCfg",{...eg.canvasCfg,width:bg})}}),ig=vue.computed({get:()=>eg.canvasCfg.height,set:bg=>{updateCanvasBackgroundSize(eg.canvasCfg.width,bg),Ig("update:canvasCfg",{...eg.canvasCfg,height:bg})}}),ng=vue.computed({get:()=>eg.canvasCfg.scale,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,scale:bg})}}),lg=vue.computed({get:()=>eg.canvasCfg.scale,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,scale:bg})}}),og=[{value:.5,label:.5},{value:1,label:1},{value:1.5,label:1.5},{value:2,label:2}],sg=vue.computed({get:()=>{var bg;return((bg=eg.canvasCfg.color)==null?void 0:bg.trim())||"#ffffff"},set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,color:bg})}}),rg=vue.computed(()=>{var Zg;return`#${(((Zg=eg.canvasCfg.color)==null?void 0:Zg.trim())||"#ffffff").replace("#","").toUpperCase()}`});vue.ref(!1),vue.ref([]);const cg=vue.computed({get:()=>eg.gridCfg.enabled,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,enabled:bg})}}),ag=vue.computed({get:()=>eg.gridCfg.align,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,align:bg})}}),ug=vue.computed({get:()=>eg.gridCfg.size,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,size:bg})}}),dg=vue.computed({get:()=>eg.canvasCfg.adsorp,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,adsorp:bg})}}),hg=vue.computed({get:()=>eg.canvasCfg.guide,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,guide:bg})}});return(bg,mg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["right-aside-page-setting",{"is-embedded":Ag.embedded}])},[vue.createVNode(vue.unref(ElCollapse),{modelValue:Cg.value,"onUpdate:modelValue":mg[11]||(mg[11]=Zg=>Cg.value=Zg)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"design"},{title:vue.withCtx(()=>[...mg[12]||(mg[12]=[vue.createElementVNode("div",{class:"right-aside-collapse-title"},[vue.createElementVNode("span",{class:"right-aside-triangle","aria-hidden":"true"}),vue.createElementVNode("span",{class:"right-aside-collapse-label"},"界面设计")],-1)])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{class:"right-aside-form form-no-table-border","label-width":"72px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"画布宽度"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$9,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:tg.value,"onUpdate:modelValue":mg[0]||(mg[0]=Zg=>tg.value=Zg),size:"small",controls:!1,min:1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"画布高度"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$6,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:ig.value,"onUpdate:modelValue":mg[1]||(mg[1]=Zg=>ig.value=Zg),size:"small",controls:!1,min:1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放倍数"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$5,[vue.createVNode(vue.unref(ElSelect),{modelValue:lg.value,"onUpdate:modelValue":mg[4]||(mg[4]=Zg=>lg.value=Zg),placeholder:"请设置缩放比例",size:"small",class:"right-aside-field-control"},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(og,Zg=>vue.createVNode(vue.unref(ElOption),{key:Zg.value,label:Zg.label,value:Zg.value},null,8,["label","value"])),64)),vue.createElementVNode("div",_hoisted_4$5,[vue.createVNode(vue.unref(ElText),{size:"small"},{default:vue.withCtx(()=>[...mg[13]||(mg[13]=[vue.createTextVNode("自定义",-1)])]),_:1}),vue.createVNode(vue.unref(ElInputNumber),{modelValue:ng.value,"onUpdate:modelValue":mg[2]||(mg[2]=Zg=>ng.value=Zg),size:"small",step:.1,min:.1,class:"right-aside-scale-custom-number",onClick:mg[3]||(mg[3]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"])])]),_:1},8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"背景颜色"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$4,[vue.createElementVNode("span",_hoisted_6$4,vue.toDisplayString(rg.value),1),vue.createVNode(vue.unref(ElColorPicker),{modelValue:sg.value,"onUpdate:modelValue":mg[5]||(mg[5]=Zg=>sg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),mg[14]||(mg[14]=vue.createElementVNode("div",{class:"right-aside-form-divider","aria-hidden":"true"},null,-1)),vue.createVNode(vue.unref(ElFormItem),{label:"参考线"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElSwitch),{modelValue:hg.value,"onUpdate:modelValue":mg[6]||(mg[6]=Zg=>hg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"吸附"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$3,[vue.createVNode(vue.unref(ElSwitch),{modelValue:dg.value,"onUpdate:modelValue":mg[7]||(mg[7]=Zg=>dg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_9$3,[vue.createVNode(vue.unref(ElSwitch),{modelValue:cg.value,"onUpdate:modelValue":mg[8]||(mg[8]=Zg=>cg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),cg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"网格对齐"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_10$2,[vue.createVNode(vue.unref(ElSwitch),{modelValue:ag.value,"onUpdate:modelValue":mg[9]||(mg[9]=Zg=>ag.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),cg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"网格大小"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_11$2,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:ug.value,"onUpdate:modelValue":mg[10]||(mg[10]=Zg=>ug.value=Zg),min:1,size:"small",controls:!1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["modelValue"])],2))}}),pageSetting_vue_vue_type_style_index_0_scoped_bead2366_lang="",PageSetting=_export_sfc(_sfc_main$b,[["__scopeId","data-v-bead2366"]]);var ace$2={exports:{}};(function(Ag,gg){(function(){var eg="ace",Ig=function(){return this}();!Ig&&typeof window<"u"&&(Ig=window);var Cg=function(sg,rg,cg){if(typeof sg!="string"){Cg.original?Cg.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(cg=rg),Cg.modules[sg]||(Cg.payloads[sg]=cg,Cg.modules[sg]=null)};Cg.modules={},Cg.payloads={};var tg=function(sg,rg,cg){if(typeof rg=="string"){var ag=lg(sg,rg);if(ag!=null)return cg&&cg(),ag}else if(Object.prototype.toString.call(rg)==="[object Array]"){for(var ug=[],dg=0,hg=rg.length;dg<hg;++dg){var bg=lg(sg,rg[dg]);if(bg==null&&ig.original)return;ug.push(bg)}return cg&&cg.apply(null,ug)||!0}},ig=function(sg,rg){var cg=tg("",sg,rg);return cg==null&&ig.original?ig.original.apply(this,arguments):cg},ng=function(sg,rg){if(rg.indexOf("!")!==-1){var cg=rg.split("!");return ng(sg,cg[0])+"!"+ng(sg,cg[1])}if(rg.charAt(0)=="."){var ag=sg.split("/").slice(0,-1).join("/");for(rg=ag+"/"+rg;rg.indexOf(".")!==-1&&ug!=rg;){var ug=rg;rg=rg.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return rg},lg=function(sg,rg){rg=ng(sg,rg);var cg=Cg.modules[rg];if(!cg){if(cg=Cg.payloads[rg],typeof cg=="function"){var ag={},ug={id:rg,uri:"",exports:ag,packaged:!0},dg=function(bg,mg){return tg(rg,bg,mg)},hg=cg(dg,ag,ug);ag=hg||ug.exports,Cg.modules[rg]=ag,delete Cg.payloads[rg]}cg=Cg.modules[rg]=ag||cg}return cg};function og(sg){var rg=Ig;sg&&(Ig[sg]||(Ig[sg]={}),rg=Ig[sg]),(!rg.define||!rg.define.packaged)&&(Cg.original=rg.define,rg.define=Cg,rg.define.packaged=!0),(!rg.require||!rg.require.packaged)&&(ig.original=rg.require,rg.require=ig,rg.require.packaged=!0)}og(eg)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(eg,Ig,Cg){function tg(ig,ng,lg){Object.defineProperty(ig,ng,{value:lg,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||tg(String.prototype,"startsWith",function(ig,ng){return ng=ng||0,this.lastIndexOf(ig,ng)===ng}),String.prototype.endsWith||tg(String.prototype,"endsWith",function(ig,ng){var lg=this;(ng===void 0||ng>lg.length)&&(ng=lg.length),ng-=ig.length;var og=lg.indexOf(ig,ng);return og!==-1&&og===ng}),String.prototype.repeat||tg(String.prototype,"repeat",function(ig){for(var ng="",lg=this;ig>0;)ig&1&&(ng+=lg),(ig>>=1)&&(lg+=lg);return ng}),String.prototype.includes||tg(String.prototype,"includes",function(ig,ng){return this.indexOf(ig,ng)!=-1}),Object.assign||(Object.assign=function(ig){if(ig==null)throw new TypeError("Cannot convert undefined or null to object");for(var ng=Object(ig),lg=1;lg<arguments.length;lg++){var og=arguments[lg];og!=null&&Object.keys(og).forEach(function(sg){ng[sg]=og[sg]})}return ng}),Object.values||(Object.values=function(ig){return Object.keys(ig).map(function(ng){return ig[ng]})}),Array.prototype.find||tg(Array.prototype,"find",function(ig){for(var ng=this.length,lg=arguments[1],og=0;og<ng;og++){var sg=this[og];if(ig.call(lg,sg,og,this))return sg}}),Array.prototype.findIndex||tg(Array.prototype,"findIndex",function(ig){for(var ng=this.length,lg=arguments[1],og=0;og<ng;og++){var sg=this[og];if(ig.call(lg,sg,og,this))return og}}),Array.prototype.includes||tg(Array.prototype,"includes",function(ig,ng){return this.indexOf(ig,ng)!=-1}),Array.prototype.fill||tg(Array.prototype,"fill",function(ig){for(var ng=this,lg=ng.length>>>0,og=arguments[1],sg=og>>0,rg=sg<0?Math.max(lg+sg,0):Math.min(sg,lg),cg=arguments[2],ag=cg===void 0?lg:cg>>0,ug=ag<0?Math.max(lg+ag,0):Math.min(ag,lg);rg<ug;)ng[rg]=ig,rg++;return ng}),Array.of||tg(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(eg,Ig,Cg){eg("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(eg,Ig,Cg){Ig.deepCopy=function tg(ig){if(typeof ig!="object"||!ig)return ig;var ng;if(Array.isArray(ig)){ng=[];for(var lg=0;lg<ig.length;lg++)ng[lg]=tg(ig[lg]);return ng}if(Object.prototype.toString.call(ig)!=="[object Object]")return ig;ng={};for(var lg in ig)ng[lg]=tg(ig[lg]);return ng}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(eg,Ig,Cg){Ig.last=function(ng){return ng[ng.length-1]},Ig.stringReverse=function(ng){return ng.split("").reverse().join("")},Ig.stringRepeat=function(ng,lg){for(var og="";lg>0;)lg&1&&(og+=ng),(lg>>=1)&&(ng+=ng);return og};var tg=/^\s\s*/,ig=/\s\s*$/;Ig.stringTrimLeft=function(ng){return ng.replace(tg,"")},Ig.stringTrimRight=function(ng){return ng.replace(ig,"")},Ig.copyObject=function(ng){var lg={};for(var og in ng)lg[og]=ng[og];return lg},Ig.copyArray=function(ng){for(var lg=[],og=0,sg=ng.length;og<sg;og++)ng[og]&&typeof ng[og]=="object"?lg[og]=this.copyObject(ng[og]):lg[og]=ng[og];return lg},Ig.deepCopy=eg("./deep_copy").deepCopy,Ig.arrayToMap=function(ng){for(var lg={},og=0;og<ng.length;og++)lg[ng[og]]=1;return lg},Ig.createMap=function(ng){var lg=Object.create(null);for(var og in ng)lg[og]=ng[og];return lg},Ig.arrayRemove=function(ng,lg){for(var og=0;og<=ng.length;og++)lg===ng[og]&&ng.splice(og,1)},Ig.escapeRegExp=function(ng){return ng.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},Ig.escapeHTML=function(ng){return(""+ng).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},Ig.getMatchOffsets=function(ng,lg){var og=[];return ng.replace(lg,function(sg){og.push({offset:arguments[arguments.length-2],length:sg.length})}),og},Ig.deferredCall=function(ng){var lg=null,og=function(){lg=null,ng()},sg=function(rg){return sg.cancel(),lg=setTimeout(og,rg||0),sg};return sg.schedule=sg,sg.call=function(){return this.cancel(),ng(),sg},sg.cancel=function(){return clearTimeout(lg),lg=null,sg},sg.isPending=function(){return lg},sg},Ig.delayedCall=function(ng,lg){var og=null,sg=function(){og=null,ng()},rg=function(cg){og==null&&(og=setTimeout(sg,cg||lg))};return rg.delay=function(cg){og&&clearTimeout(og),og=setTimeout(sg,cg||lg)},rg.schedule=rg,rg.call=function(){this.cancel(),ng()},rg.cancel=function(){og&&clearTimeout(og),og=null},rg.isPending=function(){return og},rg},Ig.sleep=function(ng){return new Promise(function(lg){setTimeout(lg,ng)})},Ig.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},Ig.skipEmptyMatch=function(ng,lg,og){return og&&ng.codePointAt(lg)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(eg,Ig,Cg){Ig.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},Ig.getOS=function(){return Ig.isMac?Ig.OS.MAC:Ig.isLinux?Ig.OS.LINUX:Ig.OS.WINDOWS};var tg=typeof navigator=="object"?navigator:{},ig=(/mac|win|linux/i.exec(tg.platform)||["other"])[0].toLowerCase(),ng=tg.userAgent||"",lg=tg.appName||"";Ig.isWin=ig=="win",Ig.isMac=ig=="mac",Ig.isLinux=ig=="linux",Ig.isIE=lg=="Microsoft Internet Explorer"||lg.indexOf("MSAppHost")>=0?parseFloat((ng.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((ng.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),Ig.isOldIE=Ig.isIE&&Ig.isIE<9,Ig.isGecko=Ig.isMozilla=ng.match(/ Gecko\/\d+/),Ig.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",Ig.isWebKit=parseFloat(ng.split("WebKit/")[1])||void 0,Ig.isChrome=parseFloat(ng.split(" Chrome/")[1])||void 0,Ig.isSafari=parseFloat(ng.split(" Safari/")[1])&&!Ig.isChrome||void 0,Ig.isEdge=parseFloat(ng.split(" Edge/")[1])||void 0,Ig.isAIR=ng.indexOf("AdobeAIR")>=0,Ig.isAndroid=ng.indexOf("Android")>=0,Ig.isChromeOS=ng.indexOf(" CrOS ")>=0,Ig.isIOS=/iPad|iPhone|iPod/.test(ng)&&!window.MSStream,Ig.isIOS&&(Ig.isMac=!0),Ig.isMobile=Ig.isIOS||Ig.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(eg,Ig,Cg){var tg=eg("./useragent"),ig="http://www.w3.org/1999/xhtml";Ig.buildDom=function cg(ag,ug,dg){if(typeof ag=="string"&&ag){var hg=document.createTextNode(ag);return ug&&ug.appendChild(hg),hg}if(!Array.isArray(ag))return ag&&ag.appendChild&&ug&&ug.appendChild(ag),ag;if(typeof ag[0]!="string"||!ag[0]){for(var bg=[],mg=0;mg<ag.length;mg++){var Zg=cg(ag[mg],ug,dg);Zg&&bg.push(Zg)}return bg}var Bg=document.createElement(ag[0]),Gg=ag[1],pg=1;Gg&&typeof Gg=="object"&&!Array.isArray(Gg)&&(pg=2);for(var mg=pg;mg<ag.length;mg++)cg(ag[mg],Bg,dg);return pg==2&&Object.keys(Gg).forEach(function(fg){var Vg=Gg[fg];fg==="class"?Bg.className=Array.isArray(Vg)?Vg.join(" "):Vg:typeof Vg=="function"||fg=="value"||fg[0]=="$"?Bg[fg]=Vg:fg==="ref"?dg&&(dg[Vg]=Bg):fg==="style"?typeof Vg=="string"&&(Bg.style.cssText=Vg):Vg!=null&&Bg.setAttribute(fg,Vg)}),ug&&ug.appendChild(Bg),Bg},Ig.getDocumentHead=function(cg){return cg||(cg=document),cg.head||cg.getElementsByTagName("head")[0]||cg.documentElement},Ig.createElement=function(cg,ag){return document.createElementNS?document.createElementNS(ag||ig,cg):document.createElement(cg)},Ig.removeChildren=function(cg){cg.innerHTML=""},Ig.createTextNode=function(cg,ag){var ug=ag?ag.ownerDocument:document;return ug.createTextNode(cg)},Ig.createFragment=function(cg){var ag=cg?cg.ownerDocument:document;return ag.createDocumentFragment()},Ig.hasCssClass=function(cg,ag){var ug=(cg.className+"").split(/\s+/g);return ug.indexOf(ag)!==-1},Ig.addCssClass=function(cg,ag){Ig.hasCssClass(cg,ag)||(cg.className+=" "+ag)},Ig.removeCssClass=function(cg,ag){for(var ug=cg.className.split(/\s+/g);;){var dg=ug.indexOf(ag);if(dg==-1)break;ug.splice(dg,1)}cg.className=ug.join(" ")},Ig.toggleCssClass=function(cg,ag){for(var ug=cg.className.split(/\s+/g),dg=!0;;){var hg=ug.indexOf(ag);if(hg==-1)break;dg=!1,ug.splice(hg,1)}return dg&&ug.push(ag),cg.className=ug.join(" "),dg},Ig.setCssClass=function(cg,ag,ug){ug?Ig.addCssClass(cg,ag):Ig.removeCssClass(cg,ag)},Ig.hasCssString=function(cg,ag){var ug=0,dg;if(ag=ag||document,dg=ag.querySelectorAll("style")){for(;ug<dg.length;)if(dg[ug++].id===cg)return!0}},Ig.removeElementById=function(cg,ag){ag=ag||document,ag.getElementById(cg)&&ag.getElementById(cg).remove()};var ng,lg=[];Ig.useStrictCSP=function(cg){ng=cg,cg==!1?og():lg||(lg=[])};function og(){var cg=lg;lg=null,cg&&cg.forEach(function(ag){sg(ag[0],ag[1])})}function sg(cg,ag,ug){if(!(typeof document>"u")){if(lg){if(ug)og();else if(ug===!1)return lg.push([cg,ag])}if(!ng){var dg=ug;!ug||!ug.getRootNode?dg=document:(dg=ug.getRootNode(),(!dg||dg==ug)&&(dg=document));var hg=dg.ownerDocument||dg;if(ag&&Ig.hasCssString(ag,dg))return null;ag&&(cg+=`
|
|
73
|
+
`],...formatTraceEntry(eg))}),gg}function formatTraceEntry({vnode:Ag,recurseCount:gg}){const eg=gg>0?`... (${gg} recursive calls)`:"",Ig=Ag.component?Ag.component.parent==null:!1,Cg=` at <${formatComponentName(Ag.component,Ag.type,Ig)}`,tg=">"+eg;return Ag.props?[Cg,...formatProps(Ag.props),tg]:[Cg+tg]}function formatProps(Ag){const gg=[],eg=Object.keys(Ag);return eg.slice(0,3).forEach(Ig=>{gg.push(...formatProp(Ig,Ag[Ig]))}),eg.length>3&&gg.push(" ..."),gg}function formatProp(Ag,gg,eg){return isString(gg)?(gg=JSON.stringify(gg),eg?gg:[`${Ag}=${gg}`]):typeof gg=="number"||typeof gg=="boolean"||gg==null?eg?gg:[`${Ag}=${gg}`]:isRef(gg)?(gg=formatProp(Ag,toRaw(gg.value),!0),eg?gg:[`${Ag}=Ref<`,gg,">"]):isFunction$1(gg)?[`${Ag}=fn${gg.name?`<${gg.name}>`:""}`]:(gg=toRaw(gg),eg?gg:[`${Ag}=`,gg])}const ErrorTypeStrings={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function callWithErrorHandling(Ag,gg,eg,Ig){try{return Ig?Ag(...Ig):Ag()}catch(Cg){handleError(Cg,gg,eg)}}function handleError(Ag,gg,eg,Ig=!0){const Cg=gg?gg.vnode:null,{errorHandler:tg,throwUnhandledErrorInProduction:ig}=gg&&gg.appContext.config||EMPTY_OBJ;if(gg){let ng=gg.parent;const lg=gg.proxy,og=process.env.NODE_ENV!=="production"?ErrorTypeStrings[eg]:`https://vuejs.org/error-reference/#runtime-${eg}`;for(;ng;){const sg=ng.ec;if(sg){for(let rg=0;rg<sg.length;rg++)if(sg[rg](Ag,lg,og)===!1)return}ng=ng.parent}if(tg){callWithErrorHandling(tg,null,10,[Ag,lg,og]);return}}logError(Ag,eg,Cg,Ig,ig)}function logError(Ag,gg,eg,Ig=!0,Cg=!1){if(process.env.NODE_ENV!=="production"){const tg=ErrorTypeStrings[gg];if(eg&&pushWarningContext$1(eg),warn$1(`Unhandled error${tg?` during execution of ${tg}`:""}`),eg&&popWarningContext$1(),Ig)throw Ag;console.error(Ag)}else{if(Cg)throw Ag;console.error(Ag)}}let devtools,buffer=[];function setDevtoolsHook(Ag,gg){var eg,Ig;devtools=Ag,devtools?(devtools.enabled=!0,buffer.forEach(({event:Cg,args:tg})=>devtools.emit(Cg,...tg)),buffer=[]):typeof window<"u"&&window.HTMLElement&&!((Ig=(eg=window.navigator)==null?void 0:eg.userAgent)!=null&&Ig.includes("jsdom"))?((gg.__VUE_DEVTOOLS_HOOK_REPLAY__=gg.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(tg=>{setDevtoolsHook(tg,gg)}),setTimeout(()=>{devtools||(gg.__VUE_DEVTOOLS_HOOK_REPLAY__=null,buffer=[])},3e3)):buffer=[]}{const Ag=getGlobalThis(),gg=(eg,Ig)=>{let Cg;return(Cg=Ag[eg])||(Cg=Ag[eg]=[]),Cg.push(Ig),tg=>{Cg.length>1?Cg.forEach(ig=>ig(tg)):Cg[0](tg)}};gg("__VUE_INSTANCE_SETTERS__",eg=>eg),gg("__VUE_SSR_SETTERS__",eg=>eg)}process.env.NODE_ENV;const classifyRE=/(?:^|[-_])\w/g,classify=Ag=>Ag.replace(classifyRE,gg=>gg.toUpperCase()).replace(/[-_]/g,"");function getComponentName(Ag,gg=!0){return isFunction$1(Ag)?Ag.displayName||Ag.name:Ag.name||gg&&Ag.__name}function formatComponentName(Ag,gg,eg=!1){let Ig=getComponentName(gg);if(!Ig&&gg.__file){const Cg=gg.__file.match(/([^/\\]+)\.\w+$/);Cg&&(Ig=Cg[1])}if(!Ig&&Ag){const Cg=tg=>{for(const ig in tg)if(tg[ig]===gg)return ig};Ig=Cg(Ag.components)||Ag.parent&&Cg(Ag.parent.type.components)||Cg(Ag.appContext.components)}return Ig?classify(Ig):eg?"App":"Anonymous"}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function ssrCompile(Ag,gg){throw new Error("On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.")}const{createComponentInstance,setCurrentRenderingInstance,setupComponent,renderComponentRoot,normalizeVNode,pushWarningContext,popWarningContext}=vue.ssrUtils;function createBuffer(){let Ag=!1;const gg=[];return{getBuffer(){return gg},push(eg){const Ig=isString(eg);if(Ag&&Ig){gg[gg.length-1]+=eg;return}gg.push(eg),Ag=Ig,(isPromise(eg)||isArray$4(eg)&&eg.hasAsync)&&(gg.hasAsync=!0)}}}function renderComponentVNode(Ag,gg=null,eg){const Ig=Ag.component=createComponentInstance(Ag,gg,null);process.env.NODE_ENV!=="production"&&pushWarningContext(Ag);const Cg=setupComponent(Ig,!0);process.env.NODE_ENV!=="production"&&popWarningContext();const tg=isPromise(Cg);let ig=Ig.sp;return tg||ig?Promise.resolve(Cg).then(()=>{if(tg&&(ig=Ig.sp),ig)return Promise.all(ig.map(lg=>lg.call(Ig.proxy)))}).catch(NOOP).then(()=>renderComponentSubTree(Ig,eg)):renderComponentSubTree(Ig,eg)}function renderComponentSubTree(Ag,gg){process.env.NODE_ENV!=="production"&&pushWarningContext(Ag.vnode);const eg=Ag.type,{getBuffer:Ig,push:Cg}=createBuffer();if(isFunction$1(eg)){let tg=renderComponentRoot(Ag);if(!eg.props)for(const ig in Ag.attrs)ig.startsWith("data-v-")&&((tg.props||(tg.props={}))[ig]="");renderVNode(Cg,Ag.subTree=tg,Ag,gg)}else{(!Ag.render||Ag.render===NOOP)&&!Ag.ssrRender&&!eg.ssrRender&&isString(eg.template)&&(eg.ssrRender=ssrCompile(eg.template));const tg=Ag.ssrRender||eg.ssrRender;if(tg){let ig=Ag.inheritAttrs!==!1?Ag.attrs:void 0,ng=!1,lg=Ag;for(;;){const sg=lg.vnode.scopeId;sg&&(ng||(ig={...ig},ng=!0),ig[sg]="");const rg=lg.parent;if(rg&&rg.subTree&&rg.subTree===lg.vnode)lg=rg;else break}if(gg){ng||(ig={...ig});const sg=gg.trim().split(" ");for(let rg=0;rg<sg.length;rg++)ig[sg[rg]]=""}const og=setCurrentRenderingInstance(Ag);try{tg(Ag.proxy,Cg,Ag,ig,Ag.props,Ag.setupState,Ag.data,Ag.ctx)}finally{setCurrentRenderingInstance(og)}}else if(Ag.render&&Ag.render!==NOOP)renderVNode(Cg,Ag.subTree=renderComponentRoot(Ag),Ag,gg);else{const ig=eg.name||eg.__file||"<Anonymous>";vue.warn(`Component ${ig} is missing template or render function.`),Cg("<!---->")}}return process.env.NODE_ENV!=="production"&&popWarningContext(),Ig()}function renderVNode(Ag,gg,eg,Ig){const{type:Cg,shapeFlag:tg,children:ig,dirs:ng,props:lg}=gg;switch(ng&&(gg.props=applySSRDirectives(gg,lg,ng)),Cg){case vue.Text:Ag(escapeHtml(ig));break;case vue.Comment:Ag(ig?`<!--${escapeHtmlComment(ig)}-->`:"<!---->");break;case vue.Static:Ag(ig);break;case vue.Fragment:gg.slotScopeIds&&(Ig=(Ig?Ig+" ":"")+gg.slotScopeIds.join(" ")),Ag("<!--[-->"),renderVNodeChildren(Ag,ig,eg,Ig),Ag("<!--]-->");break;default:tg&1?renderElementVNode(Ag,gg,eg,Ig):tg&6?Ag(renderComponentVNode(gg,eg,Ig)):tg&64?renderTeleportVNode(Ag,gg,eg,Ig):tg&128?renderVNode(Ag,gg.ssContent,eg,Ig):vue.warn("[@vue/server-renderer] Invalid VNode type:",Cg,`(${typeof Cg})`)}}function renderVNodeChildren(Ag,gg,eg,Ig){for(let Cg=0;Cg<gg.length;Cg++)renderVNode(Ag,normalizeVNode(gg[Cg]),eg,Ig)}function renderElementVNode(Ag,gg,eg,Ig){const Cg=gg.type;let{props:tg,children:ig,shapeFlag:ng,scopeId:lg}=gg,og=`<${Cg}`;tg&&(og+=ssrRenderAttrs(tg,Cg)),lg&&(og+=` ${lg}`);let sg=eg,rg=gg;for(;sg&&rg===sg.subTree;)rg=sg.vnode,rg.scopeId&&(og+=` ${rg.scopeId}`),sg=sg.parent;if(Ig&&(og+=` ${Ig}`),Ag(og+">"),!isVoidTag(Cg)){let cg=!1;tg&&(tg.innerHTML?(cg=!0,Ag(tg.innerHTML)):tg.textContent?(cg=!0,Ag(escapeHtml(tg.textContent))):Cg==="textarea"&&tg.value&&(cg=!0,Ag(escapeHtml(tg.value)))),cg||(ng&8?Ag(escapeHtml(ig)):ng&16&&renderVNodeChildren(Ag,ig,eg,Ig)),Ag(`</${Cg}>`)}}function applySSRDirectives(Ag,gg,eg){const Ig=[];for(let Cg=0;Cg<eg.length;Cg++){const tg=eg[Cg],{dir:{getSSRProps:ig}}=tg;if(ig){const ng=ig(tg,Ag);ng&&Ig.push(ng)}}return vue.mergeProps(gg||{},...Ig)}function renderTeleportVNode(Ag,gg,eg,Ig){const Cg=gg.props&&gg.props.to,tg=gg.props&&gg.props.disabled;if(!Cg)return tg||vue.warn("[@vue/server-renderer] Teleport is missing target prop."),[];if(!isString(Cg))return vue.warn("[@vue/server-renderer] Teleport target must be a query selector string."),[];ssrRenderTeleport(Ag,ig=>{renderVNodeChildren(ig,gg.children,eg,Ig)},Cg,tg||tg==="",eg)}const{isVNode:isVNode$1}=vue.ssrUtils;function nestedUnrollBuffer(Ag,gg,eg){if(!Ag.hasAsync)return gg+unrollBufferSync$1(Ag);let Ig=gg;for(let Cg=eg;Cg<Ag.length;Cg+=1){const tg=Ag[Cg];if(isString(tg)){Ig+=tg;continue}if(isPromise(tg))return tg.then(ng=>(Ag[Cg]=ng,nestedUnrollBuffer(Ag,Ig,Cg)));const ig=nestedUnrollBuffer(tg,Ig,0);if(isPromise(ig))return ig.then(ng=>(Ag[Cg]=ng,nestedUnrollBuffer(Ag,"",Cg)));Ig=ig}return Ig}function unrollBuffer$1(Ag){return nestedUnrollBuffer(Ag,"",0)}function unrollBufferSync$1(Ag){let gg="";for(let eg=0;eg<Ag.length;eg++){let Ig=Ag[eg];isString(Ig)?gg+=Ig:gg+=unrollBufferSync$1(Ig)}return gg}async function renderToString(Ag,gg={}){if(isVNode$1(Ag))return renderToString(vue.createApp({render:()=>Ag}),gg);const eg=vue.createVNode(Ag._component,Ag._props);eg.appContext=Ag._context,Ag.provide(vue.ssrContextKey,gg);const Ig=await renderComponentVNode(eg),Cg=await unrollBuffer$1(Ig);if(await resolveTeleports(gg),gg.__watcherHandles)for(const tg of gg.__watcherHandles)tg();return Cg}async function resolveTeleports(Ag){if(Ag.__teleportBuffers){Ag.teleports=Ag.teleports||{};for(const gg in Ag.__teleportBuffers)Ag.teleports[gg]=await unrollBuffer$1(await Promise.all([Ag.__teleportBuffers[gg]]))}}vue.initDirectivesForSSR();const _hoisted_1$r=["src"],_sfc_main$u=vue.defineComponent({__name:"index",setup(Ag){const gg=vue.ref(""),eg=vue.useSlots(),Ig=async()=>{const Cg=eg.default?eg.default():[],tg=await renderToString(Cg[0]);gg.value=svgToImgSrc(tg)};return vue.onMounted(async()=>{await Ig()}),vue.watch(()=>eg.default(),async()=>{await Ig()},{deep:!0}),(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("img",{draggable:"false",class:"w-1/1 h-1/1",src:gg.value},null,8,_hoisted_1$r))}}),_hoisted_1$q={class:"w-1/1 h-1/1"},_hoisted_2$g=["src"],_sfc_main$t=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},doneJson:{default:()=>[]},lockState:{type:Boolean},lineAppendEnable:{type:Boolean,default:!1}},emits:["update:itemJson","setIntention","lineMouseUp"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed({get:()=>eg.itemJson,set:ig=>{Ig("update:itemJson",ig)}}),tg=(ig,ng)=>{ig.modelValue&&Ig("update:itemJson",{...Cg.value,props:{...Cg.value.props,modelValue:{...Cg.value.props.modelValue,val:ng}}})};return(ig,ng)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$q,[Cg.value.type==="svg"?(vue.openBlock(),vue.createBlock(_sfc_main$x,{key:0,draggable:"false","symbol-id":Cg.value.symbol.symbol_id,"symbol-str":Cg.value.symbol.symbol_str,width:Cg.value.symbol.width,height:Cg.value.symbol.height,props:Cg.value.props},null,8,["symbol-id","symbol-str","width","height","props"])):Cg.value.type==="group"?(vue.openBlock(),vue.createBlock(GroupRender,{key:1,"item-json":Cg.value,grid:eg.grid,"canvas-cfg":eg.canvasCfg,"canvas-dom":eg.canvasDom},null,8,["item-json","grid","canvas-cfg","canvas-dom"])):Cg.value.type==="vue"?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Cg.value.tag),vue.mergeProps({key:2,draggable:"false"},vue.unref(prosToVBind)(Cg.value.props),{"onUpdate:modelValue":ng[0]||(ng[0]=lg=>tg(Cg.value.props,lg))}),null,16)):Cg.value.type==="img"?(vue.openBlock(),vue.createElementBlock("img",{key:3,draggable:"false",class:"w-1/1 h-1/1",src:Cg.value.thumbnail},null,8,_hoisted_2$g)):Cg.value.type==="custom-svg"?(vue.openBlock(),vue.createBlock(_sfc_main$u,{key:4},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Cg.value.tag),vue.mergeProps(vue.unref(prosToVBind)(Cg.value.props),{id:Cg.value.id}),null,16,["id"]))]),_:1})):Cg.value.type==="sys-line"?(vue.openBlock(),vue.createBlock(LineRender,{key:5,"item-json":Cg.value,"onUpdate:itemJson":ng[1]||(ng[1]=lg=>Cg.value=lg),"canvas-cfg":eg.canvasCfg,grid:eg.grid,"canvas-dom":eg.canvasDom,"done-json":eg.doneJson,"lock-state":eg.lockState,mode:eg.lineAppendEnable?"line-edit":"normal",onSetIntention:ng[2]||(ng[2]=lg=>Ig("setIntention",lg)),onLineMouseUp:ng[3]||(ng[3]=lg=>Ig("lineMouseUp"))},null,8,["item-json","canvas-cfg","grid","canvas-dom","done-json","lock-state","mode"])):vue.createCommentVNode("",!0)]))}}),cacheStore=vue.reactive({boundingBox:[],setBoundingBox:Ag=>{cacheStore.boundingBox=Ag},adsorbPoint:[],setAdsorbPoint(Ag){cacheStore.adsorbPoint=Ag},copy:[],setCopy(Ag){cacheStore.copy=Ag},history:[[]],historyIndex:0,addHistory(Ag){vue.nextTick(()=>{cacheStore.historyIndex+1<cacheStore.history.length&&cacheStore.history.splice(cacheStore.historyIndex+1),cacheStore.history.push(objectDeepClone(Ag)),cacheStore.historyIndex=cacheStore.history.length-1,cacheStore.history.length>20&&(cacheStore.history.shift(),cacheStore.historyIndex=cacheStore.history.length-1)})}}),_sfc_main$s=vue.defineComponent({__name:"index",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""},vertical:{type:Boolean,default:!1}},setup(Ag){const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("p",{class:vue.normalizeClass(["break-words w-1/1 h-1/1",gg.vertical?"text-vertical":""]),style:vue.normalizeStyle({fontFamily:gg.fontFamily,fontSize:gg.fontSize+"px",color:gg.fill})},vue.toDisplayString(gg.text),7))}}),index_vue_vue_type_style_index_0_scoped_cef6b2df_lang="",TextVue=_export_sfc(_sfc_main$s,[["__scopeId","data-v-cef6b2df"]]),_hoisted_1$p={class:"w-1/1 h-1/1 flex justify-center items-center custom-card"},_sfc_main$r=vue.defineComponent({__name:"index",props:{shadow:{type:String,default:""},backGroundColor:{type:String,default:"#ffffff"},boxShadow:{type:String,default:"#ffffff"}},setup(Ag){vue.useCssVars(eg=>({v138f13ac:`0px 0px 12px ${eg.$props.boxShadow}`}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$p,[vue.createVNode(vue.unref(ElCard),{class:"w-95/100 h-95/100",shadow:gg.shadow,style:vue.normalizeStyle({"background-color":gg.backGroundColor})},null,8,["shadow","style"])]))}}),index_vue_vue_type_style_index_0_lang$1="",_hoisted_1$o={class:"flex"},_sfc_main$q=vue.defineComponent({__name:"index",props:{fontColor:{type:String,default:"#000000"},dateSize:{type:Number,default:12},weekSize:{type:Number,default:12},timeSize:{type:Number,default:24}},setup(Ag){const gg=Ag,eg=vue.ref(new Date),Ig=vue.ref(),Cg=vue.computed(()=>{const ng=eg.value.getFullYear(),lg=eg.value.getMonth()+1,og=eg.value.getDate();return ng.toString()+"年"+lg.toString()+"月"+og.toString()+"日"}),tg=vue.computed(()=>{const ng=eg.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][ng]}),ig=vue.computed(()=>{const ng=eg.value.getHours(),lg=eg.value.getMinutes(),og=eg.value.getSeconds();return(ng<10?"0"+ng.toString():ng.toString())+":"+(lg<10?"0"+lg.toString():lg.toString())+":"+(og<10?"0"+og.toString():og.toString())});return vue.onMounted(()=>{Ig.value=setInterval(()=>{eg.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(Ig.value)}),(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",_hoisted_1$o,[vue.createElementVNode("div",{class:"font-bold",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.dateSize}px`})},vue.toDisplayString(Cg.value),5),vue.createElementVNode("div",{class:"font-bold ml-5px",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.weekSize}px `})},vue.toDisplayString(tg.value),5)]),vue.createElementVNode("div",{class:"font-bold mt-5px ml-5px",style:vue.normalizeStyle({color:gg.fontColor,fontSize:`${gg.timeSize}px `})},vue.toDisplayString(ig.value),5)]))}}),_hoisted_1$n={class:"w-1/1 h-1/1 kvTable"},_hoisted_2$f={class:"kvKey kvKeyValue",colspan:"1"},_hoisted_3$e={class:"kvValue kvKeyValue",colspan:"1"},_sfc_main$p=vue.defineComponent({__name:"index",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},label:{type:String,default:""},labelWidth:{type:Number,default:50},value:{type:String,default:""},valueWidth:{type:Number,default:50},color:{type:String,default:""},border:{type:Boolean,default:!0},borderColor:{type:String,default:""}},setup(Ag){vue.useCssVars(eg=>({v7f505933:`${gg.border?1:0}px solid ${gg.borderColor}`,v52fbad19:`${gg.fontSize}px`,v4f5c51c4:`${gg.fontFamily}`,v2cd2a6f8:`${gg.color}`,v1e69a24a:`${gg.labelWidth}px`,v09d9875d:`${gg.border?1:0}px`,v27cd9bac:`${gg.borderColor}`,v9ea2ce04:`${gg.valueWidth}px`}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("table",_hoisted_1$n,[vue.createElementVNode("tbody",null,[vue.createElementVNode("tr",null,[vue.createElementVNode("td",_hoisted_2$f,vue.toDisplayString(gg.label),1),vue.createElementVNode("td",_hoisted_3$e,vue.toDisplayString(gg.value),1)])])]))}}),index_vue_vue_type_style_index_0_scroped_true_lang="",_hoisted_1$m={style:{width:"100%",height:"100%"}},_sfc_main$o=vue.defineComponent({__name:"index",props:{text:{type:String,default:"按钮文本"},type:{type:String,default:""},round:{type:Boolean,default:!1}},setup(Ag){const gg=Ag,eg=(Ig,Cg)=>{let tg="",ig="4px";return Ig=="primary"?tg="#409eff":Ig=="success"?tg="#67c23a":Ig=="warning"?tg="#e6a23c":Ig=="danger"?tg="#f56c6c":Ig=="info"&&(tg="#909399"),Cg&&(ig="20px"),{backgroundColor:tg,borderRadius:ig}};return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$m,[vue.createElementVNode("button",{class:"w-1/1 h-1/1",style:vue.normalizeStyle(eg(gg.type,gg.round))},[vue.createVNode(vue.unref(ElText),null,{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(gg.text),1)]),_:1})],4)]))}}),_hoisted_1$l={class:"rotor-container"},_hoisted_2$e={class:"rotor-circle"},_hoisted_3$d={class:"rotor-text"},_sfc_main$n=vue.defineComponent({__name:"index",props:{text:{type:String,default:"转子"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:20},borderWidth:{type:Number,default:6}},setup(Ag){vue.useCssVars(eg=>({v7e677b45:gg.borderWidth+"px",v130ce1e1:gg.circleColor,v50bf8f24:gg.textColor,v237eca2b:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$l,[vue.createElementVNode("div",_hoisted_2$e,[Ig[0]||(Ig[0]=vue.createElementVNode("div",{class:"rotor-cross"},[vue.createElementVNode("div",{class:"cross-horizontal"}),vue.createElementVNode("div",{class:"cross-vertical"})],-1)),vue.createElementVNode("span",_hoisted_3$d,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_200211fd_lang="",RotorVue=_export_sfc(_sfc_main$n,[["__scopeId","data-v-200211fd"]]),_hoisted_1$k={class:"cover-container"},_hoisted_2$d={class:"cover-circle"},_hoisted_3$c={class:"cover-text"},_sfc_main$m=vue.defineComponent({__name:"index",props:{text:{type:String,default:"顶盖"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:10},borderWidth:{type:Number,default:4},borderStyle:{type:String,default:"solid"}},setup(Ag){vue.useCssVars(eg=>({c4a87e82:gg.borderWidth+"px",v4bdee219:gg.borderStyle,v1a6271a7:gg.circleColor,v05a2586a:gg.textColor,v625b06f1:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createElementVNode("div",_hoisted_2$d,[vue.createElementVNode("span",_hoisted_3$c,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_f47d1493_lang="",TopcoverVue=_export_sfc(_sfc_main$m,[["__scopeId","data-v-f47d1493"]]),_hoisted_1$j={class:"recttext-container"},_sfc_main$l=vue.defineComponent({__name:"index",props:{text:{type:String,default:"文字"},backgroundColor:{type:String,default:"#ffffff"},borderColor:{type:String,default:"#000000"},borderWidth:{type:Number,default:2},borderStyle:{type:String,default:"solid"},textColor:{type:String,default:"#000000"},fontSize:{type:Number,default:14},borderRadius:{type:Number,default:4}},setup(Ag){const gg=Ag,eg=()=>({backgroundColor:gg.backgroundColor,borderColor:gg.borderColor,borderWidth:`${gg.borderWidth}px`,borderStyle:gg.borderStyle,borderRadius:`${gg.borderRadius}px`}),Ig=()=>({color:gg.textColor,fontSize:`${gg.fontSize}px`});return(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$j,[vue.createElementVNode("div",{class:"recttext-box",style:vue.normalizeStyle(eg())},[vue.createElementVNode("span",{class:"recttext-text",style:vue.normalizeStyle(Ig())},vue.toDisplayString(gg.text),5)],4)]))}}),index_vue_vue_type_style_index_0_scoped_d0feff13_lang="",RecttextVue=_export_sfc(_sfc_main$l,[["__scopeId","data-v-d0feff13"]]),_hoisted_1$i={class:"rotor-container"},_hoisted_2$c={class:"rotor-circle"},_hoisted_3$b={class:"rotor-text"},_sfc_main$k=vue.defineComponent({__name:"index",props:{text:{type:String,default:"机架"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:20},borderWidth:{type:Number,default:6}},setup(Ag){vue.useCssVars(eg=>({v532d7b92:gg.borderWidth+"px",a301b1a2:gg.circleColor,v7efecff2:gg.textColor,f2dc8f0e:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",_hoisted_2$c,[Ig[0]||(Ig[0]=vue.createElementVNode("div",{class:"rotor-cross"},[vue.createElementVNode("div",{class:"cross-horizontal"}),vue.createElementVNode("div",{class:"cross-vertical"})],-1)),vue.createElementVNode("span",_hoisted_3$b,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_b15ecab5_lang="",JijiaVue=_export_sfc(_sfc_main$k,[["__scopeId","data-v-b15ecab5"]]),_hoisted_1$h={class:"panche-container"},_hoisted_2$b={class:"panche-circle"},_hoisted_3$a={class:"panche-text"},_sfc_main$j=vue.defineComponent({__name:"index",props:{text:{type:String,default:"盘车装置"},textColor:{type:String,default:"#000000"},circleColor:{type:String,default:"#000000"},fontSize:{type:Number,default:10},borderWidth:{type:Number,default:4},borderStyle:{type:String,default:"solid"}},setup(Ag){vue.useCssVars(eg=>({v287a66df:gg.borderWidth+"px",v835e400e:gg.borderStyle,e65720f2:gg.circleColor,v3e3a4e4a:gg.textColor,v2ddb14d1:gg.fontSize+"px"}));const gg=Ag;return(eg,Ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[vue.createElementVNode("div",_hoisted_2$b,[vue.createElementVNode("span",_hoisted_3$a,vue.toDisplayString(gg.text),1)])]))}}),index_vue_vue_type_style_index_0_scoped_2c60328f_lang="",PancheVue=_export_sfc(_sfc_main$j,[["__scopeId","data-v-2c60328f"]]),_hoisted_1$g={key:0},_sfc_main$i=vue.defineComponent({__name:"index",props:{doneJson:{default:()=>[]},canvasCfg:{},gridCfg:{},showGhostDom:{type:Boolean,default:!0},canvasDom:{},globalLock:{type:Boolean},preivewMode:{type:Boolean,default:!1},lineAppendEnable:{type:Boolean,default:!1},showPopover:{type:Boolean,default:!0}},emits:["update:doneJson","onMouseDown","onItemMove","onMoveMouseUp","onItemMouseEnter","onItemMouseLeave","setIntention","onItemResizeDone","onItemRotateDone","onItemRightClick"],setup(Ag,{emit:gg}){var pg;const eg=vue.getCurrentInstance(),Ig=Object.keys((pg=eg==null?void 0:eg.appContext)==null?void 0:pg.components);Ig.includes("text-vue")||eg==null||eg.appContext.app.component("text-vue",TextVue),Ig.includes("card-vue")||eg==null||eg.appContext.app.component("card-vue",_sfc_main$r),Ig.includes("now-time-vue")||eg==null||eg.appContext.app.component("now-time-vue",_sfc_main$q),Ig.includes("kv-vue")||eg==null||eg.appContext.app.component("kv-vue",_sfc_main$p),Ig.includes("sys-button-vue")||eg==null||eg.appContext.app.component("sys-button-vue",_sfc_main$o),Ig.includes("rotor-vue")||eg==null||eg.appContext.app.component("rotor-vue",RotorVue),Ig.includes("topcover-vue")||eg==null||eg.appContext.app.component("topcover-vue",TopcoverVue),Ig.includes("jijia-vue")||eg==null||eg.appContext.app.component("jijia-vue",JijiaVue),Ig.includes("panche-vue")||eg==null||eg.appContext.app.component("panche-vue",PancheVue),Ig.includes("recttext-vue")||eg==null||eg.appContext.app.component("recttext-vue",RecttextVue);const Cg=Ag,tg=gg,ig=vue.computed(()=>Cg.doneJson.filter(fg=>!fg.isDelete&&!fg.hide)),ng=vue.ref([]),lg=(fg,Vg)=>{ng.value=globalStore.done_json.filter(Wg=>Wg.id!==fg.id).map(Wg=>({id:Wg.id,left:Wg.binfo.left,top:Wg.binfo.top})),Vg.stopPropagation(),tg("onMouseDown",fg,Vg)},og=(fg,Vg)=>{tg("update:doneJson",[...Cg.doneJson.map(Wg=>Wg.id===fg?{...Wg,binfo:Vg}:Wg)])},sg=(fg,Vg)=>{globalStore.setRealTimeData({show:!0,text:`${fg.new_lt.left},${fg.new_lt.top}`}),vue.nextTick(()=>{const Hg={move_item_bounding_info:globalStore.selected_items_id.map(Sg=>{const wg=document.getElementById(Sg);if(!wg)return null;const{left:Xg,top:vg,width:yg,height:Ng,right:Yg,bottom:Kg}=wg.getBoundingClientRect(),Jg=globalStore.done_json.find(Ug=>Ug.id===Sg);return Jg?{id:Sg,type:Jg.type,left:Xg,top:vg,width:yg,height:Ng,right:Yg,bottom:Kg}:null}).filter(Sg=>Sg!==null),move_binfo:fg.move_binfo};if(globalStore.selected_items_id.length>1){const Sg=globalStore.selected_items_id.filter(wg=>wg!==Vg);tg("update:doneJson",[...Cg.doneJson.map(wg=>{if(Sg.includes(wg.id)){const Xg=ng.value.find(vg=>vg.id===wg.id);return{...wg,binfo:{...wg.binfo,left:(Xg==null?void 0:Xg.left)+fg.move_length.x,top:(Xg==null?void 0:Xg.top)+fg.move_length.y}}}return wg})])}tg("onItemMove",Hg)})},rg=()=>{tg("onMoveMouseUp"),globalStore.setRealTimeData({show:!1,text:""})},cg=fg=>!fg.common_animations||!fg.common_animations.val?"":`animate__animated animate__${fg.common_animations.val} animate__${fg.common_animations.speed} animate__${fg.common_animations.repeat} animate__${fg.common_animations.delay}`,ag=(fg,Vg)=>{const Wg=[...Cg.doneJson];Wg[fg]=Vg,tg("update:doneJson",Wg)},ug=(fg,Vg)=>{tg("onItemMouseEnter",fg,Vg)},dg=(fg,Vg)=>{tg("onItemMouseLeave",fg,Vg)},hg=fg=>{globalStore.setRealTimeData({show:!0,text:`${fg==null?void 0:fg.width}x${fg==null?void 0:fg.height}`})},bg=fg=>{tg("onItemResizeDone",fg),globalStore.setRealTimeData({show:!1,text:""})},mg=fg=>{globalStore.setRealTimeData({show:!0,text:`${fg==null?void 0:fg.angle}°`})},Zg=fg=>{globalStore.setRealTimeData({show:!1,text:""}),tg("onItemRotateDone",fg)},Bg=(fg,Vg)=>{tg("onItemRightClick",fg,Vg)},Gg=()=>{setTimeout(()=>{cacheStore.addHistory(globalStore.done_json)},1e3)};return(fg,Vg)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ig.value,(Wg,Hg)=>(vue.openBlock(),vue.createBlock(MtDzr,{id:Wg.id,key:Wg.id,modelValue:Wg.binfo,"onUpdate:modelValue":[Sg=>Wg.binfo=Sg,Sg=>og(Wg.id,Sg)],"scale-ratio":Cg.canvasCfg.scale,grid:Cg.gridCfg,resize:Wg.resize,rotate:Wg.rotate,lock:Cg.globalLock?!0:Wg.lock,active:Cg.preivewMode?!1:Wg.active,useProportionalScaling:Wg.use_proportional_scaling,"show-ghost-dom":Cg.showGhostDom,hide:Wg.hide,disabled:Cg.preivewMode,adsorp_diff:vue.unref(globalStore).adsorp_diff,onMousedown:Sg=>lg(Wg,Sg),onOnItemMove:Sg=>sg(Sg,Wg.id),onMoveMouseUp:Vg[2]||(Vg[2]=Sg=>rg()),onOnMouseEnter:Sg=>ug(Sg,Wg),onOnMouseLeave:Sg=>dg(Sg,Wg),onOnResizeMove:Vg[3]||(Vg[3]=Sg=>hg(Sg)),onOnResizeDone:Sg=>bg(Wg),onOnRotateMove:Vg[4]||(Vg[4]=Sg=>mg(Sg)),onOnRotateDone:Sg=>Zg(Wg),onOnRightClick:Sg=>Bg(Sg,Wg),class:vue.normalizeClass(`${Wg.type=="sys-line"?"pointer-events-none":""} ${cg(Wg)} cursor-pointer`)},{default:vue.withCtx(()=>[Cg.preivewMode&&Cg.showPopover?(vue.openBlock(),vue.createBlock(vue.unref(ElPopover),{key:0,placement:"top-start",title:"属性信息",width:200,trigger:"hover"},{reference:vue.withCtx(()=>[vue.createVNode(_sfc_main$t,vue.mergeProps({"item-json":Wg,"canvas-cfg":Cg.canvasCfg,"canvas-dom":Cg.canvasDom,grid:Cg.gridCfg,"done-json":Cg.doneJson,"lock-state":Cg.globalLock?!0:Wg.lock,"line-append-enable":Cg.lineAppendEnable,"onUpdate:itemJson":Sg=>ag(Hg,Sg),onSetIntention:Vg[0]||(Vg[0]=Sg=>tg("setIntention",Sg)),onLineMouseUp:Gg},vue.toHandlers(Cg.preivewMode?vue.unref(eventToVOn)(Wg):{})),null,16,["item-json","canvas-cfg","canvas-dom","grid","done-json","lock-state","line-append-enable","onUpdate:itemJson"])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Wg.props,(Sg,wg)=>(vue.openBlock(),vue.createElementBlock("div",{key:wg},[Sg.disabled?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$g,vue.toDisplayString(Sg.title)+":"+vue.toDisplayString(Sg.val),1))]))),128))]),_:2},1024)):(vue.openBlock(),vue.createBlock(_sfc_main$t,vue.mergeProps({key:1,"item-json":Wg,"canvas-cfg":Cg.canvasCfg,"canvas-dom":Cg.canvasDom,grid:Cg.gridCfg,"done-json":Cg.doneJson,"lock-state":Cg.globalLock?!0:Wg.lock,"line-append-enable":Cg.lineAppendEnable,"onUpdate:itemJson":Sg=>ag(Hg,Sg),onSetIntention:Vg[1]||(Vg[1]=Sg=>tg("setIntention",Sg)),onLineMouseUp:Gg},vue.toHandlers(Cg.preivewMode?vue.unref(eventToVOn)(Wg):{})),null,16,["item-json","canvas-cfg","canvas-dom","grid","done-json","lock-state","line-append-enable","onUpdate:itemJson"]))]),_:2},1032,["id","modelValue","onUpdate:modelValue","scale-ratio","grid","resize","rotate","lock","active","useProportionalScaling","show-ghost-dom","hide","disabled","adsorp_diff","onMousedown","onOnItemMove","onOnMouseEnter","onOnMouseLeave","onOnResizeDone","onOnRotateDone","onOnRightClick","class"]))),128))}}),_hoisted_1$f={width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg"},_hoisted_2$a=["width","height"],_hoisted_3$9=["d","stroke"],_hoisted_4$8=["width","height"],_hoisted_5$6=["width","height"],_hoisted_6$6=["d","stroke"],_sfc_main$h=vue.defineComponent({__name:"index",props:{grid:{type:Number,default:10},gridCount:{type:Number,default:5},showSmall:{type:Boolean,default:!0}},setup(Ag){const gg=useDark({selector:"#mt-edit"}),eg=Ag,Ig=vue.computed(()=>eg.grid*eg.gridCount),Cg=vue.computed(()=>{const ig=[["#e4e4e4","#ebebeb"],["#414141","#363636"]],[ng,lg]=ig[gg?0:1];return{bigGrid:ng,grid:lg}}),tg=vue.computed(()=>({"--border-color":Cg.value.bigGrid}));return(ig,ng)=>(vue.openBlock(),vue.createElementBlock("div",{class:"grid-rect",style:vue.normalizeStyle(tg.value)},[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$f,[vue.createElementVNode("defs",null,[Ag.showSmall?(vue.openBlock(),vue.createElementBlock("pattern",{key:0,id:"smallGrid",width:Ag.grid,height:Ag.grid,patternUnits:"userSpaceOnUse"},[vue.createElementVNode("path",{d:`M ${Ag.grid} 0 L 0 0 0 ${Ag.grid}`,fill:"none",stroke:Cg.value.grid,"stroke-width":"0.5"},null,8,_hoisted_3$9)],8,_hoisted_2$a)):vue.createCommentVNode("",!0),vue.createElementVNode("pattern",{id:"grid",width:Ig.value,height:Ig.value,patternUnits:"userSpaceOnUse"},[Ag.showSmall?(vue.openBlock(),vue.createElementBlock("rect",{key:0,width:Ig.value,height:Ig.value,fill:"url(#smallGrid)"},null,8,_hoisted_5$6)):vue.createCommentVNode("",!0),vue.createElementVNode("path",{d:`M ${Ig.value} 0 L 0 0 0 ${Ig.value}`,fill:"none",stroke:Cg.value.bigGrid,"stroke-width":"1"},null,8,_hoisted_6$6)],8,_hoisted_4$8)]),ng[0]||(ng[0]=vue.createElementVNode("rect",{width:"100%",height:"100%",fill:"url(#grid)"},null,-1))]))],4))}}),index_vue_vue_type_style_index_0_scoped_e248ab51_lang="",PatternGrid=_export_sfc(_sfc_main$h,[["__scopeId","data-v-e248ab51"]]),_hoisted_1$e={class:"mt-selected-area"},_sfc_main$g=vue.defineComponent({__name:"index",props:{scaleRatio:{default:1},targetDom:{default:null}},emits:["selectedAreaMouseUp"],setup(Ag,{expose:gg,emit:eg}){vue.useCssVars(ng=>({v0480acc6:tg.value.width+"px",v533d0e32:tg.value.height+"px",v4ea033d2:tg.value.top+"px",v23204a47:tg.value.left+"px"}));const Ig=Ag,Cg=eg,tg=vue.ref({width:0,height:0,top:0,left:0});return gg({onMouseDown:ng=>{var ug;const{realityX:lg,realityY:og}=getRealityXY(ng,(ug=Ig.targetDom)==null?void 0:ug.getBoundingClientRect()),sg=ng instanceof MouseEvent?ng.clientX:ng.touches[0].pageX,rg=ng instanceof MouseEvent?ng.clientY:ng.touches[0].pageY,cg=dg=>{const hg=dg instanceof MouseEvent?dg.clientX:dg.touches[0].pageX,bg=dg instanceof MouseEvent?dg.clientY:dg.touches[0].pageY,mg=(hg-sg)/Ig.scaleRatio,Zg=(bg-rg)/Ig.scaleRatio;let Bg=lg/Ig.scaleRatio,Gg=og/Ig.scaleRatio,pg=Math.abs(mg),fg=Math.abs(Zg);mg<0&&(Bg=lg/Ig.scaleRatio-pg),Zg<0&&(Gg=og/Ig.scaleRatio-fg),tg.value={width:pg,height:fg,left:Bg,top:Gg}},ag=()=>{document.removeEventListener("mousemove",cg),document.removeEventListener("mouseup",ag),document.removeEventListener("touchmove",cg),document.removeEventListener("touchend",ag),Cg("selectedAreaMouseUp",vue.unref(tg)),tg.value={width:0,height:0,top:0,left:0}};document.addEventListener("mousemove",cg),document.addEventListener("mouseup",ag),document.addEventListener("touchmove",cg),document.addEventListener("touchend",ag)}}),(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e))}}),index_vue_vue_type_style_index_0_scoped_3704de4f_lang="",SelectedArea=_export_sfc(_sfc_main$g,[["__scopeId","data-v-3704de4f"]]),_hoisted_1$d={class:"hidden"},_sfc_main$f=vue.defineComponent({__name:"index",props:{scaleRatio:{default:1}},emits:["dragCanvasMouseDown","dragCanvasMouseMove","dragCanvasMouseUp"],setup(Ag,{expose:gg,emit:eg}){const Ig=eg;return gg({onMouseDown:tg=>{let ig=0,ng=0;const lg=tg instanceof MouseEvent?tg.clientX:tg.touches[0].pageX,og=tg instanceof MouseEvent?tg.clientY:tg.touches[0].pageY;Ig("dragCanvasMouseDown",lg,og);const sg=cg=>{const ag=cg instanceof MouseEvent?cg.clientX:cg.touches[0].pageX,ug=cg instanceof MouseEvent?cg.clientY:cg.touches[0].pageY;ig=(ag-lg)/1,ng=(ug-og)/1,Ig("dragCanvasMouseMove",ig,ng)},rg=()=>{document.removeEventListener("mousemove",sg),document.removeEventListener("mouseup",rg),document.removeEventListener("touchmove",sg),document.removeEventListener("touchend",rg),Ig("dragCanvasMouseUp",ig,ng)};document.addEventListener("mousemove",sg),document.addEventListener("mouseup",rg),document.addEventListener("touchmove",sg),document.addEventListener("touchend",rg)}}),(tg,ig)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d))}}),_hoisted_1$c={ref:"contextMenuRef",class:"contextMenu"},_hoisted_2$9=["onClick"],_hoisted_3$8={class:"shortcut"},_sfc_main$e=vue.defineComponent({__name:"index",props:{menuInfo:{},show:{type:Boolean}},emits:["onContextMenuClick"],setup(Ag,{emit:gg}){vue.useCssVars(tg=>({d490becc:eg.menuInfo.left+"px",v3f7af964:eg.menuInfo.top+"px"}));const eg=Ag,Ig=gg,Cg=(tg,ig,ng)=>{ig.enable&&Ig("onContextMenuClick",tg,ng)};return(tg,ig)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",_hoisted_1$c,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(eg.menuInfo.info,(ng,lg)=>(vue.openBlock(),vue.createElementBlock("li",{key:ng.title,onClick:og=>Cg(lg,ng,og)},[vue.createElementVNode("p",{class:vue.normalizeClass(ng.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(ng.title)+" ",1),vue.createElementVNode("span",_hoisted_3$8,vue.toDisplayString(ng.hot_key),1)],2)],8,_hoisted_2$9))),128))],512)),[[vue.vShow,Ag.show]])}}),index_vue_vue_type_style_index_0_scoped_e515623d_lang="",ContextMenu=_export_sfc(_sfc_main$e,[["__scopeId","data-v-e515623d"]]),contextMenuStore=vue.reactive({menuInfo:{display:!1,left:0,top:0,info:{selectAll:{title:"全选",hot_key:"Ctrl + A",enable:!1},copy:{title:"复制",hot_key:"Ctrl + C",enable:!1},paste:{title:"粘贴",hot_key:"Ctrl + V",enable:!1},delete:{title:"删除",hot_key:"Delete",enable:!1},group:{title:"组合",hot_key:"Ctrl + G",enable:!1},ungroup:{title:"取消组合",hot_key:"Ctrl + U",enable:!1},moveTop:{title:"置顶",hot_key:"Ctrl + Right",enable:!1},moveUp:{title:"上移",hot_key:"Ctrl + Up",enable:!1},moveDown:{title:"下移",hot_key:"Ctrl + Down",enable:!1},moveBottom:{title:"置底",hot_key:"Ctrl + Left",enable:!1}}},setMenuInfo:Ag=>{contextMenuStore.menuInfo=Ag},setDisplayItem:Ag=>{for(const gg in contextMenuStore.menuInfo.info)contextMenuStore.menuInfo.info[gg].enable=!1;Ag.forEach(gg=>{contextMenuStore.menuInfo.info[gg].enable=!0})}}),_hoisted_1$b=["id"],_hoisted_2$8=["id"],_hoisted_3$7=["fill"],_hoisted_4$7=["id"],_hoisted_5$5=["fill"],_hoisted_6$5=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],_hoisted_7$4=["from","to","dur"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemJson:{},canvasCfg:{},grid:{},canvasDom:{},mode:{default:"pen"}},emits:["drawLineEnd"],setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=eg,tg=configStore.lineRenderOffset;return vue.computed(()=>!Ig.grid.align||!Ig.grid.enabled?1:Ig.grid.size),gg({onMouseDown:(ng,lg,og)=>{ng.stopPropagation();const{x:sg,y:rg}=og,cg=ng instanceof MouseEvent?ng.clientX:ng.touches[0].pageX,ag=ng instanceof MouseEvent?ng.clientY:ng.touches[0].pageY;let ug=0,dg=0;const hg=mg=>{const Zg=mg instanceof MouseEvent?mg.clientX:mg.touches[0].pageX,Bg=mg instanceof MouseEvent?mg.clientY:mg.touches[0].pageY,Gg=ng.ctrlKey?0:alignToGrid((Zg-cg)/Ig.canvasCfg.scale,1),pg=ng.shiftKey?0:alignToGrid((Bg-ag)/Ig.canvasCfg.scale,1);if(ug=sg+Gg,dg=rg+pg,Ig.mode=="pencil"){Ig.itemJson.props.point_position.val.push({x:ug,y:dg});return}else{const fg=Ig.itemJson.props.point_position.val;fg[lg].x=ug,fg[lg].y=dg}},bg=()=>{document.removeEventListener("mousemove",hg),document.removeEventListener("mouseup",bg),document.removeEventListener("touchmove",hg),document.removeEventListener("touchend",bg);const mg=document.querySelector(`#${Ig.itemJson.id} g .real`).getBoundingClientRect(),Zg=Ig.canvasDom.getBoundingClientRect(),Bg=((mg==null?void 0:mg.left)-(Zg==null?void 0:Zg.left))/Ig.canvasCfg.scale,Gg=((mg==null?void 0:mg.top)-(Zg==null?void 0:Zg.top))/Ig.canvasCfg.scale,pg=Bg-Ig.itemJson.binfo.left,fg=Gg-Ig.itemJson.binfo.top,Vg={...Ig.itemJson,binfo:{...Ig.itemJson.binfo,left:Bg,top:Gg,width:(mg==null?void 0:mg.width)/Ig.canvasCfg.scale,height:(mg==null?void 0:mg.height)/Ig.canvasCfg.scale},props:{...Ig.itemJson.props,point_position:{...Ig.itemJson.props.point_position,val:Ig.itemJson.props.point_position.val.map(Wg=>({x:Wg.x-pg,y:Wg.y-fg}))}}};Cg("drawLineEnd",Vg)};document.addEventListener("mousemove",hg),document.addEventListener("mouseup",bg),document.addEventListener("touchmove",hg),document.addEventListener("touchend",bg)}}),(ng,lg)=>{var og,sg,rg,cg;return vue.openBlock(),vue.createElementBlock("svg",{id:Ig.itemJson.id,class:"mt-line-render",style:vue.normalizeStyle({position:"absolute",left:`${-vue.unref(tg)}px`,top:`${-vue.unref(tg)}px`,width:`${Ig.canvasCfg.width+vue.unref(tg)}px`,height:`${Ig.canvasCfg.height+vue.unref(tg)}px`}),version:"1.1",xmlns:"http://www.w3.org/2000/svg","pointer-events":"none"},[vue.createElementVNode("g",null,[vue.createElementVNode("defs",null,[vue.createElementVNode("marker",{id:"markerArrowStart"+Ig.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:Ig.itemJson.props.stroke.val},null,8,_hoisted_3$7)],8,_hoisted_2$8),vue.createElementVNode("marker",{id:"markerArrowEnd"+Ig.itemJson.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[vue.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:Ig.itemJson.props.stroke.val},null,8,_hoisted_5$5)],8,_hoisted_4$7)]),vue.createElementVNode("path",{d:vue.unref(positionArrarToPath)(Ig.itemJson.props.point_position.val,Ig.itemJson.binfo.left+vue.unref(tg),Ig.itemJson.binfo.top+vue.unref(tg)),"pointer-events":"visibleStroke",fill:"none",stroke:Ig.itemJson.props.ani_type.val==="electricity"?Ig.itemJson.props.ani_color.val:Ig.itemJson.props.stroke.val,"stroke-width":Ig.itemJson.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":Ig.itemJson.props.ani_type.val==="electricity"?Ig.itemJson.props["stroke-width"].val*3:0,"marker-start":(sg=(og=Ig.itemJson.props)==null?void 0:og["marker-start"])!=null&&sg.val?`url(#markerArrowStart${Ig.itemJson.id})`:"","marker-end":(cg=(rg=Ig.itemJson.props)==null?void 0:rg["marker-end"])!=null&&cg.val?`url(#markerArrowEnd${Ig.itemJson.id})`:"",class:"real"},[Ig.itemJson.props.ani_type.val==="electricity"?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:Ig.itemJson.props.ani_reverse.val?0:1e3,to:Ig.itemJson.props.ani_reverse.val?Ig.itemJson.props.ani_play.val?1e3:0:Ig.itemJson.props.ani_play.val?0:1e3,dur:`${Ig.itemJson.props.ani_dur.val<1?1:Ig.itemJson.props.ani_dur.val}s`,repeatCount:"indefinite"},null,8,_hoisted_7$4)):vue.createCommentVNode("",!0)],8,_hoisted_6$5)])],12,_hoisted_1$b)}}}),canvasBackgroundState=vue.reactive({img:"",width:0,height:0,settled:!1});function setCanvasBackground(Ag,gg,eg,Ig){return canvasBackgroundState.img=gg,canvasBackgroundState.width=eg,canvasBackgroundState.height=Ig,canvasBackgroundState.settled=!0,Ag.img=gg,Ag.width=eg,Ag.height=Ig,Ag}function clearCanvasBackground(Ag){return canvasBackgroundState.img="",canvasBackgroundState.width=0,canvasBackgroundState.height=0,canvasBackgroundState.settled=!0,Ag.img="",Ag}function updateCanvasBackgroundSize(Ag,gg){!canvasBackgroundState.settled||!canvasBackgroundState.img||(canvasBackgroundState.width=Ag,canvasBackgroundState.height=gg)}function resetCanvasBackground(){canvasBackgroundState.img="",canvasBackgroundState.width=0,canvasBackgroundState.height=0,canvasBackgroundState.settled=!1}function adoptCanvasBackground(Ag){!(Ag!=null&&Ag.img)||canvasBackgroundState.settled||(canvasBackgroundState.img=Ag.img,canvasBackgroundState.width=Ag.width??0,canvasBackgroundState.height=Ag.height??0,canvasBackgroundState.settled=!0)}function withCanvasBackground(Ag){return canvasBackgroundState.settled?canvasBackgroundState.img?{...Ag,img:canvasBackgroundState.img,width:canvasBackgroundState.width,height:canvasBackgroundState.height}:{...Ag,img:""}:Ag}const SOP_TIMELINE_ORDER=["__default__","sop-001","sop-002","sop-003","sop-004","sop-005","sop-006","sop-007"],DEFAULT_SOP_ID="__default__";let activeSopTimelineOrder=[...SOP_TIMELINE_ORDER];function setSopTimelineOrder(Ag){const gg=["__default__"];for(const eg of Ag)eg&&eg!=="__default__"&&!gg.includes(eg)&&gg.push(eg);activeSopTimelineOrder=gg.length>1?gg:[...SOP_TIMELINE_ORDER]}function getActiveSopTimelineOrder(){return activeSopTimelineOrder}function getSopTimelineIndex(Ag){const gg=activeSopTimelineOrder.indexOf(Ag);if(gg!==-1)return gg;const eg=SOP_TIMELINE_ORDER.indexOf(Ag);if(eg!==-1)return eg;if(Ag==="__default__")return 0;const Ig=Ag.match(/^sop-(\d+)$/i);return Ig?parseInt(Ig[1],10):Number.MAX_SAFE_INTEGER}function compareSopTimeline(Ag,gg){return getSopTimelineIndex(Ag)-getSopTimelineIndex(gg)}function sopIdAtTimelineIndex(Ag){return activeSopTimelineOrder[Ag]??SOP_TIMELINE_ORDER[Ag]??`sop-${String(Ag).padStart(3,"0")}`}function getIntroducedSopId(Ag){return Ag.sopIntroducedAt??DEFAULT_SOP_ID}function isItemVisibleAtSop(Ag,gg){const eg=getIntroducedSopId(Ag);return!(compareSopTimeline(eg,gg)>0||Ag.sopDeletedAt&&compareSopTimeline(Ag.sopDeletedAt,gg)<=0)}const BINFO_RESOLVE_STEP_CAP=1e3;function resolveItemBinfo(Ag,gg,eg){var lg;const Ig=getIntroducedSopId(eg);let Cg=objectDeepClone(eg.binfo);const tg=getSopTimelineIndex(Ig),ig=getSopTimelineIndex(gg),ng=Math.min(ig,tg+BINFO_RESOLVE_STEP_CAP);for(let og=tg;og<=ng;og++){const sg=sopIdAtTimelineIndex(og),rg=(lg=sopCanvasStateStore.layoutBySop[sg])==null?void 0:lg[Ag];rg&&(Cg=objectDeepClone(rg))}return Cg}const sopCanvasStateStore=vue.reactive({masterById:{},layoutBySop:{},activeSopId:DEFAULT_SOP_ID,has(Ag){return Object.prototype.hasOwnProperty.call(this.layoutBySop,Ag)}});let enterSessionBinfoById=null;const BINFO_EPS=.001;function binfoEqual(Ag,gg){return Math.abs(Ag.left-gg.left)<BINFO_EPS&&Math.abs(Ag.top-gg.top)<BINFO_EPS&&Math.abs(Ag.width-gg.width)<BINFO_EPS&&Math.abs(Ag.height-gg.height)<BINFO_EPS&&Math.abs(Ag.angle-gg.angle)<BINFO_EPS}function captureSopEnterSnapshot(Ag){enterSessionBinfoById={};for(const gg of Ag)gg.isDelete||(enterSessionBinfoById[gg.id]=objectDeepClone(gg.binfo))}function isLayoutChangedSinceEnter(Ag,gg,eg){if(enterSessionBinfoById){const tg=enterSessionBinfoById[Ag];return tg?!binfoEqual(tg,gg):!0}const Ig=sopCanvasStateStore.masterById[Ag];if(!Ig)return!0;const Cg=resolveItemBinfo(Ag,eg,Ig);return!binfoEqual(Cg,gg)}function ensureLayoutBucket(Ag){sopCanvasStateStore.layoutBySop[Ag]||(sopCanvasStateStore.layoutBySop[Ag]={})}function propagateItemLayoutFromSop(Ag,gg,eg){const Ig=objectDeepClone(eg);ensureLayoutBucket(Ag),sopCanvasStateStore.layoutBySop[Ag][gg]=objectDeepClone(Ig);const Cg=getSopTimelineIndex(Ag);if(!(Cg>=activeSopTimelineOrder.length))for(let tg=Cg+1;tg<activeSopTimelineOrder.length;tg++){const ig=sopIdAtTimelineIndex(tg);ensureLayoutBucket(ig),sopCanvasStateStore.layoutBySop[ig][gg]=objectDeepClone(Ig)}}function registerNewItemAtSop(Ag,gg){const eg=objectDeepClone(Ag);eg.sopIntroducedAt=gg,eg.sopDeletedAt=Ag.sopDeletedAt,eg.active=!1,eg.isDelete=!1,sopCanvasStateStore.masterById[Ag.id]=eg,propagateItemLayoutFromSop(gg,Ag.id,Ag.binfo),enterSessionBinfoById&&(enterSessionBinfoById[Ag.id]=objectDeepClone(Ag.binfo))}function commitSopEdits(Ag,gg){for(const eg of gg){if(eg.isDelete){const ig=sopCanvasStateStore.masterById[eg.id];ig&&(ig.sopDeletedAt=Ag);continue}const Ig=sopCanvasStateStore.masterById[eg.id],Cg=eg.sopIntroducedAt??(Ig==null?void 0:Ig.sopIntroducedAt)??Ag,tg=objectDeepClone({...Ig??{},...eg,binfo:(Ig==null?void 0:Ig.binfo)??eg.binfo,sopIntroducedAt:Cg,sopDeletedAt:Ig==null?void 0:Ig.sopDeletedAt,active:!1,isDelete:!1});sopCanvasStateStore.masterById[eg.id]=tg,isLayoutChangedSinceEnter(eg.id,eg.binfo,Ag)&&propagateItemLayoutFromSop(Ag,eg.id,eg.binfo)}}function buildCanvasForSop(Ag){return Object.values(sopCanvasStateStore.masterById).filter(gg=>isItemVisibleAtSop(gg,Ag)).map(gg=>{const eg=objectDeepClone(gg);return eg.binfo=resolveItemBinfo(gg.id,Ag,gg),eg.active=!1,eg.isDelete=!1,eg})}function applyCanvasForSop(Ag){const gg=buildCanvasForSop(Ag);globalStore.selected_items_id=[],globalStore.setGlobalStoreDoneJson(gg),sopCanvasStateStore.activeSopId=Ag,captureSopEnterSnapshot(gg)}function markItemsDeletedAtSop(Ag,gg){for(const eg of gg){const Ig=sopCanvasStateStore.masterById[eg];Ig&&(Ig.sopDeletedAt=Ag)}}function deleteItemsAtSop(Ag,gg){if(gg.length!==0){for(const eg of gg){const Ig=sopCanvasStateStore.masterById[eg];Ig&&(Ig.sopDeletedAt=Ag)}applyCanvasForSop(Ag),cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}}function syncMasterFromImportedDoneJson(Ag,gg=DEFAULT_SOP_ID){sopCanvasStateStore.masterById={},sopCanvasStateStore.layoutBySop={};for(const eg of Ag)eg.isDelete||registerNewItemAtSop(eg,eg.sopIntroducedAt??gg)}function mergeMasterFromImportedDoneJson(Ag,gg){for(const eg of Ag){if(eg.isDelete)continue;const Ig=eg.sopIntroducedAt??gg;if(!sopCanvasStateStore.masterById[eg.id]){registerNewItemAtSop(eg,Ig);continue}ensureLayoutBucket(gg),sopCanvasStateStore.layoutBySop[gg][eg.id]=objectDeepClone(eg.binfo)}}function switchSopCanvas(Ag,gg){Ag!==gg&&(commitSopEdits(Ag,globalStore.done_json),applyCanvasForSop(gg),cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0)}const _hoisted_1$a={class:"main-panel-shell w-full h-full flex flex-col overflow-hidden"},_hoisted_2$7=["src"],_hoisted_3$6={key:2},_hoisted_4$6=["data-id","onMouseenter"],DEFAULT_DROP_ITEM_SIZE=150,_sfc_main$c=vue.defineComponent({__name:"index",props:{groupEnabled:{type:Boolean},unGroupEnabled:{type:Boolean},deleteEnabled:{type:Boolean},lineAppendEnable:{type:Boolean,default:!1},sopId:{default:"__default__"}},setup(Ag,{expose:gg}){vue.useCssVars(nA=>({v0cdb94eb:vue.unref(globalStore).canvasCfg.width+"px",v4d38d53c:vue.unref(globalStore).canvasCfg.height+"px",v75ab9dbc:ag.value,c10d7e02:`scale(${vue.unref(globalStore).canvasCfg.scale})`,dd7a0a46:`${vue.unref(globalStore).canvasCfg.transform_origin.x}px ${vue.unref(globalStore).canvasCfg.transform_origin.y}px`,v7bbe4362:vue.unref(globalStore).guideCfg.x.display?"block":"none",v02603008:vue.unref(globalStore).guideCfg.x.top+"px",v77bfd241:vue.unref(globalStore).guideCfg.y.display?"block":"none",ccebea3a:vue.unref(globalStore).guideCfg.y.left+"px"}));const eg=Ag,Ig=vue.computed(()=>eg.sopId||"__default__"),Cg=vue.ref(),tg=vue.ref(),ig=vue.ref(),ng=vue.ref(),lg=vue.ref(),og=vue.ref(!0);let sg=!1;const rg=vue.reactive({left:0,top:0}),cg=vue.computed(()=>!globalStore.gridCfg.align||!globalStore.gridCfg.enabled?1:globalStore.gridCfg.size),ag=vue.computed(()=>{var nA;return((nA=globalStore.canvasCfg.color)==null?void 0:nA.trim())||"#ffffff"}),ug=vue.computed(()=>canvasBackgroundState.img||globalStore.canvasCfg.img),dg=vue.computed({get(){return globalStore.done_json},set(nA){globalStore.setGlobalStoreDoneJson(nA)}}),hg=configStore.sysComponent.find(nA=>nA.type=="sys-line"),bg={id:hg.id+"-"+randomString(),title:hg.title,type:hg.type,binfo:{left:0,top:0,width:100,height:0,angle:0},resize:!1,rotate:!1,lock:!1,active:!0,hide:!1,props:{...hg.props,point_position:{title:"点坐标",type:"jsonEdit",val:[{x:0,y:0},{x:0,y:0}],disabled:!0}},tag:hg.id,common_animations:hg.common_animations,events:[]},mg=vue.ref(objectDeepClone(bg)),Zg=(nA,oA)=>{var tI,xe,pI,oI,cI,uI;if(xA(),globalStore.lock&&globalStore.intention==="create"){ElMessage.error("画布已锁定,请先解锁!");return}if(nA.preventDefault(),oA&&globalStore.intention!=="create"){if(globalStore.lock){globalStore.setIntention("beginDragCanvas"),(tI=ng.value)==null||tI.onMouseDown(nA);return}if(eg.lineAppendEnable){globalStore.setIntention("drawSysLineStart");const{realityX:hI,realityY:Ie}=getRealityXY(nA,(xe=Cg.value)==null?void 0:xe.getBoundingClientRect());mg.value={...objectDeepClone(bg),binfo:{left:alignToGrid(hI/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(Ie/globalStore.canvasCfg.scale,cg.value),width:0,height:0,angle:0}},(pI=lg.value)==null||pI.onMouseDown(nA,1,{x:0,y:0});return}globalStore.cancelAllSelect(),globalStore.setIntention("beginDragCanvas"),(oI=ng.value)==null||oI.onMouseDown(nA)}if(globalStore.intention!=="create")return;if(!globalStore.create_item_info){console.error("拖拽初始化失败",globalStore.create_item_info);return}globalStore.setSelectItems([]);const ZA=(cI=leftAsideStore.config.get(globalStore.create_item_info.config_key))==null?void 0:cI.find(hI=>hI.id===globalStore.create_item_info.item_id);if(!ZA){console.error("拖拽配置不匹配",globalStore.create_item_info,leftAsideStore.config);return}const GA=objectDeepClone(ZA),zA=GA.type==="sys-line",NA=GA.id==="sys-line",_A=GA.id==="sys-line-vertical",{realityX:Xe,realityY:eI}=getRealityXY(nA,(uI=Cg.value)==null?void 0:uI.getBoundingClientRect()),ze={id:GA.id+"-"+randomString(),title:GA.title,type:GA.type,binfo:{left:alignToGrid(Xe/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(eI/globalStore.canvasCfg.scale,cg.value),width:NA?100:_A?0:DEFAULT_DROP_ITEM_SIZE,height:_A?100:NA?0:DEFAULT_DROP_ITEM_SIZE,angle:0},resize:!zA,rotate:!zA,lock:!1,active:!0,hide:!1,props:GA.props,tag:GA.id,common_animations:GA.common_animations,events:[]};GA.type==="svg"?ze.symbol=GA.symbol:GA.type==="img"&&(ze.thumbnail=GA.thumbnail);const Ue=[...globalStore.done_json];Ue.push(ze),globalStore.setGlobalStoreDoneJson(Ue),registerNewItemAtSop(ze,Ig.value),globalStore.setSingleSelect(ze.id),globalStore.setIntention("none"),globalStore.setCreateItemInfo(null),cacheStore.addHistory(Ue)},Bg=nA=>{nA.preventDefault()},Gg=(nA,oA)=>{if(xA(),!globalStore.lock){if(globalStore.canvasCfg.adsorp||globalStore.canvasCfg.guide){const ZA=globalStore.done_json.filter(GA=>!GA.hide).map(GA=>{const zA=document.getElementById(GA.id);if(!zA)return null;const{left:NA,top:_A,width:Xe,height:eI,right:ze,bottom:Ue}=zA.getBoundingClientRect();return{id:GA.id,type:GA.type,left:NA,top:_A,width:Xe,height:eI,right:ze,bottom:Ue}}).filter(GA=>GA!==null);cacheStore.setBoundingBox(ZA)}if(oA.ctrlKey){if(oA.ctrlKey&&!nA.lock){const ZA=globalStore.done_json.find(GA=>GA.id==nA.id);ZA.active=!ZA.active,globalStore.refreshSelectedItemsId()}}else{if(globalStore.selected_items_id.includes(nA.id))return;globalStore.setSingleSelect(nA.id)}}},pg=nA=>{var oA,ZA,GA,zA;if(xA(),globalStore.cancelAllSelect(),globalStore.lock||nA.button==2){globalStore.setIntention("beginDragCanvas"),(oA=ng.value)==null||oA.onMouseDown(nA);return}if(eg.lineAppendEnable){globalStore.setIntention("drawSysLineStart");const{realityX:NA,realityY:_A}=getRealityXY(nA,(ZA=Cg.value)==null?void 0:ZA.getBoundingClientRect());mg.value={...objectDeepClone(bg),binfo:{left:alignToGrid(NA/globalStore.canvasCfg.scale,cg.value),top:alignToGrid(_A/globalStore.canvasCfg.scale,cg.value),width:0,height:0,angle:0}},(GA=lg.value)==null||GA.onMouseDown(nA,1,{x:0,y:0});return}nA.button===0&&(globalStore.setIntention("beginDragCanvas"),(zA=ng.value)==null||zA.onMouseDown(nA))},fg=nA=>{const oA=[...globalStore.done_json].map(ZA=>{var tI,xe;const GA=(tI=document.getElementById(ZA.id))==null?void 0:tI.getBoundingClientRect(),zA=(xe=Cg.value)==null?void 0:xe.getBoundingClientRect();let{left:NA,top:_A,width:Xe,height:eI}=ZA.binfo;GA&&zA&&(NA=(GA.left-zA.left)/globalStore.canvasCfg.scale,_A=(GA.top-zA.top)/globalStore.canvasCfg.scale,Xe=GA.width/globalStore.canvasCfg.scale,eI=GA.height/globalStore.canvasCfg.scale);const ze=nA.left<NA&&nA.left+nA.width>NA+Xe,Ue=nA.top<_A&&nA.top+nA.height>_A+eI;return ze&&Ue&&!ZA.lock&&!ZA.hide&&(ZA.active=!0),ZA});globalStore.setGlobalStoreDoneJson(oA),globalStore.refreshSelectedItemsId(),globalStore.setIntention("none")},Vg=()=>{const nA=objectDeepClone(globalStore.done_json.filter(zA=>globalStore.selected_items_id.includes(zA.id)));globalStore.done_json.filter(zA=>{var NA,_A;return zA.type==="sys-line"&&(globalStore.selected_items_id.includes((NA=zA.props.bind_anchors.val.start)==null?void 0:NA.id)||globalStore.selected_items_id.includes((_A=zA.props.bind_anchors.val.end)==null?void 0:_A.id))&&!globalStore.selected_items_id.includes(zA.id)}).forEach(zA=>{zA.props.bind_anchors.val={start:null,end:null}});const ZA=createGroupInfo(nA,Cg.value,globalStore.canvasCfg.scale),GA=[...globalStore.done_json].filter(zA=>!globalStore.selected_items_id.includes(zA.id));markItemsDeletedAtSop(Ig.value,[...globalStore.selected_items_id]),registerNewItemAtSop(ZA,Ig.value),GA.push(ZA),globalStore.setGlobalStoreDoneJson(GA),globalStore.setSingleSelect(ZA.id),cacheStore.addHistory(globalStore.done_json)},Wg=()=>{if(globalStore.selected_items_id.length!=1){ElMessage.error("只能解除组合组件!");return}const nA=globalStore.done_json.find(zA=>zA.id===globalStore.selected_items_id[0]);if(!nA){ElMessage.error("未知错误!无法找到解组信息");return}if(nA.type!="group"){ElMessage.error("只能解除组合组件!");return}const oA=cancelGroup(nA,Cg.value,globalStore.canvasCfg.scale,cg.value),ZA=nA.id,GA=[...globalStore.done_json].filter(zA=>!globalStore.selected_items_id.includes(zA.id));markItemsDeletedAtSop(Ig.value,[ZA]),oA.forEach(zA=>registerNewItemAtSop(zA,Ig.value)),globalStore.setGlobalStoreDoneJson([...GA,...oA]),globalStore.setSelectItems(oA.map(zA=>zA.id)),cacheStore.addHistory(globalStore.done_json)},Hg=({move_item_bounding_info:nA,move_binfo:oA})=>{var NA;const ZA=(NA=Cg.value)==null?void 0:NA.getBoundingClientRect();if(globalStore.canvasCfg.adsorp||globalStore.canvasCfg.guide){let _A=cacheStore.boundingBox;globalStore.selected_items_id.length>1&&nA.length>1&&(_A=cacheStore.boundingBox.filter(xe=>!globalStore.selected_items_id.includes(xe.id)));const Xe=nA,{y_info:eI,move_x:ze}=calculateGuideY(_A,globalStore.canvasCfg.adsorp_diff,Xe,ZA,globalStore.canvasCfg.scale),{x_info:Ue,move_y:tI}=calculateGuideX(_A,globalStore.canvasCfg.adsorp_diff,Xe,ZA,globalStore.canvasCfg.scale);globalStore.guideCfg.x=Ue,globalStore.guideCfg.y=eI,ze!=0&&globalStore.canvasCfg.adsorp?globalStore.adsorp_diff.x=ze:globalStore.adsorp_diff.x=0,tI!=0&&globalStore.canvasCfg.adsorp?globalStore.adsorp_diff.y=tI:globalStore.adsorp_diff.y=0}globalStore.done_json.filter(_A=>_A.type=="sys-line"&&globalStore.selected_items_id.includes(_A.id)&&(_A.props.bind_anchors.val.start||_A.props.bind_anchors.val.end)).forEach(_A=>{_A.props.bind_anchors.val.start&&(globalStore.selected_items_id.includes(_A.props.bind_anchors.val.start.id)||(_A.props.bind_anchors.val.start=null)),_A.props.bind_anchors.val.end&&(globalStore.selected_items_id.includes(_A.props.bind_anchors.val.end.id)||(_A.props.bind_anchors.val.end=null))});const zA=globalStore.done_json.filter(_A=>{var Xe,eI;return _A.type=="sys-line"&&(globalStore.selected_items_id.includes((Xe=_A.props.bind_anchors.val.start)==null?void 0:Xe.id)||globalStore.selected_items_id.includes((eI=_A.props.bind_anchors.val.end)==null?void 0:eI.id))&&!globalStore.selected_items_id.includes(_A.id)});useUpdateSysLine(zA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale,oA)},Sg=()=>{globalStore.guideCfg.x.display=!1,globalStore.guideCfg.y.display=!1,cacheStore.addHistory(globalStore.done_json)},wg=nA=>{const{topLeft:oA,topRight:ZA,bottomLeft:GA,bottomRight:zA}=getRectCoordinate(nA.binfo),{topCenter:NA,bottomCenter:_A,leftCenter:Xe,rightCenter:eI}=getRectCenterCoordinate(oA,ZA,GA,zA),ze=NA.x,Ue=Xe.y,tI=Math.PI/180*nA.binfo.angle,xe=rotatePoint(NA.x,NA.y,ze,Ue,tI),pI=rotatePoint(_A.x,_A.y,ze,Ue,tI),oI=rotatePoint(Xe.x,Xe.y,ze,Ue,tI),cI=rotatePoint(eI.x,eI.y,ze,Ue,tI);cacheStore.setAdsorbPoint([{type:"tc",x:xe.x,y:xe.y,id:nA.id},{type:"bc",x:pI.x,y:pI.y,id:nA.id},{type:"lc",x:oI.x,y:oI.y,id:nA.id},{type:"rc",x:cI.x,y:cI.y,id:nA.id}])},Xg=(nA,oA)=>{oA.type!="sys-line"&&wg(oA)},vg=(nA,oA)=>{globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"||cacheStore.setAdsorbPoint([])},yg=nA=>{globalStore.setIntention(nA)},Ng=nA=>{if(globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"){const oA=globalStore.done_json.find(ZA=>ZA.id==globalStore.selected_items_id[0]);oA&&(globalStore.intention=="adsorbStart"?(oA.props.bind_anchors.val={...oA.props.bind_anchors.val,start:{type:nA.type,id:nA.id}},oA.props.point_position.val[0]={x:nA.x-oA.binfo.left,y:nA.y-oA.binfo.top}):globalStore.intention=="adsorbEnd"&&(oA.props.bind_anchors.val={...oA.props.bind_anchors.val,end:{type:nA.type,id:nA.id}},oA.props.point_position.val[oA.props.point_position.val.length-1]={x:nA.x-oA.binfo.left,y:nA.y-oA.binfo.top}))}},Yg=()=>{if(globalStore.intention=="adsorbStart"||globalStore.intention=="adsorbEnd"){const nA=globalStore.done_json.find(oA=>oA.id==globalStore.selected_items_id[0]);nA&&(globalStore.intention=="adsorbStart"?nA.props.bind_anchors.val={...nA.props.bind_anchors.val,start:null}:globalStore.intention=="adsorbEnd"&&(nA.props.bind_anchors.val={...nA.props.bind_anchors.val,end:null}))}},Kg=nA=>{const oA=globalStore.done_json.filter(ZA=>{var GA,zA;return ZA.type=="sys-line"&&(((GA=ZA.props.bind_anchors.val.start)==null?void 0:GA.id)==nA.id||((zA=ZA.props.bind_anchors.val.end)==null?void 0:zA.id)==nA.id)});useUpdateSysLine(oA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)},Jg=nA=>{const oA=globalStore.done_json.filter(ZA=>{var GA,zA;return ZA.type=="sys-line"&&(((GA=ZA.props.bind_anchors.val.start)==null?void 0:GA.id)==nA.id||((zA=ZA.props.bind_anchors.val.end)==null?void 0:zA.id)==nA.id)});useUpdateSysLine(oA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)},Ug=nA=>{const oA=globalStore.done_json.filter(ZA=>globalStore.selected_items_id.includes(ZA.id));handleAlign(nA,oA,Cg.value,globalStore.canvasCfg.scale,globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},Qg=()=>{const nA=tg.value;nA&&(rg.left=nA.scrollLeft,rg.top=nA.scrollTop)},xg=(nA,oA)=>{const ZA=tg.value;ZA&&(nA===0&&oA===0||(globalStore.setIntention("runDragCanvas"),ZA.scrollLeft=rg.left-nA,ZA.scrollTop=rg.top-oA))},Tg=()=>{globalStore.intention=="runDragCanvas"?globalStore.setIntention("endDragCanvas"):globalStore.setIntention("none")},Mg=nA=>{if(globalStore.intention=="endDragCanvas")return;const oA=[];cacheStore.copy.length>0&&oA.push("paste"),globalStore.done_json.length>0&&oA.push("selectAll"),contextMenuStore.setDisplayItem(oA),contextMenuStore.setMenuInfo({...contextMenuStore.menuInfo,left:nA.clientX,top:nA.clientY}),globalStore.setIntention("showContextMenu")},Eg=(nA,oA)=>{const ZA=["copy","delete"];eg.groupEnabled&&ZA.push("group"),eg.unGroupEnabled&&ZA.push("ungroup"),eg.deleteEnabled&&ZA.push("delete");const GA=globalStore.done_json.findIndex(zA=>zA.id==oA.id);GA>-1&&GA<globalStore.done_json.length-1&&(ZA.push("moveTop"),ZA.push("moveUp")),GA>-1&&GA>0&&(ZA.push("moveDown"),ZA.push("moveBottom")),contextMenuStore.setDisplayItem(ZA),contextMenuStore.setMenuInfo({...contextMenuStore.menuInfo,left:nA.clientX,top:nA.clientY}),globalStore.setIntention("showContextMenu")},Og=()=>{globalStore.setSelectItems(globalStore.done_json.map(nA=>nA.id))},gA=()=>{globalStore.selected_items_id.length<1||(cacheStore.setCopy(globalStore.done_json.filter(nA=>globalStore.selected_items_id.includes(nA.id))),ElMessage.success("复制成功"))},IA=nA=>(nA.forEach(oA=>{oA.id=oA.tag+"-"+randomString(),oA.type=="sys-line"?oA.props.bind_anchors.val={start:null,end:null}:oA.type=="group"&&oA.children&&(oA.children=IA(oA.children))}),nA),Pg=(nA,oA)=>{if(cacheStore.copy.length<1)return;const ZA=IA(objectDeepClone(cacheStore.copy)).map(GA=>({...GA,binfo:{...GA.binfo,left:GA.binfo.left-nA,top:GA.binfo.top-oA}}));ZA.forEach(GA=>registerNewItemAtSop(GA,Ig.value)),globalStore.setGlobalStoreDoneJson([...globalStore.done_json,...ZA]),globalStore.setSelectItems(ZA.map(GA=>GA.id)),cacheStore.addHistory(globalStore.done_json)},qg=()=>{globalStore.selected_items_id.length<1||deleteItemsAtSop(Ig.value,[...globalStore.selected_items_id])},lA=()=>{globalStore.selected_items_id.length<2||Vg()},pA=()=>{globalStore.selected_items_id.length>1||Wg()},VA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.find(oA=>oA.id===globalStore.selected_items_id[0]);globalStore.setGlobalStoreDoneJson([...globalStore.done_json.filter(oA=>oA.id!==nA.id),nA]),cacheStore.addHistory(globalStore.done_json)},XA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.find(oA=>oA.id===globalStore.selected_items_id[0]);globalStore.setGlobalStoreDoneJson([nA,...globalStore.done_json.filter(oA=>oA.id!==nA.id)]),cacheStore.addHistory(globalStore.done_json)},hA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.findIndex(ZA=>ZA.id===globalStore.selected_items_id[0]);if(nA>=globalStore.done_json.length-1){ElMessage.error("已经是最上层了");return}const oA=globalStore.done_json[nA];globalStore.done_json[nA]=globalStore.done_json[nA+1],globalStore.done_json[nA+1]=oA,globalStore.setGlobalStoreDoneJson(globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},CA=()=>{if(globalStore.selected_items_id.length!==1)return;const nA=globalStore.done_json.findIndex(ZA=>ZA.id===globalStore.selected_items_id[0]);if(nA<=0){ElMessage.error("已经是最下层了");return}const oA=globalStore.done_json[nA];globalStore.done_json[nA]=globalStore.done_json[nA-1],globalStore.done_json[nA-1]=oA,globalStore.setGlobalStoreDoneJson(globalStore.done_json),cacheStore.addHistory(globalStore.done_json)},DA=()=>{cacheStore.historyIndex!=0&&(cacheStore.historyIndex-=1,globalStore.setGlobalStoreDoneJson(objectDeepClone(cacheStore.history[cacheStore.historyIndex])),globalStore.setSelectItems([]))},EA=()=>{cacheStore.historyIndex!=cacheStore.history.length-1&&(cacheStore.historyIndex+=1,globalStore.setGlobalStoreDoneJson(objectDeepClone(cacheStore.history[cacheStore.historyIndex])),globalStore.setSelectItems([]))},HA=(nA,oA)=>{var ZA;switch(nA){case"selectAll":Og();break;case"copy":gA();break;case"paste":{if(cacheStore.copy.length<1)return;const{realityX:GA,realityY:zA}=getRealityXY(oA,(ZA=Cg.value)==null?void 0:ZA.getBoundingClientRect()),NA=alignToGrid(GA/globalStore.canvasCfg.scale,1),_A=alignToGrid(zA/globalStore.canvasCfg.scale,1);let Xe="",eI=1/0;cacheStore.copy.forEach(xe=>{xe.binfo.top<eI&&(eI=xe.binfo.top,Xe=xe.id)});const ze=cacheStore.copy.find(xe=>xe.id===Xe),Ue=ze.binfo.left-NA,tI=ze.binfo.top-_A;Pg(Ue,tI);break}case"delete":qg();break;case"group":lA();break;case"ungroup":pA();break;case"moveTop":{VA();break}case"moveBottom":{XA();break}case"moveUp":{hA();break}case"moveDown":{CA();break}}globalStore.setIntention("none")},kA=nA=>{nA.ctrlKey&&nA.key.toLocaleLowerCase()==="a"?(nA.preventDefault(),Og()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="c"?(nA.preventDefault(),gA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="v"?(nA.preventDefault(),Pg(10,10)):nA.key.toLocaleLowerCase()==="delete"?(nA.preventDefault(),qg()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="g"?(nA.preventDefault(),lA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="u"?(nA.preventDefault(),pA()):nA.ctrlKey&&nA.key==="ArrowRight"?(nA.preventDefault(),VA()):nA.ctrlKey&&nA.key==="ArrowLeft"?(nA.preventDefault(),XA()):nA.ctrlKey&&nA.key==="ArrowUp"?(nA.preventDefault(),hA()):nA.ctrlKey&&nA.key==="ArrowDown"?(nA.preventDefault(),CA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="z"?(nA.preventDefault(),DA()):nA.ctrlKey&&nA.key.toLocaleLowerCase()==="y"?(nA.preventDefault(),EA()):nA.key==="ArrowUp"?(nA.preventDefault(),oA(0,-1)):nA.key==="ArrowDown"?(nA.preventDefault(),oA(0,1)):nA.key==="ArrowLeft"?(nA.preventDefault(),oA(-1,0)):nA.key==="ArrowRight"&&(nA.preventDefault(),oA(1,0));function oA(ZA,GA){if(globalStore.selected_items_id.length<1)return;const zA=[];globalStore.done_json.forEach(NA=>{globalStore.selected_items_id.includes(NA.id)&&(NA.binfo.left+=ZA,NA.binfo.top+=GA,NA.type=="sys-line"?NA.props.bind_anchors.val={start:null,end:null}:zA.push(...globalStore.done_json.filter(_A=>{var Xe,eI;return _A.type=="sys-line"&&(((Xe=_A.props.bind_anchors.val.start)==null?void 0:Xe.id)==NA.id||((eI=_A.props.bind_anchors.val.end)==null?void 0:eI.id)==NA.id)})))}),useUpdateSysLine(zA,globalStore.done_json,Cg.value,globalStore.canvasCfg.scale),cacheStore.addHistory(globalStore.done_json)}},xA=()=>{sg||(document.addEventListener("keydown",kA),sg=!0)},rA=()=>{sg&&(document.removeEventListener("keydown",kA),sg=!1)},dA=()=>{og.value=!0},MA=nA=>{const oA=[...globalStore.done_json],ZA={...nA,id:nA.tag+"-"+randomString()};oA.push(ZA),registerNewItemAtSop(ZA,Ig.value),globalStore.setGlobalStoreDoneJson(oA),globalStore.setSingleSelect(ZA.id),globalStore.setIntention("none"),cacheStore.addHistory(oA)},$A=()=>{if(!tg.value)return;const{scrollLeft:nA,scrollTop:oA}=tg.value;globalStore.canvasCfg.drag_offset.x=nA,globalStore.canvasCfg.drag_offset.y=oA};return vue.onMounted(()=>{var nA;xA(),(nA=tg.value)==null||nA.addEventListener("scroll",$A)}),vue.onUnmounted(()=>{var nA;rA(),(nA=tg.value)==null||nA.removeEventListener("scroll",$A)}),gg({createGroupItem:Vg,onUngroup:Wg,onAlignSelected:Ug,onRedo:EA,onUndo:DA,beginListenerKeyDown:xA,stopListenerKeyDown:rA}),(nA,oA)=>{var ZA;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"canvas-scroll-container flex-1 min-h-0",ref_key:"scrollContainerRef",ref:tg},[vue.createElementVNode("div",{id:"mtCanvasArea",ref_key:"canvasAreaRef",ref:Cg,class:vue.normalizeClass(`canvasArea ${vue.unref(globalStore).intention=="runDragCanvas"?"cursor-grab":""}`),onDrop:Zg,onDragover:Bg,onTouchstart:oA[3]||(oA[3]=GA=>Zg(GA,!0)),onMousedown:pg,onMousemove:dA,onContextmenu:vue.withModifiers(Mg,["right","prevent"])},[ug.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"canvas-bg-image",src:ug.value,alt:"",draggable:"false"},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0),vue.unref(globalStore).gridCfg.enabled?(vue.openBlock(),vue.createBlock(PatternGrid,{key:1,class:"canvas-pattern-overlay",grid:vue.unref(globalStore).gridCfg.size},null,8,["grid"])):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$i,{"done-json":dg.value,"onUpdate:doneJson":oA[0]||(oA[0]=GA=>dg.value=GA),"canvas-cfg":vue.unref(globalStore).canvasCfg,"grid-cfg":vue.unref(globalStore).gridCfg,"show-ghost-dom":!(((ZA=vue.unref(globalStore).selected_items_id)==null?void 0:ZA.length)>1),"canvas-dom":Cg.value,"global-lock":vue.unref(globalStore).lock,"line-append-enable":eg.lineAppendEnable,onOnMouseDown:Gg,onOnItemMove:Hg,onOnMoveMouseUp:Sg,onOnItemMouseEnter:Xg,onOnItemMouseLeave:vg,onSetIntention:yg,onOnItemResizeDone:Kg,onOnItemRotateDone:Jg,onOnItemRightClick:vue.withModifiers(Eg,["stop"])},null,8,["done-json","canvas-cfg","grid-cfg","show-ghost-dom","canvas-dom","global-lock","line-append-enable"]),vue.withDirectives(vue.createVNode(SelectedArea,{ref_key:"selectedAreaRef",ref:ig,"scale-ratio":vue.unref(globalStore).canvasCfg.scale,"target-dom":Cg.value,onSelectedAreaMouseUp:fg},null,8,["scale-ratio","target-dom"]),[[vue.vShow,!1]]),vue.createVNode(_sfc_main$f,{ref_key:"dragCanvasRef",ref:ng,"scale-ratio":vue.unref(globalStore).canvasCfg.scale,onDragCanvasMouseDown:Qg,onDragCanvasMouseMove:xg,onDragCanvasMouseUp:Tg},null,8,["scale-ratio"]),vue.withDirectives(vue.createVNode(_sfc_main$d,{ref_key:"dragLineRenderRef",ref:lg,"item-json":mg.value,"onUpdate:itemJson":oA[1]||(oA[1]=GA=>mg.value=GA),"canvas-cfg":vue.unref(globalStore).canvasCfg,"canvas-dom":Cg.value,grid:vue.unref(globalStore).gridCfg,mode:"pen",onDrawLineEnd:MA},null,8,["item-json","canvas-cfg","canvas-dom","grid"]),[[vue.vShow,vue.unref(globalStore).intention=="drawSysLineStart"]]),vue.unref(globalStore).intention=="adsorbStart"||vue.unref(globalStore).intention=="adsorbEnd"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(cacheStore).adsorbPoint,GA=>(vue.openBlock(),vue.createElementBlock("div",{key:GA.type,class:"adsorb-point touch-none",style:vue.normalizeStyle({left:GA.x+"px",top:GA.y+"px"}),"data-id":GA.type,onMouseenter:zA=>Ng(GA),onMouseout:oA[2]||(oA[2]=zA=>Yg())},null,44,_hoisted_4$6))),128))])):vue.createCommentVNode("",!0),oA[4]||(oA[4]=vue.createElementVNode("div",{id:"guide-x"},null,-1)),oA[5]||(oA[5]=vue.createElementVNode("div",{id:"guide-y"},null,-1))],34)],512),vue.createVNode(ContextMenu,{"menu-info":vue.unref(contextMenuStore).menuInfo,show:vue.unref(globalStore).intention=="showContextMenu",onOnContextMenuClick:HA},null,8,["menu-info","show"])])}}}),index_vue_vue_type_style_index_0_scoped_eba46ced_lang="",MainPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-eba46ced"]]),_hoisted_1$9={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_2$6={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_3$5={class:"right-aside-field"},_hoisted_4$5={class:"flex justify-between items-center px-8px py-8px border-t border-#e4e7ed"},_hoisted_5$4={class:"right-aside-field right-aside-color-field"},_hoisted_6$4={class:"right-aside-color-hex"},_hoisted_7$3={class:"right-aside-field right-aside-switch-field"},_hoisted_8$3={class:"right-aside-field right-aside-switch-field"},_hoisted_9$2={class:"right-aside-field right-aside-switch-field"},_hoisted_10$2={class:"right-aside-field right-aside-switch-field"},_hoisted_11$2={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_sfc_main$b=vue.defineComponent({__name:"page-setting",props:{canvasCfg:{},gridCfg:{},activeCollapse:{default:()=>["design"]},embedded:{type:Boolean,default:!1}},emits:["update:canvasCfg","update:gridCfg","update:activeCollapse"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed({get:()=>eg.activeCollapse,set:bg=>Ig("update:activeCollapse",bg)});vue.ref();const tg=vue.computed({get:()=>eg.canvasCfg.width,set:bg=>{updateCanvasBackgroundSize(bg,eg.canvasCfg.height),Ig("update:canvasCfg",{...eg.canvasCfg,width:bg})}}),ig=vue.computed({get:()=>eg.canvasCfg.height,set:bg=>{updateCanvasBackgroundSize(eg.canvasCfg.width,bg),Ig("update:canvasCfg",{...eg.canvasCfg,height:bg})}}),ng=vue.computed({get:()=>eg.canvasCfg.scale,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,scale:bg})}}),lg=vue.computed({get:()=>eg.canvasCfg.scale,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,scale:bg})}}),og=[{value:.5,label:.5},{value:1,label:1},{value:1.5,label:1.5},{value:2,label:2}],sg=vue.computed({get:()=>{var bg;return((bg=eg.canvasCfg.color)==null?void 0:bg.trim())||"#ffffff"},set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,color:bg})}}),rg=vue.computed(()=>{var Zg;return`#${(((Zg=eg.canvasCfg.color)==null?void 0:Zg.trim())||"#ffffff").replace("#","").toUpperCase()}`});vue.ref(!1),vue.ref([]);const cg=vue.computed({get:()=>eg.gridCfg.enabled,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,enabled:bg})}}),ag=vue.computed({get:()=>eg.gridCfg.align,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,align:bg})}}),ug=vue.computed({get:()=>eg.gridCfg.size,set:bg=>{Ig("update:gridCfg",{...eg.gridCfg,size:bg})}}),dg=vue.computed({get:()=>eg.canvasCfg.adsorp,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,adsorp:bg})}}),hg=vue.computed({get:()=>eg.canvasCfg.guide,set:bg=>{Ig("update:canvasCfg",{...eg.canvasCfg,guide:bg})}});return(bg,mg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["right-aside-page-setting",{"is-embedded":Ag.embedded}])},[vue.createVNode(vue.unref(ElCollapse),{modelValue:Cg.value,"onUpdate:modelValue":mg[11]||(mg[11]=Zg=>Cg.value=Zg)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"design"},{title:vue.withCtx(()=>[...mg[12]||(mg[12]=[vue.createElementVNode("div",{class:"right-aside-collapse-title"},[vue.createElementVNode("span",{class:"right-aside-triangle","aria-hidden":"true"}),vue.createElementVNode("span",{class:"right-aside-collapse-label"},"界面设计")],-1)])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{class:"right-aside-form form-no-table-border","label-width":"72px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"画布宽度"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$9,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:tg.value,"onUpdate:modelValue":mg[0]||(mg[0]=Zg=>tg.value=Zg),size:"small",controls:!1,min:1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"画布高度"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$6,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:ig.value,"onUpdate:modelValue":mg[1]||(mg[1]=Zg=>ig.value=Zg),size:"small",controls:!1,min:1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放倍数"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$5,[vue.createVNode(vue.unref(ElSelect),{modelValue:lg.value,"onUpdate:modelValue":mg[4]||(mg[4]=Zg=>lg.value=Zg),placeholder:"请设置缩放比例",size:"small",class:"right-aside-field-control"},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(og,Zg=>vue.createVNode(vue.unref(ElOption),{key:Zg.value,label:Zg.label,value:Zg.value},null,8,["label","value"])),64)),vue.createElementVNode("div",_hoisted_4$5,[vue.createVNode(vue.unref(ElText),{size:"small"},{default:vue.withCtx(()=>[...mg[13]||(mg[13]=[vue.createTextVNode("自定义",-1)])]),_:1}),vue.createVNode(vue.unref(ElInputNumber),{modelValue:ng.value,"onUpdate:modelValue":mg[2]||(mg[2]=Zg=>ng.value=Zg),size:"small",step:.1,min:.1,class:"right-aside-scale-custom-number",onClick:mg[3]||(mg[3]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"])])]),_:1},8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"背景颜色"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$4,[vue.createElementVNode("span",_hoisted_6$4,vue.toDisplayString(rg.value),1),vue.createVNode(vue.unref(ElColorPicker),{modelValue:sg.value,"onUpdate:modelValue":mg[5]||(mg[5]=Zg=>sg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),mg[14]||(mg[14]=vue.createElementVNode("div",{class:"right-aside-form-divider","aria-hidden":"true"},null,-1)),vue.createVNode(vue.unref(ElFormItem),{label:"参考线"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElSwitch),{modelValue:hg.value,"onUpdate:modelValue":mg[6]||(mg[6]=Zg=>hg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"吸附"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$3,[vue.createVNode(vue.unref(ElSwitch),{modelValue:dg.value,"onUpdate:modelValue":mg[7]||(mg[7]=Zg=>dg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_9$2,[vue.createVNode(vue.unref(ElSwitch),{modelValue:cg.value,"onUpdate:modelValue":mg[8]||(mg[8]=Zg=>cg.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1}),cg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"网格对齐"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_10$2,[vue.createVNode(vue.unref(ElSwitch),{modelValue:ag.value,"onUpdate:modelValue":mg[9]||(mg[9]=Zg=>ag.value=Zg),size:"small"},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),cg.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"网格大小"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_11$2,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:ug.value,"onUpdate:modelValue":mg[10]||(mg[10]=Zg=>ug.value=Zg),min:1,size:"small",controls:!1,class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["modelValue"])],2))}}),pageSetting_vue_vue_type_style_index_0_scoped_bead2366_lang="",PageSetting=_export_sfc(_sfc_main$b,[["__scopeId","data-v-bead2366"]]);var ace$2={exports:{}};(function(Ag,gg){(function(){var eg="ace",Ig=function(){return this}();!Ig&&typeof window<"u"&&(Ig=window);var Cg=function(sg,rg,cg){if(typeof sg!="string"){Cg.original?Cg.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(cg=rg),Cg.modules[sg]||(Cg.payloads[sg]=cg,Cg.modules[sg]=null)};Cg.modules={},Cg.payloads={};var tg=function(sg,rg,cg){if(typeof rg=="string"){var ag=lg(sg,rg);if(ag!=null)return cg&&cg(),ag}else if(Object.prototype.toString.call(rg)==="[object Array]"){for(var ug=[],dg=0,hg=rg.length;dg<hg;++dg){var bg=lg(sg,rg[dg]);if(bg==null&&ig.original)return;ug.push(bg)}return cg&&cg.apply(null,ug)||!0}},ig=function(sg,rg){var cg=tg("",sg,rg);return cg==null&&ig.original?ig.original.apply(this,arguments):cg},ng=function(sg,rg){if(rg.indexOf("!")!==-1){var cg=rg.split("!");return ng(sg,cg[0])+"!"+ng(sg,cg[1])}if(rg.charAt(0)=="."){var ag=sg.split("/").slice(0,-1).join("/");for(rg=ag+"/"+rg;rg.indexOf(".")!==-1&&ug!=rg;){var ug=rg;rg=rg.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return rg},lg=function(sg,rg){rg=ng(sg,rg);var cg=Cg.modules[rg];if(!cg){if(cg=Cg.payloads[rg],typeof cg=="function"){var ag={},ug={id:rg,uri:"",exports:ag,packaged:!0},dg=function(bg,mg){return tg(rg,bg,mg)},hg=cg(dg,ag,ug);ag=hg||ug.exports,Cg.modules[rg]=ag,delete Cg.payloads[rg]}cg=Cg.modules[rg]=ag||cg}return cg};function og(sg){var rg=Ig;sg&&(Ig[sg]||(Ig[sg]={}),rg=Ig[sg]),(!rg.define||!rg.define.packaged)&&(Cg.original=rg.define,rg.define=Cg,rg.define.packaged=!0),(!rg.require||!rg.require.packaged)&&(ig.original=rg.require,rg.require=ig,rg.require.packaged=!0)}og(eg)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(eg,Ig,Cg){function tg(ig,ng,lg){Object.defineProperty(ig,ng,{value:lg,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||tg(String.prototype,"startsWith",function(ig,ng){return ng=ng||0,this.lastIndexOf(ig,ng)===ng}),String.prototype.endsWith||tg(String.prototype,"endsWith",function(ig,ng){var lg=this;(ng===void 0||ng>lg.length)&&(ng=lg.length),ng-=ig.length;var og=lg.indexOf(ig,ng);return og!==-1&&og===ng}),String.prototype.repeat||tg(String.prototype,"repeat",function(ig){for(var ng="",lg=this;ig>0;)ig&1&&(ng+=lg),(ig>>=1)&&(lg+=lg);return ng}),String.prototype.includes||tg(String.prototype,"includes",function(ig,ng){return this.indexOf(ig,ng)!=-1}),Object.assign||(Object.assign=function(ig){if(ig==null)throw new TypeError("Cannot convert undefined or null to object");for(var ng=Object(ig),lg=1;lg<arguments.length;lg++){var og=arguments[lg];og!=null&&Object.keys(og).forEach(function(sg){ng[sg]=og[sg]})}return ng}),Object.values||(Object.values=function(ig){return Object.keys(ig).map(function(ng){return ig[ng]})}),Array.prototype.find||tg(Array.prototype,"find",function(ig){for(var ng=this.length,lg=arguments[1],og=0;og<ng;og++){var sg=this[og];if(ig.call(lg,sg,og,this))return sg}}),Array.prototype.findIndex||tg(Array.prototype,"findIndex",function(ig){for(var ng=this.length,lg=arguments[1],og=0;og<ng;og++){var sg=this[og];if(ig.call(lg,sg,og,this))return og}}),Array.prototype.includes||tg(Array.prototype,"includes",function(ig,ng){return this.indexOf(ig,ng)!=-1}),Array.prototype.fill||tg(Array.prototype,"fill",function(ig){for(var ng=this,lg=ng.length>>>0,og=arguments[1],sg=og>>0,rg=sg<0?Math.max(lg+sg,0):Math.min(sg,lg),cg=arguments[2],ag=cg===void 0?lg:cg>>0,ug=ag<0?Math.max(lg+ag,0):Math.min(ag,lg);rg<ug;)ng[rg]=ig,rg++;return ng}),Array.of||tg(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(eg,Ig,Cg){eg("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(eg,Ig,Cg){Ig.deepCopy=function tg(ig){if(typeof ig!="object"||!ig)return ig;var ng;if(Array.isArray(ig)){ng=[];for(var lg=0;lg<ig.length;lg++)ng[lg]=tg(ig[lg]);return ng}if(Object.prototype.toString.call(ig)!=="[object Object]")return ig;ng={};for(var lg in ig)ng[lg]=tg(ig[lg]);return ng}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(eg,Ig,Cg){Ig.last=function(ng){return ng[ng.length-1]},Ig.stringReverse=function(ng){return ng.split("").reverse().join("")},Ig.stringRepeat=function(ng,lg){for(var og="";lg>0;)lg&1&&(og+=ng),(lg>>=1)&&(ng+=ng);return og};var tg=/^\s\s*/,ig=/\s\s*$/;Ig.stringTrimLeft=function(ng){return ng.replace(tg,"")},Ig.stringTrimRight=function(ng){return ng.replace(ig,"")},Ig.copyObject=function(ng){var lg={};for(var og in ng)lg[og]=ng[og];return lg},Ig.copyArray=function(ng){for(var lg=[],og=0,sg=ng.length;og<sg;og++)ng[og]&&typeof ng[og]=="object"?lg[og]=this.copyObject(ng[og]):lg[og]=ng[og];return lg},Ig.deepCopy=eg("./deep_copy").deepCopy,Ig.arrayToMap=function(ng){for(var lg={},og=0;og<ng.length;og++)lg[ng[og]]=1;return lg},Ig.createMap=function(ng){var lg=Object.create(null);for(var og in ng)lg[og]=ng[og];return lg},Ig.arrayRemove=function(ng,lg){for(var og=0;og<=ng.length;og++)lg===ng[og]&&ng.splice(og,1)},Ig.escapeRegExp=function(ng){return ng.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},Ig.escapeHTML=function(ng){return(""+ng).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},Ig.getMatchOffsets=function(ng,lg){var og=[];return ng.replace(lg,function(sg){og.push({offset:arguments[arguments.length-2],length:sg.length})}),og},Ig.deferredCall=function(ng){var lg=null,og=function(){lg=null,ng()},sg=function(rg){return sg.cancel(),lg=setTimeout(og,rg||0),sg};return sg.schedule=sg,sg.call=function(){return this.cancel(),ng(),sg},sg.cancel=function(){return clearTimeout(lg),lg=null,sg},sg.isPending=function(){return lg},sg},Ig.delayedCall=function(ng,lg){var og=null,sg=function(){og=null,ng()},rg=function(cg){og==null&&(og=setTimeout(sg,cg||lg))};return rg.delay=function(cg){og&&clearTimeout(og),og=setTimeout(sg,cg||lg)},rg.schedule=rg,rg.call=function(){this.cancel(),ng()},rg.cancel=function(){og&&clearTimeout(og),og=null},rg.isPending=function(){return og},rg},Ig.sleep=function(ng){return new Promise(function(lg){setTimeout(lg,ng)})},Ig.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},Ig.skipEmptyMatch=function(ng,lg,og){return og&&ng.codePointAt(lg)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(eg,Ig,Cg){Ig.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},Ig.getOS=function(){return Ig.isMac?Ig.OS.MAC:Ig.isLinux?Ig.OS.LINUX:Ig.OS.WINDOWS};var tg=typeof navigator=="object"?navigator:{},ig=(/mac|win|linux/i.exec(tg.platform)||["other"])[0].toLowerCase(),ng=tg.userAgent||"",lg=tg.appName||"";Ig.isWin=ig=="win",Ig.isMac=ig=="mac",Ig.isLinux=ig=="linux",Ig.isIE=lg=="Microsoft Internet Explorer"||lg.indexOf("MSAppHost")>=0?parseFloat((ng.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((ng.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),Ig.isOldIE=Ig.isIE&&Ig.isIE<9,Ig.isGecko=Ig.isMozilla=ng.match(/ Gecko\/\d+/),Ig.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",Ig.isWebKit=parseFloat(ng.split("WebKit/")[1])||void 0,Ig.isChrome=parseFloat(ng.split(" Chrome/")[1])||void 0,Ig.isSafari=parseFloat(ng.split(" Safari/")[1])&&!Ig.isChrome||void 0,Ig.isEdge=parseFloat(ng.split(" Edge/")[1])||void 0,Ig.isAIR=ng.indexOf("AdobeAIR")>=0,Ig.isAndroid=ng.indexOf("Android")>=0,Ig.isChromeOS=ng.indexOf(" CrOS ")>=0,Ig.isIOS=/iPad|iPhone|iPod/.test(ng)&&!window.MSStream,Ig.isIOS&&(Ig.isMac=!0),Ig.isMobile=Ig.isIOS||Ig.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(eg,Ig,Cg){var tg=eg("./useragent"),ig="http://www.w3.org/1999/xhtml";Ig.buildDom=function cg(ag,ug,dg){if(typeof ag=="string"&&ag){var hg=document.createTextNode(ag);return ug&&ug.appendChild(hg),hg}if(!Array.isArray(ag))return ag&&ag.appendChild&&ug&&ug.appendChild(ag),ag;if(typeof ag[0]!="string"||!ag[0]){for(var bg=[],mg=0;mg<ag.length;mg++){var Zg=cg(ag[mg],ug,dg);Zg&&bg.push(Zg)}return bg}var Bg=document.createElement(ag[0]),Gg=ag[1],pg=1;Gg&&typeof Gg=="object"&&!Array.isArray(Gg)&&(pg=2);for(var mg=pg;mg<ag.length;mg++)cg(ag[mg],Bg,dg);return pg==2&&Object.keys(Gg).forEach(function(fg){var Vg=Gg[fg];fg==="class"?Bg.className=Array.isArray(Vg)?Vg.join(" "):Vg:typeof Vg=="function"||fg=="value"||fg[0]=="$"?Bg[fg]=Vg:fg==="ref"?dg&&(dg[Vg]=Bg):fg==="style"?typeof Vg=="string"&&(Bg.style.cssText=Vg):Vg!=null&&Bg.setAttribute(fg,Vg)}),ug&&ug.appendChild(Bg),Bg},Ig.getDocumentHead=function(cg){return cg||(cg=document),cg.head||cg.getElementsByTagName("head")[0]||cg.documentElement},Ig.createElement=function(cg,ag){return document.createElementNS?document.createElementNS(ag||ig,cg):document.createElement(cg)},Ig.removeChildren=function(cg){cg.innerHTML=""},Ig.createTextNode=function(cg,ag){var ug=ag?ag.ownerDocument:document;return ug.createTextNode(cg)},Ig.createFragment=function(cg){var ag=cg?cg.ownerDocument:document;return ag.createDocumentFragment()},Ig.hasCssClass=function(cg,ag){var ug=(cg.className+"").split(/\s+/g);return ug.indexOf(ag)!==-1},Ig.addCssClass=function(cg,ag){Ig.hasCssClass(cg,ag)||(cg.className+=" "+ag)},Ig.removeCssClass=function(cg,ag){for(var ug=cg.className.split(/\s+/g);;){var dg=ug.indexOf(ag);if(dg==-1)break;ug.splice(dg,1)}cg.className=ug.join(" ")},Ig.toggleCssClass=function(cg,ag){for(var ug=cg.className.split(/\s+/g),dg=!0;;){var hg=ug.indexOf(ag);if(hg==-1)break;dg=!1,ug.splice(hg,1)}return dg&&ug.push(ag),cg.className=ug.join(" "),dg},Ig.setCssClass=function(cg,ag,ug){ug?Ig.addCssClass(cg,ag):Ig.removeCssClass(cg,ag)},Ig.hasCssString=function(cg,ag){var ug=0,dg;if(ag=ag||document,dg=ag.querySelectorAll("style")){for(;ug<dg.length;)if(dg[ug++].id===cg)return!0}},Ig.removeElementById=function(cg,ag){ag=ag||document,ag.getElementById(cg)&&ag.getElementById(cg).remove()};var ng,lg=[];Ig.useStrictCSP=function(cg){ng=cg,cg==!1?og():lg||(lg=[])};function og(){var cg=lg;lg=null,cg&&cg.forEach(function(ag){sg(ag[0],ag[1])})}function sg(cg,ag,ug){if(!(typeof document>"u")){if(lg){if(ug)og();else if(ug===!1)return lg.push([cg,ag])}if(!ng){var dg=ug;!ug||!ug.getRootNode?dg=document:(dg=ug.getRootNode(),(!dg||dg==ug)&&(dg=document));var hg=dg.ownerDocument||dg;if(ag&&Ig.hasCssString(ag,dg))return null;ag&&(cg+=`
|
|
74
74
|
/*# sourceURL=ace/css/`+ag+" */");var bg=Ig.createElement("style");bg.appendChild(hg.createTextNode(cg)),ag&&(bg.id=ag),dg==hg&&(dg=Ig.getDocumentHead(hg)),dg.insertBefore(bg,dg.firstChild)}}}if(Ig.importCssString=sg,Ig.importCssStylsheet=function(cg,ag){Ig.buildDom(["link",{rel:"stylesheet",href:cg}],Ig.getDocumentHead(ag))},Ig.$fixPositionBug=function(cg){var ag=cg.getBoundingClientRect();if(cg.style.left){var ug=parseFloat(cg.style.left),dg=+ag.left;Math.abs(ug-dg)>1&&(cg.style.left=2*ug-dg+"px")}if(cg.style.right){var ug=parseFloat(cg.style.right),dg=window.innerWidth-ag.right;Math.abs(ug-dg)>1&&(cg.style.right=2*ug-dg+"px")}if(cg.style.top){var ug=parseFloat(cg.style.top),dg=+ag.top;Math.abs(ug-dg)>1&&(cg.style.top=2*ug-dg+"px")}if(cg.style.bottom){var ug=parseFloat(cg.style.bottom),dg=window.innerHeight-ag.bottom;Math.abs(ug-dg)>1&&(cg.style.bottom=2*ug-dg+"px")}},Ig.scrollbarWidth=function(cg){var ag=Ig.createElement("ace_inner");ag.style.width="100%",ag.style.minWidth="0px",ag.style.height="200px",ag.style.display="block";var ug=Ig.createElement("ace_outer"),dg=ug.style;dg.position="absolute",dg.left="-10000px",dg.overflow="hidden",dg.width="200px",dg.minWidth="0px",dg.height="150px",dg.display="block",ug.appendChild(ag);var hg=cg&&cg.documentElement||document&&document.documentElement;if(!hg)return 0;hg.appendChild(ug);var bg=ag.offsetWidth;dg.overflow="scroll";var mg=ag.offsetWidth;return bg===mg&&(mg=ug.clientWidth),hg.removeChild(ug),bg-mg},Ig.computedStyle=function(cg,ag){return window.getComputedStyle(cg,"")||{}},Ig.setStyle=function(cg,ag,ug){cg[ag]!==ug&&(cg[ag]=ug)},Ig.HAS_CSS_ANIMATION=!1,Ig.HAS_CSS_TRANSFORMS=!1,Ig.HI_DPI=tg.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,tg.isChromeOS&&(Ig.HI_DPI=!1),typeof document<"u"){var rg=document.createElement("div");Ig.HI_DPI&&rg.style.transform!==void 0&&(Ig.HAS_CSS_TRANSFORMS=!0),!tg.isEdge&&typeof rg.style.animationName<"u"&&(Ig.HAS_CSS_ANIMATION=!0),rg=null}Ig.HAS_CSS_TRANSFORMS?Ig.translate=function(cg,ag,ug){cg.style.transform="translate("+Math.round(ag)+"px, "+Math.round(ug)+"px)"}:Ig.translate=function(cg,ag,ug){cg.style.top=Math.round(ug)+"px",cg.style.left=Math.round(ag)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(eg,Ig,Cg){/*
|
|
75
75
|
* based on code from:
|
|
76
76
|
*
|
|
@@ -1165,7 +1165,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:Ig,cur
|
|
|
1165
1165
|
callback: (action) => {
|
|
1166
1166
|
console.log(action)
|
|
1167
1167
|
},
|
|
1168
|
-
})`,score:1e3,meta:"消息弹出框"},{name:"$item_info",value:"$item_info",score:1e3,meta:"回调函数中获取当前触发事件图形的信息"}])}});const _hoisted_1$6={key:0,class:"right-aside-item-setting select-none"},_hoisted_2$5={class:"right-aside-field"},_hoisted_3$4={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_4$4={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_5$3={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_6$3={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_7$2={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_8$2={class:"right-aside-field right-aside-switch-field"},_hoisted_9$2={class:"right-aside-field right-aside-switch-field"},_hoisted_10$1={class:"right-aside-field right-aside-switch-field"},_hoisted_11$1={class:"right-aside-field right-aside-switch-field"},_hoisted_12={class:"right-aside-field right-aside-switch-field"},_sfc_main$8=vue.defineComponent({__name:"select-item-setting",props:{itemJson:{},doneJson:{}},emits:["update:itemJson","addHistory"],setup(Ag,{emit:gg}){const eg=vue.ref(["props"]),Ig=Ag,Cg=gg,tg=vue.useSlots(),ig=vue.computed(()=>{var Zg;return((Zg=Ig.itemJson)==null?void 0:Zg.type)==="sys-line"}),ng=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.title},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,title:Zg})}}),lg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.left},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,left:Zg}})}}),og=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.top},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,top:Zg}})}}),sg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.width},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,width:Zg}})}}),rg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.height},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,height:Zg}})}}),cg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.angle},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,angle:Zg}})}}),ag=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.hide},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,hide:Zg})}}),ug=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.lock},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,lock:Zg})}}),dg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.resize},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,resize:Zg})}}),hg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.use_proportional_scaling},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,use_proportional_scaling:Zg})}}),bg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.rotate},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,rotate:Zg})}}),mg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.props},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,props:Zg})}});return vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.common_animations},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,common_animations:Zg})}}),vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.events},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,events:Zg})}}),vue.computed(()=>!!tg.deviceBind),(Zg,Bg)=>Ig.itemJson?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createVNode(vue.unref(ElCollapse),{modelValue:eg.value,"onUpdate:modelValue":Bg[19]||(Bg[19]=Gg=>eg.value=Gg)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"props"},{title:vue.withCtx(()=>[...Bg[20]||(Bg[20]=[vue.createElementVNode("div",{class:"right-aside-collapse-title"},[vue.createElementVNode("span",{class:"right-aside-triangle","aria-hidden":"true"}),vue.createElementVNode("span",{class:"right-aside-collapse-label"},"图元属性")],-1)])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{class:"right-aside-form","label-width":"72px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"名称",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$5,[vue.createVNode(vue.unref(ElInput),{size:"small",modelValue:ng.value,"onUpdate:modelValue":Bg[0]||(Bg[0]=Gg=>ng.value=Gg),disabled:"",class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x轴坐标",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:lg.value,"onUpdate:modelValue":Bg[1]||(Bg[1]=Gg=>lg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[2]||(Bg[2]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y轴坐标",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$4,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:og.value,"onUpdate:modelValue":Bg[3]||(Bg[3]=Gg=>og.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[4]||(Bg[4]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"宽度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$3,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:sg.value,"onUpdate:modelValue":Bg[5]||(Bg[5]=Gg=>sg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[6]||(Bg[6]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"高度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:rg.value,"onUpdate:modelValue":Bg[7]||(Bg[7]=Gg=>rg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[8]||(Bg[8]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"旋转角度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$2,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:cg.value,"onUpdate:modelValue":Bg[9]||(Bg[9]=Gg=>cg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[10]||(Bg[10]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),Bg[21]||(Bg[21]=vue.createElementVNode("div",{class:"right-aside-form-divider","aria-hidden":"true"},null,-1)),vue.createVNode(vue.unref(ElFormItem),{label:"隐藏",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$2,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:ag.value,"onUpdate:modelValue":Bg[11]||(Bg[11]=Gg=>ag.value=Gg),onChange:Bg[12]||(Bg[12]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"锁定",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_9$2,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:ug.value,"onUpdate:modelValue":Bg[13]||(Bg[13]=Gg=>ug.value=Gg),onChange:Bg[14]||(Bg[14]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"可缩放",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_10$1,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:dg.value,"onUpdate:modelValue":Bg[15]||(Bg[15]=Gg=>dg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),dg.value&&!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:4,label:"等比缩放",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_11$1,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:hg.value,"onUpdate:modelValue":Bg[16]||(Bg[16]=Gg=>hg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:5,label:"可旋转",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:bg.value,"onUpdate:modelValue":Bg[17]||(Bg[17]=Gg=>bg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$9,{propsInfo:mg.value,"onUpdate:propsInfo":Bg[18]||(Bg[18]=Gg=>mg.value=Gg)},null,8,["propsInfo"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])):vue.createCommentVNode("",!0)}}),_hoisted_1$5={class:"task-sop-setting"},_hoisted_2$4=["aria-expanded"],_hoisted_3$3={class:"task-sop-body"},_hoisted_4$3=["title"],_hoisted_5$2={class:"task-sop-name-tag"},_hoisted_6$2={key:0,class:"task-sop-list"},_hoisted_7$1=["onClick"],_hoisted_8$1=["title"],_hoisted_9$1={key:1,class:"task-sop-empty"},_sfc_main$7=vue.defineComponent({__name:"task-sop-setting",props:{task:{},activeSopId:{},expanded:{type:Boolean}},emits:["selectSop","update:expanded"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=()=>{Ig("update:expanded",!eg.expanded)},tg=vue.computed(()=>(eg.task.sopList??[]).filter(ng=>ng.isDel!=="Y")),ig=ng=>{ng!==eg.activeSopId&&Ig("selectSop",ng)};return(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("button",{type:"button",class:"task-sop-collapse-header","aria-expanded":Ag.expanded,onClick:Cg},[vue.createElementVNode("span",{class:vue.normalizeClass(["right-aside-triangle",{"is-expanded":Ag.expanded}]),"aria-hidden":"true"},null,2),lg[0]||(lg[0]=vue.createElementVNode("span",{class:"task-sop-collapse-label"},"任务与SOP",-1))],8,_hoisted_2$4),vue.withDirectives(vue.createElementVNode("div",_hoisted_3$3,[vue.createElementVNode("p",{class:"task-sop-plan",title:Ag.task.planIdName},vue.toDisplayString(Ag.task.planIdName),9,_hoisted_4$3),vue.createElementVNode("div",_hoisted_5$2,vue.toDisplayString(Ag.task.taskName),1),lg[2]||(lg[2]=vue.createElementVNode("div",{class:"task-sop-divider","aria-hidden":"true"},null,-1)),lg[3]||(lg[3]=vue.createElementVNode("div",{class:"task-sop-list-head"},[vue.createElementVNode("span",{class:"task-sop-list-title"},"关联 SOP 列表"),vue.createElementVNode("span",{class:"task-sop-list-hint"},"可拖拽图元")],-1)),tg.value.length?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_6$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,og=>(vue.openBlock(),vue.createElementBlock("li",{key:og.sopId,class:vue.normalizeClass(["task-sop-list-item",{"is-active":og.sopId===Ag.activeSopId}]),onClick:vue.withModifiers(sg=>ig(og.sopId),["stop"])},[lg[1]||(lg[1]=vue.createElementVNode("span",{class:"task-sop-list-dot","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",{class:"task-sop-list-label",title:og.sopName},vue.toDisplayString(og.sopName),9,_hoisted_8$1)],10,_hoisted_7$1))),128))])):(vue.openBlock(),vue.createElementBlock("p",_hoisted_9$1,"当前任务暂无关联 SOP"))],512),[[vue.vShow,Ag.expanded]])]))}}),taskSopSetting_vue_vue_type_style_index_0_scoped_ac63c7f8_lang="",TaskSopSetting=_export_sfc(_sfc_main$7,[["__scopeId","data-v-ac63c7f8"]]),_hoisted_1$4={key:0,class:"right-aside-main right-aside-view-mode"},_hoisted_2$3={key:1,class:"right-aside-footer-hint"},_hoisted_3$2={key:2,class:"right-aside-main"},_hoisted_4$2={key:1,class:"right-aside-footer-hint"},_sfc_main$6=vue.defineComponent({__name:"index",props:{viewMode:{type:Boolean,default:!1},selectedTask:{},activeSopId:{default:"__default__"}},emits:["selectTaskSop"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.ref(["design"]),tg=vue.ref(!1),ig=vue.computed(()=>eg.viewMode?!0:tg.value),ng=Zg=>{eg.viewMode||(tg.value=Zg)},lg=vue.computed(()=>!Cg.value.includes("design"));let og=!1;const sg=Zg=>{og=!0,Zg(),og=!1},rg=()=>{Cg.value=[]},cg=()=>{sg(()=>{Cg.value=[],tg.value=!0})},ag=()=>{sg(()=>{tg.value=!1,Cg.value=["design"]})};vue.watch(Cg,Zg=>{og||Zg.includes("design")&&sg(()=>{tg.value=!1})},{deep:!0}),vue.watch(tg,Zg=>{og||Zg&&sg(()=>{Cg.value=[]})});const ug=Zg=>{rg(),Ig("selectTaskSop",Zg)};vue.watch(()=>eg.activeSopId,(Zg,Bg)=>{!eg.selectedTask||!Zg||Zg===Bg||rg()}),vue.watch(()=>{var Zg;return(Zg=eg.selectedTask)==null?void 0:Zg.pdTaskId},Zg=>{if(eg.viewMode){Zg&&(tg.value=!0);return}Zg?cg():ag()});const dg=vue.useSlots(),hg=vue.computed(()=>globalStore.done_json.findIndex(Zg=>Zg.id==globalStore.selected_items_id[0])),bg=()=>{cacheStore.addHistory(globalStore.done_json)},mg=vue.computed(()=>!!dg.deviceBind);return(Zg,Bg)=>(vue.openBlock(),vue.createElementBlock("div",{id:"mt-right-aside",class:vue.normalizeClass(["right-aside-root",{"is-task-sop-only":Ag.viewMode}])},[Ag.viewMode?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[Ag.selectedTask?(vue.openBlock(),vue.createBlock(TaskSopSetting,{key:Ag.selectedTask.pdTaskId,task:Ag.selectedTask,"active-sop-id":Ag.activeSopId,expanded:ig.value,"onUpdate:expanded":ng,onSelectSop:ug},null,8,["task","active-sop-id","expanded"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[...Bg[5]||(Bg[5]=[vue.createElementVNode("p",null,"请在底部时间轴选择任务",-1),vue.createElementVNode("p",null,"以查看关联 SOP",-1)])]))])):vue.unref(globalStore).selected_items_id.length==1?(vue.openBlock(),vue.createBlock(_sfc_main$8,{key:1,class:"right-aside-item-panel","item-json":vue.unref(globalStore).done_json[hg.value],"onUpdate:itemJson":Bg[0]||(Bg[0]=Gg=>vue.unref(globalStore).done_json[hg.value]=Gg),"done-json":vue.unref(globalStore).done_json,onAddHistory:bg},vue.createSlots({_:2},[mg.value?{name:"deviceBind",fn:vue.withCtx(({item:Gg})=>[vue.renderSlot(Zg.$slots,"deviceBind",{item:Gg})]),key:"0"}:void 0]),1032,["item-json","done-json"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$2,[vue.createElementVNode("div",{class:vue.normalizeClass(["right-aside-design-scroll",{"is-design-collapsed":lg.value}])},[vue.createVNode(PageSetting,{canvasCfg:vue.unref(globalStore).canvasCfg,"onUpdate:canvasCfg":Bg[1]||(Bg[1]=Gg=>vue.unref(globalStore).canvasCfg=Gg),"grid-cfg":vue.unref(globalStore).gridCfg,"onUpdate:gridCfg":Bg[2]||(Bg[2]=Gg=>vue.unref(globalStore).gridCfg=Gg),"active-collapse":Cg.value,"onUpdate:activeCollapse":Bg[3]||(Bg[3]=Gg=>Cg.value=Gg)},null,8,["canvasCfg","grid-cfg","active-collapse"])],2),Ag.selectedTask?(vue.openBlock(),vue.createBlock(TaskSopSetting,{key:Ag.selectedTask.pdTaskId,task:Ag.selectedTask,"active-sop-id":Ag.activeSopId,expanded:tg.value,"onUpdate:expanded":Bg[4]||(Bg[4]=Gg=>tg.value=Gg),onSelectSop:ug},null,8,["task","active-sop-id","expanded"])):vue.createCommentVNode("",!0),Ag.selectedTask?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$2,[...Bg[6]||(Bg[6]=[vue.createElementVNode("p",null,"选中画布中的图元后",-1),vue.createElementVNode("p",null,"可在此处修改名称与尺寸",-1)])]))]))],2))}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$3={class:"flex justify-between w-8/10"},_sfc_main$5=vue.defineComponent({__name:"index",props:{doneJson:{},selectedItemsId:{}},emits:["updateSelectedItemsId","updateSelectedIdHide"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed(()=>eg.selectedItemsId.length==1?eg.selectedItemsId[0]:""),tg=lg=>{Ig("updateSelectedItemsId",lg.id)},ig=lg=>{Ig("updateSelectedIdHide",lg.id)},ng={children:"nochildren",label:"title"};return(lg,og)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:eg.doneJson,props:ng,onNodeClick:tg,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":Cg.value},{default:vue.withCtx(({node:sg,data:rg})=>[vue.createElementVNode("div",_hoisted_1$3,[vue.createElementVNode("div",null,vue.toDisplayString(sg.label),1),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",class:"mr-10px"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:rg.hide?"隐藏":"显示",size:20,onClick:vue.withModifiers(cg=>ig(rg),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:rg.hide?"view-hide":"view-show"},null,8,["name"])]),_:2},1032,["title","onClick"])]),_:2},1024)])]),_:1},8,["data","current-node-key"]))}}),genExportJson=(Ag,gg,eg)=>{let Ig=[];return Ig=objectDeepClone(eg).map(tg=>{tg.symbol&&delete tg.symbol;let ig={};for(const ng in tg.props)ig={...ig,[ng]:tg.props[ng].val};return{...tg,props:ig,active:!1}}),{exportJson:{canvasCfg:Ag,gridCfg:gg,json:Ig}}},useExportJsonToDoneJson=Ag=>{let gg=[];for(const Ig of leftAsideStore.config.values())Ig.length>0&&(gg=[...gg,...Ig]);const eg=Ag.json.map(Ig=>{let Cg={},tg;const ig=gg.find(lg=>(lg==null?void 0:lg.id)==Ig.tag),ng=ig==null?void 0:ig.props;ng&&(Cg={...Cg,...objectDeepClone(ng)});for(const lg in Ig.props)Cg[lg].val=Ig.props[lg];return ig!=null&&ig.symbol&&(tg=ig.symbol),{...Ig,props:Cg,symbol:tg}});return{canvasCfg:Ag.canvasCfg,gridCfg:Ag.gridCfg,importDoneJson:eg}},_sfc_main$4=vue.defineComponent({__name:"index",props:{doneJson:{},canvasCfg:{},gridCfg:{}},setup(Ag){const gg=Ag,eg=vue.computed({get:()=>{const{exportJson:Ig}=genExportJson(gg.canvasCfg,gg.gridCfg,gg.doneJson);return JSON.stringify(Ig,null,2)},set:()=>{}});return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(VAceEditor),{value:eg.value,"onUpdate:value":Cg[0]||(Cg[0]=tg=>eg.value=tg),lang:"json",theme:"monokai",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"])]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(Ag,{expose:gg}){const eg=vue.ref("");return gg({onImport:()=>new Promise((Cg,tg)=>{try{const ig=JSON.parse(eg.value),{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(ig);resetCanvasBackground(),adoptCanvasBackground(ng),globalStore.canvasCfg=withCanvasBackground(ng),globalStore.gridCfg=lg,globalStore.setGlobalStoreDoneJson(og),Cg(!0)}catch{Cg(!1)}})}),(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(VAceEditor),{value:eg.value,"onUpdate:value":tg[0]||(tg[0]=ig=>eg.value=ig),lang:"json",theme:"monokai",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"])]))}});function _typeof$2(Ag){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gg){return typeof gg}:function(gg){return gg&&typeof Symbol=="function"&&gg.constructor===Symbol&&gg!==Symbol.prototype?"symbol":typeof gg},_typeof$2(Ag)}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(Ag,gg){for(var eg=new u16(31),Ig=0;Ig<31;++Ig)eg[Ig]=gg+=1<<Ag[Ig-1];for(var Cg=new i32(eg[30]),Ig=1;Ig<30;++Ig)for(var tg=eg[Ig];tg<eg[Ig+1];++tg)Cg[tg]=tg-eg[Ig]<<5|Ig;return{b:eg,r:Cg}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),fd=_b.b,revfd=_b.r,rev=new u16(32768),i$7=0;i$7<32768;++i$7){var x$1=(i$7&43690)>>1|(i$7&21845)<<1;x$1=(x$1&52428)>>2|(x$1&13107)<<2,x$1=(x$1&61680)>>4|(x$1&3855)<<4,rev[i$7]=((x$1&65280)>>8|(x$1&255)<<8)>>1}for(var hMap=function(Ag,gg,eg){for(var Ig=Ag.length,Cg=0,tg=new u16(gg);Cg<Ig;++Cg)Ag[Cg]&&++tg[Ag[Cg]-1];var ig=new u16(gg);for(Cg=1;Cg<gg;++Cg)ig[Cg]=ig[Cg-1]+tg[Cg-1]<<1;var ng;if(eg){ng=new u16(1<<gg);var lg=15-gg;for(Cg=0;Cg<Ig;++Cg)if(Ag[Cg])for(var og=Cg<<4|Ag[Cg],sg=gg-Ag[Cg],rg=ig[Ag[Cg]-1]++<<sg,cg=rg|(1<<sg)-1;rg<=cg;++rg)ng[rev[rg]>>lg]=og}else for(ng=new u16(Ig),Cg=0;Cg<Ig;++Cg)Ag[Cg]&&(ng[Cg]=rev[ig[Ag[Cg]-1]++]>>15-Ag[Cg]);return ng},flt=new u8(288),i$7=0;i$7<144;++i$7)flt[i$7]=8;for(var i$7=144;i$7<256;++i$7)flt[i$7]=9;for(var i$7=256;i$7<280;++i$7)flt[i$7]=7;for(var i$7=280;i$7<288;++i$7)flt[i$7]=8;for(var fdt=new u8(32),i$7=0;i$7<32;++i$7)fdt[i$7]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),max$2=function(Ag){for(var gg=Ag[0],eg=1;eg<Ag.length;++eg)Ag[eg]>gg&&(gg=Ag[eg]);return gg},bits=function(Ag,gg,eg){var Ig=gg/8|0;return(Ag[Ig]|Ag[Ig+1]<<8)>>(gg&7)&eg},bits16=function(Ag,gg){var eg=gg/8|0;return(Ag[eg]|Ag[eg+1]<<8|Ag[eg+2]<<16)>>(gg&7)},shft=function(Ag){return(Ag+7)/8|0},slc=function(Ag,gg,eg){return(gg==null||gg<0)&&(gg=0),(eg==null||eg>Ag.length)&&(eg=Ag.length),new u8(Ag.subarray(gg,eg))},ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(Ag,gg,eg){var Ig=new Error(gg||ec[Ag]);if(Ig.code=Ag,Error.captureStackTrace&&Error.captureStackTrace(Ig,err),!eg)throw Ig;return Ig},inflt=function(Ag,gg,eg,Ig){var Cg=Ag.length,tg=Ig?Ig.length:0;if(!Cg||gg.f&&!gg.l)return eg||new u8(0);var ig=!eg,ng=ig||gg.i!=2,lg=gg.i;ig&&(eg=new u8(Cg*3));var og=function(lA){var pA=eg.length;if(lA>pA){var VA=new u8(Math.max(pA*2,lA));VA.set(eg),eg=VA}},sg=gg.f||0,rg=gg.p||0,cg=gg.b||0,ag=gg.l,ug=gg.d,dg=gg.m,hg=gg.n,bg=Cg*8;do{if(!ag){sg=bits(Ag,rg,1);var mg=bits(Ag,rg+1,3);if(rg+=3,mg)if(mg==1)ag=flrm,ug=fdrm,dg=9,hg=5;else if(mg==2){var pg=bits(Ag,rg,31)+257,fg=bits(Ag,rg+10,15)+4,Vg=pg+bits(Ag,rg+5,31)+1;rg+=14;for(var Wg=new u8(Vg),Hg=new u8(19),Sg=0;Sg<fg;++Sg)Hg[clim[Sg]]=bits(Ag,rg+Sg*3,7);rg+=fg*3;for(var wg=max$2(Hg),Xg=(1<<wg)-1,vg=hMap(Hg,wg,1),Sg=0;Sg<Vg;){var yg=vg[bits(Ag,rg,Xg)];rg+=yg&15;var Zg=yg>>4;if(Zg<16)Wg[Sg++]=Zg;else{var Ng=0,Yg=0;for(Zg==16?(Yg=3+bits(Ag,rg,3),rg+=2,Ng=Wg[Sg-1]):Zg==17?(Yg=3+bits(Ag,rg,7),rg+=3):Zg==18&&(Yg=11+bits(Ag,rg,127),rg+=7);Yg--;)Wg[Sg++]=Ng}}var Kg=Wg.subarray(0,pg),Jg=Wg.subarray(pg);dg=max$2(Kg),hg=max$2(Jg),ag=hMap(Kg,dg,1),ug=hMap(Jg,hg,1)}else err(1);else{var Zg=shft(rg)+4,Bg=Ag[Zg-4]|Ag[Zg-3]<<8,Gg=Zg+Bg;if(Gg>Cg){lg&&err(0);break}ng&&og(cg+Bg),eg.set(Ag.subarray(Zg,Gg),cg),gg.b=cg+=Bg,gg.p=rg=Gg*8,gg.f=sg;continue}if(rg>bg){lg&&err(0);break}}ng&&og(cg+131072);for(var Ug=(1<<dg)-1,Qg=(1<<hg)-1,xg=rg;;xg=rg){var Ng=ag[bits16(Ag,rg)&Ug],Tg=Ng>>4;if(rg+=Ng&15,rg>bg){lg&&err(0);break}if(Ng||err(2),Tg<256)eg[cg++]=Tg;else if(Tg==256){xg=rg,ag=null;break}else{var Mg=Tg-254;if(Tg>264){var Sg=Tg-257,Eg=fleb[Sg];Mg=bits(Ag,rg,(1<<Eg)-1)+fl[Sg],rg+=Eg}var Og=ug[bits16(Ag,rg)&Qg],gA=Og>>4;Og||err(3),rg+=Og&15;var Jg=fd[gA];if(gA>3){var Eg=fdeb[gA];Jg+=bits16(Ag,rg)&(1<<Eg)-1,rg+=Eg}if(rg>bg){lg&&err(0);break}ng&&og(cg+131072);var IA=cg+Mg;if(cg<Jg){var Pg=tg-Jg,qg=Math.min(Jg,IA);for(Pg+cg<0&&err(3);cg<qg;++cg)eg[cg]=Ig[Pg+cg]}for(;cg<IA;++cg)eg[cg]=eg[cg-Jg]}}gg.l=ag,gg.p=xg,gg.b=cg,gg.f=sg,ag&&(sg=1,gg.m=dg,gg.d=ug,gg.n=hg)}while(!sg);return cg!=eg.length&&ig?slc(eg,0,cg):eg.subarray(0,cg)},wbits=function(Ag,gg,eg){eg<<=gg&7;var Ig=gg/8|0;Ag[Ig]|=eg,Ag[Ig+1]|=eg>>8},wbits16=function(Ag,gg,eg){eg<<=gg&7;var Ig=gg/8|0;Ag[Ig]|=eg,Ag[Ig+1]|=eg>>8,Ag[Ig+2]|=eg>>16},hTree=function(Ag,gg){for(var eg=[],Ig=0;Ig<Ag.length;++Ig)Ag[Ig]&&eg.push({s:Ig,f:Ag[Ig]});var Cg=eg.length,tg=eg.slice();if(!Cg)return{t:et$1,l:0};if(Cg==1){var ig=new u8(eg[0].s+1);return ig[eg[0].s]=1,{t:ig,l:1}}eg.sort(function(Gg,pg){return Gg.f-pg.f}),eg.push({s:-1,f:25001});var ng=eg[0],lg=eg[1],og=0,sg=1,rg=2;for(eg[0]={s:-1,f:ng.f+lg.f,l:ng,r:lg};sg!=Cg-1;)ng=eg[eg[og].f<eg[rg].f?og++:rg++],lg=eg[og!=sg&&eg[og].f<eg[rg].f?og++:rg++],eg[sg++]={s:-1,f:ng.f+lg.f,l:ng,r:lg};for(var cg=tg[0].s,Ig=1;Ig<Cg;++Ig)tg[Ig].s>cg&&(cg=tg[Ig].s);var ag=new u16(cg+1),ug=ln(eg[sg-1],ag,0);if(ug>gg){var Ig=0,dg=0,hg=ug-gg,bg=1<<hg;for(tg.sort(function(pg,fg){return ag[fg.s]-ag[pg.s]||pg.f-fg.f});Ig<Cg;++Ig){var mg=tg[Ig].s;if(ag[mg]>gg)dg+=bg-(1<<ug-ag[mg]),ag[mg]=gg;else break}for(dg>>=hg;dg>0;){var Zg=tg[Ig].s;ag[Zg]<gg?dg-=1<<gg-ag[Zg]++-1:++Ig}for(;Ig>=0&&dg;--Ig){var Bg=tg[Ig].s;ag[Bg]==gg&&(--ag[Bg],++dg)}ug=gg}return{t:new u8(ag),l:ug}},ln=function(Ag,gg,eg){return Ag.s==-1?Math.max(ln(Ag.l,gg,eg+1),ln(Ag.r,gg,eg+1)):gg[Ag.s]=eg},lc=function(Ag){for(var gg=Ag.length;gg&&!Ag[--gg];);for(var eg=new u16(++gg),Ig=0,Cg=Ag[0],tg=1,ig=function(lg){eg[Ig++]=lg},ng=1;ng<=gg;++ng)if(Ag[ng]==Cg&&ng!=gg)++tg;else{if(!Cg&&tg>2){for(;tg>138;tg-=138)ig(32754);tg>2&&(ig(tg>10?tg-11<<5|28690:tg-3<<5|12305),tg=0)}else if(tg>3){for(ig(Cg),--tg;tg>6;tg-=6)ig(8304);tg>2&&(ig(tg-3<<5|8208),tg=0)}for(;tg--;)ig(Cg);tg=1,Cg=Ag[ng]}return{c:eg.subarray(0,Ig),n:gg}},clen=function(Ag,gg){for(var eg=0,Ig=0;Ig<gg.length;++Ig)eg+=Ag[Ig]*gg[Ig];return eg},wfblk=function(Ag,gg,eg){var Ig=eg.length,Cg=shft(gg+2);Ag[Cg]=Ig&255,Ag[Cg+1]=Ig>>8,Ag[Cg+2]=Ag[Cg]^255,Ag[Cg+3]=Ag[Cg+1]^255;for(var tg=0;tg<Ig;++tg)Ag[Cg+tg+4]=eg[tg];return(Cg+4+Ig)*8},wblk=function(Ag,gg,eg,Ig,Cg,tg,ig,ng,lg,og,sg){wbits(gg,sg++,eg),++Cg[256];for(var rg=hTree(Cg,15),cg=rg.t,ag=rg.l,ug=hTree(tg,15),dg=ug.t,hg=ug.l,bg=lc(cg),mg=bg.c,Zg=bg.n,Bg=lc(dg),Gg=Bg.c,pg=Bg.n,fg=new u16(19),Vg=0;Vg<mg.length;++Vg)++fg[mg[Vg]&31];for(var Vg=0;Vg<Gg.length;++Vg)++fg[Gg[Vg]&31];for(var Wg=hTree(fg,7),Hg=Wg.t,Sg=Wg.l,wg=19;wg>4&&!Hg[clim[wg-1]];--wg);var Xg=og+5<<3,vg=clen(Cg,flt)+clen(tg,fdt)+ig,yg=clen(Cg,cg)+clen(tg,dg)+ig+14+3*wg+clen(fg,Hg)+2*fg[16]+3*fg[17]+7*fg[18];if(lg>=0&&Xg<=vg&&Xg<=yg)return wfblk(gg,sg,Ag.subarray(lg,lg+og));var Ng,Yg,Kg,Jg;if(wbits(gg,sg,1+(yg<vg)),sg+=2,yg<vg){Ng=hMap(cg,ag,0),Yg=cg,Kg=hMap(dg,hg,0),Jg=dg;var Ug=hMap(Hg,Sg,0);wbits(gg,sg,Zg-257),wbits(gg,sg+5,pg-1),wbits(gg,sg+10,wg-4),sg+=14;for(var Vg=0;Vg<wg;++Vg)wbits(gg,sg+3*Vg,Hg[clim[Vg]]);sg+=3*wg;for(var Qg=[mg,Gg],xg=0;xg<2;++xg)for(var Tg=Qg[xg],Vg=0;Vg<Tg.length;++Vg){var Mg=Tg[Vg]&31;wbits(gg,sg,Ug[Mg]),sg+=Hg[Mg],Mg>15&&(wbits(gg,sg,Tg[Vg]>>5&127),sg+=Tg[Vg]>>12)}}else Ng=flm,Yg=flt,Kg=fdm,Jg=fdt;for(var Vg=0;Vg<ng;++Vg){var Eg=Ig[Vg];if(Eg>255){var Mg=Eg>>18&31;wbits16(gg,sg,Ng[Mg+257]),sg+=Yg[Mg+257],Mg>7&&(wbits(gg,sg,Eg>>23&31),sg+=fleb[Mg]);var Og=Eg&31;wbits16(gg,sg,Kg[Og]),sg+=Jg[Og],Og>3&&(wbits16(gg,sg,Eg>>5&8191),sg+=fdeb[Og])}else wbits16(gg,sg,Ng[Eg]),sg+=Yg[Eg]}return wbits16(gg,sg,Ng[256]),sg+Yg[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$1=new u8(0),dflt=function(Ag,gg,eg,Ig,Cg,tg){var ig=tg.z||Ag.length,ng=new u8(Ig+ig+5*(1+Math.ceil(ig/7e3))+Cg),lg=ng.subarray(Ig,ng.length-Cg),og=tg.l,sg=(tg.r||0)&7;if(gg){sg&&(lg[0]=tg.r>>3);for(var rg=deo[gg-1],cg=rg>>13,ag=rg&8191,ug=(1<<eg)-1,dg=tg.p||new u16(32768),hg=tg.h||new u16(ug+1),bg=Math.ceil(eg/3),mg=2*bg,Zg=function(XA){return(Ag[XA]^Ag[XA+1]<<bg^Ag[XA+2]<<mg)&ug},Bg=new i32(25e3),Gg=new u16(288),pg=new u16(32),fg=0,Vg=0,Wg=tg.i||0,Hg=0,Sg=tg.w||0,wg=0;Wg+2<ig;++Wg){var Xg=Zg(Wg),vg=Wg&32767,yg=hg[Xg];if(dg[vg]=yg,hg[Xg]=vg,Sg<=Wg){var Ng=ig-Wg;if((fg>7e3||Hg>24576)&&(Ng>423||!og)){sg=wblk(Ag,lg,0,Bg,Gg,pg,Vg,Hg,wg,Wg-wg,sg),Hg=fg=Vg=0,wg=Wg;for(var Yg=0;Yg<286;++Yg)Gg[Yg]=0;for(var Yg=0;Yg<30;++Yg)pg[Yg]=0}var Kg=2,Jg=0,Ug=ag,Qg=vg-yg&32767;if(Ng>2&&Xg==Zg(Wg-Qg))for(var xg=Math.min(cg,Ng)-1,Tg=Math.min(32767,Wg),Mg=Math.min(258,Ng);Qg<=Tg&&--Ug&&vg!=yg;){if(Ag[Wg+Kg]==Ag[Wg+Kg-Qg]){for(var Eg=0;Eg<Mg&&Ag[Wg+Eg]==Ag[Wg+Eg-Qg];++Eg);if(Eg>Kg){if(Kg=Eg,Jg=Qg,Eg>xg)break;for(var Og=Math.min(Qg,Eg-2),gA=0,Yg=0;Yg<Og;++Yg){var IA=Wg-Qg+Yg&32767,Pg=dg[IA],qg=IA-Pg&32767;qg>gA&&(gA=qg,yg=IA)}}}vg=yg,yg=dg[vg],Qg+=vg-yg&32767}if(Jg){Bg[Hg++]=268435456|revfl[Kg]<<18|revfd[Jg];var lA=revfl[Kg]&31,pA=revfd[Jg]&31;Vg+=fleb[lA]+fdeb[pA],++Gg[257+lA],++pg[pA],Sg=Wg+Kg,++fg}else Bg[Hg++]=Ag[Wg],++Gg[Ag[Wg]]}}for(Wg=Math.max(Wg,Sg);Wg<ig;++Wg)Bg[Hg++]=Ag[Wg],++Gg[Ag[Wg]];sg=wblk(Ag,lg,og,Bg,Gg,pg,Vg,Hg,wg,Wg-wg,sg),og||(tg.r=sg&7|lg[sg/8|0]<<3,sg-=7,tg.h=hg,tg.p=dg,tg.i=Wg,tg.w=Sg)}else{for(var Wg=tg.w||0;Wg<ig+og;Wg+=65535){var VA=Wg+65535;VA>=ig&&(lg[sg/8|0]=og,VA=ig),sg=wfblk(lg,sg+1,Ag.subarray(Wg,VA))}tg.i=ig}return slc(ng,0,Ig+shft(sg)+Cg)},adler=function(){var Ag=1,gg=0;return{p:function(eg){for(var Ig=Ag,Cg=gg,tg=eg.length|0,ig=0;ig!=tg;){for(var ng=Math.min(ig+2655,tg);ig<ng;++ig)Cg+=Ig+=eg[ig];Ig=(Ig&65535)+15*(Ig>>16),Cg=(Cg&65535)+15*(Cg>>16)}Ag=Ig,gg=Cg},d:function(){return Ag%=65521,gg%=65521,(Ag&255)<<24|(Ag&65280)<<8|(gg&255)<<8|gg>>8}}},dopt=function(Ag,gg,eg,Ig,Cg){if(!Cg&&(Cg={l:1},gg.dictionary)){var tg=gg.dictionary.subarray(-32768),ig=new u8(tg.length+Ag.length);ig.set(tg),ig.set(Ag,tg.length),Ag=ig,Cg.w=tg.length}return dflt(Ag,gg.level==null?6:gg.level,gg.mem==null?Cg.l?Math.ceil(Math.max(8,Math.min(13,Math.log(Ag.length)))*1.5):20:12+gg.mem,eg,Ig,Cg)},wbytes=function(Ag,gg,eg){for(;eg;++gg)Ag[gg]=eg,eg>>>=8},zlh=function(Ag,gg){var eg=gg.level,Ig=eg==0?0:eg<6?1:eg==9?3:2;if(Ag[0]=120,Ag[1]=Ig<<6|(gg.dictionary&&32),Ag[1]|=31-(Ag[0]<<8|Ag[1])%31,gg.dictionary){var Cg=adler();Cg.p(gg.dictionary),wbytes(Ag,2,Cg.d())}},zls=function(Ag,gg){return((Ag[0]&15)!=8||Ag[0]>>4>7||(Ag[0]<<8|Ag[1])%31)&&err(6,"invalid zlib data"),(Ag[1]>>5&1)==+!gg&&err(6,"invalid zlib data: "+(Ag[1]&32?"need":"unexpected")+" dictionary"),(Ag[1]>>3&4)+2};function zlibSync(Ag,gg){gg||(gg={});var eg=adler();eg.p(Ag);var Ig=dopt(Ag,gg,gg.dictionary?6:2,4);return zlh(Ig,gg),wbytes(Ig,Ig.length-4,eg.d()),Ig}function unzlibSync(Ag,gg){return inflt(Ag.subarray(zls(Ag,gg&&gg.dictionary),-4),{i:2},gg&&gg.out,gg&&gg.dictionary)}var td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et$1,{stream:!0}),tds=1}catch(Ag){}/** @license
|
|
1168
|
+
})`,score:1e3,meta:"消息弹出框"},{name:"$item_info",value:"$item_info",score:1e3,meta:"回调函数中获取当前触发事件图形的信息"}])}});const _hoisted_1$6={key:0,class:"right-aside-item-setting select-none"},_hoisted_2$5={class:"right-aside-field"},_hoisted_3$4={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_4$4={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_5$3={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_6$3={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_7$2={class:"right-aside-field right-aside-number-field right-aside-plain-number"},_hoisted_8$2={class:"right-aside-field right-aside-switch-field"},_hoisted_9$1={class:"right-aside-field right-aside-switch-field"},_hoisted_10$1={class:"right-aside-field right-aside-switch-field"},_hoisted_11$1={class:"right-aside-field right-aside-switch-field"},_hoisted_12={class:"right-aside-field right-aside-switch-field"},_sfc_main$8=vue.defineComponent({__name:"select-item-setting",props:{itemJson:{},doneJson:{}},emits:["update:itemJson","addHistory"],setup(Ag,{emit:gg}){const eg=vue.ref(["props"]),Ig=Ag,Cg=gg,tg=vue.useSlots(),ig=vue.computed(()=>{var Zg;return((Zg=Ig.itemJson)==null?void 0:Zg.type)==="sys-line"}),ng=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.title},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,title:Zg})}}),lg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.left},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,left:Zg}})}}),og=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.top},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,top:Zg}})}}),sg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.width},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,width:Zg}})}}),rg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.height},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,height:Zg}})}}),cg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.binfo.angle},set:Zg=>{var Bg;Cg("update:itemJson",{...Ig.itemJson,binfo:{...(Bg=Ig.itemJson)==null?void 0:Bg.binfo,angle:Zg}})}}),ag=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.hide},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,hide:Zg})}}),ug=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.lock},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,lock:Zg})}}),dg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.resize},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,resize:Zg})}}),hg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.use_proportional_scaling},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,use_proportional_scaling:Zg})}}),bg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.rotate},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,rotate:Zg})}}),mg=vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.props},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,props:Zg})}});return vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.common_animations},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,common_animations:Zg})}}),vue.computed({get:()=>{var Zg;return(Zg=Ig.itemJson)==null?void 0:Zg.events},set:Zg=>{Cg("update:itemJson",{...Ig.itemJson,events:Zg})}}),vue.computed(()=>!!tg.deviceBind),(Zg,Bg)=>Ig.itemJson?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createVNode(vue.unref(ElCollapse),{modelValue:eg.value,"onUpdate:modelValue":Bg[19]||(Bg[19]=Gg=>eg.value=Gg)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"props"},{title:vue.withCtx(()=>[...Bg[20]||(Bg[20]=[vue.createElementVNode("div",{class:"right-aside-collapse-title"},[vue.createElementVNode("span",{class:"right-aside-triangle","aria-hidden":"true"}),vue.createElementVNode("span",{class:"right-aside-collapse-label"},"图元属性")],-1)])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{class:"right-aside-form","label-width":"72px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"名称",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$5,[vue.createVNode(vue.unref(ElInput),{size:"small",modelValue:ng.value,"onUpdate:modelValue":Bg[0]||(Bg[0]=Gg=>ng.value=Gg),disabled:"",class:"right-aside-field-control"},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x轴坐标",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:lg.value,"onUpdate:modelValue":Bg[1]||(Bg[1]=Gg=>lg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[2]||(Bg[2]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y轴坐标",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$4,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:og.value,"onUpdate:modelValue":Bg[3]||(Bg[3]=Gg=>og.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[4]||(Bg[4]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"宽度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$3,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:sg.value,"onUpdate:modelValue":Bg[5]||(Bg[5]=Gg=>sg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[6]||(Bg[6]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"高度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:rg.value,"onUpdate:modelValue":Bg[7]||(Bg[7]=Gg=>rg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[8]||(Bg[8]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),ig.value?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"旋转角度",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$2,[vue.createVNode(vue.unref(ElInputNumber),{size:"small",modelValue:cg.value,"onUpdate:modelValue":Bg[9]||(Bg[9]=Gg=>cg.value=Gg),controls:!1,class:"right-aside-field-control",onChange:Bg[10]||(Bg[10]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1})),Bg[21]||(Bg[21]=vue.createElementVNode("div",{class:"right-aside-form-divider","aria-hidden":"true"},null,-1)),vue.createVNode(vue.unref(ElFormItem),{label:"隐藏",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_8$2,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:ag.value,"onUpdate:modelValue":Bg[11]||(Bg[11]=Gg=>ag.value=Gg),onChange:Bg[12]||(Bg[12]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"锁定",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_9$1,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:ug.value,"onUpdate:modelValue":Bg[13]||(Bg[13]=Gg=>ug.value=Gg),onChange:Bg[14]||(Bg[14]=Gg=>Cg("addHistory"))},null,8,["modelValue"])])]),_:1}),!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"可缩放",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_10$1,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:dg.value,"onUpdate:modelValue":Bg[15]||(Bg[15]=Gg=>dg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),dg.value&&!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:4,label:"等比缩放",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_11$1,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:hg.value,"onUpdate:modelValue":Bg[16]||(Bg[16]=Gg=>hg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),!ug.value&&!ig.value?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:5,label:"可旋转",size:"small"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.createVNode(vue.unref(ElSwitch),{size:"small",modelValue:bg.value,"onUpdate:modelValue":Bg[17]||(Bg[17]=Gg=>bg.value=Gg)},null,8,["modelValue"])])]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$9,{propsInfo:mg.value,"onUpdate:propsInfo":Bg[18]||(Bg[18]=Gg=>mg.value=Gg)},null,8,["propsInfo"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])):vue.createCommentVNode("",!0)}}),_hoisted_1$5=["aria-expanded"],_hoisted_2$4={class:"task-sop-body"},_hoisted_3$3=["title"],_hoisted_4$3={class:"task-sop-name-tag"},_hoisted_5$2={key:0,class:"task-sop-list"},_hoisted_6$2=["onClick"],_hoisted_7$1=["title"],_hoisted_8$1={key:1,class:"task-sop-empty"},_sfc_main$7=vue.defineComponent({__name:"task-sop-setting",props:{task:{},activeSopId:{},expanded:{type:Boolean}},emits:["selectSop","update:expanded"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=()=>{Ig("update:expanded",!eg.expanded)},tg=vue.computed(()=>(eg.task.sopList??[]).filter(ng=>ng.isDel!=="Y")),ig=ng=>{ng!==eg.activeSopId&&Ig("selectSop",ng)};return(ng,lg)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["task-sop-setting",{"is-expanded":Ag.expanded}])},[vue.createElementVNode("button",{type:"button",class:"task-sop-collapse-header","aria-expanded":Ag.expanded,onClick:Cg},[vue.createElementVNode("span",{class:vue.normalizeClass(["right-aside-triangle",{"is-expanded":Ag.expanded}]),"aria-hidden":"true"},null,2),lg[0]||(lg[0]=vue.createElementVNode("span",{class:"task-sop-collapse-label"},"任务与SOP",-1))],8,_hoisted_1$5),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$4,[vue.createElementVNode("p",{class:"task-sop-plan",title:Ag.task.planIdName},vue.toDisplayString(Ag.task.planIdName),9,_hoisted_3$3),vue.createElementVNode("div",_hoisted_4$3,vue.toDisplayString(Ag.task.taskName),1),lg[2]||(lg[2]=vue.createElementVNode("div",{class:"task-sop-divider","aria-hidden":"true"},null,-1)),lg[3]||(lg[3]=vue.createElementVNode("div",{class:"task-sop-list-head"},[vue.createElementVNode("span",{class:"task-sop-list-title"},"关联 SOP 列表"),vue.createElementVNode("span",{class:"task-sop-list-hint"},"可拖拽图元")],-1)),tg.value.length?(vue.openBlock(),vue.createElementBlock("ul",_hoisted_5$2,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,og=>(vue.openBlock(),vue.createElementBlock("li",{key:og.sopId,class:vue.normalizeClass(["task-sop-list-item",{"is-active":og.sopId===Ag.activeSopId}]),onClick:vue.withModifiers(sg=>ig(og.sopId),["stop"])},[lg[1]||(lg[1]=vue.createElementVNode("span",{class:"task-sop-list-dot","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",{class:"task-sop-list-label",title:og.sopName},vue.toDisplayString(og.sopName),9,_hoisted_7$1)],10,_hoisted_6$2))),128))])):(vue.openBlock(),vue.createElementBlock("p",_hoisted_8$1,"当前任务暂无关联 SOP"))],512),[[vue.vShow,Ag.expanded]])],2))}}),taskSopSetting_vue_vue_type_style_index_0_scoped_bc9c9bc0_lang="",TaskSopSetting=_export_sfc(_sfc_main$7,[["__scopeId","data-v-bc9c9bc0"]]),_hoisted_1$4={key:0,class:"right-aside-main right-aside-view-mode"},_hoisted_2$3={key:1,class:"right-aside-footer-hint"},_hoisted_3$2={key:2,class:"right-aside-main"},_hoisted_4$2={key:1,class:"right-aside-footer-hint"},_sfc_main$6=vue.defineComponent({__name:"index",props:{viewMode:{type:Boolean,default:!1},selectedTask:{},activeSopId:{default:"__default__"}},emits:["selectTaskSop"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.ref(["design"]),tg=vue.ref(!1),ig=vue.computed(()=>eg.viewMode?!0:tg.value),ng=Zg=>{eg.viewMode||(tg.value=Zg)},lg=vue.computed(()=>!Cg.value.includes("design"));let og=!1;const sg=Zg=>{og=!0,Zg(),og=!1},rg=()=>{Cg.value=[]},cg=()=>{sg(()=>{Cg.value=[],tg.value=!0})},ag=()=>{sg(()=>{tg.value=!1,Cg.value=["design"]})};vue.watch(Cg,Zg=>{og||Zg.includes("design")&&sg(()=>{tg.value=!1})},{deep:!0}),vue.watch(tg,Zg=>{og||Zg&&sg(()=>{Cg.value=[]})});const ug=Zg=>{rg(),Ig("selectTaskSop",Zg)};vue.watch(()=>eg.activeSopId,(Zg,Bg)=>{!eg.selectedTask||!Zg||Zg===Bg||rg()}),vue.watch(()=>{var Zg;return(Zg=eg.selectedTask)==null?void 0:Zg.pdTaskId},Zg=>{if(eg.viewMode){Zg&&(tg.value=!0);return}Zg?cg():ag()});const dg=vue.useSlots(),hg=vue.computed(()=>globalStore.done_json.findIndex(Zg=>Zg.id==globalStore.selected_items_id[0])),bg=()=>{cacheStore.addHistory(globalStore.done_json)},mg=vue.computed(()=>!!dg.deviceBind);return(Zg,Bg)=>(vue.openBlock(),vue.createElementBlock("div",{id:"mt-right-aside",class:vue.normalizeClass(["right-aside-root",{"is-task-sop-only":Ag.viewMode}])},[Ag.viewMode?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[Ag.selectedTask?(vue.openBlock(),vue.createBlock(TaskSopSetting,{key:Ag.selectedTask.pdTaskId,task:Ag.selectedTask,"active-sop-id":Ag.activeSopId,expanded:ig.value,"onUpdate:expanded":ng,onSelectSop:ug},null,8,["task","active-sop-id","expanded"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[...Bg[5]||(Bg[5]=[vue.createElementVNode("p",null,"请在底部时间轴选择任务",-1),vue.createElementVNode("p",null,"以查看关联 SOP",-1)])]))])):vue.unref(globalStore).selected_items_id.length==1?(vue.openBlock(),vue.createBlock(_sfc_main$8,{key:1,class:"right-aside-item-panel","item-json":vue.unref(globalStore).done_json[hg.value],"onUpdate:itemJson":Bg[0]||(Bg[0]=Gg=>vue.unref(globalStore).done_json[hg.value]=Gg),"done-json":vue.unref(globalStore).done_json,onAddHistory:bg},vue.createSlots({_:2},[mg.value?{name:"deviceBind",fn:vue.withCtx(({item:Gg})=>[vue.renderSlot(Zg.$slots,"deviceBind",{item:Gg})]),key:"0"}:void 0]),1032,["item-json","done-json"])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$2,[vue.createElementVNode("div",{class:vue.normalizeClass(["right-aside-design-scroll",{"is-design-collapsed":lg.value}])},[vue.createVNode(PageSetting,{canvasCfg:vue.unref(globalStore).canvasCfg,"onUpdate:canvasCfg":Bg[1]||(Bg[1]=Gg=>vue.unref(globalStore).canvasCfg=Gg),"grid-cfg":vue.unref(globalStore).gridCfg,"onUpdate:gridCfg":Bg[2]||(Bg[2]=Gg=>vue.unref(globalStore).gridCfg=Gg),"active-collapse":Cg.value,"onUpdate:activeCollapse":Bg[3]||(Bg[3]=Gg=>Cg.value=Gg)},null,8,["canvasCfg","grid-cfg","active-collapse"])],2),Ag.selectedTask?(vue.openBlock(),vue.createBlock(TaskSopSetting,{key:Ag.selectedTask.pdTaskId,task:Ag.selectedTask,"active-sop-id":Ag.activeSopId,expanded:tg.value,"onUpdate:expanded":Bg[4]||(Bg[4]=Gg=>tg.value=Gg),onSelectSop:ug},null,8,["task","active-sop-id","expanded"])):vue.createCommentVNode("",!0),Ag.selectedTask?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$2,[...Bg[6]||(Bg[6]=[vue.createElementVNode("p",null,"选中画布中的图元后",-1),vue.createElementVNode("p",null,"可在此处修改名称与尺寸",-1)])]))]))],2))}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$3={class:"flex justify-between w-8/10"},_sfc_main$5=vue.defineComponent({__name:"index",props:{doneJson:{},selectedItemsId:{}},emits:["updateSelectedItemsId","updateSelectedIdHide"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg,Cg=vue.computed(()=>eg.selectedItemsId.length==1?eg.selectedItemsId[0]:""),tg=lg=>{Ig("updateSelectedItemsId",lg.id)},ig=lg=>{Ig("updateSelectedIdHide",lg.id)},ng={children:"nochildren",label:"title"};return(lg,og)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:eg.doneJson,props:ng,onNodeClick:tg,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":Cg.value},{default:vue.withCtx(({node:sg,data:rg})=>[vue.createElementVNode("div",_hoisted_1$3,[vue.createElementVNode("div",null,vue.toDisplayString(sg.label),1),vue.createVNode(vue.unref(ElButton),{text:"",circle:"",size:"small",class:"mr-10px"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{title:rg.hide?"隐藏":"显示",size:20,onClick:vue.withModifiers(cg=>ig(rg),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$A,{name:rg.hide?"view-hide":"view-show"},null,8,["name"])]),_:2},1032,["title","onClick"])]),_:2},1024)])]),_:1},8,["data","current-node-key"]))}}),genExportJson=(Ag,gg,eg)=>{let Ig=[];return Ig=objectDeepClone(eg).map(tg=>{tg.symbol&&delete tg.symbol;let ig={};for(const ng in tg.props)ig={...ig,[ng]:tg.props[ng].val};return{...tg,props:ig,active:!1}}),{exportJson:{canvasCfg:Ag,gridCfg:gg,json:Ig}}},useExportJsonToDoneJson=Ag=>{let gg=[];for(const Ig of leftAsideStore.config.values())Ig.length>0&&(gg=[...gg,...Ig]);const eg=Ag.json.map(Ig=>{let Cg={},tg;const ig=gg.find(lg=>(lg==null?void 0:lg.id)==Ig.tag),ng=ig==null?void 0:ig.props;ng&&(Cg={...Cg,...objectDeepClone(ng)});for(const lg in Ig.props)Cg[lg].val=Ig.props[lg];return ig!=null&&ig.symbol&&(tg=ig.symbol),{...Ig,props:Cg,symbol:tg}});return{canvasCfg:Ag.canvasCfg,gridCfg:Ag.gridCfg,importDoneJson:eg}},_sfc_main$4=vue.defineComponent({__name:"index",props:{doneJson:{},canvasCfg:{},gridCfg:{}},setup(Ag){const gg=Ag,eg=vue.computed({get:()=>{const{exportJson:Ig}=genExportJson(gg.canvasCfg,gg.gridCfg,gg.doneJson);return JSON.stringify(Ig,null,2)},set:()=>{}});return(Ig,Cg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(VAceEditor),{value:eg.value,"onUpdate:value":Cg[0]||(Cg[0]=tg=>eg.value=tg),lang:"json",theme:"monokai",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"])]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(Ag,{expose:gg}){const eg=vue.ref("");return gg({onImport:()=>new Promise((Cg,tg)=>{try{const ig=JSON.parse(eg.value),{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(ig);resetCanvasBackground(),adoptCanvasBackground(ng),globalStore.canvasCfg=withCanvasBackground(ng),globalStore.gridCfg=lg,globalStore.setGlobalStoreDoneJson(og),Cg(!0)}catch{Cg(!1)}})}),(Cg,tg)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(VAceEditor),{value:eg.value,"onUpdate:value":tg[0]||(tg[0]=ig=>eg.value=ig),lang:"json",theme:"monokai",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"])]))}});function _typeof$2(Ag){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gg){return typeof gg}:function(gg){return gg&&typeof Symbol=="function"&&gg.constructor===Symbol&&gg!==Symbol.prototype?"symbol":typeof gg},_typeof$2(Ag)}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(Ag,gg){for(var eg=new u16(31),Ig=0;Ig<31;++Ig)eg[Ig]=gg+=1<<Ag[Ig-1];for(var Cg=new i32(eg[30]),Ig=1;Ig<30;++Ig)for(var tg=eg[Ig];tg<eg[Ig+1];++tg)Cg[tg]=tg-eg[Ig]<<5|Ig;return{b:eg,r:Cg}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),fd=_b.b,revfd=_b.r,rev=new u16(32768),i$7=0;i$7<32768;++i$7){var x$1=(i$7&43690)>>1|(i$7&21845)<<1;x$1=(x$1&52428)>>2|(x$1&13107)<<2,x$1=(x$1&61680)>>4|(x$1&3855)<<4,rev[i$7]=((x$1&65280)>>8|(x$1&255)<<8)>>1}for(var hMap=function(Ag,gg,eg){for(var Ig=Ag.length,Cg=0,tg=new u16(gg);Cg<Ig;++Cg)Ag[Cg]&&++tg[Ag[Cg]-1];var ig=new u16(gg);for(Cg=1;Cg<gg;++Cg)ig[Cg]=ig[Cg-1]+tg[Cg-1]<<1;var ng;if(eg){ng=new u16(1<<gg);var lg=15-gg;for(Cg=0;Cg<Ig;++Cg)if(Ag[Cg])for(var og=Cg<<4|Ag[Cg],sg=gg-Ag[Cg],rg=ig[Ag[Cg]-1]++<<sg,cg=rg|(1<<sg)-1;rg<=cg;++rg)ng[rev[rg]>>lg]=og}else for(ng=new u16(Ig),Cg=0;Cg<Ig;++Cg)Ag[Cg]&&(ng[Cg]=rev[ig[Ag[Cg]-1]++]>>15-Ag[Cg]);return ng},flt=new u8(288),i$7=0;i$7<144;++i$7)flt[i$7]=8;for(var i$7=144;i$7<256;++i$7)flt[i$7]=9;for(var i$7=256;i$7<280;++i$7)flt[i$7]=7;for(var i$7=280;i$7<288;++i$7)flt[i$7]=8;for(var fdt=new u8(32),i$7=0;i$7<32;++i$7)fdt[i$7]=5;var flm=hMap(flt,9,0),flrm=hMap(flt,9,1),fdm=hMap(fdt,5,0),fdrm=hMap(fdt,5,1),max$2=function(Ag){for(var gg=Ag[0],eg=1;eg<Ag.length;++eg)Ag[eg]>gg&&(gg=Ag[eg]);return gg},bits=function(Ag,gg,eg){var Ig=gg/8|0;return(Ag[Ig]|Ag[Ig+1]<<8)>>(gg&7)&eg},bits16=function(Ag,gg){var eg=gg/8|0;return(Ag[eg]|Ag[eg+1]<<8|Ag[eg+2]<<16)>>(gg&7)},shft=function(Ag){return(Ag+7)/8|0},slc=function(Ag,gg,eg){return(gg==null||gg<0)&&(gg=0),(eg==null||eg>Ag.length)&&(eg=Ag.length),new u8(Ag.subarray(gg,eg))},ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(Ag,gg,eg){var Ig=new Error(gg||ec[Ag]);if(Ig.code=Ag,Error.captureStackTrace&&Error.captureStackTrace(Ig,err),!eg)throw Ig;return Ig},inflt=function(Ag,gg,eg,Ig){var Cg=Ag.length,tg=Ig?Ig.length:0;if(!Cg||gg.f&&!gg.l)return eg||new u8(0);var ig=!eg,ng=ig||gg.i!=2,lg=gg.i;ig&&(eg=new u8(Cg*3));var og=function(lA){var pA=eg.length;if(lA>pA){var VA=new u8(Math.max(pA*2,lA));VA.set(eg),eg=VA}},sg=gg.f||0,rg=gg.p||0,cg=gg.b||0,ag=gg.l,ug=gg.d,dg=gg.m,hg=gg.n,bg=Cg*8;do{if(!ag){sg=bits(Ag,rg,1);var mg=bits(Ag,rg+1,3);if(rg+=3,mg)if(mg==1)ag=flrm,ug=fdrm,dg=9,hg=5;else if(mg==2){var pg=bits(Ag,rg,31)+257,fg=bits(Ag,rg+10,15)+4,Vg=pg+bits(Ag,rg+5,31)+1;rg+=14;for(var Wg=new u8(Vg),Hg=new u8(19),Sg=0;Sg<fg;++Sg)Hg[clim[Sg]]=bits(Ag,rg+Sg*3,7);rg+=fg*3;for(var wg=max$2(Hg),Xg=(1<<wg)-1,vg=hMap(Hg,wg,1),Sg=0;Sg<Vg;){var yg=vg[bits(Ag,rg,Xg)];rg+=yg&15;var Zg=yg>>4;if(Zg<16)Wg[Sg++]=Zg;else{var Ng=0,Yg=0;for(Zg==16?(Yg=3+bits(Ag,rg,3),rg+=2,Ng=Wg[Sg-1]):Zg==17?(Yg=3+bits(Ag,rg,7),rg+=3):Zg==18&&(Yg=11+bits(Ag,rg,127),rg+=7);Yg--;)Wg[Sg++]=Ng}}var Kg=Wg.subarray(0,pg),Jg=Wg.subarray(pg);dg=max$2(Kg),hg=max$2(Jg),ag=hMap(Kg,dg,1),ug=hMap(Jg,hg,1)}else err(1);else{var Zg=shft(rg)+4,Bg=Ag[Zg-4]|Ag[Zg-3]<<8,Gg=Zg+Bg;if(Gg>Cg){lg&&err(0);break}ng&&og(cg+Bg),eg.set(Ag.subarray(Zg,Gg),cg),gg.b=cg+=Bg,gg.p=rg=Gg*8,gg.f=sg;continue}if(rg>bg){lg&&err(0);break}}ng&&og(cg+131072);for(var Ug=(1<<dg)-1,Qg=(1<<hg)-1,xg=rg;;xg=rg){var Ng=ag[bits16(Ag,rg)&Ug],Tg=Ng>>4;if(rg+=Ng&15,rg>bg){lg&&err(0);break}if(Ng||err(2),Tg<256)eg[cg++]=Tg;else if(Tg==256){xg=rg,ag=null;break}else{var Mg=Tg-254;if(Tg>264){var Sg=Tg-257,Eg=fleb[Sg];Mg=bits(Ag,rg,(1<<Eg)-1)+fl[Sg],rg+=Eg}var Og=ug[bits16(Ag,rg)&Qg],gA=Og>>4;Og||err(3),rg+=Og&15;var Jg=fd[gA];if(gA>3){var Eg=fdeb[gA];Jg+=bits16(Ag,rg)&(1<<Eg)-1,rg+=Eg}if(rg>bg){lg&&err(0);break}ng&&og(cg+131072);var IA=cg+Mg;if(cg<Jg){var Pg=tg-Jg,qg=Math.min(Jg,IA);for(Pg+cg<0&&err(3);cg<qg;++cg)eg[cg]=Ig[Pg+cg]}for(;cg<IA;++cg)eg[cg]=eg[cg-Jg]}}gg.l=ag,gg.p=xg,gg.b=cg,gg.f=sg,ag&&(sg=1,gg.m=dg,gg.d=ug,gg.n=hg)}while(!sg);return cg!=eg.length&&ig?slc(eg,0,cg):eg.subarray(0,cg)},wbits=function(Ag,gg,eg){eg<<=gg&7;var Ig=gg/8|0;Ag[Ig]|=eg,Ag[Ig+1]|=eg>>8},wbits16=function(Ag,gg,eg){eg<<=gg&7;var Ig=gg/8|0;Ag[Ig]|=eg,Ag[Ig+1]|=eg>>8,Ag[Ig+2]|=eg>>16},hTree=function(Ag,gg){for(var eg=[],Ig=0;Ig<Ag.length;++Ig)Ag[Ig]&&eg.push({s:Ig,f:Ag[Ig]});var Cg=eg.length,tg=eg.slice();if(!Cg)return{t:et$1,l:0};if(Cg==1){var ig=new u8(eg[0].s+1);return ig[eg[0].s]=1,{t:ig,l:1}}eg.sort(function(Gg,pg){return Gg.f-pg.f}),eg.push({s:-1,f:25001});var ng=eg[0],lg=eg[1],og=0,sg=1,rg=2;for(eg[0]={s:-1,f:ng.f+lg.f,l:ng,r:lg};sg!=Cg-1;)ng=eg[eg[og].f<eg[rg].f?og++:rg++],lg=eg[og!=sg&&eg[og].f<eg[rg].f?og++:rg++],eg[sg++]={s:-1,f:ng.f+lg.f,l:ng,r:lg};for(var cg=tg[0].s,Ig=1;Ig<Cg;++Ig)tg[Ig].s>cg&&(cg=tg[Ig].s);var ag=new u16(cg+1),ug=ln(eg[sg-1],ag,0);if(ug>gg){var Ig=0,dg=0,hg=ug-gg,bg=1<<hg;for(tg.sort(function(pg,fg){return ag[fg.s]-ag[pg.s]||pg.f-fg.f});Ig<Cg;++Ig){var mg=tg[Ig].s;if(ag[mg]>gg)dg+=bg-(1<<ug-ag[mg]),ag[mg]=gg;else break}for(dg>>=hg;dg>0;){var Zg=tg[Ig].s;ag[Zg]<gg?dg-=1<<gg-ag[Zg]++-1:++Ig}for(;Ig>=0&&dg;--Ig){var Bg=tg[Ig].s;ag[Bg]==gg&&(--ag[Bg],++dg)}ug=gg}return{t:new u8(ag),l:ug}},ln=function(Ag,gg,eg){return Ag.s==-1?Math.max(ln(Ag.l,gg,eg+1),ln(Ag.r,gg,eg+1)):gg[Ag.s]=eg},lc=function(Ag){for(var gg=Ag.length;gg&&!Ag[--gg];);for(var eg=new u16(++gg),Ig=0,Cg=Ag[0],tg=1,ig=function(lg){eg[Ig++]=lg},ng=1;ng<=gg;++ng)if(Ag[ng]==Cg&&ng!=gg)++tg;else{if(!Cg&&tg>2){for(;tg>138;tg-=138)ig(32754);tg>2&&(ig(tg>10?tg-11<<5|28690:tg-3<<5|12305),tg=0)}else if(tg>3){for(ig(Cg),--tg;tg>6;tg-=6)ig(8304);tg>2&&(ig(tg-3<<5|8208),tg=0)}for(;tg--;)ig(Cg);tg=1,Cg=Ag[ng]}return{c:eg.subarray(0,Ig),n:gg}},clen=function(Ag,gg){for(var eg=0,Ig=0;Ig<gg.length;++Ig)eg+=Ag[Ig]*gg[Ig];return eg},wfblk=function(Ag,gg,eg){var Ig=eg.length,Cg=shft(gg+2);Ag[Cg]=Ig&255,Ag[Cg+1]=Ig>>8,Ag[Cg+2]=Ag[Cg]^255,Ag[Cg+3]=Ag[Cg+1]^255;for(var tg=0;tg<Ig;++tg)Ag[Cg+tg+4]=eg[tg];return(Cg+4+Ig)*8},wblk=function(Ag,gg,eg,Ig,Cg,tg,ig,ng,lg,og,sg){wbits(gg,sg++,eg),++Cg[256];for(var rg=hTree(Cg,15),cg=rg.t,ag=rg.l,ug=hTree(tg,15),dg=ug.t,hg=ug.l,bg=lc(cg),mg=bg.c,Zg=bg.n,Bg=lc(dg),Gg=Bg.c,pg=Bg.n,fg=new u16(19),Vg=0;Vg<mg.length;++Vg)++fg[mg[Vg]&31];for(var Vg=0;Vg<Gg.length;++Vg)++fg[Gg[Vg]&31];for(var Wg=hTree(fg,7),Hg=Wg.t,Sg=Wg.l,wg=19;wg>4&&!Hg[clim[wg-1]];--wg);var Xg=og+5<<3,vg=clen(Cg,flt)+clen(tg,fdt)+ig,yg=clen(Cg,cg)+clen(tg,dg)+ig+14+3*wg+clen(fg,Hg)+2*fg[16]+3*fg[17]+7*fg[18];if(lg>=0&&Xg<=vg&&Xg<=yg)return wfblk(gg,sg,Ag.subarray(lg,lg+og));var Ng,Yg,Kg,Jg;if(wbits(gg,sg,1+(yg<vg)),sg+=2,yg<vg){Ng=hMap(cg,ag,0),Yg=cg,Kg=hMap(dg,hg,0),Jg=dg;var Ug=hMap(Hg,Sg,0);wbits(gg,sg,Zg-257),wbits(gg,sg+5,pg-1),wbits(gg,sg+10,wg-4),sg+=14;for(var Vg=0;Vg<wg;++Vg)wbits(gg,sg+3*Vg,Hg[clim[Vg]]);sg+=3*wg;for(var Qg=[mg,Gg],xg=0;xg<2;++xg)for(var Tg=Qg[xg],Vg=0;Vg<Tg.length;++Vg){var Mg=Tg[Vg]&31;wbits(gg,sg,Ug[Mg]),sg+=Hg[Mg],Mg>15&&(wbits(gg,sg,Tg[Vg]>>5&127),sg+=Tg[Vg]>>12)}}else Ng=flm,Yg=flt,Kg=fdm,Jg=fdt;for(var Vg=0;Vg<ng;++Vg){var Eg=Ig[Vg];if(Eg>255){var Mg=Eg>>18&31;wbits16(gg,sg,Ng[Mg+257]),sg+=Yg[Mg+257],Mg>7&&(wbits(gg,sg,Eg>>23&31),sg+=fleb[Mg]);var Og=Eg&31;wbits16(gg,sg,Kg[Og]),sg+=Jg[Og],Og>3&&(wbits16(gg,sg,Eg>>5&8191),sg+=fdeb[Og])}else wbits16(gg,sg,Ng[Eg]),sg+=Yg[Eg]}return wbits16(gg,sg,Ng[256]),sg+Yg[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$1=new u8(0),dflt=function(Ag,gg,eg,Ig,Cg,tg){var ig=tg.z||Ag.length,ng=new u8(Ig+ig+5*(1+Math.ceil(ig/7e3))+Cg),lg=ng.subarray(Ig,ng.length-Cg),og=tg.l,sg=(tg.r||0)&7;if(gg){sg&&(lg[0]=tg.r>>3);for(var rg=deo[gg-1],cg=rg>>13,ag=rg&8191,ug=(1<<eg)-1,dg=tg.p||new u16(32768),hg=tg.h||new u16(ug+1),bg=Math.ceil(eg/3),mg=2*bg,Zg=function(XA){return(Ag[XA]^Ag[XA+1]<<bg^Ag[XA+2]<<mg)&ug},Bg=new i32(25e3),Gg=new u16(288),pg=new u16(32),fg=0,Vg=0,Wg=tg.i||0,Hg=0,Sg=tg.w||0,wg=0;Wg+2<ig;++Wg){var Xg=Zg(Wg),vg=Wg&32767,yg=hg[Xg];if(dg[vg]=yg,hg[Xg]=vg,Sg<=Wg){var Ng=ig-Wg;if((fg>7e3||Hg>24576)&&(Ng>423||!og)){sg=wblk(Ag,lg,0,Bg,Gg,pg,Vg,Hg,wg,Wg-wg,sg),Hg=fg=Vg=0,wg=Wg;for(var Yg=0;Yg<286;++Yg)Gg[Yg]=0;for(var Yg=0;Yg<30;++Yg)pg[Yg]=0}var Kg=2,Jg=0,Ug=ag,Qg=vg-yg&32767;if(Ng>2&&Xg==Zg(Wg-Qg))for(var xg=Math.min(cg,Ng)-1,Tg=Math.min(32767,Wg),Mg=Math.min(258,Ng);Qg<=Tg&&--Ug&&vg!=yg;){if(Ag[Wg+Kg]==Ag[Wg+Kg-Qg]){for(var Eg=0;Eg<Mg&&Ag[Wg+Eg]==Ag[Wg+Eg-Qg];++Eg);if(Eg>Kg){if(Kg=Eg,Jg=Qg,Eg>xg)break;for(var Og=Math.min(Qg,Eg-2),gA=0,Yg=0;Yg<Og;++Yg){var IA=Wg-Qg+Yg&32767,Pg=dg[IA],qg=IA-Pg&32767;qg>gA&&(gA=qg,yg=IA)}}}vg=yg,yg=dg[vg],Qg+=vg-yg&32767}if(Jg){Bg[Hg++]=268435456|revfl[Kg]<<18|revfd[Jg];var lA=revfl[Kg]&31,pA=revfd[Jg]&31;Vg+=fleb[lA]+fdeb[pA],++Gg[257+lA],++pg[pA],Sg=Wg+Kg,++fg}else Bg[Hg++]=Ag[Wg],++Gg[Ag[Wg]]}}for(Wg=Math.max(Wg,Sg);Wg<ig;++Wg)Bg[Hg++]=Ag[Wg],++Gg[Ag[Wg]];sg=wblk(Ag,lg,og,Bg,Gg,pg,Vg,Hg,wg,Wg-wg,sg),og||(tg.r=sg&7|lg[sg/8|0]<<3,sg-=7,tg.h=hg,tg.p=dg,tg.i=Wg,tg.w=Sg)}else{for(var Wg=tg.w||0;Wg<ig+og;Wg+=65535){var VA=Wg+65535;VA>=ig&&(lg[sg/8|0]=og,VA=ig),sg=wfblk(lg,sg+1,Ag.subarray(Wg,VA))}tg.i=ig}return slc(ng,0,Ig+shft(sg)+Cg)},adler=function(){var Ag=1,gg=0;return{p:function(eg){for(var Ig=Ag,Cg=gg,tg=eg.length|0,ig=0;ig!=tg;){for(var ng=Math.min(ig+2655,tg);ig<ng;++ig)Cg+=Ig+=eg[ig];Ig=(Ig&65535)+15*(Ig>>16),Cg=(Cg&65535)+15*(Cg>>16)}Ag=Ig,gg=Cg},d:function(){return Ag%=65521,gg%=65521,(Ag&255)<<24|(Ag&65280)<<8|(gg&255)<<8|gg>>8}}},dopt=function(Ag,gg,eg,Ig,Cg){if(!Cg&&(Cg={l:1},gg.dictionary)){var tg=gg.dictionary.subarray(-32768),ig=new u8(tg.length+Ag.length);ig.set(tg),ig.set(Ag,tg.length),Ag=ig,Cg.w=tg.length}return dflt(Ag,gg.level==null?6:gg.level,gg.mem==null?Cg.l?Math.ceil(Math.max(8,Math.min(13,Math.log(Ag.length)))*1.5):20:12+gg.mem,eg,Ig,Cg)},wbytes=function(Ag,gg,eg){for(;eg;++gg)Ag[gg]=eg,eg>>>=8},zlh=function(Ag,gg){var eg=gg.level,Ig=eg==0?0:eg<6?1:eg==9?3:2;if(Ag[0]=120,Ag[1]=Ig<<6|(gg.dictionary&&32),Ag[1]|=31-(Ag[0]<<8|Ag[1])%31,gg.dictionary){var Cg=adler();Cg.p(gg.dictionary),wbytes(Ag,2,Cg.d())}},zls=function(Ag,gg){return((Ag[0]&15)!=8||Ag[0]>>4>7||(Ag[0]<<8|Ag[1])%31)&&err(6,"invalid zlib data"),(Ag[1]>>5&1)==+!gg&&err(6,"invalid zlib data: "+(Ag[1]&32?"need":"unexpected")+" dictionary"),(Ag[1]>>3&4)+2};function zlibSync(Ag,gg){gg||(gg={});var eg=adler();eg.p(Ag);var Ig=dopt(Ag,gg,gg.dictionary?6:2,4);return zlh(Ig,gg),wbytes(Ig,Ig.length-4,eg.d()),Ig}function unzlibSync(Ag,gg){return inflt(Ag.subarray(zls(Ag,gg&&gg.dictionary),-4),{i:2},gg&&gg.out,gg&&gg.dictionary)}var td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et$1,{stream:!0}),tds=1}catch(Ag){}/** @license
|
|
1169
1169
|
*
|
|
1170
1170
|
* jsPDF - PDF Document creation from JavaScript
|
|
1171
1171
|
* Version 2.5.2 Built on 2024-09-17T13:29:57.859Z
|
|
@@ -1442,7 +1442,7 @@ end`};gg.events.push(["putFont",function(tg){(function(ig){var ng=ig.font,lg=ig.
|
|
|
1442
1442
|
content: "" !important;
|
|
1443
1443
|
display: none !important;
|
|
1444
1444
|
}`,createPseudoHideStyles=function(Ag){createStyles(Ag,"."+PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+PSEUDO_BEFORE+PSEUDO_HIDE_ELEMENT_STYLE+`
|
|
1445
|
-
.`+PSEUDO_HIDE_ELEMENT_CLASS_AFTER+PSEUDO_AFTER+PSEUDO_HIDE_ELEMENT_STYLE)},createStyles=function(Ag,gg){var eg=Ag.ownerDocument;if(eg){var Ig=eg.createElement("style");Ig.textContent=gg,Ag.appendChild(Ig)}},CacheStorage=function(){function Ag(){}return Ag.getOrigin=function(gg){var eg=Ag._link;return eg?(eg.href=gg,eg.href=eg.href,eg.protocol+eg.hostname+eg.port):"about:blank"},Ag.isSameOrigin=function(gg){return Ag.getOrigin(gg)===Ag._origin},Ag.setContext=function(gg){Ag._link=gg.document.createElement("a"),Ag._origin=Ag.getOrigin(gg.location.href)},Ag._origin="about:blank",Ag}(),Cache=function(){function Ag(gg,eg){this.context=gg,this._options=eg,this._cache={}}return Ag.prototype.addImage=function(gg){var eg=Promise.resolve();return this.has(gg)||(isBlobImage(gg)||isRenderable(gg))&&(this._cache[gg]=this.loadImage(gg)).catch(function(){}),eg},Ag.prototype.match=function(gg){return this._cache[gg]},Ag.prototype.loadImage=function(gg){return __awaiter(this,void 0,void 0,function(){var eg,Ig,Cg,tg,ig=this;return __generator(this,function(ng){switch(ng.label){case 0:return eg=CacheStorage.isSameOrigin(gg),Ig=!isInlineImage(gg)&&this._options.useCORS===!0&&FEATURES.SUPPORT_CORS_IMAGES&&!eg,Cg=!isInlineImage(gg)&&!eg&&!isBlobImage(gg)&&typeof this._options.proxy=="string"&&FEATURES.SUPPORT_CORS_XHR&&!Ig,!eg&&this._options.allowTaint===!1&&!isInlineImage(gg)&&!isBlobImage(gg)&&!Cg&&!Ig?[2]:(tg=gg,Cg?[4,this.proxy(tg)]:[3,2]);case 1:tg=ng.sent(),ng.label=2;case 2:return this.context.logger.debug("Added image "+gg.substring(0,256)),[4,new Promise(function(lg,og){var sg=new Image;sg.onload=function(){return lg(sg)},sg.onerror=og,(isInlineBase64Image(tg)||Ig)&&(sg.crossOrigin="anonymous"),sg.src=tg,sg.complete===!0&&setTimeout(function(){return lg(sg)},500),ig._options.imageTimeout>0&&setTimeout(function(){return og("Timed out ("+ig._options.imageTimeout+"ms) loading image")},ig._options.imageTimeout)})];case 3:return[2,ng.sent()]}})})},Ag.prototype.has=function(gg){return typeof this._cache[gg]<"u"},Ag.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Ag.prototype.proxy=function(gg){var eg=this,Ig=this._options.proxy;if(!Ig)throw new Error("No proxy defined");var Cg=gg.substring(0,256);return new Promise(function(tg,ig){var ng=FEATURES.SUPPORT_RESPONSE_TYPE?"blob":"text",lg=new XMLHttpRequest;lg.onload=function(){if(lg.status===200)if(ng==="text")tg(lg.response);else{var rg=new FileReader;rg.addEventListener("load",function(){return tg(rg.result)},!1),rg.addEventListener("error",function(cg){return ig(cg)},!1),rg.readAsDataURL(lg.response)}else ig("Failed to proxy resource "+Cg+" with status code "+lg.status)},lg.onerror=ig;var og=Ig.indexOf("?")>-1?"&":"?";if(lg.open("GET",""+Ig+og+"url="+encodeURIComponent(gg)+"&responseType="+ng),ng!=="text"&&lg instanceof XMLHttpRequest&&(lg.responseType=ng),eg._options.imageTimeout){var sg=eg._options.imageTimeout;lg.timeout=sg,lg.ontimeout=function(){return ig("Timed out ("+sg+"ms) proxying "+Cg)}}lg.send()})},Ag}(),INLINE_SVG=/^data:image\/svg\+xml/i,INLINE_BASE64=/^data:image\/.*;base64,/i,INLINE_IMG=/^data:image\/.*/i,isRenderable=function(Ag){return FEATURES.SUPPORT_SVG_DRAWING||!isSVG(Ag)},isInlineImage=function(Ag){return INLINE_IMG.test(Ag)},isInlineBase64Image=function(Ag){return INLINE_BASE64.test(Ag)},isBlobImage=function(Ag){return Ag.substr(0,4)==="blob"},isSVG=function(Ag){return Ag.substr(-3).toLowerCase()==="svg"||INLINE_SVG.test(Ag)},Vector=function(){function Ag(gg,eg){this.type=0,this.x=gg,this.y=eg}return Ag.prototype.add=function(gg,eg){return new Ag(this.x+gg,this.y+eg)},Ag}(),lerp=function(Ag,gg,eg){return new Vector(Ag.x+(gg.x-Ag.x)*eg,Ag.y+(gg.y-Ag.y)*eg)},BezierCurve=function(){function Ag(gg,eg,Ig,Cg){this.type=1,this.start=gg,this.startControl=eg,this.endControl=Ig,this.end=Cg}return Ag.prototype.subdivide=function(gg,eg){var Ig=lerp(this.start,this.startControl,gg),Cg=lerp(this.startControl,this.endControl,gg),tg=lerp(this.endControl,this.end,gg),ig=lerp(Ig,Cg,gg),ng=lerp(Cg,tg,gg),lg=lerp(ig,ng,gg);return eg?new Ag(this.start,Ig,ig,lg):new Ag(lg,ng,tg,this.end)},Ag.prototype.add=function(gg,eg){return new Ag(this.start.add(gg,eg),this.startControl.add(gg,eg),this.endControl.add(gg,eg),this.end.add(gg,eg))},Ag.prototype.reverse=function(){return new Ag(this.end,this.endControl,this.startControl,this.start)},Ag}(),isBezierCurve=function(Ag){return Ag.type===1},BoundCurves=function(){function Ag(gg){var eg=gg.styles,Ig=gg.bounds,Cg=getAbsoluteValueForTuple(eg.borderTopLeftRadius,Ig.width,Ig.height),tg=Cg[0],ig=Cg[1],ng=getAbsoluteValueForTuple(eg.borderTopRightRadius,Ig.width,Ig.height),lg=ng[0],og=ng[1],sg=getAbsoluteValueForTuple(eg.borderBottomRightRadius,Ig.width,Ig.height),rg=sg[0],cg=sg[1],ag=getAbsoluteValueForTuple(eg.borderBottomLeftRadius,Ig.width,Ig.height),ug=ag[0],dg=ag[1],hg=[];hg.push((tg+lg)/Ig.width),hg.push((ug+rg)/Ig.width),hg.push((ig+dg)/Ig.height),hg.push((og+cg)/Ig.height);var bg=Math.max.apply(Math,hg);bg>1&&(tg/=bg,ig/=bg,lg/=bg,og/=bg,rg/=bg,cg/=bg,ug/=bg,dg/=bg);var mg=Ig.width-lg,Zg=Ig.height-cg,Bg=Ig.width-rg,Gg=Ig.height-dg,pg=eg.borderTopWidth,fg=eg.borderRightWidth,Vg=eg.borderBottomWidth,Wg=eg.borderLeftWidth,Hg=getAbsoluteValue(eg.paddingTop,gg.bounds.width),Sg=getAbsoluteValue(eg.paddingRight,gg.bounds.width),wg=getAbsoluteValue(eg.paddingBottom,gg.bounds.width),Xg=getAbsoluteValue(eg.paddingLeft,gg.bounds.width);this.topLeftBorderDoubleOuterBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg/3,Ig.top+pg/3,tg-Wg/3,ig-pg/3,CORNER.TOP_LEFT):new Vector(Ig.left+Wg/3,Ig.top+pg/3),this.topRightBorderDoubleOuterBox=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg/3,lg-fg/3,og-pg/3,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg/3,Ig.top+pg/3),this.bottomRightBorderDoubleOuterBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg/3,cg-Vg/3,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg/3,Ig.top+Ig.height-Vg/3),this.bottomLeftBorderDoubleOuterBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg/3,Ig.top+Gg,ug-Wg/3,dg-Vg/3,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg/3,Ig.top+Ig.height-Vg/3),this.topLeftBorderDoubleInnerBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg*2/3,Ig.top+pg*2/3,tg-Wg*2/3,ig-pg*2/3,CORNER.TOP_LEFT):new Vector(Ig.left+Wg*2/3,Ig.top+pg*2/3),this.topRightBorderDoubleInnerBox=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg*2/3,lg-fg*2/3,og-pg*2/3,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg*2/3,Ig.top+pg*2/3),this.bottomRightBorderDoubleInnerBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg*2/3,cg-Vg*2/3,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg*2/3,Ig.top+Ig.height-Vg*2/3),this.bottomLeftBorderDoubleInnerBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg*2/3,Ig.top+Gg,ug-Wg*2/3,dg-Vg*2/3,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg*2/3,Ig.top+Ig.height-Vg*2/3),this.topLeftBorderStroke=tg>0||ig>0?getCurvePoints(Ig.left+Wg/2,Ig.top+pg/2,tg-Wg/2,ig-pg/2,CORNER.TOP_LEFT):new Vector(Ig.left+Wg/2,Ig.top+pg/2),this.topRightBorderStroke=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg/2,lg-fg/2,og-pg/2,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg/2,Ig.top+pg/2),this.bottomRightBorderStroke=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg/2,cg-Vg/2,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg/2,Ig.top+Ig.height-Vg/2),this.bottomLeftBorderStroke=ug>0||dg>0?getCurvePoints(Ig.left+Wg/2,Ig.top+Gg,ug-Wg/2,dg-Vg/2,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg/2,Ig.top+Ig.height-Vg/2),this.topLeftBorderBox=tg>0||ig>0?getCurvePoints(Ig.left,Ig.top,tg,ig,CORNER.TOP_LEFT):new Vector(Ig.left,Ig.top),this.topRightBorderBox=lg>0||og>0?getCurvePoints(Ig.left+mg,Ig.top,lg,og,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width,Ig.top),this.bottomRightBorderBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg,cg,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width,Ig.top+Ig.height),this.bottomLeftBorderBox=ug>0||dg>0?getCurvePoints(Ig.left,Ig.top+Gg,ug,dg,CORNER.BOTTOM_LEFT):new Vector(Ig.left,Ig.top+Ig.height),this.topLeftPaddingBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg,Ig.top+pg,Math.max(0,tg-Wg),Math.max(0,ig-pg),CORNER.TOP_LEFT):new Vector(Ig.left+Wg,Ig.top+pg),this.topRightPaddingBox=lg>0||og>0?getCurvePoints(Ig.left+Math.min(mg,Ig.width-fg),Ig.top+pg,mg>Ig.width+fg?0:Math.max(0,lg-fg),Math.max(0,og-pg),CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg,Ig.top+pg),this.bottomRightPaddingBox=rg>0||cg>0?getCurvePoints(Ig.left+Math.min(Bg,Ig.width-Wg),Ig.top+Math.min(Zg,Ig.height-Vg),Math.max(0,rg-fg),Math.max(0,cg-Vg),CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg,Ig.top+Ig.height-Vg),this.bottomLeftPaddingBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg,Ig.top+Math.min(Gg,Ig.height-Vg),Math.max(0,ug-Wg),Math.max(0,dg-Vg),CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg,Ig.top+Ig.height-Vg),this.topLeftContentBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg+Xg,Ig.top+pg+Hg,Math.max(0,tg-(Wg+Xg)),Math.max(0,ig-(pg+Hg)),CORNER.TOP_LEFT):new Vector(Ig.left+Wg+Xg,Ig.top+pg+Hg),this.topRightContentBox=lg>0||og>0?getCurvePoints(Ig.left+Math.min(mg,Ig.width+Wg+Xg),Ig.top+pg+Hg,mg>Ig.width+Wg+Xg?0:lg-Wg+Xg,og-(pg+Hg),CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-(fg+Sg),Ig.top+pg+Hg),this.bottomRightContentBox=rg>0||cg>0?getCurvePoints(Ig.left+Math.min(Bg,Ig.width-(Wg+Xg)),Ig.top+Math.min(Zg,Ig.height+pg+Hg),Math.max(0,rg-(fg+Sg)),cg-(Vg+wg),CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-(fg+Sg),Ig.top+Ig.height-(Vg+wg)),this.bottomLeftContentBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg+Xg,Ig.top+Gg,Math.max(0,ug-(Wg+Xg)),dg-(Vg+wg),CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg+Xg,Ig.top+Ig.height-(Vg+wg))}return Ag}(),CORNER;(function(Ag){Ag[Ag.TOP_LEFT=0]="TOP_LEFT",Ag[Ag.TOP_RIGHT=1]="TOP_RIGHT",Ag[Ag.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Ag[Ag.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(CORNER||(CORNER={}));var getCurvePoints=function(Ag,gg,eg,Ig,Cg){var tg=4*((Math.sqrt(2)-1)/3),ig=eg*tg,ng=Ig*tg,lg=Ag+eg,og=gg+Ig;switch(Cg){case CORNER.TOP_LEFT:return new BezierCurve(new Vector(Ag,og),new Vector(Ag,og-ng),new Vector(lg-ig,gg),new Vector(lg,gg));case CORNER.TOP_RIGHT:return new BezierCurve(new Vector(Ag,gg),new Vector(Ag+ig,gg),new Vector(lg,og-ng),new Vector(lg,og));case CORNER.BOTTOM_RIGHT:return new BezierCurve(new Vector(lg,gg),new Vector(lg,gg+ng),new Vector(Ag+ig,og),new Vector(Ag,og));case CORNER.BOTTOM_LEFT:default:return new BezierCurve(new Vector(lg,og),new Vector(lg-ig,og),new Vector(Ag,gg+ng),new Vector(Ag,gg))}},calculateBorderBoxPath=function(Ag){return[Ag.topLeftBorderBox,Ag.topRightBorderBox,Ag.bottomRightBorderBox,Ag.bottomLeftBorderBox]},calculateContentBoxPath=function(Ag){return[Ag.topLeftContentBox,Ag.topRightContentBox,Ag.bottomRightContentBox,Ag.bottomLeftContentBox]},calculatePaddingBoxPath=function(Ag){return[Ag.topLeftPaddingBox,Ag.topRightPaddingBox,Ag.bottomRightPaddingBox,Ag.bottomLeftPaddingBox]},TransformEffect=function(){function Ag(gg,eg,Ig){this.offsetX=gg,this.offsetY=eg,this.matrix=Ig,this.type=0,this.target=6}return Ag}(),ClipEffect=function(){function Ag(gg,eg){this.path=gg,this.target=eg,this.type=1}return Ag}(),OpacityEffect=function(){function Ag(gg){this.opacity=gg,this.type=2,this.target=6}return Ag}(),isTransformEffect=function(Ag){return Ag.type===0},isClipEffect=function(Ag){return Ag.type===1},isOpacityEffect=function(Ag){return Ag.type===2},equalPath=function(Ag,gg){return Ag.length===gg.length?Ag.some(function(eg,Ig){return eg===gg[Ig]}):!1},transformPath=function(Ag,gg,eg,Ig,Cg){return Ag.map(function(tg,ig){switch(ig){case 0:return tg.add(gg,eg);case 1:return tg.add(gg+Ig,eg);case 2:return tg.add(gg+Ig,eg+Cg);case 3:return tg.add(gg,eg+Cg)}return tg})},StackingContext=function(){function Ag(gg){this.element=gg,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return Ag}(),ElementPaint=function(){function Ag(gg,eg){if(this.container=gg,this.parent=eg,this.effects=[],this.curves=new BoundCurves(this.container),this.container.styles.opacity<1&&this.effects.push(new OpacityEffect(this.container.styles.opacity)),this.container.styles.transform!==null){var Ig=this.container.bounds.left+this.container.styles.transformOrigin[0].number,Cg=this.container.bounds.top+this.container.styles.transformOrigin[1].number,tg=this.container.styles.transform;this.effects.push(new TransformEffect(Ig,Cg,tg))}if(this.container.styles.overflowX!==0){var ig=calculateBorderBoxPath(this.curves),ng=calculatePaddingBoxPath(this.curves);equalPath(ig,ng)?this.effects.push(new ClipEffect(ig,6)):(this.effects.push(new ClipEffect(ig,2)),this.effects.push(new ClipEffect(ng,4)))}}return Ag.prototype.getEffects=function(gg){for(var eg=[2,3].indexOf(this.container.styles.position)===-1,Ig=this.parent,Cg=this.effects.slice(0);Ig;){var tg=Ig.effects.filter(function(lg){return!isClipEffect(lg)});if(eg||Ig.container.styles.position!==0||!Ig.parent){if(Cg.unshift.apply(Cg,tg),eg=[2,3].indexOf(Ig.container.styles.position)===-1,Ig.container.styles.overflowX!==0){var ig=calculateBorderBoxPath(Ig.curves),ng=calculatePaddingBoxPath(Ig.curves);equalPath(ig,ng)||Cg.unshift(new ClipEffect(ng,6))}}else Cg.unshift.apply(Cg,tg);Ig=Ig.parent}return Cg.filter(function(lg){return contains(lg.target,gg)})},Ag}(),parseStackTree=function(Ag,gg,eg,Ig){Ag.container.elements.forEach(function(Cg){var tg=contains(Cg.flags,4),ig=contains(Cg.flags,2),ng=new ElementPaint(Cg,Ag);contains(Cg.styles.display,2048)&&Ig.push(ng);var lg=contains(Cg.flags,8)?[]:Ig;if(tg||ig){var og=tg||Cg.styles.isPositioned()?eg:gg,sg=new StackingContext(ng);if(Cg.styles.isPositioned()||Cg.styles.opacity<1||Cg.styles.isTransformed()){var rg=Cg.styles.zIndex.order;if(rg<0){var cg=0;og.negativeZIndex.some(function(ug,dg){return rg>ug.element.container.styles.zIndex.order?(cg=dg,!1):cg>0}),og.negativeZIndex.splice(cg,0,sg)}else if(rg>0){var ag=0;og.positiveZIndex.some(function(ug,dg){return rg>=ug.element.container.styles.zIndex.order?(ag=dg+1,!1):ag>0}),og.positiveZIndex.splice(ag,0,sg)}else og.zeroOrAutoZIndexOrTransformedOrOpacity.push(sg)}else Cg.styles.isFloating()?og.nonPositionedFloats.push(sg):og.nonPositionedInlineLevel.push(sg);parseStackTree(ng,sg,tg?sg:eg,lg)}else Cg.styles.isInlineLevel()?gg.inlineLevel.push(ng):gg.nonInlineLevel.push(ng),parseStackTree(ng,gg,eg,lg);contains(Cg.flags,8)&&processListItems(Cg,lg)})},processListItems=function(Ag,gg){for(var eg=Ag instanceof OLElementContainer?Ag.start:1,Ig=Ag instanceof OLElementContainer?Ag.reversed:!1,Cg=0;Cg<gg.length;Cg++){var tg=gg[Cg];tg.container instanceof LIElementContainer&&typeof tg.container.value=="number"&&tg.container.value!==0&&(eg=tg.container.value),tg.listValue=createCounterText(eg,tg.container.styles.listStyleType,!0),eg+=Ig?-1:1}},parseStackingContexts=function(Ag){var gg=new ElementPaint(Ag,null),eg=new StackingContext(gg),Ig=[];return parseStackTree(gg,eg,eg,Ig),processListItems(gg.container,Ig),eg},parsePathForBorder=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderBox,Ag.topLeftPaddingBox,Ag.topRightBorderBox,Ag.topRightPaddingBox);case 1:return createPathFromCurves(Ag.topRightBorderBox,Ag.topRightPaddingBox,Ag.bottomRightBorderBox,Ag.bottomRightPaddingBox);case 2:return createPathFromCurves(Ag.bottomRightBorderBox,Ag.bottomRightPaddingBox,Ag.bottomLeftBorderBox,Ag.bottomLeftPaddingBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderBox,Ag.bottomLeftPaddingBox,Ag.topLeftBorderBox,Ag.topLeftPaddingBox)}},parsePathForBorderDoubleOuter=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderBox,Ag.topLeftBorderDoubleOuterBox,Ag.topRightBorderBox,Ag.topRightBorderDoubleOuterBox);case 1:return createPathFromCurves(Ag.topRightBorderBox,Ag.topRightBorderDoubleOuterBox,Ag.bottomRightBorderBox,Ag.bottomRightBorderDoubleOuterBox);case 2:return createPathFromCurves(Ag.bottomRightBorderBox,Ag.bottomRightBorderDoubleOuterBox,Ag.bottomLeftBorderBox,Ag.bottomLeftBorderDoubleOuterBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderBox,Ag.bottomLeftBorderDoubleOuterBox,Ag.topLeftBorderBox,Ag.topLeftBorderDoubleOuterBox)}},parsePathForBorderDoubleInner=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderDoubleInnerBox,Ag.topLeftPaddingBox,Ag.topRightBorderDoubleInnerBox,Ag.topRightPaddingBox);case 1:return createPathFromCurves(Ag.topRightBorderDoubleInnerBox,Ag.topRightPaddingBox,Ag.bottomRightBorderDoubleInnerBox,Ag.bottomRightPaddingBox);case 2:return createPathFromCurves(Ag.bottomRightBorderDoubleInnerBox,Ag.bottomRightPaddingBox,Ag.bottomLeftBorderDoubleInnerBox,Ag.bottomLeftPaddingBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderDoubleInnerBox,Ag.bottomLeftPaddingBox,Ag.topLeftBorderDoubleInnerBox,Ag.topLeftPaddingBox)}},parsePathForBorderStroke=function(Ag,gg){switch(gg){case 0:return createStrokePathFromCurves(Ag.topLeftBorderStroke,Ag.topRightBorderStroke);case 1:return createStrokePathFromCurves(Ag.topRightBorderStroke,Ag.bottomRightBorderStroke);case 2:return createStrokePathFromCurves(Ag.bottomRightBorderStroke,Ag.bottomLeftBorderStroke);case 3:default:return createStrokePathFromCurves(Ag.bottomLeftBorderStroke,Ag.topLeftBorderStroke)}},createStrokePathFromCurves=function(Ag,gg){var eg=[];return isBezierCurve(Ag)?eg.push(Ag.subdivide(.5,!1)):eg.push(Ag),isBezierCurve(gg)?eg.push(gg.subdivide(.5,!0)):eg.push(gg),eg},createPathFromCurves=function(Ag,gg,eg,Ig){var Cg=[];return isBezierCurve(Ag)?Cg.push(Ag.subdivide(.5,!1)):Cg.push(Ag),isBezierCurve(eg)?Cg.push(eg.subdivide(.5,!0)):Cg.push(eg),isBezierCurve(Ig)?Cg.push(Ig.subdivide(.5,!0).reverse()):Cg.push(Ig),isBezierCurve(gg)?Cg.push(gg.subdivide(.5,!1).reverse()):Cg.push(gg),Cg},paddingBox=function(Ag){var gg=Ag.bounds,eg=Ag.styles;return gg.add(eg.borderLeftWidth,eg.borderTopWidth,-(eg.borderRightWidth+eg.borderLeftWidth),-(eg.borderTopWidth+eg.borderBottomWidth))},contentBox=function(Ag){var gg=Ag.styles,eg=Ag.bounds,Ig=getAbsoluteValue(gg.paddingLeft,eg.width),Cg=getAbsoluteValue(gg.paddingRight,eg.width),tg=getAbsoluteValue(gg.paddingTop,eg.width),ig=getAbsoluteValue(gg.paddingBottom,eg.width);return eg.add(Ig+gg.borderLeftWidth,tg+gg.borderTopWidth,-(gg.borderRightWidth+gg.borderLeftWidth+Ig+Cg),-(gg.borderTopWidth+gg.borderBottomWidth+tg+ig))},calculateBackgroundPositioningArea=function(Ag,gg){return Ag===0?gg.bounds:Ag===2?contentBox(gg):paddingBox(gg)},calculateBackgroundPaintingArea=function(Ag,gg){return Ag===0?gg.bounds:Ag===2?contentBox(gg):paddingBox(gg)},calculateBackgroundRendering=function(Ag,gg,eg){var Ig=calculateBackgroundPositioningArea(getBackgroundValueForIndex(Ag.styles.backgroundOrigin,gg),Ag),Cg=calculateBackgroundPaintingArea(getBackgroundValueForIndex(Ag.styles.backgroundClip,gg),Ag),tg=calculateBackgroundSize(getBackgroundValueForIndex(Ag.styles.backgroundSize,gg),eg,Ig),ig=tg[0],ng=tg[1],lg=getAbsoluteValueForTuple(getBackgroundValueForIndex(Ag.styles.backgroundPosition,gg),Ig.width-ig,Ig.height-ng),og=calculateBackgroundRepeatPath(getBackgroundValueForIndex(Ag.styles.backgroundRepeat,gg),lg,tg,Ig,Cg),sg=Math.round(Ig.left+lg[0]),rg=Math.round(Ig.top+lg[1]);return[og,sg,rg,ig,ng]},isAuto=function(Ag){return isIdentToken(Ag)&&Ag.value===BACKGROUND_SIZE.AUTO},hasIntrinsicValue=function(Ag){return typeof Ag=="number"},calculateBackgroundSize=function(Ag,gg,eg){var Ig=gg[0],Cg=gg[1],tg=gg[2],ig=Ag[0],ng=Ag[1];if(!ig)return[0,0];if(isLengthPercentage(ig)&&ng&&isLengthPercentage(ng))return[getAbsoluteValue(ig,eg.width),getAbsoluteValue(ng,eg.height)];var lg=hasIntrinsicValue(tg);if(isIdentToken(ig)&&(ig.value===BACKGROUND_SIZE.CONTAIN||ig.value===BACKGROUND_SIZE.COVER)){if(hasIntrinsicValue(tg)){var og=eg.width/eg.height;return og<tg!=(ig.value===BACKGROUND_SIZE.COVER)?[eg.width,eg.width/tg]:[eg.height*tg,eg.height]}return[eg.width,eg.height]}var sg=hasIntrinsicValue(Ig),rg=hasIntrinsicValue(Cg),cg=sg||rg;if(isAuto(ig)&&(!ng||isAuto(ng))){if(sg&&rg)return[Ig,Cg];if(!lg&&!cg)return[eg.width,eg.height];if(cg&&lg){var ag=sg?Ig:Cg*tg,ug=rg?Cg:Ig/tg;return[ag,ug]}var dg=sg?Ig:eg.width,hg=rg?Cg:eg.height;return[dg,hg]}if(lg){var bg=0,mg=0;return isLengthPercentage(ig)?bg=getAbsoluteValue(ig,eg.width):isLengthPercentage(ng)&&(mg=getAbsoluteValue(ng,eg.height)),isAuto(ig)?bg=mg*tg:(!ng||isAuto(ng))&&(mg=bg/tg),[bg,mg]}var Zg=null,Bg=null;if(isLengthPercentage(ig)?Zg=getAbsoluteValue(ig,eg.width):ng&&isLengthPercentage(ng)&&(Bg=getAbsoluteValue(ng,eg.height)),Zg!==null&&(!ng||isAuto(ng))&&(Bg=sg&&rg?Zg/Ig*Cg:eg.height),Bg!==null&&isAuto(ig)&&(Zg=sg&&rg?Bg/Cg*Ig:eg.width),Zg!==null&&Bg!==null)return[Zg,Bg];throw new Error("Unable to calculate background-size for element")},getBackgroundValueForIndex=function(Ag,gg){var eg=Ag[gg];return typeof eg>"u"?Ag[0]:eg},calculateBackgroundRepeatPath=function(Ag,gg,eg,Ig,Cg){var tg=gg[0],ig=gg[1],ng=eg[0],lg=eg[1];switch(Ag){case 2:return[new Vector(Math.round(Ig.left),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+Ig.width),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+Ig.width),Math.round(lg+Ig.top+ig)),new Vector(Math.round(Ig.left),Math.round(lg+Ig.top+ig))];case 3:return[new Vector(Math.round(Ig.left+tg),Math.round(Ig.top)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.height+Ig.top)),new Vector(Math.round(Ig.left+tg),Math.round(Ig.height+Ig.top))];case 1:return[new Vector(Math.round(Ig.left+tg),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top+ig+lg)),new Vector(Math.round(Ig.left+tg),Math.round(Ig.top+ig+lg))];default:return[new Vector(Math.round(Cg.left),Math.round(Cg.top)),new Vector(Math.round(Cg.left+Cg.width),Math.round(Cg.top)),new Vector(Math.round(Cg.left+Cg.width),Math.round(Cg.height+Cg.top)),new Vector(Math.round(Cg.left),Math.round(Cg.height+Cg.top))]}},SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",SAMPLE_TEXT="Hidden Text",FontMetrics=function(){function Ag(gg){this._data={},this._document=gg}return Ag.prototype.parseMetrics=function(gg,eg){var Ig=this._document.createElement("div"),Cg=this._document.createElement("img"),tg=this._document.createElement("span"),ig=this._document.body;Ig.style.visibility="hidden",Ig.style.fontFamily=gg,Ig.style.fontSize=eg,Ig.style.margin="0",Ig.style.padding="0",Ig.style.whiteSpace="nowrap",ig.appendChild(Ig),Cg.src=SMALL_IMAGE,Cg.width=1,Cg.height=1,Cg.style.margin="0",Cg.style.padding="0",Cg.style.verticalAlign="baseline",tg.style.fontFamily=gg,tg.style.fontSize=eg,tg.style.margin="0",tg.style.padding="0",tg.appendChild(this._document.createTextNode(SAMPLE_TEXT)),Ig.appendChild(tg),Ig.appendChild(Cg);var ng=Cg.offsetTop-tg.offsetTop+2;Ig.removeChild(tg),Ig.appendChild(this._document.createTextNode(SAMPLE_TEXT)),Ig.style.lineHeight="normal",Cg.style.verticalAlign="super";var lg=Cg.offsetTop-Ig.offsetTop+2;return ig.removeChild(Ig),{baseline:ng,middle:lg}},Ag.prototype.getMetrics=function(gg,eg){var Ig=gg+" "+eg;return typeof this._data[Ig]>"u"&&(this._data[Ig]=this.parseMetrics(gg,eg)),this._data[Ig]},Ag}(),Renderer=function(){function Ag(gg,eg){this.context=gg,this.options=eg}return Ag}(),MASK_OFFSET=1e4,CanvasRenderer=function(Ag){__extends(gg,Ag);function gg(eg,Ig){var Cg=Ag.call(this,eg,Ig)||this;return Cg._activeEffects=[],Cg.canvas=Ig.canvas?Ig.canvas:document.createElement("canvas"),Cg.ctx=Cg.canvas.getContext("2d"),Ig.canvas||(Cg.canvas.width=Math.floor(Ig.width*Ig.scale),Cg.canvas.height=Math.floor(Ig.height*Ig.scale),Cg.canvas.style.width=Ig.width+"px",Cg.canvas.style.height=Ig.height+"px"),Cg.fontMetrics=new FontMetrics(document),Cg.ctx.scale(Cg.options.scale,Cg.options.scale),Cg.ctx.translate(-Ig.x,-Ig.y),Cg.ctx.textBaseline="bottom",Cg._activeEffects=[],Cg.context.logger.debug("Canvas renderer initialized ("+Ig.width+"x"+Ig.height+") with scale "+Ig.scale),Cg}return gg.prototype.applyEffects=function(eg){for(var Ig=this;this._activeEffects.length;)this.popEffect();eg.forEach(function(Cg){return Ig.applyEffect(Cg)})},gg.prototype.applyEffect=function(eg){this.ctx.save(),isOpacityEffect(eg)&&(this.ctx.globalAlpha=eg.opacity),isTransformEffect(eg)&&(this.ctx.translate(eg.offsetX,eg.offsetY),this.ctx.transform(eg.matrix[0],eg.matrix[1],eg.matrix[2],eg.matrix[3],eg.matrix[4],eg.matrix[5]),this.ctx.translate(-eg.offsetX,-eg.offsetY)),isClipEffect(eg)&&(this.path(eg.path),this.ctx.clip()),this._activeEffects.push(eg)},gg.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},gg.prototype.renderStack=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig;return __generator(this,function(Cg){switch(Cg.label){case 0:return Ig=eg.element.container.styles,Ig.isVisible()?[4,this.renderStackContent(eg)]:[3,2];case 1:Cg.sent(),Cg.label=2;case 2:return[2]}})})},gg.prototype.renderNode=function(eg){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(Ig){switch(Ig.label){case 0:if(contains(eg.container.flags,16))debugger;return eg.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(eg)]:[3,3];case 1:return Ig.sent(),[4,this.renderNodeContent(eg)];case 2:Ig.sent(),Ig.label=3;case 3:return[2]}})})},gg.prototype.renderTextWithLetterSpacing=function(eg,Ig,Cg){var tg=this;if(Ig===0)this.ctx.fillText(eg.text,eg.bounds.left,eg.bounds.top+Cg);else{var ig=segmentGraphemes(eg.text);ig.reduce(function(ng,lg){return tg.ctx.fillText(lg,ng,eg.bounds.top+Cg),ng+tg.ctx.measureText(lg).width},eg.bounds.left)}},gg.prototype.createFontStyle=function(eg){var Ig=eg.fontVariant.filter(function(ig){return ig==="normal"||ig==="small-caps"}).join(""),Cg=fixIOSSystemFonts(eg.fontFamily).join(", "),tg=isDimensionToken(eg.fontSize)?""+eg.fontSize.number+eg.fontSize.unit:eg.fontSize.number+"px";return[[eg.fontStyle,Ig,eg.fontWeight,tg,Cg].join(" "),Cg,tg]},gg.prototype.renderTextNode=function(eg,Ig){return __awaiter(this,void 0,void 0,function(){var Cg,tg,ig,ng,lg,og,sg,rg,cg=this;return __generator(this,function(ag){return Cg=this.createFontStyle(Ig),tg=Cg[0],ig=Cg[1],ng=Cg[2],this.ctx.font=tg,this.ctx.direction=Ig.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",lg=this.fontMetrics.getMetrics(ig,ng),og=lg.baseline,sg=lg.middle,rg=Ig.paintOrder,eg.textBounds.forEach(function(ug){rg.forEach(function(dg){switch(dg){case 0:cg.ctx.fillStyle=asString(Ig.color),cg.renderTextWithLetterSpacing(ug,Ig.letterSpacing,og);var hg=Ig.textShadow;hg.length&&ug.text.trim().length&&(hg.slice(0).reverse().forEach(function(bg){cg.ctx.shadowColor=asString(bg.color),cg.ctx.shadowOffsetX=bg.offsetX.number*cg.options.scale,cg.ctx.shadowOffsetY=bg.offsetY.number*cg.options.scale,cg.ctx.shadowBlur=bg.blur.number,cg.renderTextWithLetterSpacing(ug,Ig.letterSpacing,og)}),cg.ctx.shadowColor="",cg.ctx.shadowOffsetX=0,cg.ctx.shadowOffsetY=0,cg.ctx.shadowBlur=0),Ig.textDecorationLine.length&&(cg.ctx.fillStyle=asString(Ig.textDecorationColor||Ig.color),Ig.textDecorationLine.forEach(function(bg){switch(bg){case 1:cg.ctx.fillRect(ug.bounds.left,Math.round(ug.bounds.top+og),ug.bounds.width,1);break;case 2:cg.ctx.fillRect(ug.bounds.left,Math.round(ug.bounds.top),ug.bounds.width,1);break;case 3:cg.ctx.fillRect(ug.bounds.left,Math.ceil(ug.bounds.top+sg),ug.bounds.width,1);break}}));break;case 1:Ig.webkitTextStrokeWidth&&ug.text.trim().length&&(cg.ctx.strokeStyle=asString(Ig.webkitTextStrokeColor),cg.ctx.lineWidth=Ig.webkitTextStrokeWidth,cg.ctx.lineJoin=window.chrome?"miter":"round",cg.ctx.strokeText(ug.text,ug.bounds.left,ug.bounds.top+og)),cg.ctx.strokeStyle="",cg.ctx.lineWidth=0,cg.ctx.lineJoin="miter";break}})}),[2]})})},gg.prototype.renderReplacedElement=function(eg,Ig,Cg){if(Cg&&eg.intrinsicWidth>0&&eg.intrinsicHeight>0){var tg=contentBox(eg),ig=calculatePaddingBoxPath(Ig);this.path(ig),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(Cg,0,0,eg.intrinsicWidth,eg.intrinsicHeight,tg.left,tg.top,tg.width,tg.height),this.ctx.restore()}},gg.prototype.renderNodeContent=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg,mg,mg,og,sg,rg,cg,Bg,ag,ug,Gg,dg,hg,bg,mg,Zg,Bg,Gg;return __generator(this,function(pg){switch(pg.label){case 0:this.applyEffects(eg.getEffects(4)),Ig=eg.container,Cg=eg.curves,tg=Ig.styles,ig=0,ng=Ig.textNodes,pg.label=1;case 1:return ig<ng.length?(lg=ng[ig],[4,this.renderTextNode(lg,tg)]):[3,4];case 2:pg.sent(),pg.label=3;case 3:return ig++,[3,1];case 4:if(!(Ig instanceof ImageElementContainer))return[3,8];pg.label=5;case 5:return pg.trys.push([5,7,,8]),[4,this.context.cache.match(Ig.src)];case 6:return mg=pg.sent(),this.renderReplacedElement(Ig,Cg,mg),[3,8];case 7:return pg.sent(),this.context.logger.error("Error loading image "+Ig.src),[3,8];case 8:if(Ig instanceof CanvasElementContainer&&this.renderReplacedElement(Ig,Cg,Ig.canvas),!(Ig instanceof SVGElementContainer))return[3,12];pg.label=9;case 9:return pg.trys.push([9,11,,12]),[4,this.context.cache.match(Ig.svg)];case 10:return mg=pg.sent(),this.renderReplacedElement(Ig,Cg,mg),[3,12];case 11:return pg.sent(),this.context.logger.error("Error loading svg "+Ig.svg.substring(0,255)),[3,12];case 12:return Ig instanceof IFrameElementContainer&&Ig.tree?(og=new gg(this.context,{scale:this.options.scale,backgroundColor:Ig.backgroundColor,x:0,y:0,width:Ig.width,height:Ig.height}),[4,og.render(Ig.tree)]):[3,14];case 13:sg=pg.sent(),Ig.width&&Ig.height&&this.ctx.drawImage(sg,0,0,Ig.width,Ig.height,Ig.bounds.left,Ig.bounds.top,Ig.bounds.width,Ig.bounds.height),pg.label=14;case 14:if(Ig instanceof InputElementContainer&&(rg=Math.min(Ig.bounds.width,Ig.bounds.height),Ig.type===CHECKBOX?Ig.checked&&(this.ctx.save(),this.path([new Vector(Ig.bounds.left+rg*.39363,Ig.bounds.top+rg*.79),new Vector(Ig.bounds.left+rg*.16,Ig.bounds.top+rg*.5549),new Vector(Ig.bounds.left+rg*.27347,Ig.bounds.top+rg*.44071),new Vector(Ig.bounds.left+rg*.39694,Ig.bounds.top+rg*.5649),new Vector(Ig.bounds.left+rg*.72983,Ig.bounds.top+rg*.23),new Vector(Ig.bounds.left+rg*.84,Ig.bounds.top+rg*.34085),new Vector(Ig.bounds.left+rg*.39363,Ig.bounds.top+rg*.79)]),this.ctx.fillStyle=asString(INPUT_COLOR),this.ctx.fill(),this.ctx.restore()):Ig.type===RADIO&&Ig.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(Ig.bounds.left+rg/2,Ig.bounds.top+rg/2,rg/4,0,Math.PI*2,!0),this.ctx.fillStyle=asString(INPUT_COLOR),this.ctx.fill(),this.ctx.restore())),isTextInputElement(Ig)&&Ig.value.length){switch(cg=this.createFontStyle(tg),Bg=cg[0],ag=cg[1],ug=this.fontMetrics.getMetrics(Bg,ag).baseline,this.ctx.font=Bg,this.ctx.fillStyle=asString(tg.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=canvasTextAlign(Ig.styles.textAlign),Gg=contentBox(Ig),dg=0,Ig.styles.textAlign){case 1:dg+=Gg.width/2;break;case 2:dg+=Gg.width;break}hg=Gg.add(dg,0,0,-Gg.height/2+1),this.ctx.save(),this.path([new Vector(Gg.left,Gg.top),new Vector(Gg.left+Gg.width,Gg.top),new Vector(Gg.left+Gg.width,Gg.top+Gg.height),new Vector(Gg.left,Gg.top+Gg.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new TextBounds(Ig.value,hg),tg.letterSpacing,ug),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!contains(Ig.styles.display,2048))return[3,20];if(Ig.styles.listStyleImage===null)return[3,19];if(bg=Ig.styles.listStyleImage,bg.type!==0)return[3,18];mg=void 0,Zg=bg.url,pg.label=15;case 15:return pg.trys.push([15,17,,18]),[4,this.context.cache.match(Zg)];case 16:return mg=pg.sent(),this.ctx.drawImage(mg,Ig.bounds.left-(mg.width+10),Ig.bounds.top),[3,18];case 17:return pg.sent(),this.context.logger.error("Error loading list-style-image "+Zg),[3,18];case 18:return[3,20];case 19:eg.listValue&&Ig.styles.listStyleType!==-1&&(Bg=this.createFontStyle(tg)[0],this.ctx.font=Bg,this.ctx.fillStyle=asString(tg.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Gg=new Bounds(Ig.bounds.left,Ig.bounds.top+getAbsoluteValue(Ig.styles.paddingTop,Ig.bounds.width),Ig.bounds.width,computeLineHeight(tg.lineHeight,tg.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new TextBounds(eg.listValue,Gg),tg.letterSpacing,computeLineHeight(tg.lineHeight,tg.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),pg.label=20;case 20:return[2]}})})},gg.prototype.renderStackContent=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,bg,tg,ig,bg,ng,lg,bg,og,sg,bg,rg,cg,bg,ag,ug,bg,dg,hg,bg;return __generator(this,function(mg){switch(mg.label){case 0:if(contains(eg.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(eg.element)];case 1:mg.sent(),Ig=0,Cg=eg.negativeZIndex,mg.label=2;case 2:return Ig<Cg.length?(bg=Cg[Ig],[4,this.renderStack(bg)]):[3,5];case 3:mg.sent(),mg.label=4;case 4:return Ig++,[3,2];case 5:return[4,this.renderNodeContent(eg.element)];case 6:mg.sent(),tg=0,ig=eg.nonInlineLevel,mg.label=7;case 7:return tg<ig.length?(bg=ig[tg],[4,this.renderNode(bg)]):[3,10];case 8:mg.sent(),mg.label=9;case 9:return tg++,[3,7];case 10:ng=0,lg=eg.nonPositionedFloats,mg.label=11;case 11:return ng<lg.length?(bg=lg[ng],[4,this.renderStack(bg)]):[3,14];case 12:mg.sent(),mg.label=13;case 13:return ng++,[3,11];case 14:og=0,sg=eg.nonPositionedInlineLevel,mg.label=15;case 15:return og<sg.length?(bg=sg[og],[4,this.renderStack(bg)]):[3,18];case 16:mg.sent(),mg.label=17;case 17:return og++,[3,15];case 18:rg=0,cg=eg.inlineLevel,mg.label=19;case 19:return rg<cg.length?(bg=cg[rg],[4,this.renderNode(bg)]):[3,22];case 20:mg.sent(),mg.label=21;case 21:return rg++,[3,19];case 22:ag=0,ug=eg.zeroOrAutoZIndexOrTransformedOrOpacity,mg.label=23;case 23:return ag<ug.length?(bg=ug[ag],[4,this.renderStack(bg)]):[3,26];case 24:mg.sent(),mg.label=25;case 25:return ag++,[3,23];case 26:dg=0,hg=eg.positiveZIndex,mg.label=27;case 27:return dg<hg.length?(bg=hg[dg],[4,this.renderStack(bg)]):[3,30];case 28:mg.sent(),mg.label=29;case 29:return dg++,[3,27];case 30:return[2]}})})},gg.prototype.mask=function(eg){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(eg.slice(0).reverse()),this.ctx.closePath()},gg.prototype.path=function(eg){this.ctx.beginPath(),this.formatPath(eg),this.ctx.closePath()},gg.prototype.formatPath=function(eg){var Ig=this;eg.forEach(function(Cg,tg){var ig=isBezierCurve(Cg)?Cg.start:Cg;tg===0?Ig.ctx.moveTo(ig.x,ig.y):Ig.ctx.lineTo(ig.x,ig.y),isBezierCurve(Cg)&&Ig.ctx.bezierCurveTo(Cg.startControl.x,Cg.startControl.y,Cg.endControl.x,Cg.endControl.y,Cg.end.x,Cg.end.y)})},gg.prototype.renderRepeat=function(eg,Ig,Cg,tg){this.path(eg),this.ctx.fillStyle=Ig,this.ctx.translate(Cg,tg),this.ctx.fill(),this.ctx.translate(-Cg,-tg)},gg.prototype.resizeImage=function(eg,Ig,Cg){var tg;if(eg.width===Ig&&eg.height===Cg)return eg;var ig=(tg=this.canvas.ownerDocument)!==null&&tg!==void 0?tg:document,ng=ig.createElement("canvas");ng.width=Math.max(1,Ig),ng.height=Math.max(1,Cg);var lg=ng.getContext("2d");return lg.drawImage(eg,0,0,eg.width,eg.height,0,0,Ig,Cg),ng},gg.prototype.renderBackgroundImage=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg;return __generator(this,function(og){switch(og.label){case 0:Ig=eg.styles.backgroundImage.length-1,Cg=function(sg){var rg,cg,ag,Hg,Ng,Yg,Xg,vg,Vg,ug,Hg,Ng,Yg,Xg,vg,dg,hg,bg,mg,Zg,Bg,Gg,pg,fg,Vg,Wg,Hg,Sg,wg,Xg,vg,yg,Ng,Yg,Kg,Jg,Ug,Qg,xg,Tg,Mg,Eg;return __generator(this,function(Og){switch(Og.label){case 0:if(sg.type!==0)return[3,5];rg=void 0,cg=sg.url,Og.label=1;case 1:return Og.trys.push([1,3,,4]),[4,tg.context.cache.match(cg)];case 2:return rg=Og.sent(),[3,4];case 3:return Og.sent(),tg.context.logger.error("Error loading background-image "+cg),[3,4];case 4:return rg&&(ag=calculateBackgroundRendering(eg,Ig,[rg.width,rg.height,rg.width/rg.height]),Hg=ag[0],Ng=ag[1],Yg=ag[2],Xg=ag[3],vg=ag[4],Vg=tg.ctx.createPattern(tg.resizeImage(rg,Xg,vg),"repeat"),tg.renderRepeat(Hg,Vg,Ng,Yg)),[3,6];case 5:isLinearGradient(sg)?(ug=calculateBackgroundRendering(eg,Ig,[null,null,null]),Hg=ug[0],Ng=ug[1],Yg=ug[2],Xg=ug[3],vg=ug[4],dg=calculateGradientDirection(sg.angle,Xg,vg),hg=dg[0],bg=dg[1],mg=dg[2],Zg=dg[3],Bg=dg[4],Gg=document.createElement("canvas"),Gg.width=Xg,Gg.height=vg,pg=Gg.getContext("2d"),fg=pg.createLinearGradient(bg,Zg,mg,Bg),processColorStops(sg.stops,hg).forEach(function(gA){return fg.addColorStop(gA.stop,asString(gA.color))}),pg.fillStyle=fg,pg.fillRect(0,0,Xg,vg),Xg>0&&vg>0&&(Vg=tg.ctx.createPattern(Gg,"repeat"),tg.renderRepeat(Hg,Vg,Ng,Yg))):isRadialGradient(sg)&&(Wg=calculateBackgroundRendering(eg,Ig,[null,null,null]),Hg=Wg[0],Sg=Wg[1],wg=Wg[2],Xg=Wg[3],vg=Wg[4],yg=sg.position.length===0?[FIFTY_PERCENT]:sg.position,Ng=getAbsoluteValue(yg[0],Xg),Yg=getAbsoluteValue(yg[yg.length-1],vg),Kg=calculateRadius(sg,Ng,Yg,Xg,vg),Jg=Kg[0],Ug=Kg[1],Jg>0&&Ug>0&&(Qg=tg.ctx.createRadialGradient(Sg+Ng,wg+Yg,0,Sg+Ng,wg+Yg,Jg),processColorStops(sg.stops,Jg*2).forEach(function(gA){return Qg.addColorStop(gA.stop,asString(gA.color))}),tg.path(Hg),tg.ctx.fillStyle=Qg,Jg!==Ug?(xg=eg.bounds.left+.5*eg.bounds.width,Tg=eg.bounds.top+.5*eg.bounds.height,Mg=Ug/Jg,Eg=1/Mg,tg.ctx.save(),tg.ctx.translate(xg,Tg),tg.ctx.transform(1,0,0,Mg,0,0),tg.ctx.translate(-xg,-Tg),tg.ctx.fillRect(Sg,Eg*(wg-Tg)+Tg,Xg,vg*Eg),tg.ctx.restore()):tg.ctx.fill())),Og.label=6;case 6:return Ig--,[2]}})},tg=this,ig=0,ng=eg.styles.backgroundImage.slice(0).reverse(),og.label=1;case 1:return ig<ng.length?(lg=ng[ig],[5,Cg(lg)]):[3,4];case 2:og.sent(),og.label=3;case 3:return ig++,[3,1];case 4:return[2]}})})},gg.prototype.renderSolidBorder=function(eg,Ig,Cg){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(tg){return this.path(parsePathForBorder(Cg,Ig)),this.ctx.fillStyle=asString(eg),this.ctx.fill(),[2]})})},gg.prototype.renderDoubleBorder=function(eg,Ig,Cg,tg){return __awaiter(this,void 0,void 0,function(){var ig,ng;return __generator(this,function(lg){switch(lg.label){case 0:return Ig<3?[4,this.renderSolidBorder(eg,Cg,tg)]:[3,2];case 1:return lg.sent(),[2];case 2:return ig=parsePathForBorderDoubleOuter(tg,Cg),this.path(ig),this.ctx.fillStyle=asString(eg),this.ctx.fill(),ng=parsePathForBorderDoubleInner(tg,Cg),this.path(ng),this.ctx.fill(),[2]}})})},gg.prototype.renderNodeBackgroundAndBorders=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg,og,sg,rg=this;return __generator(this,function(cg){switch(cg.label){case 0:return this.applyEffects(eg.getEffects(2)),Ig=eg.container.styles,Cg=!isTransparent(Ig.backgroundColor)||Ig.backgroundImage.length,tg=[{style:Ig.borderTopStyle,color:Ig.borderTopColor,width:Ig.borderTopWidth},{style:Ig.borderRightStyle,color:Ig.borderRightColor,width:Ig.borderRightWidth},{style:Ig.borderBottomStyle,color:Ig.borderBottomColor,width:Ig.borderBottomWidth},{style:Ig.borderLeftStyle,color:Ig.borderLeftColor,width:Ig.borderLeftWidth}],ig=calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(Ig.backgroundClip,0),eg.curves),Cg||Ig.boxShadow.length?(this.ctx.save(),this.path(ig),this.ctx.clip(),isTransparent(Ig.backgroundColor)||(this.ctx.fillStyle=asString(Ig.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(eg.container)]):[3,2];case 1:cg.sent(),this.ctx.restore(),Ig.boxShadow.slice(0).reverse().forEach(function(ag){rg.ctx.save();var ug=calculateBorderBoxPath(eg.curves),dg=ag.inset?0:MASK_OFFSET,hg=transformPath(ug,-dg+(ag.inset?1:-1)*ag.spread.number,(ag.inset?1:-1)*ag.spread.number,ag.spread.number*(ag.inset?-2:2),ag.spread.number*(ag.inset?-2:2));ag.inset?(rg.path(ug),rg.ctx.clip(),rg.mask(hg)):(rg.mask(ug),rg.ctx.clip(),rg.path(hg)),rg.ctx.shadowOffsetX=ag.offsetX.number+dg,rg.ctx.shadowOffsetY=ag.offsetY.number,rg.ctx.shadowColor=asString(ag.color),rg.ctx.shadowBlur=ag.blur.number,rg.ctx.fillStyle=ag.inset?asString(ag.color):"rgba(0,0,0,1)",rg.ctx.fill(),rg.ctx.restore()}),cg.label=2;case 2:ng=0,lg=0,og=tg,cg.label=3;case 3:return lg<og.length?(sg=og[lg],sg.style!==0&&!isTransparent(sg.color)&&sg.width>0?sg.style!==2?[3,5]:[4,this.renderDashedDottedBorder(sg.color,sg.width,ng,eg.curves,2)]:[3,11]):[3,13];case 4:return cg.sent(),[3,11];case 5:return sg.style!==3?[3,7]:[4,this.renderDashedDottedBorder(sg.color,sg.width,ng,eg.curves,3)];case 6:return cg.sent(),[3,11];case 7:return sg.style!==4?[3,9]:[4,this.renderDoubleBorder(sg.color,sg.width,ng,eg.curves)];case 8:return cg.sent(),[3,11];case 9:return[4,this.renderSolidBorder(sg.color,ng,eg.curves)];case 10:cg.sent(),cg.label=11;case 11:ng++,cg.label=12;case 12:return lg++,[3,3];case 13:return[2]}})})},gg.prototype.renderDashedDottedBorder=function(eg,Ig,Cg,tg,ig){return __awaiter(this,void 0,void 0,function(){var ng,lg,og,sg,rg,cg,ag,ug,dg,hg,bg,mg,Zg,Bg,Gg,pg,Gg,pg;return __generator(this,function(fg){return this.ctx.save(),ng=parsePathForBorderStroke(tg,Cg),lg=parsePathForBorder(tg,Cg),ig===2&&(this.path(lg),this.ctx.clip()),isBezierCurve(lg[0])?(og=lg[0].start.x,sg=lg[0].start.y):(og=lg[0].x,sg=lg[0].y),isBezierCurve(lg[1])?(rg=lg[1].end.x,cg=lg[1].end.y):(rg=lg[1].x,cg=lg[1].y),Cg===0||Cg===2?ag=Math.abs(og-rg):ag=Math.abs(sg-cg),this.ctx.beginPath(),ig===3?this.formatPath(ng):this.formatPath(lg.slice(0,2)),ug=Ig<3?Ig*3:Ig*2,dg=Ig<3?Ig*2:Ig,ig===3&&(ug=Ig,dg=Ig),hg=!0,ag<=ug*2?hg=!1:ag<=ug*2+dg?(bg=ag/(2*ug+dg),ug*=bg,dg*=bg):(mg=Math.floor((ag+dg)/(ug+dg)),Zg=(ag-mg*ug)/(mg-1),Bg=(ag-(mg+1)*ug)/mg,dg=Bg<=0||Math.abs(dg-Zg)<Math.abs(dg-Bg)?Zg:Bg),hg&&(ig===3?this.ctx.setLineDash([0,ug+dg]):this.ctx.setLineDash([ug,dg])),ig===3?(this.ctx.lineCap="round",this.ctx.lineWidth=Ig):this.ctx.lineWidth=Ig*2+1.1,this.ctx.strokeStyle=asString(eg),this.ctx.stroke(),this.ctx.setLineDash([]),ig===2&&(isBezierCurve(lg[0])&&(Gg=lg[3],pg=lg[0],this.ctx.beginPath(),this.formatPath([new Vector(Gg.end.x,Gg.end.y),new Vector(pg.start.x,pg.start.y)]),this.ctx.stroke()),isBezierCurve(lg[1])&&(Gg=lg[1],pg=lg[2],this.ctx.beginPath(),this.formatPath([new Vector(Gg.end.x,Gg.end.y),new Vector(pg.start.x,pg.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},gg.prototype.render=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig;return __generator(this,function(Cg){switch(Cg.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),Ig=parseStackingContexts(eg),[4,this.renderStack(Ig)];case 1:return Cg.sent(),this.applyEffects([]),[2,this.canvas]}})})},gg}(Renderer),isTextInputElement=function(Ag){return Ag instanceof TextareaElementContainer||Ag instanceof SelectElementContainer?!0:Ag instanceof InputElementContainer&&Ag.type!==RADIO&&Ag.type!==CHECKBOX},calculateBackgroundCurvedPaintingArea=function(Ag,gg){switch(Ag){case 0:return calculateBorderBoxPath(gg);case 2:return calculateContentBoxPath(gg);case 1:default:return calculatePaddingBoxPath(gg)}},canvasTextAlign=function(Ag){switch(Ag){case 1:return"center";case 2:return"right";case 0:default:return"left"}},iOSBrokenFonts=["-apple-system","system-ui"],fixIOSSystemFonts=function(Ag){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?Ag.filter(function(gg){return iOSBrokenFonts.indexOf(gg)===-1}):Ag},ForeignObjectRenderer=function(Ag){__extends(gg,Ag);function gg(eg,Ig){var Cg=Ag.call(this,eg,Ig)||this;return Cg.canvas=Ig.canvas?Ig.canvas:document.createElement("canvas"),Cg.ctx=Cg.canvas.getContext("2d"),Cg.options=Ig,Cg.canvas.width=Math.floor(Ig.width*Ig.scale),Cg.canvas.height=Math.floor(Ig.height*Ig.scale),Cg.canvas.style.width=Ig.width+"px",Cg.canvas.style.height=Ig.height+"px",Cg.ctx.scale(Cg.options.scale,Cg.options.scale),Cg.ctx.translate(-Ig.x,-Ig.y),Cg.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+Ig.width+"x"+Ig.height+" at "+Ig.x+","+Ig.y+") with scale "+Ig.scale),Cg}return gg.prototype.render=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg;return __generator(this,function(tg){switch(tg.label){case 0:return Ig=createForeignObjectSVG(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,eg),[4,loadSerializedSVG(Ig)];case 1:return Cg=tg.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(Cg,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},gg}(Renderer),loadSerializedSVG=function(Ag){return new Promise(function(gg,eg){var Ig=new Image;Ig.onload=function(){gg(Ig)},Ig.onerror=eg,Ig.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(Ag))})},Logger=function(){function Ag(gg){var eg=gg.id,Ig=gg.enabled;this.id=eg,this.enabled=Ig,this.start=Date.now()}return Ag.prototype.debug=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.prototype.getTime=function(){return Date.now()-this.start},Ag.prototype.info=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg))},Ag.prototype.warn=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.prototype.error=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.instances={},Ag}(),Context=function(){function Ag(gg,eg){var Ig;this.windowBounds=eg,this.instanceName="#"+Ag.instanceCount++,this.logger=new Logger({id:this.instanceName,enabled:gg.logging}),this.cache=(Ig=gg.cache)!==null&&Ig!==void 0?Ig:new Cache(this,gg)}return Ag.instanceCount=1,Ag}(),html2canvas=function(Ag,gg){return gg===void 0&&(gg={}),renderElement(Ag,gg)};typeof window<"u"&&CacheStorage.setContext(window);var renderElement=function(Ag,gg){return __awaiter(void 0,void 0,void 0,function(){var eg,Ig,Cg,tg,ig,ng,lg,og,sg,rg,cg,ag,ug,dg,hg,bg,mg,Zg,Bg,Gg,fg,pg,fg,Vg,Wg,Hg,Sg,wg,Xg,vg,yg,Ng,Yg,Kg,Jg,Ug,Qg,xg,Tg,Mg;return __generator(this,function(Eg){switch(Eg.label){case 0:if(!Ag||typeof Ag!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(eg=Ag.ownerDocument,!eg)throw new Error("Element is not attached to a Document");if(Ig=eg.defaultView,!Ig)throw new Error("Document is not attached to a Window");return Cg={allowTaint:(Vg=gg.allowTaint)!==null&&Vg!==void 0?Vg:!1,imageTimeout:(Wg=gg.imageTimeout)!==null&&Wg!==void 0?Wg:15e3,proxy:gg.proxy,useCORS:(Hg=gg.useCORS)!==null&&Hg!==void 0?Hg:!1},tg=__assign({logging:(Sg=gg.logging)!==null&&Sg!==void 0?Sg:!0,cache:gg.cache},Cg),ig={windowWidth:(wg=gg.windowWidth)!==null&&wg!==void 0?wg:Ig.innerWidth,windowHeight:(Xg=gg.windowHeight)!==null&&Xg!==void 0?Xg:Ig.innerHeight,scrollX:(vg=gg.scrollX)!==null&&vg!==void 0?vg:Ig.pageXOffset,scrollY:(yg=gg.scrollY)!==null&&yg!==void 0?yg:Ig.pageYOffset},ng=new Bounds(ig.scrollX,ig.scrollY,ig.windowWidth,ig.windowHeight),lg=new Context(tg,ng),og=(Ng=gg.foreignObjectRendering)!==null&&Ng!==void 0?Ng:!1,sg={allowTaint:(Yg=gg.allowTaint)!==null&&Yg!==void 0?Yg:!1,onclone:gg.onclone,ignoreElements:gg.ignoreElements,inlineImages:og,copyStyles:og},lg.logger.debug("Starting document clone with size "+ng.width+"x"+ng.height+" scrolled to "+-ng.left+","+-ng.top),rg=new DocumentCloner(lg,Ag,sg),cg=rg.clonedReferenceElement,cg?[4,rg.toIFrame(eg,ng)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return ag=Eg.sent(),ug=isBodyElement(cg)||isHTMLElement(cg)?parseDocumentSize(cg.ownerDocument):parseBounds(lg,cg),dg=ug.width,hg=ug.height,bg=ug.left,mg=ug.top,Zg=parseBackgroundColor(lg,cg,gg.backgroundColor),Bg={canvas:gg.canvas,backgroundColor:Zg,scale:(Jg=(Kg=gg.scale)!==null&&Kg!==void 0?Kg:Ig.devicePixelRatio)!==null&&Jg!==void 0?Jg:1,x:((Ug=gg.x)!==null&&Ug!==void 0?Ug:0)+bg,y:((Qg=gg.y)!==null&&Qg!==void 0?Qg:0)+mg,width:(xg=gg.width)!==null&&xg!==void 0?xg:Math.ceil(dg),height:(Tg=gg.height)!==null&&Tg!==void 0?Tg:Math.ceil(hg)},og?(lg.logger.debug("Document cloned, using foreign object rendering"),fg=new ForeignObjectRenderer(lg,Bg),[4,fg.render(cg)]):[3,3];case 2:return Gg=Eg.sent(),[3,5];case 3:return lg.logger.debug("Document cloned, element located at "+bg+","+mg+" with size "+dg+"x"+hg+" using computed rendering"),lg.logger.debug("Starting DOM parsing"),pg=parseTree(lg,cg),Zg===pg.styles.backgroundColor&&(pg.styles.backgroundColor=COLORS.TRANSPARENT),lg.logger.debug("Starting renderer for element at "+Bg.x+","+Bg.y+" with size "+Bg.width+"x"+Bg.height),fg=new CanvasRenderer(lg,Bg),[4,fg.render(pg)];case 4:Gg=Eg.sent(),Eg.label=5;case 5:return(!((Mg=gg.removeContainer)!==null&&Mg!==void 0)||Mg)&&(DocumentCloner.destroy(ag)||lg.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),lg.logger.debug("Finished rendering"),[2,Gg]}})})},parseBackgroundColor=function(Ag,gg,eg){var Ig=gg.ownerDocument,Cg=Ig.documentElement?parseColor(Ag,getComputedStyle(Ig.documentElement).backgroundColor):COLORS.TRANSPARENT,tg=Ig.body?parseColor(Ag,getComputedStyle(Ig.body).backgroundColor):COLORS.TRANSPARENT,ig=typeof eg=="string"?parseColor(Ag,eg):eg===null?COLORS.TRANSPARENT:4294967295;return gg===Ig.documentElement?isTransparent(Cg)?isTransparent(tg)?ig:tg:Cg:ig};const html2canvas_esm=Object.freeze(Object.defineProperty({__proto__:null,default:html2canvas},Symbol.toStringTag,{value:"Module"}));async function captureCanvasArea(Ag="mtCanvasArea",gg={}){const eg=gg.scale??2,Ig=document.querySelector(`#${Ag}`);if(!Ig)throw new Error("没有找到 canvas 元素");const Cg=[],tg=document.body.querySelectorAll(`#${Ag} .mt-line-render`);for(const lg of tg){const og=lg.outerHTML.trim(),sg=document.createElement("canvas");sg.width=lg.getBoundingClientRect().width,sg.height=lg.getBoundingClientRect().height;const rg=sg.getContext("2d");await Canvg$1.fromString(rg,og).render(),lg.style.position&&(sg.style.position+=lg.style.position,sg.style.left+=lg.style.left,sg.style.top+=lg.style.top),lg.parentNode.appendChild(sg),Cg.push(sg)}const ig=Ig.offsetWidth,ng=Ig.offsetHeight;try{return await html2canvas(Ig,{useCORS:!0,scale:eg,width:ig,height:ng,allowTaint:!0,windowHeight:ng,logging:!1,ignoreElements:lg=>lg.classList.contains("mt-line-render")})}finally{Cg.forEach(lg=>lg.remove())}}async function captureCanvasAreaOrNotify(Ag,gg){try{return await captureCanvasArea(Ag,gg)}catch{return ElMessage.error("画布截图失败,请检查画布是否正常显示"),null}}function pickCaptureScale(Ag,gg){const eg=Math.max(Ag,gg);return eg>4e3?.5:eg>2500?1:2}async function exportCanvasToPdf(Ag="mtCanvasArea",gg){const eg=document.querySelector(`#${Ag}`);if(!eg){ElMessage.error("没有找到画布,无法导出 PDF");return}const Ig=eg.offsetWidth,Cg=eg.offsetHeight,tg=pickCaptureScale(Ig,Cg),ig=ElMessage({message:"正在导出 PDF…",type:"info",duration:0,showClose:!1});try{const ng=await captureCanvasAreaOrNotify(Ag,{scale:tg});if(!ng)return;const lg=ng.width,og=ng.height,sg=ng.toDataURL("image/jpeg",.92),rg=new E$1({orientation:lg>=og?"landscape":"portrait",unit:"px",format:[lg,og],compress:!0});rg.addImage(sg,"JPEG",0,0,lg,og,void 0,"FAST"),rg.save(gg??`定置图-${formatFileStamp()}.pdf`),ElMessage.success("PDF 导出成功")}catch{ElMessage.error("导出 PDF 失败,请稍后重试")}finally{ig.close()}}function formatFileStamp(){const Ag=new Date,gg=eg=>String(eg).padStart(2,"0");return`${Ag.getFullYear()}${gg(Ag.getMonth()+1)}${gg(Ag.getDate())}-${gg(Ag.getHours())}${gg(Ag.getMinutes())}`}function parsePlanStartMs(Ag){if(!Ag)return 0;const gg=Ag.includes("T")?Ag:Ag.replace(" ","T"),eg=new Date(gg).getTime();return Number.isNaN(eg)?0:eg}function sortTasksForTimeline(Ag){return Ag.map((gg,eg)=>({task:gg,index:eg})).sort((gg,eg)=>{const Ig=parsePlanStartMs(gg.task.planStartDate)-parsePlanStartMs(eg.task.planStartDate);return Ig!==0?Ig:gg.index-eg.index}).map(({task:gg})=>gg)}function buildSopTimelineOrderFromTasks(Ag){const gg=sortTasksForTimeline(Ag),eg=[];for(const Ig of gg)for(const Cg of Ig.sopList??[])Cg.isDel!=="Y"&&(eg.includes(Cg.sopId)||eg.push(Cg.sopId));return eg}const sopCanvasCfgCache=vue.reactive({}),sopPositionDataMerged=new Set;function snapshotCurrentCanvasCfg(){return{canvasCfg:objectDeepClone(globalStore.canvasCfg),gridCfg:objectDeepClone(globalStore.gridCfg)}}function parsePositionData(Ag){if(!Ag||typeof Ag!="string")return null;try{return JSON.parse(Ag)}catch{return null}}function finishSopCanvasSwitch(Ag){applyCanvasForSop(Ag),globalStore.selected_items_id=[],cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}function findTaskSop(Ag,gg){var eg;return(eg=Ag==null?void 0:Ag.sopList)==null?void 0:eg.find(Ig=>Ig.sopId===gg&&Ig.isDel!=="Y")}function switchTaskSopCanvas(Ag,gg,eg){var ig;if(Ag===gg)return;commitSopEdits(Ag,globalStore.done_json),sopCanvasCfgCache[Ag]=snapshotCurrentCanvasCfg();const Ig=sopCanvasCfgCache[gg];if(Ig){globalStore.canvasCfg=withCanvasBackground(objectDeepClone(Ig.canvasCfg)),globalStore.gridCfg=objectDeepClone(Ig.gridCfg),finishSopCanvasSwitch(gg);return}const Cg=findTaskSop(eg,gg),tg=parsePositionData((Cg==null?void 0:Cg.positionData)??null);if(tg&&!sopPositionDataMerged.has(gg)){const{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(tg);adoptCanvasBackground(ng),globalStore.canvasCfg=withCanvasBackground({...ng,color:((ig=ng.color)==null?void 0:ig.trim())||"#ffffff"}),globalStore.gridCfg=lg,mergeMasterFromImportedDoneJson(og,gg),sopPositionDataMerged.add(gg)}finishSopCanvasSwitch(gg)}function clearTaskSopCanvasCache(){for(const Ag of Object.keys(sopCanvasCfgCache))delete sopCanvasCfgCache[Ag];sopPositionDataMerged.clear()}function findSopPositionData(Ag,gg){var eg;for(const Ig of Ag){const Cg=(eg=Ig.sopList)==null?void 0:eg.find(tg=>tg.sopId===gg&&tg.isDel!=="Y");if(Cg)return Cg.positionData??null}return null}function buildSopExportJsonMap(Ag,gg){const eg=Ag.length?buildSopTimelineOrderFromTasks(Ag):[...getActiveSopTimelineOrder()];for(const tg of eg){if(sopPositionDataMerged.has(tg))continue;const ig=parsePositionData(findSopPositionData(Ag,tg));if(!ig)continue;const{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(ig);adoptCanvasBackground(ng),mergeMasterFromImportedDoneJson(og,tg),sopPositionDataMerged.add(tg),sopCanvasCfgCache[tg]={canvasCfg:withCanvasBackground(objectDeepClone(ng)),gridCfg:objectDeepClone(lg)}}const Ig=tg=>tg===gg||tg===sopCanvasStateStore.activeSopId?snapshotCurrentCanvasCfg():sopCanvasCfgCache[tg]??{canvasCfg:objectDeepClone(globalStore.canvasCfg),gridCfg:objectDeepClone(globalStore.gridCfg)},Cg={};for(const tg of eg){const ig=Ig(tg),{exportJson:ng}=genExportJson(withCanvasBackground(objectDeepClone(ig.canvasCfg)),ig.gridCfg,buildCanvasForSop(tg));Cg[tg]=ng}return Cg}function restoreSopExportJsonMap(Ag,gg){var Cg;clearTaskSopCanvasCache(),resetCanvasBackground(),sopCanvasStateStore.masterById={},sopCanvasStateStore.layoutBySop={};const eg=Object.keys(Ag).sort(compareSopTimeline);for(const tg of eg){const{canvasCfg:ig,gridCfg:ng,importDoneJson:lg}=useExportJsonToDoneJson(Ag[tg]);adoptCanvasBackground(ig),mergeMasterFromImportedDoneJson(lg,tg),sopPositionDataMerged.add(tg),sopCanvasCfgCache[tg]={canvasCfg:withCanvasBackground(objectDeepClone(ig)),gridCfg:objectDeepClone(ng)}}const Ig=Ag[gg];Ig&&(globalStore.canvasCfg=withCanvasBackground({...Ig.canvasCfg,color:((Cg=Ig.canvasCfg.color)==null?void 0:Cg.trim())||"#ffffff"}),globalStore.gridCfg=Ig.gridCfg),applyCanvasForSop(gg),globalStore.selected_items_id=[],cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}const _hoisted_1$2={class:"task-timeline"},_hoisted_2$2={class:"task-timeline-header"},_hoisted_3$1={class:"task-timeline-track-wrap"},_hoisted_4$1={class:"task-timeline-track-inner"},_hoisted_5$1={class:"task-timeline-nodes"},_hoisted_6$1=["onClick"],_hoisted_7={class:"task-timeline-card-wrap"},_hoisted_8={class:"task-timeline-label"},_hoisted_9={key:0,class:"task-timeline-date"},_hoisted_10={class:"task-timeline-name"},_hoisted_11=["title"],_sfc_main$2=vue.defineComponent({__name:"task-timeline",props:{tasks:{},selectedPdTaskId:{}},emits:["selectTask","linkTask"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg;function Cg(lg){if(!lg)return"";const og=new Date(lg);if(Number.isNaN(og.getTime()))return lg.slice(0,10);const sg=og.getFullYear(),rg=String(og.getMonth()+1).padStart(2,"0"),cg=String(og.getDate()).padStart(2,"0");return`${sg}-${rg}-${cg}`}const tg=vue.computed(()=>{const lg=new Map;for(const sg of eg.tasks){const rg=Cg(sg.planStartDate)||sg.pdTaskId,cg=lg.get(rg);cg?cg.push(sg):lg.set(rg,[sg])}const og=[];for(const[sg,rg]of lg){const cg=[...rg].sort((ug,dg)=>ug.sortNo-dg.sortNo),ag=cg[0];og.push({dateKey:sg,dateLabel:Cg(ag.planStartDate)||sg,tasks:cg,displayTaskName:ag.taskName})}return og.sort((sg,rg)=>{const cg=new Date(sg.tasks[0].planStartDate).getTime(),ag=new Date(rg.tasks[0].planStartDate).getTime();return!Number.isNaN(cg)&&!Number.isNaN(ag)?cg-ag:sg.dateKey.localeCompare(rg.dateKey)}),og}),ig=lg=>eg.selectedPdTaskId?lg.tasks.some(og=>og.pdTaskId===eg.selectedPdTaskId):!1,ng=lg=>{const og=lg.tasks.findIndex(rg=>rg.pdTaskId===eg.selectedPdTaskId),sg=og>=0?lg.tasks[(og+1)%lg.tasks.length]:lg.tasks[0];Ig("selectTask",sg)};return(lg,og)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[og[1]||(og[1]=vue.createElementVNode("span",{class:"task-timeline-title"},"任务时间轴",-1)),vue.createElementVNode("button",{type:"button",class:"task-timeline-link-btn",onClick:og[0]||(og[0]=sg=>Ig("linkTask"))}," 关联任务 ")]),vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4$1,[og[3]||(og[3]=vue.createElementVNode("div",{class:"task-timeline-line","aria-hidden":"true"},null,-1)),vue.createElementVNode("div",_hoisted_5$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,sg=>(vue.openBlock(),vue.createElementBlock("button",{key:sg.dateKey,type:"button",class:vue.normalizeClass(["task-timeline-node",{"is-active":ig(sg)}]),onClick:rg=>ng(sg)},[og[2]||(og[2]=vue.createElementVNode("span",{class:"task-timeline-dot","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",_hoisted_7,[vue.createElementVNode("span",_hoisted_8,[sg.dateLabel?(vue.openBlock(),vue.createElementBlock("span",_hoisted_9,vue.toDisplayString(sg.dateLabel),1)):vue.createCommentVNode("",!0),vue.createElementVNode("span",_hoisted_10,vue.toDisplayString(sg.displayTaskName),1)]),sg.tasks.length>1?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"task-timeline-parallel-suffix",title:`另有 ${sg.tasks.length-1} 项并行任务,点击切换`}," +"+vue.toDisplayString(sg.tasks.length-1),9,_hoisted_11)):vue.createCommentVNode("",!0)])],10,_hoisted_6$1))),128))])])])]))}}),taskTimeline_vue_vue_type_style_index_0_scoped_5404ac45_lang="",TaskTimeline=_export_sfc(_sfc_main$2,[["__scopeId","data-v-5404ac45"]]),_hoisted_1$1={id:"mt-edit",class:"relative flex flex-col w-full h-full dark"},_hoisted_2$1={key:0,class:"mt-edit-aside-shell mt-edit-aside-shell--left"},_hoisted_3=["title"],_hoisted_4={key:1,class:"mt-edit-aside-shell mt-edit-aside-shell--right"},_hoisted_5=["title"],_hoisted_6={class:"p-10px"},_sfc_main$1=vue.defineComponent({__name:"index",props:{useThumbnail:{type:Boolean,default:!1},sopId:{default:"__default__"},taskList:{default:()=>[]},selectedTask:{default:null},viewMode:{type:Boolean,default:!1},canvasBackgroundList:{default:()=>[]},selectedCanvasBackgroundId:{default:""}},emits:["onPreviewClick","onReturnClick","onSaveClick","onThumbnailClick","onCanvasBgClick","onFullscreenToggle","onLinkTask","update:sopId","update:selectedTask","update:selectedCanvasBackgroundId"],setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=vue.computed(()=>Ig.sopId||"__default__");vue.watch(()=>Ig.taskList,rA=>{setSopTimelineOrder(buildSopTimelineOrderFromTasks(rA??[]))},{immediate:!0,deep:!0});const tg=vue.ref(null);vue.watch(()=>Ig.viewMode,rA=>{rA?(tg.value===null&&(tg.value=globalStore.lock),globalStore.lock=!0):tg.value!==null&&(globalStore.lock=tg.value,tg.value=null)},{immediate:!0});const ig=eg,ng=vue.ref(!1),lg=(rA,dA)=>{rA!==dA&&dA!==sopCanvasStateStore.activeSopId&&(Ig.selectedTask?switchTaskSopCanvas(rA,dA,Ig.selectedTask):switchSopCanvas(rA,dA))},og=rA=>{const dA=Cg.value;dA!==rA&&(ng.value=!0,lg(dA,rA),ig("update:sopId",rA),ng.value=!1)},sg=rA=>{var MA;const dA=(MA=rA.sopList)==null?void 0:MA.find($A=>$A.isDel!=="Y");return(dA==null?void 0:dA.sopId)??null},rg=rA=>{const dA=sg(rA);if(!dA||Cg.value===dA)return;const MA=Cg.value;ng.value=!0,switchTaskSopCanvas(MA,dA,rA),ig("update:sopId",dA),ng.value=!1},cg=rA=>{ig("update:selectedTask",rA),rg(rA)};vue.watch(()=>{var rA;return(rA=Ig.selectedTask)==null?void 0:rA.pdTaskId},(rA,dA)=>{if(!rA||rA===dA)return;const MA=Ig.selectedTask;MA&&rg(MA)}),vue.watch(()=>Ig.sopId,(rA,dA)=>{ng.value||!rA||rA===dA||lg(dA||sopCanvasStateStore.activeSopId,rA)});const ag=vue.useSlots(),ug=vue.ref(),dg=vue.ref(),hg=vue.reactive({left_show:!0,right_show:!0}),bg=()=>{hg.left_show=!hg.left_show},mg=()=>{hg.right_show=!hg.right_show},Zg=vue.computed(()=>!!ag.deviceBind),Bg=vue.computed(()=>globalStore.selected_items_id.length>0),Gg=vue.computed(()=>globalStore.selected_items_id.length>1),pg=vue.computed(()=>{if(globalStore.selected_items_id.length===1){const rA=globalStore.done_json.find(dA=>dA.id===globalStore.selected_items_id[0]);return(rA==null?void 0:rA.type)==="group"}return!1}),fg=vue.computed(()=>globalStore.done_json.filter(dA=>globalStore.selected_items_id.includes(dA.id)&&dA.type!=="sys-line").length>1),Vg=vue.ref(!1),Wg=vue.ref(!1),Hg=vue.ref(!1),Sg=vue.ref(!1),wg=vue.ref(!1);vue.ref(),vue.ref([]),vue.ref(!1);const Xg=()=>{deleteItemsAtSop(Cg.value,[...globalStore.selected_items_id])},vg=()=>{var rA;Vg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown()},yg=()=>{var rA;Wg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown()},Ng=rA=>{globalStore.setSingleSelect(rA)},Yg=rA=>{const dA=globalStore.done_json.find(MA=>MA.id===rA);dA&&(dA.hide=!dA.hide)},Kg=rA=>{var dA;(dA=ug.value)==null||dA.onAlignSelected(rA)},Jg=vue.getCurrentInstance(),Ug=()=>{var rA;return!!((rA=Jg==null?void 0:Jg.vnode.props)!=null&&rA.onOnCanvasBgClick)},Qg=()=>{var rA;ig("onCanvasBgClick"),!Ug()&&(wg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown())};let xg="";const Tg=async rA=>{if(!rA)return clearCanvasBackground(globalStore.canvasCfg),!0;try{const dA=await processCanvasBackgroundUrl(rA.url,rA.width,rA.height);return dA.scaled?ElMessage.warning(`背景尺寸 ${dA.originalWidth}×${dA.originalHeight} 超出浏览器限制,已缩放为 ${dA.width}×${dA.height} 并同步画布大小`):ElMessage.success(`已切换底图,画布尺寸 ${dA.width}×${dA.height}`),setCanvasBackground(globalStore.canvasCfg,dA.dataUrl,dA.width,dA.height),!0}catch(dA){console.error("[canvas-bg-preset]",dA);const MA=dA instanceof Error?dA.message:"";return ElMessage.error(MA?`底图加载失败:${MA}`:"底图加载失败"),!1}},Mg=async rA=>{const dA=rA?Ig.canvasBackgroundList.find($A=>$A.id===rA)??null:null;if(rA&&!dA)return;xg=rA,await Tg(dA)?ig("update:selectedCanvasBackgroundId",rA):xg=""},Eg=async()=>{const rA=Ig.selectedCanvasBackgroundId;if(rA&&rA===xg)return;if(!rA){xg="",await Tg(null);return}const dA=Ig.canvasBackgroundList.find($A=>$A.id===rA);if(!dA)return;xg=rA,await Tg(dA)||(xg="",ig("update:selectedCanvasBackgroundId",""))};vue.watch(()=>Ig.selectedCanvasBackgroundId,Eg),vue.watch(()=>Ig.canvasBackgroundList,rA=>{const dA=Ig.selectedCanvasBackgroundId;if(dA){if(!rA.some(MA=>MA.id===dA)){xg="",clearCanvasBackground(globalStore.canvasCfg),ig("update:selectedCanvasBackgroundId","");return}Eg()}},{deep:!0}),vue.watch(()=>globalStore.canvasCfg.img,rA=>{if(!rA&&canvasBackgroundState.img){globalStore.canvasCfg.img=canvasBackgroundState.img;return}if(!rA){Ig.selectedCanvasBackgroundId&&ig("update:selectedCanvasBackgroundId","");return}const dA=Ig.canvasBackgroundList.find(MA=>MA.url===rA||MA.url===globalStore.canvasCfg.img);dA&&dA.id!==Ig.selectedCanvasBackgroundId&&ig("update:selectedCanvasBackgroundId",dA.id)});const Og=rA=>{ig("onFullscreenToggle",rA)},gA=()=>{window.open("http://mt.yaolm.top")},IA=()=>{var rA;(rA=ug.value)==null||rA.onRedo()},Pg=()=>{var rA;(rA=ug.value)==null||rA.onUndo()},qg=async()=>{var dA;await((dA=dg.value)==null?void 0:dA.onImport())?(Vg.value=!1,cacheStore.addHistory(globalStore.done_json)):ElMessage.error("导入失败,请检查数据格式")},lA=()=>{const{exportJson:rA}=genExportJson(globalStore.canvasCfg,globalStore.gridCfg,globalStore.done_json);ig("onPreviewClick",rA)},pA=()=>{commitSopEdits(Cg.value,globalStore.done_json);const{exportJson:rA}=genExportJson(globalStore.canvasCfg,globalStore.gridCfg,globalStore.done_json);return rA.sopJsonMap=buildSopExportJsonMap(Ig.taskList??[],Cg.value),ig("onSaveClick",rA),rA},VA=()=>{ig("onThumbnailClick")},XA=()=>{exportCanvasToPdf("mtCanvasArea")},hA=rA=>{Sg.value=rA};return gg({setImportJson:rA=>{var nA;if(rA.sopJsonMap&&Object.keys(rA.sopJsonMap).length>0)return restoreSopExportJsonMap(rA.sopJsonMap,Cg.value),cacheStore.history[0]=objectDeepClone(globalStore.done_json),!0;const{canvasCfg:dA,gridCfg:MA,importDoneJson:$A}=useExportJsonToDoneJson(rA);return resetCanvasBackground(),adoptCanvasBackground(dA),globalStore.canvasCfg=withCanvasBackground({...dA,color:((nA=dA.color)==null?void 0:nA.trim())||"#ffffff"}),globalStore.gridCfg=MA,globalStore.setGlobalStoreDoneJson($A),syncMasterFromImportedDoneJson($A,Cg.value),cacheStore.history[0]=$A,!0},save:pA,lockCanvas:()=>{globalStore.lock=!0},unlockCanvas:()=>{globalStore.lock=!1},toggleLock:()=>{globalStore.lock=!globalStore.lock},getAllElementIds:()=>globalStore.done_json.map(rA=>rA.id),switchSopCanvas:(rA,dA)=>{lg(rA,dA)},hasSopCanvasState:rA=>sopCanvasStateStore.has(rA)}),(rA,dA)=>{const MA=vue.resolveComponent("el-form-item"),$A=vue.resolveComponent("el-form");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createVNode(vue.unref(ElContainer),{class:"h-full flex flex-row min-h-0"},{default:vue.withCtx(()=>[Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$1,[vue.createVNode(vue.unref(ElAside),{width:hg.left_show?"300px":"0px",class:"dark:bg-myDarkBgColor cr-border mt-edit-aside select-none",onMousedown:dA[0]||(dA[0]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.stopListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(LeftAside,{class:"h-full min-h-0",leftAsideConfig:vue.unref(leftAsideStore).config},null,8,["leftAsideConfig"])]),_:1},8,["width"]),vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["mt-edit-aside-toggle mt-edit-aside-toggle--left",{"is-collapsed":!hg.left_show}]),title:hg.left_show?"收起图元库":"展开图元库",onMousedown:dA[1]||(dA[1]=vue.withModifiers(()=>{},["stop"])),onClick:bg},[...dA[20]||(dA[20]=[vue.createElementVNode("span",{class:"mt-edit-aside-toggle-icon","aria-hidden":"true"},null,-1)])],42,_hoisted_3)])),vue.createVNode(vue.unref(ElMain),{class:"mt-edit-main flex-1 p-0 flex flex-col h-full min-h-0 min-w-0",onMousedown:dA[8]||(dA[8]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{default:vue.withCtx(()=>{var nA,oA;return[Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"mt-edit-toolbar w-full select-none flex-none",onMousedown:dA[5]||(dA[5]=ZA=>{var GA;return(GA=ug.value)==null?void 0:GA.stopListenerKeyDown()})},[vue.createVNode(HeaderPanel,{"lock-state":vue.unref(globalStore).lock,"onUpdate:lockState":dA[2]||(dA[2]=ZA=>vue.unref(globalStore).lock=ZA),"selected-items-id":vue.unref(globalStore).selected_items_id,"group-enabled":Gg.value,"un-group-enabled":pg.value,"align-enabled":fg.value,"delete-enabled":Bg.value,"undo-enabled":vue.unref(cacheStore).historyIndex>0,"redo-enabled":vue.unref(cacheStore).historyIndex<vue.unref(cacheStore).history.length-1,"real-time-data":vue.unref(globalStore).real_time_data,"use-thumbnail":Ig.useThumbnail,"canvas-background-list":Ig.canvasBackgroundList,"selected-canvas-background-id":Ig.selectedCanvasBackgroundId,onOnGroupClick:(nA=ug.value)==null?void 0:nA.createGroupItem,onOnUngroupClick:(oA=ug.value)==null?void 0:oA.onUngroup,onOnDeleteClick:Xg,onOnExportClick:yg,onOnTreeClick:dA[3]||(dA[3]=ZA=>Hg.value=!0),onOnHelpClick:gA,onAlignSelected:Kg,onOnRedoClick:IA,onOnUndoClick:Pg,onOnImportClick:vg,onOnReturnClick:dA[4]||(dA[4]=ZA=>ig("onReturnClick")),onOnSaveClick:pA,onOnPreviewClick:lA,onOnThumbnailClick:VA,onOnDrawLineClick:hA,onOnCanvasBgClick:Qg,onOnCanvasBackgroundSelect:Mg,onOnExportPdfClick:XA,onOnFullscreenToggle:Og},null,8,["lock-state","selected-items-id","group-enabled","un-group-enabled","align-enabled","delete-enabled","undo-enabled","redo-enabled","real-time-data","use-thumbnail","canvas-background-list","selected-canvas-background-id","onOnGroupClick","onOnUngroupClick"])],32)),vue.createVNode(MainPanel,{ref_key:"mainPanelRef",ref:ug,class:"flex-1 min-h-0","group-enabled":Gg.value,"un-group-enabled":pg.value,"delete-enabled":Bg.value,"line-append-enable":Sg.value,"sop-id":Cg.value},null,8,["group-enabled","un-group-enabled","delete-enabled","line-append-enable","sop-id"]),vue.createElementVNode("div",{class:"mt-edit-bottom-panel flex-none min-w-0 w-full max-w-full dark:bg-myDarkBgColor border-t border-gray-700",onMousedown:dA[7]||(dA[7]=vue.withModifiers(()=>{},["stop"]))},[vue.renderSlot(rA.$slots,"bottomPanel",{tasks:Ig.taskList??[],selectedTask:Ig.selectedTask,selectTask:cg},()=>{var ZA,GA;return[(((ZA=Ig.taskList)==null?void 0:ZA.length)??0)>0?(vue.openBlock(),vue.createBlock(TaskTimeline,{key:0,tasks:Ig.taskList,"selected-pd-task-id":(GA=Ig.selectedTask)==null?void 0:GA.pdTaskId,onSelectTask:cg,onLinkTask:dA[6]||(dA[6]=zA=>ig("onLinkTask"))},null,8,["tasks","selected-pd-task-id"])):vue.createCommentVNode("",!0)]},!0)],32)]}),_:3}),Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["mt-edit-aside-toggle mt-edit-aside-toggle--right",{"is-collapsed":!hg.right_show}]),title:hg.right_show?"收起属性面板":"展开属性面板",onMousedown:dA[9]||(dA[9]=vue.withModifiers(()=>{},["stop"])),onClick:mg},[...dA[21]||(dA[21]=[vue.createElementVNode("span",{class:"mt-edit-aside-toggle-icon","aria-hidden":"true"},null,-1)])],42,_hoisted_5),vue.createVNode(vue.unref(ElAside),{width:hg.right_show?"300px":"0px",class:"dark:bg-myDarkBgColor cl-border mt-edit-aside select-none",onMousedown:dA[10]||(dA[10]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.stopListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$6,{"selected-task":Ig.selectedTask,"active-sop-id":Cg.value,onSelectTaskSop:og},vue.createSlots({_:2},[Zg.value?{name:"deviceBind",fn:vue.withCtx(({item:nA})=>[vue.renderSlot(rA.$slots,"deviceBind",{item:nA},void 0,!0)]),key:"0"}:void 0]),1032,["selected-task","active-sop-id"])]),_:3},8,["width"])]))]),_:3}),vue.createVNode(vue.unref(ElDialog),{modelValue:Vg.value,"onUpdate:modelValue":dA[11]||(dA[11]=nA=>Vg.value=nA),title:"数据导入",onClose:dA[12]||(dA[12]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:qg},{default:vue.withCtx(()=>[...dA[22]||(dA[22]=[vue.createTextVNode("确定",-1)])]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:dg},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{modelValue:Wg.value,"onUpdate:modelValue":dA[13]||(dA[13]=nA=>Wg.value=nA),title:"数据导出",onClose:dA[14]||(dA[14]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4,{"done-json":vue.unref(objectDeepClone)(vue.unref(globalStore).done_json),"canvas-cfg":vue.unref(globalStore).canvasCfg,"grid-cfg":vue.unref(globalStore).gridCfg},null,8,["done-json","canvas-cfg","grid-cfg"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDrawer),{modelValue:Hg.value,"onUpdate:modelValue":dA[15]||(dA[15]=nA=>Hg.value=nA),title:"图形结构树",direction:"ltr",size:"30%"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$5,{"done-json":vue.unref(globalStore).done_json,"selected-items-id":vue.unref(globalStore).selected_items_id,onUpdateSelectedItemsId:Ng,onUpdateSelectedIdHide:Yg},null,8,["done-json","selected-items-id"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{modelValue:wg.value,"onUpdate:modelValue":dA[18]||(dA[18]=nA=>wg.value=nA),title:"画布背景",width:"400px",onClose:dA[19]||(dA[19]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:dA[17]||(dA[17]=nA=>wg.value=!1)},{default:vue.withCtx(()=>[...dA[23]||(dA[23]=[vue.createTextVNode("关闭",-1)])]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6,[vue.createVNode($A,{"label-width":"100px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(MA,{label:"背景颜色"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(globalStore).canvasCfg.color,"onUpdate:modelValue":dA[16]||(dA[16]=nA=>vue.unref(globalStore).canvasCfg.color=nA)},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1},8,["modelValue"])])}}}),index_vue_vue_type_style_index_0_scoped_57dc5010_lang="",MtEdit=_export_sfc(_sfc_main$1,[["__scopeId","data-v-57dc5010"]]),_hoisted_1={style:{height:"100vh"}},_hoisted_2=["src"],_sfc_main=vue.defineComponent({__name:"index",props:{exportJson:{},canZoom:{type:Boolean,default:!0},canDrag:{type:Boolean,default:!0},showPopover:{type:Boolean,default:!0}},emits:["onEventCallBack"],setup(Ag,{expose:gg,emit:eg}){vue.useCssVars(fg=>({b16cb428:`scale(${ig.value.scale})`,v798570b2:ig.value.width+"px",v01f5327b:ig.value.height+"px",e7220190:ig.value.color}));const Ig=Ag,Cg=eg,tg=vue.ref(),ig=vue.ref({width:1920,height:1080,scale:1,color:"#ffffff",img:"",guide:!0,adsorp:!0,adsorp_diff:3,transform_origin:{x:0,y:0},drag_offset:{x:0,y:0}}),ng=vue.ref({enabled:!0,align:!0,size:10}),lg=vue.ref([]),og=vue.ref(),sg=vue.ref(),rg=vue.reactive({begin_left:0,begin_top:0,left:0,top:0}),cg=({scrollLeft:fg,scrollTop:Vg})=>{rg.left=fg,rg.top=Vg},ag=fg=>{var Vg;Ig.canDrag&&((Vg=sg.value)==null||Vg.onMouseDown(fg))},ug=()=>{rg.begin_left=rg.left,rg.begin_top=rg.top},dg=(fg,Vg)=>{var Sg,wg;let Wg=rg.begin_left-fg,Hg=rg.begin_top-Vg;(Sg=og.value)==null||Sg.setScrollLeft(Wg),(wg=og.value)==null||wg.setScrollTop(Hg)},hg=()=>{},bg=(fg,Vg,Wg)=>setItemAttr(fg,Vg,Wg,lg.value),mg=fg=>{fg.forEach(Vg=>{setItemAttr(Vg.id,Vg.key,Vg.val,lg.value)})},Zg=(fg,Vg,Wg)=>getItemAttr(fg,Vg,lg.value),Bg=fg=>{fg.ctrlKey&&Ig.canZoom&&(fg.preventDefault(),fg.stopPropagation(),fg.deltaY>0?ig.value.scale=(ig.value.scale*10-1)/10:fg.deltaY<0&&(ig.value.scale=(ig.value.scale*10+1)/10))},Gg=(fg,Vg,Wg)=>{setTimeout(()=>{bg(fg,Vg,Wg)},0)};return window.$mtElMessage=ElMessage,window.$mtElMessageBox=ElMessageBox,window.$setItemAttrByID=(fg,Vg,Wg)=>Gg(fg,Vg,Wg),window.$getItemAttrByID=Zg,window.$previewCompareVal=previewCompareVal,window.$mtEventCallBack=(fg,Vg,...Wg)=>Cg("onEventCallBack",fg,Vg,...Wg),vue.onMounted(()=>{if(Ig.exportJson){const{canvasCfg:fg,gridCfg:Vg,importDoneJson:Wg}=useExportJsonToDoneJson(Ig.exportJson);ig.value=fg,ng.value=Vg,lg.value=Wg}}),gg({setItemAttrByID:bg,setImportJson:fg=>{const{canvasCfg:Vg,gridCfg:Wg,importDoneJson:Hg}=useExportJsonToDoneJson(fg);return ig.value=Vg,ng.value=Wg,lg.value=Hg,!0},setItemAttrs:mg}),(fg,Vg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createVNode(vue.unref(ElScrollbar),{ref_key:"elScrollbarRef",ref:og,class:"w-1/1 h-1/1","max-height":ig.value.height,onScroll:cg},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref_key:"canvasAreaRef",ref:tg,class:vue.normalizeClass(`canvasArea ${Ig.canDrag?"cursor-grab":""} `),onMousedown:ag,onWheel:Bg},[ig.value.img?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"canvas-bg-image",src:ig.value.img,alt:"",draggable:"false"},null,8,_hoisted_2)):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$i,{"done-json":lg.value,"onUpdate:doneJson":Vg[0]||(Vg[0]=Wg=>lg.value=Wg),"canvas-cfg":ig.value,"grid-cfg":ng.value,"show-ghost-dom":!1,"canvas-dom":tg.value,"global-lock":!1,"preivew-mode":!0,"show-popover":Ig.showPopover},null,8,["done-json","canvas-cfg","grid-cfg","canvas-dom","show-popover"])],34),vue.createVNode(_sfc_main$f,{ref_key:"dragCanvasRef",ref:sg,"scale-ratio":ig.value.scale,onDragCanvasMouseDown:ug,onDragCanvasMouseMove:dg,onDragCanvasMouseUp:hg},null,8,["scale-ratio"])]),_:1},8,["max-height"])]))}}),index_vue_vue_type_style_index_0_scoped_2abcde76_lang="",MtPreview=_export_sfc(_sfc_main,[["__scopeId","data-v-2abcde76"]]);/*! @license DOMPurify 2.5.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.9/LICENSE */function _typeof(Ag){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gg){return typeof gg}:function(gg){return gg&&typeof Symbol=="function"&&gg.constructor===Symbol&&gg!==Symbol.prototype?"symbol":typeof gg},_typeof(Ag)}function _setPrototypeOf(Ag,gg){return _setPrototypeOf=Object.setPrototypeOf||function(Ig,Cg){return Ig.__proto__=Cg,Ig},_setPrototypeOf(Ag,gg)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(Ag,gg,eg){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(Cg,tg,ig){var ng=[null];ng.push.apply(ng,tg);var lg=Function.bind.apply(Cg,ng),og=new lg;return ig&&_setPrototypeOf(og,ig.prototype),og},_construct.apply(null,arguments)}function _toConsumableArray(Ag){return _arrayWithoutHoles(Ag)||_iterableToArray(Ag)||_unsupportedIterableToArray(Ag)||_nonIterableSpread()}function _arrayWithoutHoles(Ag){if(Array.isArray(Ag))return _arrayLikeToArray(Ag)}function _iterableToArray(Ag){if(typeof Symbol<"u"&&Ag[Symbol.iterator]!=null||Ag["@@iterator"]!=null)return Array.from(Ag)}function _unsupportedIterableToArray(Ag,gg){if(Ag){if(typeof Ag=="string")return _arrayLikeToArray(Ag,gg);var eg=Object.prototype.toString.call(Ag).slice(8,-1);if(eg==="Object"&&Ag.constructor&&(eg=Ag.constructor.name),eg==="Map"||eg==="Set")return Array.from(Ag);if(eg==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(eg))return _arrayLikeToArray(Ag,gg)}}function _arrayLikeToArray(Ag,gg){(gg==null||gg>Ag.length)&&(gg=Ag.length);for(var eg=0,Ig=new Array(gg);eg<gg;eg++)Ig[eg]=Ag[eg];return Ig}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1445
|
+
.`+PSEUDO_HIDE_ELEMENT_CLASS_AFTER+PSEUDO_AFTER+PSEUDO_HIDE_ELEMENT_STYLE)},createStyles=function(Ag,gg){var eg=Ag.ownerDocument;if(eg){var Ig=eg.createElement("style");Ig.textContent=gg,Ag.appendChild(Ig)}},CacheStorage=function(){function Ag(){}return Ag.getOrigin=function(gg){var eg=Ag._link;return eg?(eg.href=gg,eg.href=eg.href,eg.protocol+eg.hostname+eg.port):"about:blank"},Ag.isSameOrigin=function(gg){return Ag.getOrigin(gg)===Ag._origin},Ag.setContext=function(gg){Ag._link=gg.document.createElement("a"),Ag._origin=Ag.getOrigin(gg.location.href)},Ag._origin="about:blank",Ag}(),Cache=function(){function Ag(gg,eg){this.context=gg,this._options=eg,this._cache={}}return Ag.prototype.addImage=function(gg){var eg=Promise.resolve();return this.has(gg)||(isBlobImage(gg)||isRenderable(gg))&&(this._cache[gg]=this.loadImage(gg)).catch(function(){}),eg},Ag.prototype.match=function(gg){return this._cache[gg]},Ag.prototype.loadImage=function(gg){return __awaiter(this,void 0,void 0,function(){var eg,Ig,Cg,tg,ig=this;return __generator(this,function(ng){switch(ng.label){case 0:return eg=CacheStorage.isSameOrigin(gg),Ig=!isInlineImage(gg)&&this._options.useCORS===!0&&FEATURES.SUPPORT_CORS_IMAGES&&!eg,Cg=!isInlineImage(gg)&&!eg&&!isBlobImage(gg)&&typeof this._options.proxy=="string"&&FEATURES.SUPPORT_CORS_XHR&&!Ig,!eg&&this._options.allowTaint===!1&&!isInlineImage(gg)&&!isBlobImage(gg)&&!Cg&&!Ig?[2]:(tg=gg,Cg?[4,this.proxy(tg)]:[3,2]);case 1:tg=ng.sent(),ng.label=2;case 2:return this.context.logger.debug("Added image "+gg.substring(0,256)),[4,new Promise(function(lg,og){var sg=new Image;sg.onload=function(){return lg(sg)},sg.onerror=og,(isInlineBase64Image(tg)||Ig)&&(sg.crossOrigin="anonymous"),sg.src=tg,sg.complete===!0&&setTimeout(function(){return lg(sg)},500),ig._options.imageTimeout>0&&setTimeout(function(){return og("Timed out ("+ig._options.imageTimeout+"ms) loading image")},ig._options.imageTimeout)})];case 3:return[2,ng.sent()]}})})},Ag.prototype.has=function(gg){return typeof this._cache[gg]<"u"},Ag.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},Ag.prototype.proxy=function(gg){var eg=this,Ig=this._options.proxy;if(!Ig)throw new Error("No proxy defined");var Cg=gg.substring(0,256);return new Promise(function(tg,ig){var ng=FEATURES.SUPPORT_RESPONSE_TYPE?"blob":"text",lg=new XMLHttpRequest;lg.onload=function(){if(lg.status===200)if(ng==="text")tg(lg.response);else{var rg=new FileReader;rg.addEventListener("load",function(){return tg(rg.result)},!1),rg.addEventListener("error",function(cg){return ig(cg)},!1),rg.readAsDataURL(lg.response)}else ig("Failed to proxy resource "+Cg+" with status code "+lg.status)},lg.onerror=ig;var og=Ig.indexOf("?")>-1?"&":"?";if(lg.open("GET",""+Ig+og+"url="+encodeURIComponent(gg)+"&responseType="+ng),ng!=="text"&&lg instanceof XMLHttpRequest&&(lg.responseType=ng),eg._options.imageTimeout){var sg=eg._options.imageTimeout;lg.timeout=sg,lg.ontimeout=function(){return ig("Timed out ("+sg+"ms) proxying "+Cg)}}lg.send()})},Ag}(),INLINE_SVG=/^data:image\/svg\+xml/i,INLINE_BASE64=/^data:image\/.*;base64,/i,INLINE_IMG=/^data:image\/.*/i,isRenderable=function(Ag){return FEATURES.SUPPORT_SVG_DRAWING||!isSVG(Ag)},isInlineImage=function(Ag){return INLINE_IMG.test(Ag)},isInlineBase64Image=function(Ag){return INLINE_BASE64.test(Ag)},isBlobImage=function(Ag){return Ag.substr(0,4)==="blob"},isSVG=function(Ag){return Ag.substr(-3).toLowerCase()==="svg"||INLINE_SVG.test(Ag)},Vector=function(){function Ag(gg,eg){this.type=0,this.x=gg,this.y=eg}return Ag.prototype.add=function(gg,eg){return new Ag(this.x+gg,this.y+eg)},Ag}(),lerp=function(Ag,gg,eg){return new Vector(Ag.x+(gg.x-Ag.x)*eg,Ag.y+(gg.y-Ag.y)*eg)},BezierCurve=function(){function Ag(gg,eg,Ig,Cg){this.type=1,this.start=gg,this.startControl=eg,this.endControl=Ig,this.end=Cg}return Ag.prototype.subdivide=function(gg,eg){var Ig=lerp(this.start,this.startControl,gg),Cg=lerp(this.startControl,this.endControl,gg),tg=lerp(this.endControl,this.end,gg),ig=lerp(Ig,Cg,gg),ng=lerp(Cg,tg,gg),lg=lerp(ig,ng,gg);return eg?new Ag(this.start,Ig,ig,lg):new Ag(lg,ng,tg,this.end)},Ag.prototype.add=function(gg,eg){return new Ag(this.start.add(gg,eg),this.startControl.add(gg,eg),this.endControl.add(gg,eg),this.end.add(gg,eg))},Ag.prototype.reverse=function(){return new Ag(this.end,this.endControl,this.startControl,this.start)},Ag}(),isBezierCurve=function(Ag){return Ag.type===1},BoundCurves=function(){function Ag(gg){var eg=gg.styles,Ig=gg.bounds,Cg=getAbsoluteValueForTuple(eg.borderTopLeftRadius,Ig.width,Ig.height),tg=Cg[0],ig=Cg[1],ng=getAbsoluteValueForTuple(eg.borderTopRightRadius,Ig.width,Ig.height),lg=ng[0],og=ng[1],sg=getAbsoluteValueForTuple(eg.borderBottomRightRadius,Ig.width,Ig.height),rg=sg[0],cg=sg[1],ag=getAbsoluteValueForTuple(eg.borderBottomLeftRadius,Ig.width,Ig.height),ug=ag[0],dg=ag[1],hg=[];hg.push((tg+lg)/Ig.width),hg.push((ug+rg)/Ig.width),hg.push((ig+dg)/Ig.height),hg.push((og+cg)/Ig.height);var bg=Math.max.apply(Math,hg);bg>1&&(tg/=bg,ig/=bg,lg/=bg,og/=bg,rg/=bg,cg/=bg,ug/=bg,dg/=bg);var mg=Ig.width-lg,Zg=Ig.height-cg,Bg=Ig.width-rg,Gg=Ig.height-dg,pg=eg.borderTopWidth,fg=eg.borderRightWidth,Vg=eg.borderBottomWidth,Wg=eg.borderLeftWidth,Hg=getAbsoluteValue(eg.paddingTop,gg.bounds.width),Sg=getAbsoluteValue(eg.paddingRight,gg.bounds.width),wg=getAbsoluteValue(eg.paddingBottom,gg.bounds.width),Xg=getAbsoluteValue(eg.paddingLeft,gg.bounds.width);this.topLeftBorderDoubleOuterBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg/3,Ig.top+pg/3,tg-Wg/3,ig-pg/3,CORNER.TOP_LEFT):new Vector(Ig.left+Wg/3,Ig.top+pg/3),this.topRightBorderDoubleOuterBox=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg/3,lg-fg/3,og-pg/3,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg/3,Ig.top+pg/3),this.bottomRightBorderDoubleOuterBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg/3,cg-Vg/3,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg/3,Ig.top+Ig.height-Vg/3),this.bottomLeftBorderDoubleOuterBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg/3,Ig.top+Gg,ug-Wg/3,dg-Vg/3,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg/3,Ig.top+Ig.height-Vg/3),this.topLeftBorderDoubleInnerBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg*2/3,Ig.top+pg*2/3,tg-Wg*2/3,ig-pg*2/3,CORNER.TOP_LEFT):new Vector(Ig.left+Wg*2/3,Ig.top+pg*2/3),this.topRightBorderDoubleInnerBox=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg*2/3,lg-fg*2/3,og-pg*2/3,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg*2/3,Ig.top+pg*2/3),this.bottomRightBorderDoubleInnerBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg*2/3,cg-Vg*2/3,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg*2/3,Ig.top+Ig.height-Vg*2/3),this.bottomLeftBorderDoubleInnerBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg*2/3,Ig.top+Gg,ug-Wg*2/3,dg-Vg*2/3,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg*2/3,Ig.top+Ig.height-Vg*2/3),this.topLeftBorderStroke=tg>0||ig>0?getCurvePoints(Ig.left+Wg/2,Ig.top+pg/2,tg-Wg/2,ig-pg/2,CORNER.TOP_LEFT):new Vector(Ig.left+Wg/2,Ig.top+pg/2),this.topRightBorderStroke=tg>0||ig>0?getCurvePoints(Ig.left+mg,Ig.top+pg/2,lg-fg/2,og-pg/2,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg/2,Ig.top+pg/2),this.bottomRightBorderStroke=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg-fg/2,cg-Vg/2,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg/2,Ig.top+Ig.height-Vg/2),this.bottomLeftBorderStroke=ug>0||dg>0?getCurvePoints(Ig.left+Wg/2,Ig.top+Gg,ug-Wg/2,dg-Vg/2,CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg/2,Ig.top+Ig.height-Vg/2),this.topLeftBorderBox=tg>0||ig>0?getCurvePoints(Ig.left,Ig.top,tg,ig,CORNER.TOP_LEFT):new Vector(Ig.left,Ig.top),this.topRightBorderBox=lg>0||og>0?getCurvePoints(Ig.left+mg,Ig.top,lg,og,CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width,Ig.top),this.bottomRightBorderBox=rg>0||cg>0?getCurvePoints(Ig.left+Bg,Ig.top+Zg,rg,cg,CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width,Ig.top+Ig.height),this.bottomLeftBorderBox=ug>0||dg>0?getCurvePoints(Ig.left,Ig.top+Gg,ug,dg,CORNER.BOTTOM_LEFT):new Vector(Ig.left,Ig.top+Ig.height),this.topLeftPaddingBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg,Ig.top+pg,Math.max(0,tg-Wg),Math.max(0,ig-pg),CORNER.TOP_LEFT):new Vector(Ig.left+Wg,Ig.top+pg),this.topRightPaddingBox=lg>0||og>0?getCurvePoints(Ig.left+Math.min(mg,Ig.width-fg),Ig.top+pg,mg>Ig.width+fg?0:Math.max(0,lg-fg),Math.max(0,og-pg),CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-fg,Ig.top+pg),this.bottomRightPaddingBox=rg>0||cg>0?getCurvePoints(Ig.left+Math.min(Bg,Ig.width-Wg),Ig.top+Math.min(Zg,Ig.height-Vg),Math.max(0,rg-fg),Math.max(0,cg-Vg),CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-fg,Ig.top+Ig.height-Vg),this.bottomLeftPaddingBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg,Ig.top+Math.min(Gg,Ig.height-Vg),Math.max(0,ug-Wg),Math.max(0,dg-Vg),CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg,Ig.top+Ig.height-Vg),this.topLeftContentBox=tg>0||ig>0?getCurvePoints(Ig.left+Wg+Xg,Ig.top+pg+Hg,Math.max(0,tg-(Wg+Xg)),Math.max(0,ig-(pg+Hg)),CORNER.TOP_LEFT):new Vector(Ig.left+Wg+Xg,Ig.top+pg+Hg),this.topRightContentBox=lg>0||og>0?getCurvePoints(Ig.left+Math.min(mg,Ig.width+Wg+Xg),Ig.top+pg+Hg,mg>Ig.width+Wg+Xg?0:lg-Wg+Xg,og-(pg+Hg),CORNER.TOP_RIGHT):new Vector(Ig.left+Ig.width-(fg+Sg),Ig.top+pg+Hg),this.bottomRightContentBox=rg>0||cg>0?getCurvePoints(Ig.left+Math.min(Bg,Ig.width-(Wg+Xg)),Ig.top+Math.min(Zg,Ig.height+pg+Hg),Math.max(0,rg-(fg+Sg)),cg-(Vg+wg),CORNER.BOTTOM_RIGHT):new Vector(Ig.left+Ig.width-(fg+Sg),Ig.top+Ig.height-(Vg+wg)),this.bottomLeftContentBox=ug>0||dg>0?getCurvePoints(Ig.left+Wg+Xg,Ig.top+Gg,Math.max(0,ug-(Wg+Xg)),dg-(Vg+wg),CORNER.BOTTOM_LEFT):new Vector(Ig.left+Wg+Xg,Ig.top+Ig.height-(Vg+wg))}return Ag}(),CORNER;(function(Ag){Ag[Ag.TOP_LEFT=0]="TOP_LEFT",Ag[Ag.TOP_RIGHT=1]="TOP_RIGHT",Ag[Ag.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",Ag[Ag.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(CORNER||(CORNER={}));var getCurvePoints=function(Ag,gg,eg,Ig,Cg){var tg=4*((Math.sqrt(2)-1)/3),ig=eg*tg,ng=Ig*tg,lg=Ag+eg,og=gg+Ig;switch(Cg){case CORNER.TOP_LEFT:return new BezierCurve(new Vector(Ag,og),new Vector(Ag,og-ng),new Vector(lg-ig,gg),new Vector(lg,gg));case CORNER.TOP_RIGHT:return new BezierCurve(new Vector(Ag,gg),new Vector(Ag+ig,gg),new Vector(lg,og-ng),new Vector(lg,og));case CORNER.BOTTOM_RIGHT:return new BezierCurve(new Vector(lg,gg),new Vector(lg,gg+ng),new Vector(Ag+ig,og),new Vector(Ag,og));case CORNER.BOTTOM_LEFT:default:return new BezierCurve(new Vector(lg,og),new Vector(lg-ig,og),new Vector(Ag,gg+ng),new Vector(Ag,gg))}},calculateBorderBoxPath=function(Ag){return[Ag.topLeftBorderBox,Ag.topRightBorderBox,Ag.bottomRightBorderBox,Ag.bottomLeftBorderBox]},calculateContentBoxPath=function(Ag){return[Ag.topLeftContentBox,Ag.topRightContentBox,Ag.bottomRightContentBox,Ag.bottomLeftContentBox]},calculatePaddingBoxPath=function(Ag){return[Ag.topLeftPaddingBox,Ag.topRightPaddingBox,Ag.bottomRightPaddingBox,Ag.bottomLeftPaddingBox]},TransformEffect=function(){function Ag(gg,eg,Ig){this.offsetX=gg,this.offsetY=eg,this.matrix=Ig,this.type=0,this.target=6}return Ag}(),ClipEffect=function(){function Ag(gg,eg){this.path=gg,this.target=eg,this.type=1}return Ag}(),OpacityEffect=function(){function Ag(gg){this.opacity=gg,this.type=2,this.target=6}return Ag}(),isTransformEffect=function(Ag){return Ag.type===0},isClipEffect=function(Ag){return Ag.type===1},isOpacityEffect=function(Ag){return Ag.type===2},equalPath=function(Ag,gg){return Ag.length===gg.length?Ag.some(function(eg,Ig){return eg===gg[Ig]}):!1},transformPath=function(Ag,gg,eg,Ig,Cg){return Ag.map(function(tg,ig){switch(ig){case 0:return tg.add(gg,eg);case 1:return tg.add(gg+Ig,eg);case 2:return tg.add(gg+Ig,eg+Cg);case 3:return tg.add(gg,eg+Cg)}return tg})},StackingContext=function(){function Ag(gg){this.element=gg,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return Ag}(),ElementPaint=function(){function Ag(gg,eg){if(this.container=gg,this.parent=eg,this.effects=[],this.curves=new BoundCurves(this.container),this.container.styles.opacity<1&&this.effects.push(new OpacityEffect(this.container.styles.opacity)),this.container.styles.transform!==null){var Ig=this.container.bounds.left+this.container.styles.transformOrigin[0].number,Cg=this.container.bounds.top+this.container.styles.transformOrigin[1].number,tg=this.container.styles.transform;this.effects.push(new TransformEffect(Ig,Cg,tg))}if(this.container.styles.overflowX!==0){var ig=calculateBorderBoxPath(this.curves),ng=calculatePaddingBoxPath(this.curves);equalPath(ig,ng)?this.effects.push(new ClipEffect(ig,6)):(this.effects.push(new ClipEffect(ig,2)),this.effects.push(new ClipEffect(ng,4)))}}return Ag.prototype.getEffects=function(gg){for(var eg=[2,3].indexOf(this.container.styles.position)===-1,Ig=this.parent,Cg=this.effects.slice(0);Ig;){var tg=Ig.effects.filter(function(lg){return!isClipEffect(lg)});if(eg||Ig.container.styles.position!==0||!Ig.parent){if(Cg.unshift.apply(Cg,tg),eg=[2,3].indexOf(Ig.container.styles.position)===-1,Ig.container.styles.overflowX!==0){var ig=calculateBorderBoxPath(Ig.curves),ng=calculatePaddingBoxPath(Ig.curves);equalPath(ig,ng)||Cg.unshift(new ClipEffect(ng,6))}}else Cg.unshift.apply(Cg,tg);Ig=Ig.parent}return Cg.filter(function(lg){return contains(lg.target,gg)})},Ag}(),parseStackTree=function(Ag,gg,eg,Ig){Ag.container.elements.forEach(function(Cg){var tg=contains(Cg.flags,4),ig=contains(Cg.flags,2),ng=new ElementPaint(Cg,Ag);contains(Cg.styles.display,2048)&&Ig.push(ng);var lg=contains(Cg.flags,8)?[]:Ig;if(tg||ig){var og=tg||Cg.styles.isPositioned()?eg:gg,sg=new StackingContext(ng);if(Cg.styles.isPositioned()||Cg.styles.opacity<1||Cg.styles.isTransformed()){var rg=Cg.styles.zIndex.order;if(rg<0){var cg=0;og.negativeZIndex.some(function(ug,dg){return rg>ug.element.container.styles.zIndex.order?(cg=dg,!1):cg>0}),og.negativeZIndex.splice(cg,0,sg)}else if(rg>0){var ag=0;og.positiveZIndex.some(function(ug,dg){return rg>=ug.element.container.styles.zIndex.order?(ag=dg+1,!1):ag>0}),og.positiveZIndex.splice(ag,0,sg)}else og.zeroOrAutoZIndexOrTransformedOrOpacity.push(sg)}else Cg.styles.isFloating()?og.nonPositionedFloats.push(sg):og.nonPositionedInlineLevel.push(sg);parseStackTree(ng,sg,tg?sg:eg,lg)}else Cg.styles.isInlineLevel()?gg.inlineLevel.push(ng):gg.nonInlineLevel.push(ng),parseStackTree(ng,gg,eg,lg);contains(Cg.flags,8)&&processListItems(Cg,lg)})},processListItems=function(Ag,gg){for(var eg=Ag instanceof OLElementContainer?Ag.start:1,Ig=Ag instanceof OLElementContainer?Ag.reversed:!1,Cg=0;Cg<gg.length;Cg++){var tg=gg[Cg];tg.container instanceof LIElementContainer&&typeof tg.container.value=="number"&&tg.container.value!==0&&(eg=tg.container.value),tg.listValue=createCounterText(eg,tg.container.styles.listStyleType,!0),eg+=Ig?-1:1}},parseStackingContexts=function(Ag){var gg=new ElementPaint(Ag,null),eg=new StackingContext(gg),Ig=[];return parseStackTree(gg,eg,eg,Ig),processListItems(gg.container,Ig),eg},parsePathForBorder=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderBox,Ag.topLeftPaddingBox,Ag.topRightBorderBox,Ag.topRightPaddingBox);case 1:return createPathFromCurves(Ag.topRightBorderBox,Ag.topRightPaddingBox,Ag.bottomRightBorderBox,Ag.bottomRightPaddingBox);case 2:return createPathFromCurves(Ag.bottomRightBorderBox,Ag.bottomRightPaddingBox,Ag.bottomLeftBorderBox,Ag.bottomLeftPaddingBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderBox,Ag.bottomLeftPaddingBox,Ag.topLeftBorderBox,Ag.topLeftPaddingBox)}},parsePathForBorderDoubleOuter=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderBox,Ag.topLeftBorderDoubleOuterBox,Ag.topRightBorderBox,Ag.topRightBorderDoubleOuterBox);case 1:return createPathFromCurves(Ag.topRightBorderBox,Ag.topRightBorderDoubleOuterBox,Ag.bottomRightBorderBox,Ag.bottomRightBorderDoubleOuterBox);case 2:return createPathFromCurves(Ag.bottomRightBorderBox,Ag.bottomRightBorderDoubleOuterBox,Ag.bottomLeftBorderBox,Ag.bottomLeftBorderDoubleOuterBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderBox,Ag.bottomLeftBorderDoubleOuterBox,Ag.topLeftBorderBox,Ag.topLeftBorderDoubleOuterBox)}},parsePathForBorderDoubleInner=function(Ag,gg){switch(gg){case 0:return createPathFromCurves(Ag.topLeftBorderDoubleInnerBox,Ag.topLeftPaddingBox,Ag.topRightBorderDoubleInnerBox,Ag.topRightPaddingBox);case 1:return createPathFromCurves(Ag.topRightBorderDoubleInnerBox,Ag.topRightPaddingBox,Ag.bottomRightBorderDoubleInnerBox,Ag.bottomRightPaddingBox);case 2:return createPathFromCurves(Ag.bottomRightBorderDoubleInnerBox,Ag.bottomRightPaddingBox,Ag.bottomLeftBorderDoubleInnerBox,Ag.bottomLeftPaddingBox);case 3:default:return createPathFromCurves(Ag.bottomLeftBorderDoubleInnerBox,Ag.bottomLeftPaddingBox,Ag.topLeftBorderDoubleInnerBox,Ag.topLeftPaddingBox)}},parsePathForBorderStroke=function(Ag,gg){switch(gg){case 0:return createStrokePathFromCurves(Ag.topLeftBorderStroke,Ag.topRightBorderStroke);case 1:return createStrokePathFromCurves(Ag.topRightBorderStroke,Ag.bottomRightBorderStroke);case 2:return createStrokePathFromCurves(Ag.bottomRightBorderStroke,Ag.bottomLeftBorderStroke);case 3:default:return createStrokePathFromCurves(Ag.bottomLeftBorderStroke,Ag.topLeftBorderStroke)}},createStrokePathFromCurves=function(Ag,gg){var eg=[];return isBezierCurve(Ag)?eg.push(Ag.subdivide(.5,!1)):eg.push(Ag),isBezierCurve(gg)?eg.push(gg.subdivide(.5,!0)):eg.push(gg),eg},createPathFromCurves=function(Ag,gg,eg,Ig){var Cg=[];return isBezierCurve(Ag)?Cg.push(Ag.subdivide(.5,!1)):Cg.push(Ag),isBezierCurve(eg)?Cg.push(eg.subdivide(.5,!0)):Cg.push(eg),isBezierCurve(Ig)?Cg.push(Ig.subdivide(.5,!0).reverse()):Cg.push(Ig),isBezierCurve(gg)?Cg.push(gg.subdivide(.5,!1).reverse()):Cg.push(gg),Cg},paddingBox=function(Ag){var gg=Ag.bounds,eg=Ag.styles;return gg.add(eg.borderLeftWidth,eg.borderTopWidth,-(eg.borderRightWidth+eg.borderLeftWidth),-(eg.borderTopWidth+eg.borderBottomWidth))},contentBox=function(Ag){var gg=Ag.styles,eg=Ag.bounds,Ig=getAbsoluteValue(gg.paddingLeft,eg.width),Cg=getAbsoluteValue(gg.paddingRight,eg.width),tg=getAbsoluteValue(gg.paddingTop,eg.width),ig=getAbsoluteValue(gg.paddingBottom,eg.width);return eg.add(Ig+gg.borderLeftWidth,tg+gg.borderTopWidth,-(gg.borderRightWidth+gg.borderLeftWidth+Ig+Cg),-(gg.borderTopWidth+gg.borderBottomWidth+tg+ig))},calculateBackgroundPositioningArea=function(Ag,gg){return Ag===0?gg.bounds:Ag===2?contentBox(gg):paddingBox(gg)},calculateBackgroundPaintingArea=function(Ag,gg){return Ag===0?gg.bounds:Ag===2?contentBox(gg):paddingBox(gg)},calculateBackgroundRendering=function(Ag,gg,eg){var Ig=calculateBackgroundPositioningArea(getBackgroundValueForIndex(Ag.styles.backgroundOrigin,gg),Ag),Cg=calculateBackgroundPaintingArea(getBackgroundValueForIndex(Ag.styles.backgroundClip,gg),Ag),tg=calculateBackgroundSize(getBackgroundValueForIndex(Ag.styles.backgroundSize,gg),eg,Ig),ig=tg[0],ng=tg[1],lg=getAbsoluteValueForTuple(getBackgroundValueForIndex(Ag.styles.backgroundPosition,gg),Ig.width-ig,Ig.height-ng),og=calculateBackgroundRepeatPath(getBackgroundValueForIndex(Ag.styles.backgroundRepeat,gg),lg,tg,Ig,Cg),sg=Math.round(Ig.left+lg[0]),rg=Math.round(Ig.top+lg[1]);return[og,sg,rg,ig,ng]},isAuto=function(Ag){return isIdentToken(Ag)&&Ag.value===BACKGROUND_SIZE.AUTO},hasIntrinsicValue=function(Ag){return typeof Ag=="number"},calculateBackgroundSize=function(Ag,gg,eg){var Ig=gg[0],Cg=gg[1],tg=gg[2],ig=Ag[0],ng=Ag[1];if(!ig)return[0,0];if(isLengthPercentage(ig)&&ng&&isLengthPercentage(ng))return[getAbsoluteValue(ig,eg.width),getAbsoluteValue(ng,eg.height)];var lg=hasIntrinsicValue(tg);if(isIdentToken(ig)&&(ig.value===BACKGROUND_SIZE.CONTAIN||ig.value===BACKGROUND_SIZE.COVER)){if(hasIntrinsicValue(tg)){var og=eg.width/eg.height;return og<tg!=(ig.value===BACKGROUND_SIZE.COVER)?[eg.width,eg.width/tg]:[eg.height*tg,eg.height]}return[eg.width,eg.height]}var sg=hasIntrinsicValue(Ig),rg=hasIntrinsicValue(Cg),cg=sg||rg;if(isAuto(ig)&&(!ng||isAuto(ng))){if(sg&&rg)return[Ig,Cg];if(!lg&&!cg)return[eg.width,eg.height];if(cg&&lg){var ag=sg?Ig:Cg*tg,ug=rg?Cg:Ig/tg;return[ag,ug]}var dg=sg?Ig:eg.width,hg=rg?Cg:eg.height;return[dg,hg]}if(lg){var bg=0,mg=0;return isLengthPercentage(ig)?bg=getAbsoluteValue(ig,eg.width):isLengthPercentage(ng)&&(mg=getAbsoluteValue(ng,eg.height)),isAuto(ig)?bg=mg*tg:(!ng||isAuto(ng))&&(mg=bg/tg),[bg,mg]}var Zg=null,Bg=null;if(isLengthPercentage(ig)?Zg=getAbsoluteValue(ig,eg.width):ng&&isLengthPercentage(ng)&&(Bg=getAbsoluteValue(ng,eg.height)),Zg!==null&&(!ng||isAuto(ng))&&(Bg=sg&&rg?Zg/Ig*Cg:eg.height),Bg!==null&&isAuto(ig)&&(Zg=sg&&rg?Bg/Cg*Ig:eg.width),Zg!==null&&Bg!==null)return[Zg,Bg];throw new Error("Unable to calculate background-size for element")},getBackgroundValueForIndex=function(Ag,gg){var eg=Ag[gg];return typeof eg>"u"?Ag[0]:eg},calculateBackgroundRepeatPath=function(Ag,gg,eg,Ig,Cg){var tg=gg[0],ig=gg[1],ng=eg[0],lg=eg[1];switch(Ag){case 2:return[new Vector(Math.round(Ig.left),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+Ig.width),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+Ig.width),Math.round(lg+Ig.top+ig)),new Vector(Math.round(Ig.left),Math.round(lg+Ig.top+ig))];case 3:return[new Vector(Math.round(Ig.left+tg),Math.round(Ig.top)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.height+Ig.top)),new Vector(Math.round(Ig.left+tg),Math.round(Ig.height+Ig.top))];case 1:return[new Vector(Math.round(Ig.left+tg),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top+ig)),new Vector(Math.round(Ig.left+tg+ng),Math.round(Ig.top+ig+lg)),new Vector(Math.round(Ig.left+tg),Math.round(Ig.top+ig+lg))];default:return[new Vector(Math.round(Cg.left),Math.round(Cg.top)),new Vector(Math.round(Cg.left+Cg.width),Math.round(Cg.top)),new Vector(Math.round(Cg.left+Cg.width),Math.round(Cg.height+Cg.top)),new Vector(Math.round(Cg.left),Math.round(Cg.height+Cg.top))]}},SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",SAMPLE_TEXT="Hidden Text",FontMetrics=function(){function Ag(gg){this._data={},this._document=gg}return Ag.prototype.parseMetrics=function(gg,eg){var Ig=this._document.createElement("div"),Cg=this._document.createElement("img"),tg=this._document.createElement("span"),ig=this._document.body;Ig.style.visibility="hidden",Ig.style.fontFamily=gg,Ig.style.fontSize=eg,Ig.style.margin="0",Ig.style.padding="0",Ig.style.whiteSpace="nowrap",ig.appendChild(Ig),Cg.src=SMALL_IMAGE,Cg.width=1,Cg.height=1,Cg.style.margin="0",Cg.style.padding="0",Cg.style.verticalAlign="baseline",tg.style.fontFamily=gg,tg.style.fontSize=eg,tg.style.margin="0",tg.style.padding="0",tg.appendChild(this._document.createTextNode(SAMPLE_TEXT)),Ig.appendChild(tg),Ig.appendChild(Cg);var ng=Cg.offsetTop-tg.offsetTop+2;Ig.removeChild(tg),Ig.appendChild(this._document.createTextNode(SAMPLE_TEXT)),Ig.style.lineHeight="normal",Cg.style.verticalAlign="super";var lg=Cg.offsetTop-Ig.offsetTop+2;return ig.removeChild(Ig),{baseline:ng,middle:lg}},Ag.prototype.getMetrics=function(gg,eg){var Ig=gg+" "+eg;return typeof this._data[Ig]>"u"&&(this._data[Ig]=this.parseMetrics(gg,eg)),this._data[Ig]},Ag}(),Renderer=function(){function Ag(gg,eg){this.context=gg,this.options=eg}return Ag}(),MASK_OFFSET=1e4,CanvasRenderer=function(Ag){__extends(gg,Ag);function gg(eg,Ig){var Cg=Ag.call(this,eg,Ig)||this;return Cg._activeEffects=[],Cg.canvas=Ig.canvas?Ig.canvas:document.createElement("canvas"),Cg.ctx=Cg.canvas.getContext("2d"),Ig.canvas||(Cg.canvas.width=Math.floor(Ig.width*Ig.scale),Cg.canvas.height=Math.floor(Ig.height*Ig.scale),Cg.canvas.style.width=Ig.width+"px",Cg.canvas.style.height=Ig.height+"px"),Cg.fontMetrics=new FontMetrics(document),Cg.ctx.scale(Cg.options.scale,Cg.options.scale),Cg.ctx.translate(-Ig.x,-Ig.y),Cg.ctx.textBaseline="bottom",Cg._activeEffects=[],Cg.context.logger.debug("Canvas renderer initialized ("+Ig.width+"x"+Ig.height+") with scale "+Ig.scale),Cg}return gg.prototype.applyEffects=function(eg){for(var Ig=this;this._activeEffects.length;)this.popEffect();eg.forEach(function(Cg){return Ig.applyEffect(Cg)})},gg.prototype.applyEffect=function(eg){this.ctx.save(),isOpacityEffect(eg)&&(this.ctx.globalAlpha=eg.opacity),isTransformEffect(eg)&&(this.ctx.translate(eg.offsetX,eg.offsetY),this.ctx.transform(eg.matrix[0],eg.matrix[1],eg.matrix[2],eg.matrix[3],eg.matrix[4],eg.matrix[5]),this.ctx.translate(-eg.offsetX,-eg.offsetY)),isClipEffect(eg)&&(this.path(eg.path),this.ctx.clip()),this._activeEffects.push(eg)},gg.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},gg.prototype.renderStack=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig;return __generator(this,function(Cg){switch(Cg.label){case 0:return Ig=eg.element.container.styles,Ig.isVisible()?[4,this.renderStackContent(eg)]:[3,2];case 1:Cg.sent(),Cg.label=2;case 2:return[2]}})})},gg.prototype.renderNode=function(eg){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(Ig){switch(Ig.label){case 0:if(contains(eg.container.flags,16))debugger;return eg.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(eg)]:[3,3];case 1:return Ig.sent(),[4,this.renderNodeContent(eg)];case 2:Ig.sent(),Ig.label=3;case 3:return[2]}})})},gg.prototype.renderTextWithLetterSpacing=function(eg,Ig,Cg){var tg=this;if(Ig===0)this.ctx.fillText(eg.text,eg.bounds.left,eg.bounds.top+Cg);else{var ig=segmentGraphemes(eg.text);ig.reduce(function(ng,lg){return tg.ctx.fillText(lg,ng,eg.bounds.top+Cg),ng+tg.ctx.measureText(lg).width},eg.bounds.left)}},gg.prototype.createFontStyle=function(eg){var Ig=eg.fontVariant.filter(function(ig){return ig==="normal"||ig==="small-caps"}).join(""),Cg=fixIOSSystemFonts(eg.fontFamily).join(", "),tg=isDimensionToken(eg.fontSize)?""+eg.fontSize.number+eg.fontSize.unit:eg.fontSize.number+"px";return[[eg.fontStyle,Ig,eg.fontWeight,tg,Cg].join(" "),Cg,tg]},gg.prototype.renderTextNode=function(eg,Ig){return __awaiter(this,void 0,void 0,function(){var Cg,tg,ig,ng,lg,og,sg,rg,cg=this;return __generator(this,function(ag){return Cg=this.createFontStyle(Ig),tg=Cg[0],ig=Cg[1],ng=Cg[2],this.ctx.font=tg,this.ctx.direction=Ig.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",lg=this.fontMetrics.getMetrics(ig,ng),og=lg.baseline,sg=lg.middle,rg=Ig.paintOrder,eg.textBounds.forEach(function(ug){rg.forEach(function(dg){switch(dg){case 0:cg.ctx.fillStyle=asString(Ig.color),cg.renderTextWithLetterSpacing(ug,Ig.letterSpacing,og);var hg=Ig.textShadow;hg.length&&ug.text.trim().length&&(hg.slice(0).reverse().forEach(function(bg){cg.ctx.shadowColor=asString(bg.color),cg.ctx.shadowOffsetX=bg.offsetX.number*cg.options.scale,cg.ctx.shadowOffsetY=bg.offsetY.number*cg.options.scale,cg.ctx.shadowBlur=bg.blur.number,cg.renderTextWithLetterSpacing(ug,Ig.letterSpacing,og)}),cg.ctx.shadowColor="",cg.ctx.shadowOffsetX=0,cg.ctx.shadowOffsetY=0,cg.ctx.shadowBlur=0),Ig.textDecorationLine.length&&(cg.ctx.fillStyle=asString(Ig.textDecorationColor||Ig.color),Ig.textDecorationLine.forEach(function(bg){switch(bg){case 1:cg.ctx.fillRect(ug.bounds.left,Math.round(ug.bounds.top+og),ug.bounds.width,1);break;case 2:cg.ctx.fillRect(ug.bounds.left,Math.round(ug.bounds.top),ug.bounds.width,1);break;case 3:cg.ctx.fillRect(ug.bounds.left,Math.ceil(ug.bounds.top+sg),ug.bounds.width,1);break}}));break;case 1:Ig.webkitTextStrokeWidth&&ug.text.trim().length&&(cg.ctx.strokeStyle=asString(Ig.webkitTextStrokeColor),cg.ctx.lineWidth=Ig.webkitTextStrokeWidth,cg.ctx.lineJoin=window.chrome?"miter":"round",cg.ctx.strokeText(ug.text,ug.bounds.left,ug.bounds.top+og)),cg.ctx.strokeStyle="",cg.ctx.lineWidth=0,cg.ctx.lineJoin="miter";break}})}),[2]})})},gg.prototype.renderReplacedElement=function(eg,Ig,Cg){if(Cg&&eg.intrinsicWidth>0&&eg.intrinsicHeight>0){var tg=contentBox(eg),ig=calculatePaddingBoxPath(Ig);this.path(ig),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(Cg,0,0,eg.intrinsicWidth,eg.intrinsicHeight,tg.left,tg.top,tg.width,tg.height),this.ctx.restore()}},gg.prototype.renderNodeContent=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg,mg,mg,og,sg,rg,cg,Bg,ag,ug,Gg,dg,hg,bg,mg,Zg,Bg,Gg;return __generator(this,function(pg){switch(pg.label){case 0:this.applyEffects(eg.getEffects(4)),Ig=eg.container,Cg=eg.curves,tg=Ig.styles,ig=0,ng=Ig.textNodes,pg.label=1;case 1:return ig<ng.length?(lg=ng[ig],[4,this.renderTextNode(lg,tg)]):[3,4];case 2:pg.sent(),pg.label=3;case 3:return ig++,[3,1];case 4:if(!(Ig instanceof ImageElementContainer))return[3,8];pg.label=5;case 5:return pg.trys.push([5,7,,8]),[4,this.context.cache.match(Ig.src)];case 6:return mg=pg.sent(),this.renderReplacedElement(Ig,Cg,mg),[3,8];case 7:return pg.sent(),this.context.logger.error("Error loading image "+Ig.src),[3,8];case 8:if(Ig instanceof CanvasElementContainer&&this.renderReplacedElement(Ig,Cg,Ig.canvas),!(Ig instanceof SVGElementContainer))return[3,12];pg.label=9;case 9:return pg.trys.push([9,11,,12]),[4,this.context.cache.match(Ig.svg)];case 10:return mg=pg.sent(),this.renderReplacedElement(Ig,Cg,mg),[3,12];case 11:return pg.sent(),this.context.logger.error("Error loading svg "+Ig.svg.substring(0,255)),[3,12];case 12:return Ig instanceof IFrameElementContainer&&Ig.tree?(og=new gg(this.context,{scale:this.options.scale,backgroundColor:Ig.backgroundColor,x:0,y:0,width:Ig.width,height:Ig.height}),[4,og.render(Ig.tree)]):[3,14];case 13:sg=pg.sent(),Ig.width&&Ig.height&&this.ctx.drawImage(sg,0,0,Ig.width,Ig.height,Ig.bounds.left,Ig.bounds.top,Ig.bounds.width,Ig.bounds.height),pg.label=14;case 14:if(Ig instanceof InputElementContainer&&(rg=Math.min(Ig.bounds.width,Ig.bounds.height),Ig.type===CHECKBOX?Ig.checked&&(this.ctx.save(),this.path([new Vector(Ig.bounds.left+rg*.39363,Ig.bounds.top+rg*.79),new Vector(Ig.bounds.left+rg*.16,Ig.bounds.top+rg*.5549),new Vector(Ig.bounds.left+rg*.27347,Ig.bounds.top+rg*.44071),new Vector(Ig.bounds.left+rg*.39694,Ig.bounds.top+rg*.5649),new Vector(Ig.bounds.left+rg*.72983,Ig.bounds.top+rg*.23),new Vector(Ig.bounds.left+rg*.84,Ig.bounds.top+rg*.34085),new Vector(Ig.bounds.left+rg*.39363,Ig.bounds.top+rg*.79)]),this.ctx.fillStyle=asString(INPUT_COLOR),this.ctx.fill(),this.ctx.restore()):Ig.type===RADIO&&Ig.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(Ig.bounds.left+rg/2,Ig.bounds.top+rg/2,rg/4,0,Math.PI*2,!0),this.ctx.fillStyle=asString(INPUT_COLOR),this.ctx.fill(),this.ctx.restore())),isTextInputElement(Ig)&&Ig.value.length){switch(cg=this.createFontStyle(tg),Bg=cg[0],ag=cg[1],ug=this.fontMetrics.getMetrics(Bg,ag).baseline,this.ctx.font=Bg,this.ctx.fillStyle=asString(tg.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=canvasTextAlign(Ig.styles.textAlign),Gg=contentBox(Ig),dg=0,Ig.styles.textAlign){case 1:dg+=Gg.width/2;break;case 2:dg+=Gg.width;break}hg=Gg.add(dg,0,0,-Gg.height/2+1),this.ctx.save(),this.path([new Vector(Gg.left,Gg.top),new Vector(Gg.left+Gg.width,Gg.top),new Vector(Gg.left+Gg.width,Gg.top+Gg.height),new Vector(Gg.left,Gg.top+Gg.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new TextBounds(Ig.value,hg),tg.letterSpacing,ug),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!contains(Ig.styles.display,2048))return[3,20];if(Ig.styles.listStyleImage===null)return[3,19];if(bg=Ig.styles.listStyleImage,bg.type!==0)return[3,18];mg=void 0,Zg=bg.url,pg.label=15;case 15:return pg.trys.push([15,17,,18]),[4,this.context.cache.match(Zg)];case 16:return mg=pg.sent(),this.ctx.drawImage(mg,Ig.bounds.left-(mg.width+10),Ig.bounds.top),[3,18];case 17:return pg.sent(),this.context.logger.error("Error loading list-style-image "+Zg),[3,18];case 18:return[3,20];case 19:eg.listValue&&Ig.styles.listStyleType!==-1&&(Bg=this.createFontStyle(tg)[0],this.ctx.font=Bg,this.ctx.fillStyle=asString(tg.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",Gg=new Bounds(Ig.bounds.left,Ig.bounds.top+getAbsoluteValue(Ig.styles.paddingTop,Ig.bounds.width),Ig.bounds.width,computeLineHeight(tg.lineHeight,tg.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new TextBounds(eg.listValue,Gg),tg.letterSpacing,computeLineHeight(tg.lineHeight,tg.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),pg.label=20;case 20:return[2]}})})},gg.prototype.renderStackContent=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,bg,tg,ig,bg,ng,lg,bg,og,sg,bg,rg,cg,bg,ag,ug,bg,dg,hg,bg;return __generator(this,function(mg){switch(mg.label){case 0:if(contains(eg.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(eg.element)];case 1:mg.sent(),Ig=0,Cg=eg.negativeZIndex,mg.label=2;case 2:return Ig<Cg.length?(bg=Cg[Ig],[4,this.renderStack(bg)]):[3,5];case 3:mg.sent(),mg.label=4;case 4:return Ig++,[3,2];case 5:return[4,this.renderNodeContent(eg.element)];case 6:mg.sent(),tg=0,ig=eg.nonInlineLevel,mg.label=7;case 7:return tg<ig.length?(bg=ig[tg],[4,this.renderNode(bg)]):[3,10];case 8:mg.sent(),mg.label=9;case 9:return tg++,[3,7];case 10:ng=0,lg=eg.nonPositionedFloats,mg.label=11;case 11:return ng<lg.length?(bg=lg[ng],[4,this.renderStack(bg)]):[3,14];case 12:mg.sent(),mg.label=13;case 13:return ng++,[3,11];case 14:og=0,sg=eg.nonPositionedInlineLevel,mg.label=15;case 15:return og<sg.length?(bg=sg[og],[4,this.renderStack(bg)]):[3,18];case 16:mg.sent(),mg.label=17;case 17:return og++,[3,15];case 18:rg=0,cg=eg.inlineLevel,mg.label=19;case 19:return rg<cg.length?(bg=cg[rg],[4,this.renderNode(bg)]):[3,22];case 20:mg.sent(),mg.label=21;case 21:return rg++,[3,19];case 22:ag=0,ug=eg.zeroOrAutoZIndexOrTransformedOrOpacity,mg.label=23;case 23:return ag<ug.length?(bg=ug[ag],[4,this.renderStack(bg)]):[3,26];case 24:mg.sent(),mg.label=25;case 25:return ag++,[3,23];case 26:dg=0,hg=eg.positiveZIndex,mg.label=27;case 27:return dg<hg.length?(bg=hg[dg],[4,this.renderStack(bg)]):[3,30];case 28:mg.sent(),mg.label=29;case 29:return dg++,[3,27];case 30:return[2]}})})},gg.prototype.mask=function(eg){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(eg.slice(0).reverse()),this.ctx.closePath()},gg.prototype.path=function(eg){this.ctx.beginPath(),this.formatPath(eg),this.ctx.closePath()},gg.prototype.formatPath=function(eg){var Ig=this;eg.forEach(function(Cg,tg){var ig=isBezierCurve(Cg)?Cg.start:Cg;tg===0?Ig.ctx.moveTo(ig.x,ig.y):Ig.ctx.lineTo(ig.x,ig.y),isBezierCurve(Cg)&&Ig.ctx.bezierCurveTo(Cg.startControl.x,Cg.startControl.y,Cg.endControl.x,Cg.endControl.y,Cg.end.x,Cg.end.y)})},gg.prototype.renderRepeat=function(eg,Ig,Cg,tg){this.path(eg),this.ctx.fillStyle=Ig,this.ctx.translate(Cg,tg),this.ctx.fill(),this.ctx.translate(-Cg,-tg)},gg.prototype.resizeImage=function(eg,Ig,Cg){var tg;if(eg.width===Ig&&eg.height===Cg)return eg;var ig=(tg=this.canvas.ownerDocument)!==null&&tg!==void 0?tg:document,ng=ig.createElement("canvas");ng.width=Math.max(1,Ig),ng.height=Math.max(1,Cg);var lg=ng.getContext("2d");return lg.drawImage(eg,0,0,eg.width,eg.height,0,0,Ig,Cg),ng},gg.prototype.renderBackgroundImage=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg;return __generator(this,function(og){switch(og.label){case 0:Ig=eg.styles.backgroundImage.length-1,Cg=function(sg){var rg,cg,ag,Hg,Ng,Yg,Xg,vg,Vg,ug,Hg,Ng,Yg,Xg,vg,dg,hg,bg,mg,Zg,Bg,Gg,pg,fg,Vg,Wg,Hg,Sg,wg,Xg,vg,yg,Ng,Yg,Kg,Jg,Ug,Qg,xg,Tg,Mg,Eg;return __generator(this,function(Og){switch(Og.label){case 0:if(sg.type!==0)return[3,5];rg=void 0,cg=sg.url,Og.label=1;case 1:return Og.trys.push([1,3,,4]),[4,tg.context.cache.match(cg)];case 2:return rg=Og.sent(),[3,4];case 3:return Og.sent(),tg.context.logger.error("Error loading background-image "+cg),[3,4];case 4:return rg&&(ag=calculateBackgroundRendering(eg,Ig,[rg.width,rg.height,rg.width/rg.height]),Hg=ag[0],Ng=ag[1],Yg=ag[2],Xg=ag[3],vg=ag[4],Vg=tg.ctx.createPattern(tg.resizeImage(rg,Xg,vg),"repeat"),tg.renderRepeat(Hg,Vg,Ng,Yg)),[3,6];case 5:isLinearGradient(sg)?(ug=calculateBackgroundRendering(eg,Ig,[null,null,null]),Hg=ug[0],Ng=ug[1],Yg=ug[2],Xg=ug[3],vg=ug[4],dg=calculateGradientDirection(sg.angle,Xg,vg),hg=dg[0],bg=dg[1],mg=dg[2],Zg=dg[3],Bg=dg[4],Gg=document.createElement("canvas"),Gg.width=Xg,Gg.height=vg,pg=Gg.getContext("2d"),fg=pg.createLinearGradient(bg,Zg,mg,Bg),processColorStops(sg.stops,hg).forEach(function(gA){return fg.addColorStop(gA.stop,asString(gA.color))}),pg.fillStyle=fg,pg.fillRect(0,0,Xg,vg),Xg>0&&vg>0&&(Vg=tg.ctx.createPattern(Gg,"repeat"),tg.renderRepeat(Hg,Vg,Ng,Yg))):isRadialGradient(sg)&&(Wg=calculateBackgroundRendering(eg,Ig,[null,null,null]),Hg=Wg[0],Sg=Wg[1],wg=Wg[2],Xg=Wg[3],vg=Wg[4],yg=sg.position.length===0?[FIFTY_PERCENT]:sg.position,Ng=getAbsoluteValue(yg[0],Xg),Yg=getAbsoluteValue(yg[yg.length-1],vg),Kg=calculateRadius(sg,Ng,Yg,Xg,vg),Jg=Kg[0],Ug=Kg[1],Jg>0&&Ug>0&&(Qg=tg.ctx.createRadialGradient(Sg+Ng,wg+Yg,0,Sg+Ng,wg+Yg,Jg),processColorStops(sg.stops,Jg*2).forEach(function(gA){return Qg.addColorStop(gA.stop,asString(gA.color))}),tg.path(Hg),tg.ctx.fillStyle=Qg,Jg!==Ug?(xg=eg.bounds.left+.5*eg.bounds.width,Tg=eg.bounds.top+.5*eg.bounds.height,Mg=Ug/Jg,Eg=1/Mg,tg.ctx.save(),tg.ctx.translate(xg,Tg),tg.ctx.transform(1,0,0,Mg,0,0),tg.ctx.translate(-xg,-Tg),tg.ctx.fillRect(Sg,Eg*(wg-Tg)+Tg,Xg,vg*Eg),tg.ctx.restore()):tg.ctx.fill())),Og.label=6;case 6:return Ig--,[2]}})},tg=this,ig=0,ng=eg.styles.backgroundImage.slice(0).reverse(),og.label=1;case 1:return ig<ng.length?(lg=ng[ig],[5,Cg(lg)]):[3,4];case 2:og.sent(),og.label=3;case 3:return ig++,[3,1];case 4:return[2]}})})},gg.prototype.renderSolidBorder=function(eg,Ig,Cg){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(tg){return this.path(parsePathForBorder(Cg,Ig)),this.ctx.fillStyle=asString(eg),this.ctx.fill(),[2]})})},gg.prototype.renderDoubleBorder=function(eg,Ig,Cg,tg){return __awaiter(this,void 0,void 0,function(){var ig,ng;return __generator(this,function(lg){switch(lg.label){case 0:return Ig<3?[4,this.renderSolidBorder(eg,Cg,tg)]:[3,2];case 1:return lg.sent(),[2];case 2:return ig=parsePathForBorderDoubleOuter(tg,Cg),this.path(ig),this.ctx.fillStyle=asString(eg),this.ctx.fill(),ng=parsePathForBorderDoubleInner(tg,Cg),this.path(ng),this.ctx.fill(),[2]}})})},gg.prototype.renderNodeBackgroundAndBorders=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg,tg,ig,ng,lg,og,sg,rg=this;return __generator(this,function(cg){switch(cg.label){case 0:return this.applyEffects(eg.getEffects(2)),Ig=eg.container.styles,Cg=!isTransparent(Ig.backgroundColor)||Ig.backgroundImage.length,tg=[{style:Ig.borderTopStyle,color:Ig.borderTopColor,width:Ig.borderTopWidth},{style:Ig.borderRightStyle,color:Ig.borderRightColor,width:Ig.borderRightWidth},{style:Ig.borderBottomStyle,color:Ig.borderBottomColor,width:Ig.borderBottomWidth},{style:Ig.borderLeftStyle,color:Ig.borderLeftColor,width:Ig.borderLeftWidth}],ig=calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(Ig.backgroundClip,0),eg.curves),Cg||Ig.boxShadow.length?(this.ctx.save(),this.path(ig),this.ctx.clip(),isTransparent(Ig.backgroundColor)||(this.ctx.fillStyle=asString(Ig.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(eg.container)]):[3,2];case 1:cg.sent(),this.ctx.restore(),Ig.boxShadow.slice(0).reverse().forEach(function(ag){rg.ctx.save();var ug=calculateBorderBoxPath(eg.curves),dg=ag.inset?0:MASK_OFFSET,hg=transformPath(ug,-dg+(ag.inset?1:-1)*ag.spread.number,(ag.inset?1:-1)*ag.spread.number,ag.spread.number*(ag.inset?-2:2),ag.spread.number*(ag.inset?-2:2));ag.inset?(rg.path(ug),rg.ctx.clip(),rg.mask(hg)):(rg.mask(ug),rg.ctx.clip(),rg.path(hg)),rg.ctx.shadowOffsetX=ag.offsetX.number+dg,rg.ctx.shadowOffsetY=ag.offsetY.number,rg.ctx.shadowColor=asString(ag.color),rg.ctx.shadowBlur=ag.blur.number,rg.ctx.fillStyle=ag.inset?asString(ag.color):"rgba(0,0,0,1)",rg.ctx.fill(),rg.ctx.restore()}),cg.label=2;case 2:ng=0,lg=0,og=tg,cg.label=3;case 3:return lg<og.length?(sg=og[lg],sg.style!==0&&!isTransparent(sg.color)&&sg.width>0?sg.style!==2?[3,5]:[4,this.renderDashedDottedBorder(sg.color,sg.width,ng,eg.curves,2)]:[3,11]):[3,13];case 4:return cg.sent(),[3,11];case 5:return sg.style!==3?[3,7]:[4,this.renderDashedDottedBorder(sg.color,sg.width,ng,eg.curves,3)];case 6:return cg.sent(),[3,11];case 7:return sg.style!==4?[3,9]:[4,this.renderDoubleBorder(sg.color,sg.width,ng,eg.curves)];case 8:return cg.sent(),[3,11];case 9:return[4,this.renderSolidBorder(sg.color,ng,eg.curves)];case 10:cg.sent(),cg.label=11;case 11:ng++,cg.label=12;case 12:return lg++,[3,3];case 13:return[2]}})})},gg.prototype.renderDashedDottedBorder=function(eg,Ig,Cg,tg,ig){return __awaiter(this,void 0,void 0,function(){var ng,lg,og,sg,rg,cg,ag,ug,dg,hg,bg,mg,Zg,Bg,Gg,pg,Gg,pg;return __generator(this,function(fg){return this.ctx.save(),ng=parsePathForBorderStroke(tg,Cg),lg=parsePathForBorder(tg,Cg),ig===2&&(this.path(lg),this.ctx.clip()),isBezierCurve(lg[0])?(og=lg[0].start.x,sg=lg[0].start.y):(og=lg[0].x,sg=lg[0].y),isBezierCurve(lg[1])?(rg=lg[1].end.x,cg=lg[1].end.y):(rg=lg[1].x,cg=lg[1].y),Cg===0||Cg===2?ag=Math.abs(og-rg):ag=Math.abs(sg-cg),this.ctx.beginPath(),ig===3?this.formatPath(ng):this.formatPath(lg.slice(0,2)),ug=Ig<3?Ig*3:Ig*2,dg=Ig<3?Ig*2:Ig,ig===3&&(ug=Ig,dg=Ig),hg=!0,ag<=ug*2?hg=!1:ag<=ug*2+dg?(bg=ag/(2*ug+dg),ug*=bg,dg*=bg):(mg=Math.floor((ag+dg)/(ug+dg)),Zg=(ag-mg*ug)/(mg-1),Bg=(ag-(mg+1)*ug)/mg,dg=Bg<=0||Math.abs(dg-Zg)<Math.abs(dg-Bg)?Zg:Bg),hg&&(ig===3?this.ctx.setLineDash([0,ug+dg]):this.ctx.setLineDash([ug,dg])),ig===3?(this.ctx.lineCap="round",this.ctx.lineWidth=Ig):this.ctx.lineWidth=Ig*2+1.1,this.ctx.strokeStyle=asString(eg),this.ctx.stroke(),this.ctx.setLineDash([]),ig===2&&(isBezierCurve(lg[0])&&(Gg=lg[3],pg=lg[0],this.ctx.beginPath(),this.formatPath([new Vector(Gg.end.x,Gg.end.y),new Vector(pg.start.x,pg.start.y)]),this.ctx.stroke()),isBezierCurve(lg[1])&&(Gg=lg[1],pg=lg[2],this.ctx.beginPath(),this.formatPath([new Vector(Gg.end.x,Gg.end.y),new Vector(pg.start.x,pg.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},gg.prototype.render=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig;return __generator(this,function(Cg){switch(Cg.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),Ig=parseStackingContexts(eg),[4,this.renderStack(Ig)];case 1:return Cg.sent(),this.applyEffects([]),[2,this.canvas]}})})},gg}(Renderer),isTextInputElement=function(Ag){return Ag instanceof TextareaElementContainer||Ag instanceof SelectElementContainer?!0:Ag instanceof InputElementContainer&&Ag.type!==RADIO&&Ag.type!==CHECKBOX},calculateBackgroundCurvedPaintingArea=function(Ag,gg){switch(Ag){case 0:return calculateBorderBoxPath(gg);case 2:return calculateContentBoxPath(gg);case 1:default:return calculatePaddingBoxPath(gg)}},canvasTextAlign=function(Ag){switch(Ag){case 1:return"center";case 2:return"right";case 0:default:return"left"}},iOSBrokenFonts=["-apple-system","system-ui"],fixIOSSystemFonts=function(Ag){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?Ag.filter(function(gg){return iOSBrokenFonts.indexOf(gg)===-1}):Ag},ForeignObjectRenderer=function(Ag){__extends(gg,Ag);function gg(eg,Ig){var Cg=Ag.call(this,eg,Ig)||this;return Cg.canvas=Ig.canvas?Ig.canvas:document.createElement("canvas"),Cg.ctx=Cg.canvas.getContext("2d"),Cg.options=Ig,Cg.canvas.width=Math.floor(Ig.width*Ig.scale),Cg.canvas.height=Math.floor(Ig.height*Ig.scale),Cg.canvas.style.width=Ig.width+"px",Cg.canvas.style.height=Ig.height+"px",Cg.ctx.scale(Cg.options.scale,Cg.options.scale),Cg.ctx.translate(-Ig.x,-Ig.y),Cg.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+Ig.width+"x"+Ig.height+" at "+Ig.x+","+Ig.y+") with scale "+Ig.scale),Cg}return gg.prototype.render=function(eg){return __awaiter(this,void 0,void 0,function(){var Ig,Cg;return __generator(this,function(tg){switch(tg.label){case 0:return Ig=createForeignObjectSVG(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,eg),[4,loadSerializedSVG(Ig)];case 1:return Cg=tg.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=asString(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(Cg,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},gg}(Renderer),loadSerializedSVG=function(Ag){return new Promise(function(gg,eg){var Ig=new Image;Ig.onload=function(){gg(Ig)},Ig.onerror=eg,Ig.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(Ag))})},Logger=function(){function Ag(gg){var eg=gg.id,Ig=gg.enabled;this.id=eg,this.enabled=Ig,this.start=Date.now()}return Ag.prototype.debug=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.prototype.getTime=function(){return Date.now()-this.start},Ag.prototype.info=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg))},Ag.prototype.warn=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.prototype.error=function(){for(var gg=[],eg=0;eg<arguments.length;eg++)gg[eg]=arguments[eg];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,__spreadArray([this.id,this.getTime()+"ms"],gg)):this.info.apply(this,gg))},Ag.instances={},Ag}(),Context=function(){function Ag(gg,eg){var Ig;this.windowBounds=eg,this.instanceName="#"+Ag.instanceCount++,this.logger=new Logger({id:this.instanceName,enabled:gg.logging}),this.cache=(Ig=gg.cache)!==null&&Ig!==void 0?Ig:new Cache(this,gg)}return Ag.instanceCount=1,Ag}(),html2canvas=function(Ag,gg){return gg===void 0&&(gg={}),renderElement(Ag,gg)};typeof window<"u"&&CacheStorage.setContext(window);var renderElement=function(Ag,gg){return __awaiter(void 0,void 0,void 0,function(){var eg,Ig,Cg,tg,ig,ng,lg,og,sg,rg,cg,ag,ug,dg,hg,bg,mg,Zg,Bg,Gg,fg,pg,fg,Vg,Wg,Hg,Sg,wg,Xg,vg,yg,Ng,Yg,Kg,Jg,Ug,Qg,xg,Tg,Mg;return __generator(this,function(Eg){switch(Eg.label){case 0:if(!Ag||typeof Ag!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(eg=Ag.ownerDocument,!eg)throw new Error("Element is not attached to a Document");if(Ig=eg.defaultView,!Ig)throw new Error("Document is not attached to a Window");return Cg={allowTaint:(Vg=gg.allowTaint)!==null&&Vg!==void 0?Vg:!1,imageTimeout:(Wg=gg.imageTimeout)!==null&&Wg!==void 0?Wg:15e3,proxy:gg.proxy,useCORS:(Hg=gg.useCORS)!==null&&Hg!==void 0?Hg:!1},tg=__assign({logging:(Sg=gg.logging)!==null&&Sg!==void 0?Sg:!0,cache:gg.cache},Cg),ig={windowWidth:(wg=gg.windowWidth)!==null&&wg!==void 0?wg:Ig.innerWidth,windowHeight:(Xg=gg.windowHeight)!==null&&Xg!==void 0?Xg:Ig.innerHeight,scrollX:(vg=gg.scrollX)!==null&&vg!==void 0?vg:Ig.pageXOffset,scrollY:(yg=gg.scrollY)!==null&&yg!==void 0?yg:Ig.pageYOffset},ng=new Bounds(ig.scrollX,ig.scrollY,ig.windowWidth,ig.windowHeight),lg=new Context(tg,ng),og=(Ng=gg.foreignObjectRendering)!==null&&Ng!==void 0?Ng:!1,sg={allowTaint:(Yg=gg.allowTaint)!==null&&Yg!==void 0?Yg:!1,onclone:gg.onclone,ignoreElements:gg.ignoreElements,inlineImages:og,copyStyles:og},lg.logger.debug("Starting document clone with size "+ng.width+"x"+ng.height+" scrolled to "+-ng.left+","+-ng.top),rg=new DocumentCloner(lg,Ag,sg),cg=rg.clonedReferenceElement,cg?[4,rg.toIFrame(eg,ng)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return ag=Eg.sent(),ug=isBodyElement(cg)||isHTMLElement(cg)?parseDocumentSize(cg.ownerDocument):parseBounds(lg,cg),dg=ug.width,hg=ug.height,bg=ug.left,mg=ug.top,Zg=parseBackgroundColor(lg,cg,gg.backgroundColor),Bg={canvas:gg.canvas,backgroundColor:Zg,scale:(Jg=(Kg=gg.scale)!==null&&Kg!==void 0?Kg:Ig.devicePixelRatio)!==null&&Jg!==void 0?Jg:1,x:((Ug=gg.x)!==null&&Ug!==void 0?Ug:0)+bg,y:((Qg=gg.y)!==null&&Qg!==void 0?Qg:0)+mg,width:(xg=gg.width)!==null&&xg!==void 0?xg:Math.ceil(dg),height:(Tg=gg.height)!==null&&Tg!==void 0?Tg:Math.ceil(hg)},og?(lg.logger.debug("Document cloned, using foreign object rendering"),fg=new ForeignObjectRenderer(lg,Bg),[4,fg.render(cg)]):[3,3];case 2:return Gg=Eg.sent(),[3,5];case 3:return lg.logger.debug("Document cloned, element located at "+bg+","+mg+" with size "+dg+"x"+hg+" using computed rendering"),lg.logger.debug("Starting DOM parsing"),pg=parseTree(lg,cg),Zg===pg.styles.backgroundColor&&(pg.styles.backgroundColor=COLORS.TRANSPARENT),lg.logger.debug("Starting renderer for element at "+Bg.x+","+Bg.y+" with size "+Bg.width+"x"+Bg.height),fg=new CanvasRenderer(lg,Bg),[4,fg.render(pg)];case 4:Gg=Eg.sent(),Eg.label=5;case 5:return(!((Mg=gg.removeContainer)!==null&&Mg!==void 0)||Mg)&&(DocumentCloner.destroy(ag)||lg.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),lg.logger.debug("Finished rendering"),[2,Gg]}})})},parseBackgroundColor=function(Ag,gg,eg){var Ig=gg.ownerDocument,Cg=Ig.documentElement?parseColor(Ag,getComputedStyle(Ig.documentElement).backgroundColor):COLORS.TRANSPARENT,tg=Ig.body?parseColor(Ag,getComputedStyle(Ig.body).backgroundColor):COLORS.TRANSPARENT,ig=typeof eg=="string"?parseColor(Ag,eg):eg===null?COLORS.TRANSPARENT:4294967295;return gg===Ig.documentElement?isTransparent(Cg)?isTransparent(tg)?ig:tg:Cg:ig};const html2canvas_esm=Object.freeze(Object.defineProperty({__proto__:null,default:html2canvas},Symbol.toStringTag,{value:"Module"}));async function captureCanvasArea(Ag="mtCanvasArea",gg={}){const eg=gg.scale??2,Ig=document.querySelector(`#${Ag}`);if(!Ig)throw new Error("没有找到 canvas 元素");const Cg=[],tg=document.body.querySelectorAll(`#${Ag} .mt-line-render`);for(const lg of tg){const og=lg.outerHTML.trim(),sg=document.createElement("canvas");sg.width=lg.getBoundingClientRect().width,sg.height=lg.getBoundingClientRect().height;const rg=sg.getContext("2d");await Canvg$1.fromString(rg,og).render(),lg.style.position&&(sg.style.position+=lg.style.position,sg.style.left+=lg.style.left,sg.style.top+=lg.style.top),lg.parentNode.appendChild(sg),Cg.push(sg)}const ig=Ig.offsetWidth,ng=Ig.offsetHeight;try{return await html2canvas(Ig,{useCORS:!0,scale:eg,width:ig,height:ng,allowTaint:!0,windowHeight:ng,logging:!1,ignoreElements:lg=>lg.classList.contains("mt-line-render")})}finally{Cg.forEach(lg=>lg.remove())}}async function captureCanvasAreaOrNotify(Ag,gg){try{return await captureCanvasArea(Ag,gg)}catch{return ElMessage.error("画布截图失败,请检查画布是否正常显示"),null}}function pickCaptureScale(Ag,gg){const eg=Math.max(Ag,gg);return eg>4e3?.5:eg>2500?1:2}async function exportCanvasToPdf(Ag="mtCanvasArea",gg){const eg=document.querySelector(`#${Ag}`);if(!eg){ElMessage.error("没有找到画布,无法导出 PDF");return}const Ig=eg.offsetWidth,Cg=eg.offsetHeight,tg=pickCaptureScale(Ig,Cg),ig=ElMessage({message:"正在导出 PDF…",type:"info",duration:0,showClose:!1});try{const ng=await captureCanvasAreaOrNotify(Ag,{scale:tg});if(!ng)return;const lg=ng.width,og=ng.height,sg=ng.toDataURL("image/jpeg",.92),rg=new E$1({orientation:lg>=og?"landscape":"portrait",unit:"px",format:[lg,og],compress:!0});rg.addImage(sg,"JPEG",0,0,lg,og,void 0,"FAST"),rg.save(gg??`定置图-${formatFileStamp()}.pdf`),ElMessage.success("PDF 导出成功")}catch{ElMessage.error("导出 PDF 失败,请稍后重试")}finally{ig.close()}}function formatFileStamp(){const Ag=new Date,gg=eg=>String(eg).padStart(2,"0");return`${Ag.getFullYear()}${gg(Ag.getMonth()+1)}${gg(Ag.getDate())}-${gg(Ag.getHours())}${gg(Ag.getMinutes())}`}function parsePlanStartMs(Ag){if(!Ag)return 0;const gg=Ag.includes("T")?Ag:Ag.replace(" ","T"),eg=new Date(gg).getTime();return Number.isNaN(eg)?0:eg}function sortTasksForTimeline(Ag){return Ag.map((gg,eg)=>({task:gg,index:eg})).sort((gg,eg)=>{const Ig=parsePlanStartMs(gg.task.planStartDate)-parsePlanStartMs(eg.task.planStartDate);return Ig!==0?Ig:gg.index-eg.index}).map(({task:gg})=>gg)}function buildSopTimelineOrderFromTasks(Ag){const gg=sortTasksForTimeline(Ag),eg=[];for(const Ig of gg)for(const Cg of Ig.sopList??[])Cg.isDel!=="Y"&&(eg.includes(Cg.sopId)||eg.push(Cg.sopId));return eg}const sopCanvasCfgCache=vue.reactive({}),sopPositionDataMerged=new Set;function snapshotCurrentCanvasCfg(){return{canvasCfg:objectDeepClone(globalStore.canvasCfg),gridCfg:objectDeepClone(globalStore.gridCfg)}}function parsePositionData(Ag){if(!Ag||typeof Ag!="string")return null;try{return JSON.parse(Ag)}catch{return null}}function finishSopCanvasSwitch(Ag){applyCanvasForSop(Ag),globalStore.selected_items_id=[],cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}function findTaskSop(Ag,gg){var eg;return(eg=Ag==null?void 0:Ag.sopList)==null?void 0:eg.find(Ig=>Ig.sopId===gg&&Ig.isDel!=="Y")}function switchTaskSopCanvas(Ag,gg,eg){var ig;if(Ag===gg)return;commitSopEdits(Ag,globalStore.done_json),sopCanvasCfgCache[Ag]=snapshotCurrentCanvasCfg();const Ig=sopCanvasCfgCache[gg];if(Ig){globalStore.canvasCfg=withCanvasBackground(objectDeepClone(Ig.canvasCfg)),globalStore.gridCfg=objectDeepClone(Ig.gridCfg),finishSopCanvasSwitch(gg);return}const Cg=findTaskSop(eg,gg),tg=parsePositionData((Cg==null?void 0:Cg.positionData)??null);if(tg&&!sopPositionDataMerged.has(gg)){const{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(tg);adoptCanvasBackground(ng),globalStore.canvasCfg=withCanvasBackground({...ng,color:((ig=ng.color)==null?void 0:ig.trim())||"#ffffff"}),globalStore.gridCfg=lg,mergeMasterFromImportedDoneJson(og,gg),sopPositionDataMerged.add(gg)}finishSopCanvasSwitch(gg)}function clearTaskSopCanvasCache(){for(const Ag of Object.keys(sopCanvasCfgCache))delete sopCanvasCfgCache[Ag];sopPositionDataMerged.clear()}function findSopPositionData(Ag,gg){var eg;for(const Ig of Ag){const Cg=(eg=Ig.sopList)==null?void 0:eg.find(tg=>tg.sopId===gg&&tg.isDel!=="Y");if(Cg)return Cg.positionData??null}return null}function buildSopExportJsonMap(Ag,gg){const eg=Ag.length?buildSopTimelineOrderFromTasks(Ag):[...getActiveSopTimelineOrder()];for(const tg of eg){if(sopPositionDataMerged.has(tg))continue;const ig=parsePositionData(findSopPositionData(Ag,tg));if(!ig)continue;const{canvasCfg:ng,gridCfg:lg,importDoneJson:og}=useExportJsonToDoneJson(ig);adoptCanvasBackground(ng),mergeMasterFromImportedDoneJson(og,tg),sopPositionDataMerged.add(tg),sopCanvasCfgCache[tg]={canvasCfg:withCanvasBackground(objectDeepClone(ng)),gridCfg:objectDeepClone(lg)}}const Ig=tg=>tg===gg||tg===sopCanvasStateStore.activeSopId?snapshotCurrentCanvasCfg():sopCanvasCfgCache[tg]??{canvasCfg:objectDeepClone(globalStore.canvasCfg),gridCfg:objectDeepClone(globalStore.gridCfg)},Cg={};for(const tg of eg){const ig=Ig(tg),{exportJson:ng}=genExportJson(withCanvasBackground(objectDeepClone(ig.canvasCfg)),ig.gridCfg,buildCanvasForSop(tg));Cg[tg]=ng}return Cg}function restoreSopExportJsonMap(Ag,gg){var Cg;clearTaskSopCanvasCache(),resetCanvasBackground(),sopCanvasStateStore.masterById={},sopCanvasStateStore.layoutBySop={};const eg=Object.keys(Ag).sort(compareSopTimeline);for(const tg of eg){const{canvasCfg:ig,gridCfg:ng,importDoneJson:lg}=useExportJsonToDoneJson(Ag[tg]);adoptCanvasBackground(ig),mergeMasterFromImportedDoneJson(lg,tg),sopPositionDataMerged.add(tg),sopCanvasCfgCache[tg]={canvasCfg:withCanvasBackground(objectDeepClone(ig)),gridCfg:objectDeepClone(ng)}}const Ig=Ag[gg];Ig&&(globalStore.canvasCfg=withCanvasBackground({...Ig.canvasCfg,color:((Cg=Ig.canvasCfg.color)==null?void 0:Cg.trim())||"#ffffff"}),globalStore.gridCfg=Ig.gridCfg),applyCanvasForSop(gg),globalStore.selected_items_id=[],cacheStore.history=[objectDeepClone(globalStore.done_json)],cacheStore.historyIndex=0}const _hoisted_1$2={class:"task-timeline"},_hoisted_2$2={class:"task-timeline-header"},_hoisted_3$1={class:"task-timeline-track-wrap"},_hoisted_4$1={class:"task-timeline-track-inner"},_hoisted_5$1={class:"task-timeline-nodes"},_hoisted_6$1=["onClick"],_hoisted_7={class:"task-timeline-card-wrap"},_hoisted_8={class:"task-timeline-label"},_hoisted_9={key:0,class:"task-timeline-date"},_hoisted_10={class:"task-timeline-name"},_hoisted_11=["title"],_sfc_main$2=vue.defineComponent({__name:"task-timeline",props:{tasks:{},selectedPdTaskId:{}},emits:["selectTask","linkTask"],setup(Ag,{emit:gg}){const eg=Ag,Ig=gg;function Cg(lg){if(!lg)return"";const og=new Date(lg);if(Number.isNaN(og.getTime()))return lg.slice(0,10);const sg=og.getFullYear(),rg=String(og.getMonth()+1).padStart(2,"0"),cg=String(og.getDate()).padStart(2,"0");return`${sg}-${rg}-${cg}`}const tg=vue.computed(()=>{const lg=new Map;for(const sg of eg.tasks){const rg=Cg(sg.planStartDate)||sg.pdTaskId,cg=lg.get(rg);cg?cg.push(sg):lg.set(rg,[sg])}const og=[];for(const[sg,rg]of lg){const cg=[...rg].sort((ug,dg)=>ug.sortNo-dg.sortNo),ag=cg[0];og.push({dateKey:sg,dateLabel:Cg(ag.planStartDate)||sg,tasks:cg,displayTaskName:ag.taskName})}return og.sort((sg,rg)=>{const cg=new Date(sg.tasks[0].planStartDate).getTime(),ag=new Date(rg.tasks[0].planStartDate).getTime();return!Number.isNaN(cg)&&!Number.isNaN(ag)?cg-ag:sg.dateKey.localeCompare(rg.dateKey)}),og}),ig=lg=>eg.selectedPdTaskId?lg.tasks.some(og=>og.pdTaskId===eg.selectedPdTaskId):!1,ng=lg=>{const og=lg.tasks.findIndex(rg=>rg.pdTaskId===eg.selectedPdTaskId),sg=og>=0?lg.tasks[(og+1)%lg.tasks.length]:lg.tasks[0];Ig("selectTask",sg)};return(lg,og)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("div",_hoisted_2$2,[og[1]||(og[1]=vue.createElementVNode("span",{class:"task-timeline-title"},"任务时间轴",-1)),vue.createElementVNode("button",{type:"button",class:"task-timeline-link-btn",onClick:og[0]||(og[0]=sg=>Ig("linkTask"))}," 关联任务 ")]),vue.createElementVNode("div",_hoisted_3$1,[vue.createElementVNode("div",_hoisted_4$1,[og[3]||(og[3]=vue.createElementVNode("div",{class:"task-timeline-line","aria-hidden":"true"},null,-1)),vue.createElementVNode("div",_hoisted_5$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(tg.value,sg=>(vue.openBlock(),vue.createElementBlock("button",{key:sg.dateKey,type:"button",class:vue.normalizeClass(["task-timeline-node",{"is-active":ig(sg)}]),onClick:rg=>ng(sg)},[og[2]||(og[2]=vue.createElementVNode("span",{class:"task-timeline-dot","aria-hidden":"true"},null,-1)),vue.createElementVNode("span",_hoisted_7,[vue.createElementVNode("span",_hoisted_8,[sg.dateLabel?(vue.openBlock(),vue.createElementBlock("span",_hoisted_9,vue.toDisplayString(sg.dateLabel),1)):vue.createCommentVNode("",!0),vue.createElementVNode("span",_hoisted_10,vue.toDisplayString(sg.displayTaskName),1)]),sg.tasks.length>1?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:"task-timeline-parallel-suffix",title:`另有 ${sg.tasks.length-1} 项并行任务,点击切换`}," +"+vue.toDisplayString(sg.tasks.length-1),9,_hoisted_11)):vue.createCommentVNode("",!0)])],10,_hoisted_6$1))),128))])])])]))}}),taskTimeline_vue_vue_type_style_index_0_scoped_5404ac45_lang="",TaskTimeline=_export_sfc(_sfc_main$2,[["__scopeId","data-v-5404ac45"]]),_hoisted_1$1={id:"mt-edit",class:"relative flex flex-col w-full h-full dark"},_hoisted_2$1={key:0,class:"mt-edit-aside-shell mt-edit-aside-shell--left"},_hoisted_3=["title"],_hoisted_4={key:1,class:"mt-edit-aside-shell mt-edit-aside-shell--right"},_hoisted_5=["title"],_hoisted_6={class:"p-10px"},_sfc_main$1=vue.defineComponent({__name:"index",props:{useThumbnail:{type:Boolean,default:!1},sopId:{default:"__default__"},taskList:{default:()=>[]},selectedTask:{default:null},viewMode:{type:Boolean,default:!1},canvasBackgroundList:{default:()=>[]},selectedCanvasBackgroundId:{default:""}},emits:["onPreviewClick","onReturnClick","onSaveClick","onThumbnailClick","onCanvasBgClick","onFullscreenToggle","onLinkTask","update:sopId","update:selectedTask","update:selectedCanvasBackgroundId"],setup(Ag,{expose:gg,emit:eg}){const Ig=Ag,Cg=vue.computed(()=>Ig.sopId||"__default__");vue.watch(()=>Ig.taskList,rA=>{setSopTimelineOrder(buildSopTimelineOrderFromTasks(rA??[]))},{immediate:!0,deep:!0});const tg=vue.ref(null);vue.watch(()=>Ig.viewMode,rA=>{rA?(tg.value===null&&(tg.value=globalStore.lock),globalStore.lock=!0):tg.value!==null&&(globalStore.lock=tg.value,tg.value=null)},{immediate:!0});const ig=eg,ng=vue.ref(!1),lg=(rA,dA)=>{rA!==dA&&dA!==sopCanvasStateStore.activeSopId&&(Ig.selectedTask?switchTaskSopCanvas(rA,dA,Ig.selectedTask):switchSopCanvas(rA,dA))},og=rA=>{const dA=Cg.value;dA!==rA&&(ng.value=!0,lg(dA,rA),ig("update:sopId",rA),ng.value=!1)},sg=rA=>{var MA;const dA=(MA=rA.sopList)==null?void 0:MA.find($A=>$A.isDel!=="Y");return(dA==null?void 0:dA.sopId)??null},rg=rA=>{const dA=sg(rA);if(!dA||Cg.value===dA)return;const MA=Cg.value;ng.value=!0,switchTaskSopCanvas(MA,dA,rA),ig("update:sopId",dA),ng.value=!1},cg=rA=>{ig("update:selectedTask",rA),rg(rA)};vue.watch(()=>{var rA;return(rA=Ig.selectedTask)==null?void 0:rA.pdTaskId},(rA,dA)=>{if(!rA||rA===dA)return;const MA=Ig.selectedTask;MA&&rg(MA)}),vue.watch(()=>Ig.sopId,(rA,dA)=>{ng.value||!rA||rA===dA||lg(dA||sopCanvasStateStore.activeSopId,rA)});const ag=vue.useSlots(),ug=vue.ref(),dg=vue.ref(),hg=vue.reactive({left_show:!0,right_show:!0}),bg=()=>{hg.left_show=!hg.left_show},mg=()=>{hg.right_show=!hg.right_show},Zg=vue.computed(()=>!!ag.deviceBind),Bg=vue.computed(()=>globalStore.selected_items_id.length>0),Gg=vue.computed(()=>globalStore.selected_items_id.length>1),pg=vue.computed(()=>{if(globalStore.selected_items_id.length===1){const rA=globalStore.done_json.find(dA=>dA.id===globalStore.selected_items_id[0]);return(rA==null?void 0:rA.type)==="group"}return!1}),fg=vue.computed(()=>globalStore.done_json.filter(dA=>globalStore.selected_items_id.includes(dA.id)&&dA.type!=="sys-line").length>1),Vg=vue.ref(!1),Wg=vue.ref(!1),Hg=vue.ref(!1),Sg=vue.ref(!1),wg=vue.ref(!1);vue.ref(),vue.ref([]),vue.ref(!1);const Xg=()=>{deleteItemsAtSop(Cg.value,[...globalStore.selected_items_id])},vg=()=>{var rA;Vg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown()},yg=()=>{var rA;Wg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown()},Ng=rA=>{globalStore.setSingleSelect(rA)},Yg=rA=>{const dA=globalStore.done_json.find(MA=>MA.id===rA);dA&&(dA.hide=!dA.hide)},Kg=rA=>{var dA;(dA=ug.value)==null||dA.onAlignSelected(rA)},Jg=vue.getCurrentInstance(),Ug=()=>{var rA;return!!((rA=Jg==null?void 0:Jg.vnode.props)!=null&&rA.onOnCanvasBgClick)},Qg=()=>{var rA;ig("onCanvasBgClick"),!Ug()&&(wg.value=!0,(rA=ug.value)==null||rA.stopListenerKeyDown())};let xg="";const Tg=async rA=>{if(!rA)return clearCanvasBackground(globalStore.canvasCfg),!0;try{const dA=await processCanvasBackgroundUrl(rA.url,rA.width,rA.height);return dA.scaled?ElMessage.warning(`背景尺寸 ${dA.originalWidth}×${dA.originalHeight} 超出浏览器限制,已缩放为 ${dA.width}×${dA.height} 并同步画布大小`):ElMessage.success(`已切换底图,画布尺寸 ${dA.width}×${dA.height}`),setCanvasBackground(globalStore.canvasCfg,rA.url,dA.width,dA.height),!0}catch(dA){console.error("[canvas-bg-preset]",dA);const MA=dA instanceof Error?dA.message:"";return ElMessage.error(MA?`底图加载失败:${MA}`:"底图加载失败"),!1}},Mg=async rA=>{const dA=rA?Ig.canvasBackgroundList.find($A=>$A.id===rA)??null:null;if(rA&&!dA)return;xg=rA,await Tg(dA)?ig("update:selectedCanvasBackgroundId",rA):xg=""},Eg=async()=>{const rA=Ig.selectedCanvasBackgroundId;if(rA&&rA===xg)return;if(!rA){xg="",await Tg(null);return}const dA=Ig.canvasBackgroundList.find($A=>$A.id===rA);if(!dA)return;xg=rA,await Tg(dA)||(xg="",ig("update:selectedCanvasBackgroundId",""))};vue.watch(()=>Ig.selectedCanvasBackgroundId,Eg),vue.watch(()=>Ig.canvasBackgroundList,rA=>{const dA=Ig.selectedCanvasBackgroundId;if(dA){if(!rA.some(MA=>MA.id===dA)){xg="",clearCanvasBackground(globalStore.canvasCfg),ig("update:selectedCanvasBackgroundId","");return}Eg()}},{deep:!0}),vue.watch(()=>globalStore.canvasCfg.img,rA=>{if(!rA&&canvasBackgroundState.img){globalStore.canvasCfg.img=canvasBackgroundState.img;return}if(!rA){Ig.selectedCanvasBackgroundId&&ig("update:selectedCanvasBackgroundId","");return}const dA=Ig.canvasBackgroundList.find(MA=>MA.url===rA||MA.url===globalStore.canvasCfg.img);dA&&dA.id!==Ig.selectedCanvasBackgroundId&&ig("update:selectedCanvasBackgroundId",dA.id)});const Og=rA=>{ig("onFullscreenToggle",rA)},gA=()=>{window.open("http://mt.yaolm.top")},IA=()=>{var rA;(rA=ug.value)==null||rA.onRedo()},Pg=()=>{var rA;(rA=ug.value)==null||rA.onUndo()},qg=async()=>{var dA;await((dA=dg.value)==null?void 0:dA.onImport())?(Vg.value=!1,cacheStore.addHistory(globalStore.done_json)):ElMessage.error("导入失败,请检查数据格式")},lA=()=>{const{exportJson:rA}=genExportJson(globalStore.canvasCfg,globalStore.gridCfg,globalStore.done_json);ig("onPreviewClick",rA)},pA=()=>{commitSopEdits(Cg.value,globalStore.done_json);const{exportJson:rA}=genExportJson(globalStore.canvasCfg,globalStore.gridCfg,globalStore.done_json);return rA.sopJsonMap=buildSopExportJsonMap(Ig.taskList??[],Cg.value),ig("onSaveClick",rA),rA},VA=()=>{ig("onThumbnailClick")},XA=()=>{exportCanvasToPdf("mtCanvasArea")},hA=rA=>{Sg.value=rA};return gg({setImportJson:rA=>{var nA;if(rA.sopJsonMap&&Object.keys(rA.sopJsonMap).length>0)return restoreSopExportJsonMap(rA.sopJsonMap,Cg.value),cacheStore.history[0]=objectDeepClone(globalStore.done_json),!0;const{canvasCfg:dA,gridCfg:MA,importDoneJson:$A}=useExportJsonToDoneJson(rA);return resetCanvasBackground(),adoptCanvasBackground(dA),globalStore.canvasCfg=withCanvasBackground({...dA,color:((nA=dA.color)==null?void 0:nA.trim())||"#ffffff"}),globalStore.gridCfg=MA,globalStore.setGlobalStoreDoneJson($A),syncMasterFromImportedDoneJson($A,Cg.value),cacheStore.history[0]=$A,!0},save:pA,lockCanvas:()=>{globalStore.lock=!0},unlockCanvas:()=>{globalStore.lock=!1},toggleLock:()=>{globalStore.lock=!globalStore.lock},getAllElementIds:()=>globalStore.done_json.map(rA=>rA.id),switchSopCanvas:(rA,dA)=>{lg(rA,dA)},hasSopCanvasState:rA=>sopCanvasStateStore.has(rA)}),(rA,dA)=>{const MA=vue.resolveComponent("el-form-item"),$A=vue.resolveComponent("el-form");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1,[vue.createVNode(vue.unref(ElContainer),{class:"h-full flex flex-row min-h-0"},{default:vue.withCtx(()=>[Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$1,[vue.createVNode(vue.unref(ElAside),{width:hg.left_show?"300px":"0px",class:"dark:bg-myDarkBgColor cr-border mt-edit-aside select-none",onMousedown:dA[0]||(dA[0]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.stopListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(LeftAside,{class:"h-full min-h-0",leftAsideConfig:vue.unref(leftAsideStore).config},null,8,["leftAsideConfig"])]),_:1},8,["width"]),vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["mt-edit-aside-toggle mt-edit-aside-toggle--left",{"is-collapsed":!hg.left_show}]),title:hg.left_show?"收起图元库":"展开图元库",onMousedown:dA[1]||(dA[1]=vue.withModifiers(()=>{},["stop"])),onClick:bg},[...dA[20]||(dA[20]=[vue.createElementVNode("span",{class:"mt-edit-aside-toggle-icon","aria-hidden":"true"},null,-1)])],42,_hoisted_3)])),vue.createVNode(vue.unref(ElMain),{class:"mt-edit-main flex-1 p-0 flex flex-col h-full min-h-0 min-w-0",onMousedown:dA[8]||(dA[8]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{default:vue.withCtx(()=>{var nA,oA;return[Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"mt-edit-toolbar w-full select-none flex-none",onMousedown:dA[5]||(dA[5]=ZA=>{var GA;return(GA=ug.value)==null?void 0:GA.stopListenerKeyDown()})},[vue.createVNode(HeaderPanel,{"lock-state":vue.unref(globalStore).lock,"onUpdate:lockState":dA[2]||(dA[2]=ZA=>vue.unref(globalStore).lock=ZA),"selected-items-id":vue.unref(globalStore).selected_items_id,"group-enabled":Gg.value,"un-group-enabled":pg.value,"align-enabled":fg.value,"delete-enabled":Bg.value,"undo-enabled":vue.unref(cacheStore).historyIndex>0,"redo-enabled":vue.unref(cacheStore).historyIndex<vue.unref(cacheStore).history.length-1,"real-time-data":vue.unref(globalStore).real_time_data,"use-thumbnail":Ig.useThumbnail,"canvas-background-list":Ig.canvasBackgroundList,"selected-canvas-background-id":Ig.selectedCanvasBackgroundId,onOnGroupClick:(nA=ug.value)==null?void 0:nA.createGroupItem,onOnUngroupClick:(oA=ug.value)==null?void 0:oA.onUngroup,onOnDeleteClick:Xg,onOnExportClick:yg,onOnTreeClick:dA[3]||(dA[3]=ZA=>Hg.value=!0),onOnHelpClick:gA,onAlignSelected:Kg,onOnRedoClick:IA,onOnUndoClick:Pg,onOnImportClick:vg,onOnReturnClick:dA[4]||(dA[4]=ZA=>ig("onReturnClick")),onOnSaveClick:pA,onOnPreviewClick:lA,onOnThumbnailClick:VA,onOnDrawLineClick:hA,onOnCanvasBgClick:Qg,onOnCanvasBackgroundSelect:Mg,onOnExportPdfClick:XA,onOnFullscreenToggle:Og},null,8,["lock-state","selected-items-id","group-enabled","un-group-enabled","align-enabled","delete-enabled","undo-enabled","redo-enabled","real-time-data","use-thumbnail","canvas-background-list","selected-canvas-background-id","onOnGroupClick","onOnUngroupClick"])],32)),vue.createVNode(MainPanel,{ref_key:"mainPanelRef",ref:ug,class:"flex-1 min-h-0","group-enabled":Gg.value,"un-group-enabled":pg.value,"delete-enabled":Bg.value,"line-append-enable":Sg.value,"sop-id":Cg.value},null,8,["group-enabled","un-group-enabled","delete-enabled","line-append-enable","sop-id"]),vue.createElementVNode("div",{class:"mt-edit-bottom-panel flex-none min-w-0 w-full max-w-full dark:bg-myDarkBgColor border-t border-gray-700",onMousedown:dA[7]||(dA[7]=vue.withModifiers(()=>{},["stop"]))},[vue.renderSlot(rA.$slots,"bottomPanel",{tasks:Ig.taskList??[],selectedTask:Ig.selectedTask,selectTask:cg},()=>{var ZA,GA;return[(((ZA=Ig.taskList)==null?void 0:ZA.length)??0)>0?(vue.openBlock(),vue.createBlock(TaskTimeline,{key:0,tasks:Ig.taskList,"selected-pd-task-id":(GA=Ig.selectedTask)==null?void 0:GA.pdTaskId,onSelectTask:cg,onLinkTask:dA[6]||(dA[6]=zA=>ig("onLinkTask"))},null,8,["tasks","selected-pd-task-id"])):vue.createCommentVNode("",!0)]},!0)],32)]}),_:3}),Ig.viewMode?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.createElementVNode("button",{type:"button",class:vue.normalizeClass(["mt-edit-aside-toggle mt-edit-aside-toggle--right",{"is-collapsed":!hg.right_show}]),title:hg.right_show?"收起属性面板":"展开属性面板",onMousedown:dA[9]||(dA[9]=vue.withModifiers(()=>{},["stop"])),onClick:mg},[...dA[21]||(dA[21]=[vue.createElementVNode("span",{class:"mt-edit-aside-toggle-icon","aria-hidden":"true"},null,-1)])],42,_hoisted_5),vue.createVNode(vue.unref(ElAside),{width:hg.right_show?"300px":"0px",class:"dark:bg-myDarkBgColor cl-border mt-edit-aside select-none",onMousedown:dA[10]||(dA[10]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.stopListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$6,{"selected-task":Ig.selectedTask,"active-sop-id":Cg.value,onSelectTaskSop:og},vue.createSlots({_:2},[Zg.value?{name:"deviceBind",fn:vue.withCtx(({item:nA})=>[vue.renderSlot(rA.$slots,"deviceBind",{item:nA},void 0,!0)]),key:"0"}:void 0]),1032,["selected-task","active-sop-id"])]),_:3},8,["width"])]))]),_:3}),vue.createVNode(vue.unref(ElDialog),{modelValue:Vg.value,"onUpdate:modelValue":dA[11]||(dA[11]=nA=>Vg.value=nA),title:"数据导入",onClose:dA[12]||(dA[12]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:qg},{default:vue.withCtx(()=>[...dA[22]||(dA[22]=[vue.createTextVNode("确定",-1)])]),_:1})]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:dg},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{modelValue:Wg.value,"onUpdate:modelValue":dA[13]||(dA[13]=nA=>Wg.value=nA),title:"数据导出",onClose:dA[14]||(dA[14]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4,{"done-json":vue.unref(objectDeepClone)(vue.unref(globalStore).done_json),"canvas-cfg":vue.unref(globalStore).canvasCfg,"grid-cfg":vue.unref(globalStore).gridCfg},null,8,["done-json","canvas-cfg","grid-cfg"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDrawer),{modelValue:Hg.value,"onUpdate:modelValue":dA[15]||(dA[15]=nA=>Hg.value=nA),title:"图形结构树",direction:"ltr",size:"30%"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$5,{"done-json":vue.unref(globalStore).done_json,"selected-items-id":vue.unref(globalStore).selected_items_id,onUpdateSelectedItemsId:Ng,onUpdateSelectedIdHide:Yg},null,8,["done-json","selected-items-id"])]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{modelValue:wg.value,"onUpdate:modelValue":dA[18]||(dA[18]=nA=>wg.value=nA),title:"画布背景",width:"400px",onClose:dA[19]||(dA[19]=nA=>{var oA;return(oA=ug.value)==null?void 0:oA.beginListenerKeyDown()})},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:dA[17]||(dA[17]=nA=>wg.value=!1)},{default:vue.withCtx(()=>[...dA[23]||(dA[23]=[vue.createTextVNode("关闭",-1)])]),_:1})]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_6,[vue.createVNode($A,{"label-width":"100px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(MA,{label:"背景颜色"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(globalStore).canvasCfg.color,"onUpdate:modelValue":dA[16]||(dA[16]=nA=>vue.unref(globalStore).canvasCfg.color=nA)},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1},8,["modelValue"])])}}}),index_vue_vue_type_style_index_0_scoped_4728ec8c_lang="",MtEdit=_export_sfc(_sfc_main$1,[["__scopeId","data-v-4728ec8c"]]),_hoisted_1={style:{height:"100vh"}},_hoisted_2=["src"],_sfc_main=vue.defineComponent({__name:"index",props:{exportJson:{},canZoom:{type:Boolean,default:!0},canDrag:{type:Boolean,default:!0},showPopover:{type:Boolean,default:!0}},emits:["onEventCallBack"],setup(Ag,{expose:gg,emit:eg}){vue.useCssVars(fg=>({b16cb428:`scale(${ig.value.scale})`,v798570b2:ig.value.width+"px",v01f5327b:ig.value.height+"px",e7220190:ig.value.color}));const Ig=Ag,Cg=eg,tg=vue.ref(),ig=vue.ref({width:1920,height:1080,scale:1,color:"#ffffff",img:"",guide:!0,adsorp:!0,adsorp_diff:3,transform_origin:{x:0,y:0},drag_offset:{x:0,y:0}}),ng=vue.ref({enabled:!0,align:!0,size:10}),lg=vue.ref([]),og=vue.ref(),sg=vue.ref(),rg=vue.reactive({begin_left:0,begin_top:0,left:0,top:0}),cg=({scrollLeft:fg,scrollTop:Vg})=>{rg.left=fg,rg.top=Vg},ag=fg=>{var Vg;Ig.canDrag&&((Vg=sg.value)==null||Vg.onMouseDown(fg))},ug=()=>{rg.begin_left=rg.left,rg.begin_top=rg.top},dg=(fg,Vg)=>{var Sg,wg;let Wg=rg.begin_left-fg,Hg=rg.begin_top-Vg;(Sg=og.value)==null||Sg.setScrollLeft(Wg),(wg=og.value)==null||wg.setScrollTop(Hg)},hg=()=>{},bg=(fg,Vg,Wg)=>setItemAttr(fg,Vg,Wg,lg.value),mg=fg=>{fg.forEach(Vg=>{setItemAttr(Vg.id,Vg.key,Vg.val,lg.value)})},Zg=(fg,Vg,Wg)=>getItemAttr(fg,Vg,lg.value),Bg=fg=>{fg.ctrlKey&&Ig.canZoom&&(fg.preventDefault(),fg.stopPropagation(),fg.deltaY>0?ig.value.scale=(ig.value.scale*10-1)/10:fg.deltaY<0&&(ig.value.scale=(ig.value.scale*10+1)/10))},Gg=(fg,Vg,Wg)=>{setTimeout(()=>{bg(fg,Vg,Wg)},0)};return window.$mtElMessage=ElMessage,window.$mtElMessageBox=ElMessageBox,window.$setItemAttrByID=(fg,Vg,Wg)=>Gg(fg,Vg,Wg),window.$getItemAttrByID=Zg,window.$previewCompareVal=previewCompareVal,window.$mtEventCallBack=(fg,Vg,...Wg)=>Cg("onEventCallBack",fg,Vg,...Wg),vue.onMounted(()=>{if(Ig.exportJson){const{canvasCfg:fg,gridCfg:Vg,importDoneJson:Wg}=useExportJsonToDoneJson(Ig.exportJson);ig.value=fg,ng.value=Vg,lg.value=Wg}}),gg({setItemAttrByID:bg,setImportJson:fg=>{const{canvasCfg:Vg,gridCfg:Wg,importDoneJson:Hg}=useExportJsonToDoneJson(fg);return ig.value=Vg,ng.value=Wg,lg.value=Hg,!0},setItemAttrs:mg}),(fg,Vg)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createVNode(vue.unref(ElScrollbar),{ref_key:"elScrollbarRef",ref:og,class:"w-1/1 h-1/1","max-height":ig.value.height,onScroll:cg},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref_key:"canvasAreaRef",ref:tg,class:vue.normalizeClass(`canvasArea ${Ig.canDrag?"cursor-grab":""} `),onMousedown:ag,onWheel:Bg},[ig.value.img?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"canvas-bg-image",src:ig.value.img,alt:"",draggable:"false"},null,8,_hoisted_2)):vue.createCommentVNode("",!0),vue.createVNode(_sfc_main$i,{"done-json":lg.value,"onUpdate:doneJson":Vg[0]||(Vg[0]=Wg=>lg.value=Wg),"canvas-cfg":ig.value,"grid-cfg":ng.value,"show-ghost-dom":!1,"canvas-dom":tg.value,"global-lock":!1,"preivew-mode":!0,"show-popover":Ig.showPopover},null,8,["done-json","canvas-cfg","grid-cfg","canvas-dom","show-popover"])],34),vue.createVNode(_sfc_main$f,{ref_key:"dragCanvasRef",ref:sg,"scale-ratio":ig.value.scale,onDragCanvasMouseDown:ug,onDragCanvasMouseMove:dg,onDragCanvasMouseUp:hg},null,8,["scale-ratio"])]),_:1},8,["max-height"])]))}}),index_vue_vue_type_style_index_0_scoped_2abcde76_lang="",MtPreview=_export_sfc(_sfc_main,[["__scopeId","data-v-2abcde76"]]);/*! @license DOMPurify 2.5.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.9/LICENSE */function _typeof(Ag){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(gg){return typeof gg}:function(gg){return gg&&typeof Symbol=="function"&&gg.constructor===Symbol&&gg!==Symbol.prototype?"symbol":typeof gg},_typeof(Ag)}function _setPrototypeOf(Ag,gg){return _setPrototypeOf=Object.setPrototypeOf||function(Ig,Cg){return Ig.__proto__=Cg,Ig},_setPrototypeOf(Ag,gg)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(Ag,gg,eg){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(Cg,tg,ig){var ng=[null];ng.push.apply(ng,tg);var lg=Function.bind.apply(Cg,ng),og=new lg;return ig&&_setPrototypeOf(og,ig.prototype),og},_construct.apply(null,arguments)}function _toConsumableArray(Ag){return _arrayWithoutHoles(Ag)||_iterableToArray(Ag)||_unsupportedIterableToArray(Ag)||_nonIterableSpread()}function _arrayWithoutHoles(Ag){if(Array.isArray(Ag))return _arrayLikeToArray(Ag)}function _iterableToArray(Ag){if(typeof Symbol<"u"&&Ag[Symbol.iterator]!=null||Ag["@@iterator"]!=null)return Array.from(Ag)}function _unsupportedIterableToArray(Ag,gg){if(Ag){if(typeof Ag=="string")return _arrayLikeToArray(Ag,gg);var eg=Object.prototype.toString.call(Ag).slice(8,-1);if(eg==="Object"&&Ag.constructor&&(eg=Ag.constructor.name),eg==="Map"||eg==="Set")return Array.from(Ag);if(eg==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(eg))return _arrayLikeToArray(Ag,gg)}}function _arrayLikeToArray(Ag,gg){(gg==null||gg>Ag.length)&&(gg=Ag.length);for(var eg=0,Ig=new Array(gg);eg<gg;eg++)Ig[eg]=Ag[eg];return Ig}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1446
1446
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var hasOwnProperty$1=Object.hasOwnProperty,setPrototypeOf$2=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf$2=Object.getPrototypeOf,getOwnPropertyDescriptor$5=Object.getOwnPropertyDescriptor,freeze=Object.freeze,seal=Object.seal,create$4=Object.create,_ref=typeof Reflect<"u"&&Reflect,apply$3=_ref.apply,construct$1=_ref.construct;apply$3||(apply$3=function(gg,eg,Ig){return gg.apply(eg,Ig)}),freeze||(freeze=function(gg){return gg}),seal||(seal=function(gg){return gg}),construct$1||(construct$1=function(gg,eg){return _construct(gg,_toConsumableArray(eg))});var arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf$4=unapply(String.prototype.indexOf),stringTrim$1=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(Ag){return function(gg){for(var eg=arguments.length,Ig=new Array(eg>1?eg-1:0),Cg=1;Cg<eg;Cg++)Ig[Cg-1]=arguments[Cg];return apply$3(Ag,gg,Ig)}}function unconstruct(Ag){return function(){for(var gg=arguments.length,eg=new Array(gg),Ig=0;Ig<gg;Ig++)eg[Ig]=arguments[Ig];return construct$1(Ag,eg)}}function addToSet(Ag,gg,eg){var Ig;eg=(Ig=eg)!==null&&Ig!==void 0?Ig:stringToLowerCase,setPrototypeOf$2&&setPrototypeOf$2(Ag,null);for(var Cg=gg.length;Cg--;){var tg=gg[Cg];if(typeof tg=="string"){var ig=eg(tg);ig!==tg&&(isFrozen(gg)||(gg[Cg]=ig),tg=ig)}Ag[tg]=!0}return Ag}function clone(Ag){var gg=create$4(null),eg;for(eg in Ag)apply$3(hasOwnProperty$1,Ag,[eg])===!0&&(gg[eg]=Ag[eg]);return gg}function lookupGetter(Ag,gg){for(;Ag!==null;){var eg=getOwnPropertyDescriptor$5(Ag,gg);if(eg){if(eg.get)return unapply(eg.get);if(typeof eg.value=="function")return unapply(eg.value)}Ag=getPrototypeOf$2(Ag)}function Ig(Cg){return console.warn("fallback value for",Cg),null}return Ig}var html$1$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html$3=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\${[\w\W]*}/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i),getGlobal=function Ag(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function Ag(gg,eg){if(_typeof(gg)!=="object"||typeof gg.createPolicy!="function")return null;var Ig=null,Cg="data-tt-policy-suffix";eg.currentScript&&eg.currentScript.hasAttribute(Cg)&&(Ig=eg.currentScript.getAttribute(Cg));var tg="dompurify"+(Ig?"#"+Ig:"");try{return gg.createPolicy(tg,{createHTML:function(ng){return ng},createScriptURL:function(ng){return ng}})}catch{return console.warn("TrustedTypes policy "+tg+" could not be created."),null}};function createDOMPurify(){var Ag=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal(),gg=function(sA){return createDOMPurify(sA)};if(gg.version="2.5.9",gg.removed=[],!Ag||!Ag.document||Ag.document.nodeType!==9)return gg.isSupported=!1,gg;var eg=Ag.document,Ig=Ag.document,Cg=Ag.DocumentFragment,tg=Ag.HTMLTemplateElement,ig=Ag.Node,ng=Ag.Element,lg=Ag.NodeFilter,og=Ag.NamedNodeMap,sg=og===void 0?Ag.NamedNodeMap||Ag.MozNamedAttrMap:og,rg=Ag.HTMLFormElement,cg=Ag.DOMParser,ag=Ag.trustedTypes,ug=ng.prototype,dg=lookupGetter(ug,"cloneNode"),hg=lookupGetter(ug,"nextSibling"),bg=lookupGetter(ug,"childNodes"),mg=lookupGetter(ug,"parentNode");if(typeof tg=="function"){var Zg=Ig.createElement("template");Zg.content&&Zg.content.ownerDocument&&(Ig=Zg.content.ownerDocument)}var Bg=_createTrustedTypesPolicy(ag,eg),Gg=Bg?Bg.createHTML(""):"",pg=Ig,fg=pg.implementation,Vg=pg.createNodeIterator,Wg=pg.createDocumentFragment,Hg=pg.getElementsByTagName,Sg=eg.importNode,wg={};try{wg=clone(Ig).documentMode?Ig.documentMode:{}}catch{}var Xg={};gg.isSupported=typeof mg=="function"&&fg&&fg.createHTMLDocument!==void 0&&wg!==9;var vg=MUSTACHE_EXPR,yg=ERB_EXPR,Ng=TMPLIT_EXPR,Yg=DATA_ATTR,Kg=ARIA_ATTR,Jg=IS_SCRIPT_OR_DATA,Ug=ATTR_WHITESPACE,Qg=CUSTOM_ELEMENT,xg=IS_ALLOWED_URI,Tg=null,Mg=addToSet({},[].concat(_toConsumableArray(html$1$1),_toConsumableArray(svg$1),_toConsumableArray(svgFilters),_toConsumableArray(mathMl$1),_toConsumableArray(text))),Eg=null,Og=addToSet({},[].concat(_toConsumableArray(html$3),_toConsumableArray(svg),_toConsumableArray(mathMl),_toConsumableArray(xml))),gA=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),IA=null,Pg=null,qg=!0,lA=!0,pA=!1,VA=!0,XA=!1,hA=!0,CA=!1,DA=!1,EA=!1,HA=!1,kA=!1,xA=!1,rA=!0,dA=!1,MA="user-content-",$A=!0,nA=!1,oA={},ZA=null,GA=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),zA=null,NA=addToSet({},["audio","video","img","source","image","track"]),_A=null,Xe=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eI="http://www.w3.org/1998/Math/MathML",ze="http://www.w3.org/2000/svg",Ue="http://www.w3.org/1999/xhtml",tI=Ue,xe=!1,pI=null,oI=addToSet({},[eI,ze,Ue],stringToString),cI,uI=["application/xhtml+xml","text/html"],hI="text/html",Ie,iI=null,WC=Ig.createElement("form"),HI=function(sA){return sA instanceof RegExp||sA instanceof Function},PI=function(sA){iI&&iI===sA||((!sA||_typeof(sA)!=="object")&&(sA={}),sA=clone(sA),cI=uI.indexOf(sA.PARSER_MEDIA_TYPE)===-1?cI=hI:cI=sA.PARSER_MEDIA_TYPE,Ie=cI==="application/xhtml+xml"?stringToString:stringToLowerCase,Tg="ALLOWED_TAGS"in sA?addToSet({},sA.ALLOWED_TAGS,Ie):Mg,Eg="ALLOWED_ATTR"in sA?addToSet({},sA.ALLOWED_ATTR,Ie):Og,pI="ALLOWED_NAMESPACES"in sA?addToSet({},sA.ALLOWED_NAMESPACES,stringToString):oI,_A="ADD_URI_SAFE_ATTR"in sA?addToSet(clone(Xe),sA.ADD_URI_SAFE_ATTR,Ie):Xe,zA="ADD_DATA_URI_TAGS"in sA?addToSet(clone(NA),sA.ADD_DATA_URI_TAGS,Ie):NA,ZA="FORBID_CONTENTS"in sA?addToSet({},sA.FORBID_CONTENTS,Ie):GA,IA="FORBID_TAGS"in sA?addToSet({},sA.FORBID_TAGS,Ie):{},Pg="FORBID_ATTR"in sA?addToSet({},sA.FORBID_ATTR,Ie):{},oA="USE_PROFILES"in sA?sA.USE_PROFILES:!1,qg=sA.ALLOW_ARIA_ATTR!==!1,lA=sA.ALLOW_DATA_ATTR!==!1,pA=sA.ALLOW_UNKNOWN_PROTOCOLS||!1,VA=sA.ALLOW_SELF_CLOSE_IN_ATTR!==!1,XA=sA.SAFE_FOR_TEMPLATES||!1,hA=sA.SAFE_FOR_XML!==!1,CA=sA.WHOLE_DOCUMENT||!1,HA=sA.RETURN_DOM||!1,kA=sA.RETURN_DOM_FRAGMENT||!1,xA=sA.RETURN_TRUSTED_TYPE||!1,EA=sA.FORCE_BODY||!1,rA=sA.SANITIZE_DOM!==!1,dA=sA.SANITIZE_NAMED_PROPS||!1,$A=sA.KEEP_CONTENT!==!1,nA=sA.IN_PLACE||!1,xg=sA.ALLOWED_URI_REGEXP||xg,tI=sA.NAMESPACE||Ue,gA=sA.CUSTOM_ELEMENT_HANDLING||{},sA.CUSTOM_ELEMENT_HANDLING&&HI(sA.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(gA.tagNameCheck=sA.CUSTOM_ELEMENT_HANDLING.tagNameCheck),sA.CUSTOM_ELEMENT_HANDLING&&HI(sA.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(gA.attributeNameCheck=sA.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),sA.CUSTOM_ELEMENT_HANDLING&&typeof sA.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(gA.allowCustomizedBuiltInElements=sA.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),XA&&(lA=!1),kA&&(HA=!0),oA&&(Tg=addToSet({},_toConsumableArray(text)),Eg=[],oA.html===!0&&(addToSet(Tg,html$1$1),addToSet(Eg,html$3)),oA.svg===!0&&(addToSet(Tg,svg$1),addToSet(Eg,svg),addToSet(Eg,xml)),oA.svgFilters===!0&&(addToSet(Tg,svgFilters),addToSet(Eg,svg),addToSet(Eg,xml)),oA.mathMl===!0&&(addToSet(Tg,mathMl$1),addToSet(Eg,mathMl),addToSet(Eg,xml))),sA.ADD_TAGS&&(Tg===Mg&&(Tg=clone(Tg)),addToSet(Tg,sA.ADD_TAGS,Ie)),sA.ADD_ATTR&&(Eg===Og&&(Eg=clone(Eg)),addToSet(Eg,sA.ADD_ATTR,Ie)),sA.ADD_URI_SAFE_ATTR&&addToSet(_A,sA.ADD_URI_SAFE_ATTR,Ie),sA.FORBID_CONTENTS&&(ZA===GA&&(ZA=clone(ZA)),addToSet(ZA,sA.FORBID_CONTENTS,Ie)),$A&&(Tg["#text"]=!0),CA&&addToSet(Tg,["html","head","body"]),Tg.table&&(addToSet(Tg,["tbody"]),delete IA.tbody),freeze&&freeze(sA),iI=sA)},AC=addToSet({},["mi","mo","mn","ms","mtext"]),Oe=addToSet({},["annotation-xml"]),QI=addToSet({},["title","style","font","a","script"]),_I=addToSet({},svg$1);addToSet(_I,svgFilters),addToSet(_I,svgDisallowed);var UI=addToSet({},mathMl$1);addToSet(UI,mathMlDisallowed);var VI=function(sA){var YA=mg(sA);(!YA||!YA.tagName)&&(YA={namespaceURI:tI,tagName:"template"});var OA=stringToLowerCase(sA.tagName),lI=stringToLowerCase(YA.tagName);return pI[sA.namespaceURI]?sA.namespaceURI===ze?YA.namespaceURI===Ue?OA==="svg":YA.namespaceURI===eI?OA==="svg"&&(lI==="annotation-xml"||AC[lI]):!!_I[OA]:sA.namespaceURI===eI?YA.namespaceURI===Ue?OA==="math":YA.namespaceURI===ze?OA==="math"&&Oe[lI]:!!UI[OA]:sA.namespaceURI===Ue?YA.namespaceURI===ze&&!Oe[lI]||YA.namespaceURI===eI&&!AC[lI]?!1:!UI[OA]&&(QI[OA]||!_I[OA]):!!(cI==="application/xhtml+xml"&&pI[sA.namespaceURI]):!1},nI=function(sA){arrayPush(gg.removed,{element:sA});try{sA.parentNode.removeChild(sA)}catch{try{sA.outerHTML=Gg}catch{sA.remove()}}},FI=function(sA,YA){try{arrayPush(gg.removed,{attribute:YA.getAttributeNode(sA),from:YA})}catch{arrayPush(gg.removed,{attribute:null,from:YA})}if(YA.removeAttribute(sA),sA==="is"&&!Eg[sA])if(HA||kA)try{nI(YA)}catch{}else try{YA.setAttribute(sA,"")}catch{}},lC=function(sA){var YA,OA;if(EA)sA="<remove></remove>"+sA;else{var lI=stringMatch(sA,/^[\r\n\t ]+/);OA=lI&&lI[0]}cI==="application/xhtml+xml"&&tI===Ue&&(sA='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+sA+"</body></html>");var WI=Bg?Bg.createHTML(sA):sA;if(tI===Ue)try{YA=new cg().parseFromString(WI,cI)}catch{}if(!YA||!YA.documentElement){YA=fg.createDocument(tI,"template",null);try{YA.documentElement.innerHTML=xe?Gg:WI}catch{}}var vI=YA.body||YA.documentElement;return sA&&OA&&vI.insertBefore(Ig.createTextNode(OA),vI.childNodes[0]||null),tI===Ue?Hg.call(YA,CA?"html":"body")[0]:CA?YA.documentElement:vI},oC=function(sA){return Vg.call(sA.ownerDocument||sA,sA,lg.SHOW_ELEMENT|lg.SHOW_COMMENT|lg.SHOW_TEXT|lg.SHOW_PROCESSING_INSTRUCTION|lg.SHOW_CDATA_SECTION,null,!1)},$I=function(sA){return sA instanceof rg&&(typeof sA.nodeName!="string"||typeof sA.textContent!="string"||typeof sA.removeChild!="function"||!(sA.attributes instanceof sg)||typeof sA.removeAttribute!="function"||typeof sA.setAttribute!="function"||typeof sA.namespaceURI!="string"||typeof sA.insertBefore!="function"||typeof sA.hasChildNodes!="function")},MI=function(sA){return _typeof(ig)==="object"?sA instanceof ig:sA&&_typeof(sA)==="object"&&typeof sA.nodeType=="number"&&typeof sA.nodeName=="string"},wI=function(sA,YA,OA){Xg[sA]&&arrayForEach(Xg[sA],function(lI){lI.call(gg,YA,OA,iI)})},CC=function(sA){var YA;if(wI("beforeSanitizeElements",sA,null),$I(sA)||regExpTest(/[\u0080-\uFFFF]/,sA.nodeName))return nI(sA),!0;var OA=Ie(sA.nodeName);if(wI("uponSanitizeElement",sA,{tagName:OA,allowedTags:Tg}),sA.hasChildNodes()&&!MI(sA.firstElementChild)&&(!MI(sA.content)||!MI(sA.content.firstElementChild))&®ExpTest(/<[/\w]/g,sA.innerHTML)&®ExpTest(/<[/\w]/g,sA.textContent)||OA==="select"&®ExpTest(/<template/i,sA.innerHTML)||sA.nodeType===7||hA&&sA.nodeType===8&®ExpTest(/<[/\w]/g,sA.data))return nI(sA),!0;if(!Tg[OA]||IA[OA]){if(!IA[OA]&&yA(OA)&&(gA.tagNameCheck instanceof RegExp&®ExpTest(gA.tagNameCheck,OA)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(OA)))return!1;if($A&&!ZA[OA]){var lI=mg(sA)||sA.parentNode,WI=bg(sA)||sA.childNodes;if(WI&&lI)for(var vI=WI.length,NI=vI-1;NI>=0;--NI){var VC=dg(WI[NI],!0);VC.__removalCount=(sA.__removalCount||0)+1,lI.insertBefore(VC,hg(sA))}}return nI(sA),!0}return sA instanceof ng&&!VI(sA)||(OA==="noscript"||OA==="noembed"||OA==="noframes")&®ExpTest(/<\/no(script|embed|frames)/i,sA.innerHTML)?(nI(sA),!0):(XA&&sA.nodeType===3&&(YA=sA.textContent,YA=stringReplace(YA,vg," "),YA=stringReplace(YA,yg," "),YA=stringReplace(YA,Ng," "),sA.textContent!==YA&&(arrayPush(gg.removed,{element:sA.cloneNode()}),sA.textContent=YA)),wI("afterSanitizeElements",sA,null),!1)},KI=function(sA,YA,OA){if(rA&&(YA==="id"||YA==="name")&&(OA in Ig||OA in WC))return!1;if(!(lA&&!Pg[YA]&®ExpTest(Yg,YA))){if(!(qg&®ExpTest(Kg,YA))){if(!Eg[YA]||Pg[YA]){if(!(yA(sA)&&(gA.tagNameCheck instanceof RegExp&®ExpTest(gA.tagNameCheck,sA)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(sA))&&(gA.attributeNameCheck instanceof RegExp&®ExpTest(gA.attributeNameCheck,YA)||gA.attributeNameCheck instanceof Function&&gA.attributeNameCheck(YA))||YA==="is"&&gA.allowCustomizedBuiltInElements&&(gA.tagNameCheck instanceof RegExp&®ExpTest(gA.tagNameCheck,OA)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(OA))))return!1}else if(!_A[YA]){if(!regExpTest(xg,stringReplace(OA,Ug,""))){if(!((YA==="src"||YA==="xlink:href"||YA==="href")&&sA!=="script"&&stringIndexOf$4(OA,"data:")===0&&zA[sA])){if(!(pA&&!regExpTest(Jg,stringReplace(OA,Ug,"")))){if(OA)return!1}}}}}}return!0},yA=function(sA){return sA!=="annotation-xml"&&stringMatch(sA,Qg)},TA=function(sA){var YA,OA,lI,WI;wI("beforeSanitizeAttributes",sA,null);var vI=sA.attributes;if(!(!vI||$I(sA))){var NI={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Eg};for(WI=vI.length;WI--;){YA=vI[WI];var VC=YA,fI=VC.name,ni=VC.namespaceURI;if(OA=fI==="value"?YA.value:stringTrim$1(YA.value),lI=Ie(fI),NI.attrName=lI,NI.attrValue=OA,NI.keepAttr=!0,NI.forceKeepAttr=void 0,wI("uponSanitizeAttribute",sA,NI),OA=NI.attrValue,!NI.forceKeepAttr&&(FI(fI,sA),!!NI.keepAttr)){if(!VA&®ExpTest(/\/>/i,OA)){FI(fI,sA);continue}XA&&(OA=stringReplace(OA,vg," "),OA=stringReplace(OA,yg," "),OA=stringReplace(OA,Ng," "));var li=Ie(sA.nodeName);if(KI(li,lI,OA)){if(dA&&(lI==="id"||lI==="name")&&(FI(fI,sA),OA=MA+OA),hA&®ExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,OA)){FI(fI,sA);continue}if(Bg&&_typeof(ag)==="object"&&typeof ag.getAttributeType=="function"&&!ni)switch(ag.getAttributeType(li,lI)){case"TrustedHTML":{OA=Bg.createHTML(OA);break}case"TrustedScriptURL":{OA=Bg.createScriptURL(OA);break}}try{ni?sA.setAttributeNS(ni,fI,OA):sA.setAttribute(fI,OA),$I(sA)?nI(sA):arrayPop(gg.removed)}catch{}}}}wI("afterSanitizeAttributes",sA,null)}},Fe=function QA(sA){var YA,OA=oC(sA);for(wI("beforeSanitizeShadowDOM",sA,null);YA=OA.nextNode();)wI("uponSanitizeShadowNode",YA,null),CC(YA),TA(YA),YA.content instanceof Cg&&QA(YA.content);wI("afterSanitizeShadowDOM",sA,null)};return gg.sanitize=function(QA){var sA=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},YA,OA,lI,WI,vI;if(xe=!QA,xe&&(QA="<!-->"),typeof QA!="string"&&!MI(QA))if(typeof QA.toString=="function"){if(QA=QA.toString(),typeof QA!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!gg.isSupported){if(_typeof(Ag.toStaticHTML)==="object"||typeof Ag.toStaticHTML=="function"){if(typeof QA=="string")return Ag.toStaticHTML(QA);if(MI(QA))return Ag.toStaticHTML(QA.outerHTML)}return QA}if(DA||PI(sA),gg.removed=[],typeof QA=="string"&&(nA=!1),nA){if(QA.nodeName){var NI=Ie(QA.nodeName);if(!Tg[NI]||IA[NI])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(QA instanceof ig)YA=lC("<!---->"),OA=YA.ownerDocument.importNode(QA,!0),OA.nodeType===1&&OA.nodeName==="BODY"||OA.nodeName==="HTML"?YA=OA:YA.appendChild(OA);else{if(!HA&&!XA&&!CA&&QA.indexOf("<")===-1)return Bg&&xA?Bg.createHTML(QA):QA;if(YA=lC(QA),!YA)return HA?null:xA?Gg:""}YA&&EA&&nI(YA.firstChild);for(var VC=oC(nA?QA:YA);lI=VC.nextNode();)lI.nodeType===3&&lI===WI||(CC(lI),TA(lI),lI.content instanceof Cg&&Fe(lI.content),WI=lI);if(WI=null,nA)return QA;if(HA){if(kA)for(vI=Wg.call(YA.ownerDocument);YA.firstChild;)vI.appendChild(YA.firstChild);else vI=YA;return(Eg.shadowroot||Eg.shadowrootmod)&&(vI=Sg.call(eg,vI,!0)),vI}var fI=CA?YA.outerHTML:YA.innerHTML;return CA&&Tg["!doctype"]&&YA.ownerDocument&&YA.ownerDocument.doctype&&YA.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,YA.ownerDocument.doctype.name)&&(fI="<!DOCTYPE "+YA.ownerDocument.doctype.name+`>
|
|
1447
1447
|
`+fI),XA&&(fI=stringReplace(fI,vg," "),fI=stringReplace(fI,yg," "),fI=stringReplace(fI,Ng," ")),Bg&&xA?Bg.createHTML(fI):fI},gg.setConfig=function(QA){PI(QA),DA=!0},gg.clearConfig=function(){iI=null,DA=!1},gg.isValidAttribute=function(QA,sA,YA){iI||PI({});var OA=Ie(QA),lI=Ie(sA);return KI(OA,lI,YA)},gg.addHook=function(QA,sA){typeof sA=="function"&&(Xg[QA]=Xg[QA]||[],arrayPush(Xg[QA],sA))},gg.removeHook=function(QA){if(Xg[QA])return arrayPop(Xg[QA])},gg.removeHooks=function(QA){Xg[QA]&&(Xg[QA]=[])},gg.removeAllHooks=function(){Xg={}},gg}var purify=createDOMPurify();const purify_es=Object.freeze(Object.defineProperty({__proto__:null,default:purify},Symbol.toStringTag,{value:"Module"}));var check=function(Ag){return Ag&&Ag.Math===Math&&Ag},globalThis_1=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$m=function(Ag){try{return!!Ag()}catch{return!0}},fails$l=fails$m,descriptors=!fails$l(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),fails$k=fails$m,functionBindNative=!fails$k(function(){var Ag=(function(){}).bind();return typeof Ag!="function"||Ag.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,call$j=Function.prototype.call,functionCall=NATIVE_BIND$3?call$j.bind(call$j):function(){return call$j.apply(call$j,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$4=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$4&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function Ag(gg){var eg=getOwnPropertyDescriptor$4(this,gg);return!!eg&&eg.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$3=function(Ag,gg){return{enumerable:!(Ag&1),configurable:!(Ag&2),writable:!(Ag&4),value:gg}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$i=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$i,call$i),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(Ag){return function(){return call$i.apply(Ag,arguments)}},uncurryThis$p=functionUncurryThis,toString$b=uncurryThis$p({}.toString),stringSlice$7=uncurryThis$p("".slice),classofRaw$2=function(Ag){return stringSlice$7(toString$b(Ag),8,-1)},uncurryThis$o=functionUncurryThis,fails$j=fails$m,classof$8=classofRaw$2,$Object$4=Object,split=uncurryThis$o("".split),indexedObject=fails$j(function(){return!$Object$4("z").propertyIsEnumerable(0)})?function(Ag){return classof$8(Ag)==="String"?split(Ag,""):$Object$4(Ag)}:$Object$4,isNullOrUndefined$4=function(Ag){return Ag==null},isNullOrUndefined$3=isNullOrUndefined$4,$TypeError$f=TypeError,requireObjectCoercible$b=function(Ag){if(isNullOrUndefined$3(Ag))throw new $TypeError$f("Can't call method on "+Ag);return Ag},IndexedObject$1=indexedObject,requireObjectCoercible$a=requireObjectCoercible$b,toIndexedObject$5=function(Ag){return IndexedObject$1(requireObjectCoercible$a(Ag))},documentAll=typeof document=="object"&&document.all,isCallable$m=typeof documentAll>"u"&&documentAll!==void 0?function(Ag){return typeof Ag=="function"||Ag===documentAll}:function(Ag){return typeof Ag=="function"},isCallable$l=isCallable$m,isObject$e=function(Ag){return typeof Ag=="object"?Ag!==null:isCallable$l(Ag)},globalThis$o=globalThis_1,isCallable$k=isCallable$m,aFunction=function(Ag){return isCallable$k(Ag)?Ag:void 0},getBuiltIn$7=function(Ag,gg){return arguments.length<2?aFunction(globalThis$o[Ag]):globalThis$o[Ag]&&globalThis$o[Ag][gg]},uncurryThis$n=functionUncurryThis,objectIsPrototypeOf=uncurryThis$n({}.isPrototypeOf),globalThis$n=globalThis_1,navigator$1=globalThis$n.navigator,userAgent$5=navigator$1&&navigator$1.userAgent,environmentUserAgent=userAgent$5?String(userAgent$5):"",globalThis$m=globalThis_1,userAgent$4=environmentUserAgent,process$4=globalThis$m.process,Deno$1=globalThis$m.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version;v8&&(match=v8.split("."),version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version&&userAgent$4&&(match=userAgent$4.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$4.match(/Chrome\/(\d+)/),match&&(version=+match[1])));var environmentV8Version=version,V8_VERSION$1=environmentV8Version,fails$i=fails$m,globalThis$l=globalThis_1,$String$5=globalThis$l.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$i(function(){var Ag=Symbol("symbol detection");return!$String$5(Ag)||!(Object(Ag)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",getBuiltIn$6=getBuiltIn$7,isCallable$j=isCallable$m,isPrototypeOf$3=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$2=USE_SYMBOL_AS_UID$1?function(Ag){return typeof Ag=="symbol"}:function(Ag){var gg=getBuiltIn$6("Symbol");return isCallable$j(gg)&&isPrototypeOf$3(gg.prototype,$Object$3(Ag))},$String$4=String,tryToString$4=function(Ag){try{return $String$4(Ag)}catch{return"Object"}},isCallable$i=isCallable$m,tryToString$3=tryToString$4,$TypeError$e=TypeError,aCallable$8=function(Ag){if(isCallable$i(Ag))return Ag;throw new $TypeError$e(tryToString$3(Ag)+" is not a function")},aCallable$7=aCallable$8,isNullOrUndefined$2=isNullOrUndefined$4,getMethod$6=function(Ag,gg){var eg=Ag[gg];return isNullOrUndefined$2(eg)?void 0:aCallable$7(eg)},call$h=functionCall,isCallable$h=isCallable$m,isObject$d=isObject$e,$TypeError$d=TypeError,ordinaryToPrimitive$1=function(Ag,gg){var eg,Ig;if(gg==="string"&&isCallable$h(eg=Ag.toString)&&!isObject$d(Ig=call$h(eg,Ag))||isCallable$h(eg=Ag.valueOf)&&!isObject$d(Ig=call$h(eg,Ag))||gg!=="string"&&isCallable$h(eg=Ag.toString)&&!isObject$d(Ig=call$h(eg,Ag)))return Ig;throw new $TypeError$d("Can't convert object to primitive value")},sharedStore={exports:{}},globalThis$k=globalThis_1,defineProperty$5=Object.defineProperty,defineGlobalProperty$3=function(Ag,gg){try{defineProperty$5(globalThis$k,Ag,{value:gg,configurable:!0,writable:!0})}catch{globalThis$k[Ag]=gg}return gg},globalThis$j=globalThis_1,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=sharedStore.exports=globalThis$j[SHARED]||defineGlobalProperty$2(SHARED,{});(store$3.versions||(store$3.versions=[])).push({version:"3.51.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.51.0/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedStoreExports=sharedStore.exports,store$2=sharedStoreExports,create$3=Object.create||Object,shared$4=function(Ag,gg){return store$2[Ag]||(store$2[Ag]=gg||create$3(null))},requireObjectCoercible$9=requireObjectCoercible$b,$Object$2=Object,toObject$4=function(Ag){return $Object$2(requireObjectCoercible$9(Ag))},uncurryThis$m=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty=uncurryThis$m({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function Ag(gg,eg){return hasOwnProperty(toObject$3(gg),eg)},uncurryThis$l=functionUncurryThis,id=0,postfix=Math.random(),toString$a=uncurryThis$l(1.1.toString),uid$2=function(Ag){return"Symbol("+(Ag===void 0?"":Ag)+")_"+toString$a(++id+postfix,36)},globalThis$i=globalThis_1,shared$3=shared$4,hasOwn$a=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$1=globalThis$i.Symbol,WellKnownSymbolsStore=shared$3("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$i=function(Ag){return hasOwn$a(WellKnownSymbolsStore,Ag)||(WellKnownSymbolsStore[Ag]=NATIVE_SYMBOL&&hasOwn$a(Symbol$1,Ag)?Symbol$1[Ag]:createWellKnownSymbol("Symbol."+Ag)),WellKnownSymbolsStore[Ag]},call$g=functionCall,isObject$c=isObject$e,isSymbol$1=isSymbol$2,getMethod$5=getMethod$6,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$h=wellKnownSymbol$i,$TypeError$c=TypeError,TO_PRIMITIVE=wellKnownSymbol$h("toPrimitive"),toPrimitive$2=function(Ag,gg){if(!isObject$c(Ag)||isSymbol$1(Ag))return Ag;var eg=getMethod$5(Ag,TO_PRIMITIVE),Ig;if(eg){if(gg===void 0&&(gg="default"),Ig=call$g(eg,Ag,gg),!isObject$c(Ig)||isSymbol$1(Ig))return Ig;throw new $TypeError$c("Can't convert object to primitive value")}return gg===void 0&&(gg="number"),ordinaryToPrimitive(Ag,gg)},toPrimitive$1=toPrimitive$2,isSymbol=isSymbol$2,toPropertyKey$3=function(Ag){var gg=toPrimitive$1(Ag,"string");return isSymbol(gg)?gg:gg+""},globalThis$h=globalThis_1,isObject$b=isObject$e,document$3=globalThis$h.document,EXISTS$1=isObject$b(document$3)&&isObject$b(document$3.createElement),documentCreateElement$2=function(Ag){return EXISTS$1?document$3.createElement(Ag):{}},DESCRIPTORS$a=descriptors,fails$h=fails$m,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$a&&!fails$h(function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}),DESCRIPTORS$9=descriptors,call$f=functionCall,propertyIsEnumerableModule=objectPropertyIsEnumerable,createPropertyDescriptor$2=createPropertyDescriptor$3,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$9=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$9?$getOwnPropertyDescriptor$1:function Ag(gg,eg){if(gg=toIndexedObject$4(gg),eg=toPropertyKey$2(eg),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(gg,eg)}catch{}if(hasOwn$9(gg,eg))return createPropertyDescriptor$2(!call$f(propertyIsEnumerableModule.f,gg,eg),gg[eg])};var objectDefineProperty={},DESCRIPTORS$8=descriptors,fails$g=fails$m,v8PrototypeDefineBug=DESCRIPTORS$8&&fails$g(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),isObject$a=isObject$e,$String$3=String,$TypeError$b=TypeError,anObject$f=function(Ag){if(isObject$a(Ag))return Ag;throw new $TypeError$b($String$3(Ag)+" is not an object")},DESCRIPTORS$7=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$e=anObject$f,toPropertyKey$1=toPropertyKey$3,$TypeError$a=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$7?V8_PROTOTYPE_DEFINE_BUG$1?function Ag(gg,eg,Ig){if(anObject$e(gg),eg=toPropertyKey$1(eg),anObject$e(Ig),typeof gg=="function"&&eg==="prototype"&&"value"in Ig&&WRITABLE in Ig&&!Ig[WRITABLE]){var Cg=$getOwnPropertyDescriptor(gg,eg);Cg&&Cg[WRITABLE]&&(gg[eg]=Ig.value,Ig={configurable:CONFIGURABLE$1 in Ig?Ig[CONFIGURABLE$1]:Cg[CONFIGURABLE$1],enumerable:ENUMERABLE in Ig?Ig[ENUMERABLE]:Cg[ENUMERABLE],writable:!1})}return $defineProperty(gg,eg,Ig)}:$defineProperty:function Ag(gg,eg,Ig){if(anObject$e(gg),eg=toPropertyKey$1(eg),anObject$e(Ig),IE8_DOM_DEFINE)try{return $defineProperty(gg,eg,Ig)}catch{}if("get"in Ig||"set"in Ig)throw new $TypeError$a("Accessors not supported");return"value"in Ig&&(gg[eg]=Ig.value),gg};var DESCRIPTORS$6=descriptors,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$3,createNonEnumerableProperty$5=DESCRIPTORS$6?function(Ag,gg,eg){return definePropertyModule$3.f(Ag,gg,createPropertyDescriptor$1(1,eg))}:function(Ag,gg,eg){return Ag[gg]=eg,Ag},makeBuiltIn$3={exports:{}},DESCRIPTORS$5=descriptors,hasOwn$8=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$5&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$8(FunctionPrototype$1,"name"),PROPER=EXISTS&&(function Ag(){}).name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$5||DESCRIPTORS$5&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$k=functionUncurryThis,isCallable$g=isCallable$m,store$1=sharedStoreExports,functionToString=uncurryThis$k(Function.toString);isCallable$g(store$1.inspectSource)||(store$1.inspectSource=function(Ag){return functionToString(Ag)});var inspectSource$3=store$1.inspectSource,globalThis$g=globalThis_1,isCallable$f=isCallable$m,WeakMap$2=globalThis$g.WeakMap,weakMapBasicDetection=isCallable$f(WeakMap$2)&&/native code/.test(String(WeakMap$2)),shared$2=shared$4,uid=uid$2,keys=shared$2("keys"),sharedKey$3=function(Ag){return keys[Ag]||(keys[Ag]=uid(Ag))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,globalThis$f=globalThis_1,isObject$9=isObject$e,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$7=hasOwnProperty_1,shared$1=sharedStoreExports,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$2=globalThis$f.TypeError,WeakMap$1=globalThis$f.WeakMap,set$1,get,has,enforce=function(Ag){return has(Ag)?get(Ag):set$1(Ag,{})},getterFor=function(Ag){return function(gg){var eg;if(!isObject$9(gg)||(eg=get(gg)).type!==Ag)throw new TypeError$2("Incompatible receiver, "+Ag+" required");return eg}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap$1);store.get=store.get,store.has=store.has,store.set=store.set,set$1=function(Ag,gg){if(store.has(Ag))throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);return gg.facade=Ag,store.set(Ag,gg),gg},get=function(Ag){return store.get(Ag)||{}},has=function(Ag){return store.has(Ag)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=!0,set$1=function(Ag,gg){if(hasOwn$7(Ag,STATE))throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);return gg.facade=Ag,createNonEnumerableProperty$4(Ag,STATE,gg),gg},get=function(Ag){return hasOwn$7(Ag,STATE)?Ag[STATE]:{}},has=function(Ag){return hasOwn$7(Ag,STATE)}}var internalState={set:set$1,get,has,enforce,getterFor},uncurryThis$j=functionUncurryThis,fails$f=fails$m,isCallable$e=isCallable$m,hasOwn$6=hasOwnProperty_1,DESCRIPTORS$4=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$2=internalState,enforceInternalState=InternalStateModule$2.enforce,getInternalState$2=InternalStateModule$2.get,$String$2=String,defineProperty$4=Object.defineProperty,stringSlice$6=uncurryThis$j("".slice),replace$3=uncurryThis$j("".replace),join=uncurryThis$j([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$4&&!fails$f(function(){return defineProperty$4(function(){},"length",{value:8}).length!==8}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(Ag,gg,eg){stringSlice$6($String$2(gg),0,7)==="Symbol("&&(gg="["+replace$3($String$2(gg),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),eg&&eg.getter&&(gg="get "+gg),eg&&eg.setter&&(gg="set "+gg),(!hasOwn$6(Ag,"name")||CONFIGURABLE_FUNCTION_NAME$1&&Ag.name!==gg)&&(DESCRIPTORS$4?defineProperty$4(Ag,"name",{value:gg,configurable:!0}):Ag.name=gg),CONFIGURABLE_LENGTH&&eg&&hasOwn$6(eg,"arity")&&Ag.length!==eg.arity&&defineProperty$4(Ag,"length",{value:eg.arity});try{eg&&hasOwn$6(eg,"constructor")&&eg.constructor?DESCRIPTORS$4&&defineProperty$4(Ag,"prototype",{writable:!1}):Ag.prototype&&(Ag.prototype=void 0)}catch{}var Ig=enforceInternalState(Ag);return hasOwn$6(Ig,"source")||(Ig.source=join(TEMPLATE,typeof gg=="string"?gg:"")),Ag};Function.prototype.toString=makeBuiltIn$2(function Ag(){return isCallable$e(this)&&getInternalState$2(this).source||inspectSource$2(this)},"toString");var makeBuiltInExports=makeBuiltIn$3.exports,isCallable$d=isCallable$m,definePropertyModule$2=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$7=function(Ag,gg,eg,Ig){Ig||(Ig={});var Cg=Ig.enumerable,tg=Ig.name!==void 0?Ig.name:gg;if(isCallable$d(eg)&&makeBuiltIn$1(eg,tg,Ig),Ig.global)Cg?Ag[gg]=eg:defineGlobalProperty$1(gg,eg);else{try{Ig.unsafe?Ag[gg]&&(Cg=!0):delete Ag[gg]}catch{}Cg?Ag[gg]=eg:definePropertyModule$2.f(Ag,gg,{value:eg,enumerable:!1,configurable:!Ig.nonConfigurable,writable:!Ig.nonWritable})}return Ag},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$1=Math.floor,mathTrunc=Math.trunc||function Ag(gg){var eg=+gg;return(eg>0?floor$1:ceil)(eg)},trunc=mathTrunc,toIntegerOrInfinity$4=function(Ag){var gg=+Ag;return gg!==gg||gg===0?0:trunc(gg)},toIntegerOrInfinity$3=toIntegerOrInfinity$4,max$1=Math.max,min$5=Math.min,toAbsoluteIndex$1=function(Ag,gg){var eg=toIntegerOrInfinity$3(Ag);return eg<0?max$1(eg+gg,0):min$5(eg,gg)},toIntegerOrInfinity$2=toIntegerOrInfinity$4,min$4=Math.min,toLength$6=function(Ag){var gg=toIntegerOrInfinity$2(Ag);return gg>0?min$4(gg,9007199254740991):0},toLength$5=toLength$6,lengthOfArrayLike$3=function(Ag){return toLength$5(Ag.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex=toAbsoluteIndex$1,lengthOfArrayLike$2=lengthOfArrayLike$3,createMethod$3=function(Ag){return function(gg,eg,Ig){var Cg=toIndexedObject$3(gg),tg=lengthOfArrayLike$2(Cg);if(tg===0)return!Ag&&-1;var ig=toAbsoluteIndex(Ig,tg),ng;if(Ag&&eg!==eg){for(;tg>ig;)if(ng=Cg[ig++],ng!==ng)return!0}else for(;tg>ig;ig++)if((Ag||ig in Cg)&&Cg[ig]===eg)return Ag||ig||0;return!Ag&&-1}},arrayIncludes={includes:createMethod$3(!0),indexOf:createMethod$3(!1)},uncurryThis$i=functionUncurryThis,hasOwn$5=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$2=uncurryThis$i([].push),objectKeysInternal=function(Ag,gg){var eg=toIndexedObject$2(Ag),Ig=0,Cg=[],tg;for(tg in eg)!hasOwn$5(hiddenKeys$2,tg)&&hasOwn$5(eg,tg)&&push$2(Cg,tg);for(;gg.length>Ig;)hasOwn$5(eg,tg=gg[Ig++])&&(~indexOf$1(Cg,tg)||push$2(Cg,tg));return Cg},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function Ag(gg){return internalObjectKeys$1(gg,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$5=getBuiltIn$7,uncurryThis$h=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,anObject$d=anObject$f,concat$1=uncurryThis$h([].concat),ownKeys$4=getBuiltIn$5("Reflect","ownKeys")||function Ag(gg){var eg=getOwnPropertyNamesModule.f(anObject$d(gg)),Ig=getOwnPropertySymbolsModule.f;return Ig?concat$1(eg,Ig(gg)):eg},hasOwn$4=hasOwnProperty_1,ownKeys$3=ownKeys$4,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,copyConstructorProperties$1=function(Ag,gg,eg){for(var Ig=ownKeys$3(gg),Cg=definePropertyModule$1.f,tg=getOwnPropertyDescriptorModule.f,ig=0;ig<Ig.length;ig++){var ng=Ig[ig];!hasOwn$4(Ag,ng)&&!(eg&&hasOwn$4(eg,ng))&&Cg(Ag,ng,tg(gg,ng))}},fails$e=fails$m,isCallable$c=isCallable$m,replacement=/#|\.prototype\./,isForced$2=function(Ag,gg){var eg=data[normalize(Ag)];return eg===POLYFILL?!0:eg===NATIVE?!1:isCallable$c(gg)?fails$e(gg):!!gg},normalize=isForced$2.normalize=function(Ag){return String(Ag).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,globalThis$e=globalThis_1,getOwnPropertyDescriptor$3=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$6=defineBuiltIn$7,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced$1=isForced_1,_export=function(Ag,gg){var eg=Ag.target,Ig=Ag.global,Cg=Ag.stat,tg,ig,ng,lg,og,sg;if(Ig?ig=globalThis$e:Cg?ig=globalThis$e[eg]||defineGlobalProperty(eg,{}):ig=globalThis$e[eg]&&globalThis$e[eg].prototype,ig)for(ng in gg){if(og=gg[ng],Ag.dontCallGetSet?(sg=getOwnPropertyDescriptor$3(ig,ng),lg=sg&&sg.value):lg=ig[ng],tg=isForced$1(Ig?ng:eg+(Cg?".":"#")+ng,Ag.forced),!tg&&lg!==void 0){if(typeof og==typeof lg)continue;copyConstructorProperties(og,lg)}(Ag.sham||lg&&lg.sham)&&createNonEnumerableProperty$3(og,"sham",!0),defineBuiltIn$6(ig,ng,og,Ag)}},globalThis$d=globalThis_1,userAgent$3=environmentUserAgent,classof$7=classofRaw$2,userAgentStartsWith=function(Ag){return userAgent$3.slice(0,Ag.length)===Ag},environment=function(){return userAgentStartsWith("Bun/")?"BUN":userAgentStartsWith("Cloudflare-Workers")?"CLOUDFLARE":userAgentStartsWith("Deno/")?"DENO":userAgentStartsWith("Node.js/")?"NODE":globalThis$d.Bun&&typeof Bun.version=="string"?"BUN":globalThis$d.Deno&&typeof Deno.version=="object"?"DENO":classof$7(globalThis$d.process)==="process"?"NODE":globalThis$d.window&&globalThis$d.document?"BROWSER":"REST"}(),ENVIRONMENT$1=environment,environmentIsNode=ENVIRONMENT$1==="NODE",globalThis$c=globalThis_1,path$1=globalThis$c,uncurryThis$g=functionUncurryThis,aCallable$6=aCallable$8,functionUncurryThisAccessor=function(Ag,gg,eg){try{return uncurryThis$g(aCallable$6(Object.getOwnPropertyDescriptor(Ag,gg)[eg]))}catch{}},isObject$8=isObject$e,isPossiblePrototype$1=function(Ag){return isObject$8(Ag)||Ag===null},isPossiblePrototype=isPossiblePrototype$1,$String$1=String,$TypeError$9=TypeError,aPossiblePrototype$1=function(Ag){if(isPossiblePrototype(Ag))return Ag;throw new $TypeError$9("Can't set "+$String$1(Ag)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,isObject$7=isObject$e,requireObjectCoercible$8=requireObjectCoercible$b,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var Ag=!1,gg={},eg;try{eg=uncurryThisAccessor(Object.prototype,"__proto__","set"),eg(gg,[]),Ag=gg instanceof Array}catch{}return function(Cg,tg){return requireObjectCoercible$8(Cg),aPossiblePrototype(tg),isObject$7(Cg)&&(Ag?eg(Cg,tg):Cg.__proto__=tg),Cg}}():void 0),defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$g=wellKnownSymbol$i,TO_STRING_TAG$2=wellKnownSymbol$g("toStringTag"),setToStringTag$4=function(Ag,gg,eg){Ag&&!eg&&(Ag=Ag.prototype),Ag&&!hasOwn$3(Ag,TO_STRING_TAG$2)&&defineProperty$3(Ag,TO_STRING_TAG$2,{configurable:!0,value:gg})},makeBuiltIn=makeBuiltInExports,defineProperty$2=objectDefineProperty,defineBuiltInAccessor$1=function(Ag,gg,eg){return eg.get&&makeBuiltIn(eg.get,gg,{getter:!0}),eg.set&&makeBuiltIn(eg.set,gg,{setter:!0}),defineProperty$2.f(Ag,gg,eg)},getBuiltIn$4=getBuiltIn$7,defineBuiltInAccessor=defineBuiltInAccessor$1,wellKnownSymbol$f=wellKnownSymbol$i,DESCRIPTORS$3=descriptors,SPECIES$3=wellKnownSymbol$f("species"),setSpecies$1=function(Ag){var gg=getBuiltIn$4(Ag);DESCRIPTORS$3&&gg&&!gg[SPECIES$3]&&defineBuiltInAccessor(gg,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$2=objectIsPrototypeOf,$TypeError$8=TypeError,anInstance$1=function(Ag,gg){if(isPrototypeOf$2(gg,Ag))return Ag;throw new $TypeError$8("Incorrect invocation")},wellKnownSymbol$e=wellKnownSymbol$i,TO_STRING_TAG$1=wellKnownSymbol$e("toStringTag"),test$1={};test$1[TO_STRING_TAG$1]="z";var toStringTagSupport=String(test$1)==="[object z]",TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$b=isCallable$m,classofRaw$1=classofRaw$2,wellKnownSymbol$d=wellKnownSymbol$i,TO_STRING_TAG=wellKnownSymbol$d("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS=classofRaw$1(function(){return arguments}())==="Arguments",tryGet=function(Ag,gg){try{return Ag[gg]}catch{}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw$1:function(Ag){var gg,eg,Ig;return Ag===void 0?"Undefined":Ag===null?"Null":typeof(eg=tryGet(gg=$Object$1(Ag),TO_STRING_TAG))=="string"?eg:CORRECT_ARGUMENTS?classofRaw$1(gg):(Ig=classofRaw$1(gg))==="Object"&&isCallable$b(gg.callee)?"Arguments":Ig},uncurryThis$f=functionUncurryThis,fails$d=fails$m,isCallable$a=isCallable$m,classof$5=classof$6,getBuiltIn$3=getBuiltIn$7,inspectSource$1=inspectSource$3,noop$1=function(){},construct=getBuiltIn$3("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$1=uncurryThis$f(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.test(noop$1),isConstructorModern=function Ag(gg){if(!isCallable$a(gg))return!1;try{return construct(noop$1,[],gg),!0}catch{return!1}},isConstructorLegacy=function Ag(gg){if(!isCallable$a(gg))return!1;switch(classof$5(gg)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$1(constructorRegExp,inspectSource$1(gg))}catch{return!0}};isConstructorLegacy.sham=!0;var isConstructor$1=!construct||fails$d(function(){var Ag;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){Ag=!0})||Ag})?isConstructorLegacy:isConstructorModern,isConstructor=isConstructor$1,tryToString$2=tryToString$4,$TypeError$7=TypeError,aConstructor$1=function(Ag){if(isConstructor(Ag))return Ag;throw new $TypeError$7(tryToString$2(Ag)+" is not a constructor")},anObject$c=anObject$f,aConstructor=aConstructor$1,isNullOrUndefined$1=isNullOrUndefined$4,wellKnownSymbol$c=wellKnownSymbol$i,SPECIES$2=wellKnownSymbol$c("species"),speciesConstructor$2=function(Ag,gg){var eg=anObject$c(Ag).constructor,Ig;return eg===void 0||isNullOrUndefined$1(Ig=anObject$c(eg)[SPECIES$2])?gg:aConstructor(Ig)},NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$2=FunctionPrototype.apply,call$e=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND$1?call$e.bind(apply$2):function(){return call$e.apply(apply$2,arguments)}),classofRaw=classofRaw$2,uncurryThis$e=functionUncurryThis,functionUncurryThisClause=function(Ag){if(classofRaw(Ag)==="Function")return uncurryThis$e(Ag)},uncurryThis$d=functionUncurryThisClause,aCallable$5=aCallable$8,NATIVE_BIND=functionBindNative,bind$4=uncurryThis$d(uncurryThis$d.bind),functionBindContext=function(Ag,gg){return aCallable$5(Ag),gg===void 0?Ag:NATIVE_BIND?bind$4(Ag,gg):function(){return Ag.apply(gg,arguments)}},getBuiltIn$2=getBuiltIn$7,html$2=getBuiltIn$2("document","documentElement"),uncurryThis$c=functionUncurryThis,arraySlice$1=uncurryThis$c([].slice),$TypeError$6=TypeError,validateArgumentsLength$1=function(Ag,gg){if(Ag<gg)throw new $TypeError$6("Not enough arguments");return Ag},userAgent$2=environmentUserAgent,environmentIsIos=/ipad|iphone|ipod/i.test(userAgent$2)&&/applewebkit/i.test(userAgent$2),globalThis$b=globalThis_1,apply$1=functionApply,bind$3=functionBindContext,isCallable$9=isCallable$m,hasOwn$2=hasOwnProperty_1,fails$c=fails$m,html$1=html$2,arraySlice=arraySlice$1,createElement=documentCreateElement$2,validateArgumentsLength=validateArgumentsLength$1,IS_IOS$1=environmentIsIos,IS_NODE$3=environmentIsNode,set=globalThis$b.setImmediate,clear=globalThis$b.clearImmediate,process$3=globalThis$b.process,Dispatch=globalThis$b.Dispatch,Function$1=globalThis$b.Function,MessageChannel=globalThis$b.MessageChannel,String$1=globalThis$b.String,counter=0,queue$2={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;fails$c(function(){$location=globalThis$b.location});var run=function(Ag){if(hasOwn$2(queue$2,Ag)){var gg=queue$2[Ag];delete queue$2[Ag],gg()}},runner=function(Ag){return function(){run(Ag)}},eventListener=function(Ag){run(Ag.data)},globalPostMessageDefer=function(Ag){globalThis$b.postMessage(String$1(Ag),$location.protocol+"//"+$location.host)};(!set||!clear)&&(set=function(gg){validateArgumentsLength(arguments.length,1);var eg=isCallable$9(gg)?gg:Function$1(gg),Ig=arraySlice(arguments,1);return queue$2[++counter]=function(){apply$1(eg,void 0,Ig)},defer(counter),counter},clear=function(gg){delete queue$2[gg]},IS_NODE$3?defer=function(Ag){process$3.nextTick(runner(Ag))}:Dispatch&&Dispatch.now?defer=function(Ag){Dispatch.now(runner(Ag))}:MessageChannel&&!IS_IOS$1?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=eventListener,defer=bind$3(port.postMessage,port)):globalThis$b.addEventListener&&isCallable$9(globalThis$b.postMessage)&&!globalThis$b.importScripts&&$location&&$location.protocol!=="file:"&&!fails$c(globalPostMessageDefer)?(defer=globalPostMessageDefer,globalThis$b.addEventListener("message",eventListener,!1)):ONREADYSTATECHANGE in createElement("script")?defer=function(Ag){html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$1.removeChild(this),run(Ag)}}:defer=function(Ag){setTimeout(runner(Ag),0)});var task$1={set,clear},globalThis$a=globalThis_1,DESCRIPTORS$2=descriptors,getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor,safeGetBuiltIn$1=function(Ag){if(!DESCRIPTORS$2)return globalThis$a[Ag];var gg=getOwnPropertyDescriptor$2(globalThis$a,Ag);return gg&&gg.value},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function(Ag){var gg={item:Ag,next:null},eg=this.tail;eg?eg.next=gg:this.head=gg,this.tail=gg},get:function(){var Ag=this.head;if(Ag){var gg=this.head=Ag.next;return gg===null&&(this.tail=null),Ag.item}}};var queue$1=Queue$2,userAgent$1=environmentUserAgent,environmentIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&typeof Pebble<"u",userAgent=environmentUserAgent,environmentIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),globalThis$9=globalThis_1,safeGetBuiltIn=safeGetBuiltIn$1,bind$2=functionBindContext,macrotask=task$1.set,Queue$1=queue$1,IS_IOS=environmentIsIos,IS_IOS_PEBBLE=environmentIsIosPebble,IS_WEBOS_WEBKIT=environmentIsWebosWebkit,IS_NODE$2=environmentIsNode,MutationObserver$1=globalThis$9.MutationObserver||globalThis$9.WebKitMutationObserver,document$2=globalThis$9.document,process$2=globalThis$9.process,Promise$1=globalThis$9.Promise,microtask$1=safeGetBuiltIn("queueMicrotask"),notify$1,toggle,node$1,promise,then;if(!microtask$1){var queue=new Queue$1,flush=function(){var Ag,gg;for(IS_NODE$2&&(Ag=process$2.domain)&&Ag.exit();gg=queue.get();)try{gg()}catch(eg){throw queue.head&¬ify$1(),eg}Ag&&Ag.enter()};!IS_IOS&&!IS_NODE$2&&!IS_WEBOS_WEBKIT&&MutationObserver$1&&document$2?(toggle=!0,node$1=document$2.createTextNode(""),new MutationObserver$1(flush).observe(node$1,{characterData:!0}),notify$1=function(){node$1.data=toggle=!toggle}):!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?(promise=Promise$1.resolve(void 0),promise.constructor=Promise$1,then=bind$2(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$2?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$2(macrotask,globalThis$9),notify$1=function(){macrotask(flush)}),microtask$1=function(Ag){queue.head||notify$1(),queue.add(Ag)}}var microtask_1=microtask$1,hostReportErrors$1=function(Ag,gg){try{arguments.length===1?console.error(Ag):console.error(Ag,gg)}catch{}},perform$3=function(Ag){try{return{error:!1,value:Ag()}}catch(gg){return{error:!0,value:gg}}},globalThis$8=globalThis_1,promiseNativeConstructor=globalThis$8.Promise,globalThis$7=globalThis_1,NativePromiseConstructor$3=promiseNativeConstructor,isCallable$8=isCallable$m,isForced=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$b=wellKnownSymbol$i,ENVIRONMENT=environment,V8_VERSION=environmentV8Version;NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype;var SPECIES$1=wellKnownSymbol$b("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$8(globalThis$7.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",function(){var Ag=inspectSource(NativePromiseConstructor$3),gg=Ag!==String(NativePromiseConstructor$3);if(!gg&&V8_VERSION===66)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(Ag)){var eg=new NativePromiseConstructor$3(function(tg){tg(1)}),Ig=function(tg){tg(function(){},function(){})},Cg=eg.constructor={};if(Cg[SPECIES$1]=Ig,SUBCLASSING=eg.then(function(){})instanceof Ig,!SUBCLASSING)return!0}return!gg&&(ENVIRONMENT==="BROWSER"||ENVIRONMENT==="DENO")&&!NATIVE_PROMISE_REJECTION_EVENT$1}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING},newPromiseCapability$2={},aCallable$4=aCallable$8,$TypeError$5=TypeError,PromiseCapability=function(Ag){var gg,eg;this.promise=new Ag(function(Ig,Cg){if(gg!==void 0||eg!==void 0)throw new $TypeError$5("Bad Promise constructor");gg=Ig,eg=Cg}),this.resolve=aCallable$4(gg),this.reject=aCallable$4(eg)};newPromiseCapability$2.f=function(Ag){return new PromiseCapability(Ag)};var $$e=_export,IS_NODE$1=environmentIsNode,globalThis$6=globalThis_1,path=path$1,call$d=functionCall,defineBuiltIn$5=defineBuiltIn$7,setPrototypeOf$1=objectSetPrototypeOf,setToStringTag$3=setToStringTag$4,setSpecies=setSpecies$1,aCallable$3=aCallable$8,isCallable$7=isCallable$m,isObject$6=isObject$e,anInstance=anInstance$1,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue$1,InternalStateModule$1=internalState,NativePromiseConstructor$2=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$3=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule$1.getterFor(PROMISE),setInternalState$1=InternalStateModule$1.set,NativePromisePrototype$1=NativePromiseConstructor$2&&NativePromiseConstructor$2.prototype,PromiseConstructor=NativePromiseConstructor$2,PromisePrototype=NativePromisePrototype$1,TypeError$1=globalThis$6.TypeError,document$1=globalThis$6.document,process$1=globalThis$6.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&globalThis$6.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,isThenable=function(Ag){var gg;return isObject$6(Ag)&&isCallable$7(gg=Ag.then)?gg:!1},callReaction=function(Ag,gg){var eg=gg.value,Ig=gg.state===FULFILLED,Cg=Ig?Ag.ok:Ag.fail,tg=Ag.resolve,ig=Ag.reject,ng=Ag.domain,lg,og,sg;try{Cg?(Ig||(gg.rejection===UNHANDLED&&onHandleUnhandled(gg),gg.rejection=HANDLED),Cg===!0?lg=eg:(ng&&ng.enter(),lg=Cg(eg),ng&&(ng.exit(),sg=!0)),lg===Ag.promise?ig(new TypeError$1("Promise-chain cycle")):(og=isThenable(lg))?call$d(og,lg,tg,ig):tg(lg)):ig(eg)}catch(rg){ng&&!sg&&ng.exit(),ig(rg)}},notify=function(Ag,gg){Ag.notified||(Ag.notified=!0,microtask(function(){for(var eg=Ag.reactions,Ig;Ig=eg.get();)callReaction(Ig,Ag);Ag.notified=!1,gg&&!Ag.rejection&&onUnhandled(Ag)}))},dispatchEvent=function(Ag,gg,eg){var Ig,Cg;DISPATCH_EVENT?(Ig=document$1.createEvent("Event"),Ig.promise=gg,Ig.reason=eg,Ig.initEvent(Ag,!1,!0),globalThis$6.dispatchEvent(Ig)):Ig={promise:gg,reason:eg},!NATIVE_PROMISE_REJECTION_EVENT&&(Cg=globalThis$6["on"+Ag])?Cg(Ig):Ag===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",eg)},onUnhandled=function(Ag){call$d(task,globalThis$6,function(){var gg=Ag.facade,eg=Ag.value,Ig=isUnhandled(Ag),Cg;if(Ig&&(Cg=perform$2(function(){IS_NODE$1?process$1.emit("unhandledRejection",eg,gg):dispatchEvent(UNHANDLED_REJECTION,gg,eg)}),Ag.rejection=IS_NODE$1||isUnhandled(Ag)?UNHANDLED:HANDLED,Cg.error))throw Cg.value})},isUnhandled=function(Ag){return Ag.rejection!==HANDLED&&!Ag.parent},onHandleUnhandled=function(Ag){call$d(task,globalThis$6,function(){var gg=Ag.facade;IS_NODE$1?process$1.emit("rejectionHandled",gg):dispatchEvent(REJECTION_HANDLED,gg,Ag.value)})},bind$1=function(Ag,gg,eg){return function(Ig){Ag(gg,Ig,eg)}},internalReject=function(Ag,gg,eg){Ag.done||(Ag.done=!0,eg&&(Ag=eg),Ag.value=gg,Ag.state=REJECTED,notify(Ag,!0))},internalResolve=function(Ag,gg,eg){if(!Ag.done){Ag.done=!0,eg&&(Ag=eg);try{if(Ag.facade===gg)throw new TypeError$1("Promise can't be resolved itself");var Ig=isThenable(gg);Ig?microtask(function(){var Cg={done:!1};try{call$d(Ig,gg,bind$1(internalResolve,Cg,Ag),bind$1(internalReject,Cg,Ag))}catch(tg){internalReject(Cg,tg,Ag)}}):(Ag.value=gg,Ag.state=FULFILLED,notify(Ag,!1))}catch(Cg){internalReject({done:!1},Cg,Ag)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromiseConstructor=function(gg){anInstance(this,PromisePrototype),aCallable$3(gg),call$d(Internal,this);var eg=getInternalPromiseState(this);try{gg(bind$1(internalResolve,eg),bind$1(internalReject,eg))}catch(Ig){internalReject(eg,Ig)}},PromisePrototype=PromiseConstructor.prototype,Internal=function(gg){setInternalState$1(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:null})},Internal.prototype=defineBuiltIn$5(PromisePrototype,"then",function(gg,eg){var Ig=getInternalPromiseState(this),Cg=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return Ig.parent=!0,Cg.ok=isCallable$7(gg)?gg:!0,Cg.fail=isCallable$7(eg)&&eg,Cg.domain=IS_NODE$1?process$1.domain:void 0,Ig.state===PENDING?Ig.reactions.add(Cg):microtask(function(){callReaction(Cg,Ig)}),Cg.promise}),OwnPromiseCapability=function(){var Ag=new Internal,gg=getInternalPromiseState(Ag);this.promise=Ag,this.resolve=bind$1(internalResolve,gg),this.reject=bind$1(internalReject,gg)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(Ag){return Ag===PromiseConstructor||Ag===PromiseWrapper?new OwnPromiseCapability(Ag):newGenericPromiseCapability(Ag)},isCallable$7(NativePromiseConstructor$2)&&NativePromisePrototype$1!==Object.prototype)){nativeThen=NativePromisePrototype$1.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$5(NativePromisePrototype$1,"then",function(gg,eg){var Ig=this;return new PromiseConstructor(function(Cg,tg){call$d(nativeThen,Ig,Cg,tg)}).then(gg,eg)},{unsafe:!0});try{delete NativePromisePrototype$1.constructor}catch{}setPrototypeOf$1&&setPrototypeOf$1(NativePromisePrototype$1,PromisePrototype)}$$e({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),PromiseWrapper=path.Promise,setToStringTag$3(PromiseConstructor,PROMISE,!1),setSpecies(PROMISE);var iterators=Object.create?Object.create(null):{},wellKnownSymbol$a=wellKnownSymbol$i,Iterators$3=iterators,ITERATOR$5=wellKnownSymbol$a("iterator"),ArrayPrototype$2=Array.prototype,isArrayIteratorMethod$1=function(Ag){return Ag!==void 0&&(Iterators$3.Array===Ag||ArrayPrototype$2[ITERATOR$5]===Ag)},classof$4=classofRaw$2,isNullOrUndefined=isNullOrUndefined$4,getMethod$4=getMethod$6,wellKnownSymbol$9=wellKnownSymbol$i,ITERATOR$4=wellKnownSymbol$9("iterator"),ArrayPrototype$1=Array.prototype,getIteratorMethodInternal=function(Ag){if(!isNullOrUndefined(Ag))return getMethod$4(Ag,ITERATOR$4)||getMethod$4(Ag,"@@iterator")||(classof$4(Ag)==="Arguments"?ArrayPrototype$1[ITERATOR$4]:void 0)},call$c=functionCall,isCallable$6=isCallable$m,anObject$b=anObject$f,tryToString$1=tryToString$4,getIteratorMethod$1=getIteratorMethodInternal,$TypeError$4=TypeError,getIteratorInternal=function(Ag,gg){var eg=arguments.length<2?getIteratorMethod$1(Ag):gg;if(isCallable$6(eg))return anObject$b(call$c(eg,Ag));throw new $TypeError$4(tryToString$1(Ag)+" is not iterable")},call$b=functionCall,anObject$a=anObject$f,getMethod$3=getMethod$6,iteratorClose$1=function(Ag,gg,eg){var Ig,Cg;anObject$a(Ag);try{if(Ig=getMethod$3(Ag,"return"),!Ig){if(gg==="throw")throw eg;return eg}Ig=call$b(Ig,Ag)}catch(tg){Cg=!0,Ig=tg}if(gg==="throw")throw eg;if(Cg)throw Ig;return anObject$a(Ig),eg},bind=functionBindContext,call$a=functionCall,anObject$9=anObject$f,tryToString=tryToString$4,isArrayIteratorMethod=isArrayIteratorMethod$1,lengthOfArrayLike$1=lengthOfArrayLike$3,isPrototypeOf$1=objectIsPrototypeOf,getIterator=getIteratorInternal,getIteratorMethod=getIteratorMethodInternal,iteratorClose=iteratorClose$1,$TypeError$3=TypeError,Result=function(Ag,gg){this.stopped=Ag,this.result=gg},ResultPrototype=Result.prototype,iterate$2=function(Ag,gg,eg){var Ig=eg&&eg.that,Cg=!!(eg&&eg.AS_ENTRIES),tg=!!(eg&&eg.IS_RECORD),ig=!!(eg&&eg.IS_ITERATOR),ng=!!(eg&&eg.INTERRUPTED),lg=bind(gg,Ig),og,sg,rg,cg,ag,ug,dg,hg=function(Zg){var Bg=og;return og=void 0,Bg&&iteratorClose(Bg,"normal"),new Result(!0,Zg)},bg=function(Zg){return Cg?(anObject$9(Zg),ng?lg(Zg[0],Zg[1],hg):lg(Zg[0],Zg[1])):ng?lg(Zg,hg):lg(Zg)};if(tg)og=Ag.iterator;else if(ig)og=Ag;else{if(sg=getIteratorMethod(Ag),!sg)throw new $TypeError$3(tryToString(Ag)+" is not iterable");if(isArrayIteratorMethod(sg)){for(rg=0,cg=lengthOfArrayLike$1(Ag);cg>rg;rg++)if(ag=bg(Ag[rg]),ag&&isPrototypeOf$1(ResultPrototype,ag))return ag;return new Result(!1)}og=getIterator(Ag,sg)}for(ug=tg?Ag.next:og.next;!(dg=call$a(ug,og)).done;){var mg=dg.value;try{ag=bg(mg)}catch(Zg){if(og)iteratorClose(og,"throw",Zg);else throw Zg}if(typeof ag=="object"&&ag&&isPrototypeOf$1(ResultPrototype,ag))return ag}return new Result(!1)},wellKnownSymbol$8=wellKnownSymbol$i,ITERATOR$3=wellKnownSymbol$8("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$3]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch(Ag){}var checkCorrectnessOfIteration$1=function(Ag,gg){try{if(!gg&&!SAFE_CLOSING)return!1}catch{return!1}var eg=!1;try{var Ig={};Ig[ITERATOR$3]=function(){return{next:function(){return{done:eg=!0}}}},Ag(Ig)}catch{}return eg},NativePromiseConstructor$1=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration(function(Ag){NativePromiseConstructor$1.all(Ag).then(void 0,function(){})}),$$d=_export,call$9=functionCall,aCallable$2=aCallable$8,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$d({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{all:function Ag(gg){var eg=this,Ig=newPromiseCapabilityModule$2.f(eg),Cg=Ig.resolve,tg=Ig.reject,ig=perform$1(function(){var ng=aCallable$2(eg.resolve),lg=[],og=0,sg=1;iterate$1(gg,function(rg){var cg=og++,ag=!1;sg++,call$9(ng,eg,rg).then(function(ug){ag||(ag=!0,lg[cg]=ug,--sg||Cg(lg))},tg)}),--sg||Cg(lg)});return ig.error&&tg(ig.value),Ig.promise}});var $$c=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor=promiseNativeConstructor,getBuiltIn$1=getBuiltIn$7,isCallable$5=isCallable$m,defineBuiltIn$4=defineBuiltIn$7,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype;if($$c({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(Ag){return this.then(void 0,Ag)}}),isCallable$5(NativePromiseConstructor)){var method=getBuiltIn$1("Promise").prototype.catch;NativePromisePrototype.catch!==method&&defineBuiltIn$4(NativePromisePrototype,"catch",method,{unsafe:!0})}var $$b=_export,call$8=functionCall,aCallable$1=aCallable$8,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$b({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{race:function Ag(gg){var eg=this,Ig=newPromiseCapabilityModule$1.f(eg),Cg=Ig.reject,tg=perform(function(){var ig=aCallable$1(eg.resolve);iterate(gg,function(ng){call$8(ig,eg,ng).then(Ig.resolve,Cg)})});return tg.error&&Cg(tg.value),Ig.promise}});var $$a=_export,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$a({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function Ag(gg){var eg=newPromiseCapabilityModule.f(this),Ig=eg.reject;return Ig(gg),eg.promise}});var anObject$8=anObject$f,isObject$5=isObject$e,newPromiseCapability=newPromiseCapability$2,promiseResolve$1=function(Ag,gg){if(anObject$8(Ag),isObject$5(gg)&&gg.constructor===Ag)return gg;var eg=newPromiseCapability.f(Ag),Ig=eg.resolve;return Ig(gg),eg.promise},$$9=_export,getBuiltIn=getBuiltIn$7,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve=promiseResolve$1;getBuiltIn("Promise"),$$9({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function Ag(gg){return promiseResolve(this,gg)}});function asyncGeneratorStep(Ag,gg,eg,Ig,Cg,tg,ig){try{var ng=Ag[tg](ig),lg=ng.value}catch(og){return void eg(og)}ng.done?gg(lg):Promise.resolve(lg).then(Ig,Cg)}function _asyncToGenerator(Ag){return function(){var gg=this,eg=arguments;return new Promise(function(Ig,Cg){var tg=Ag.apply(gg,eg);function ig(lg){asyncGeneratorStep(tg,Ig,Cg,ig,ng,"next",lg)}function ng(lg){asyncGeneratorStep(tg,Ig,Cg,ig,ng,"throw",lg)}ig(void 0)})}}var classof$3=classof$6,$String=String,toString$9=function(Ag){if(classof$3(Ag)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String(Ag)},anObject$7=anObject$f,regexpFlags$1=function(){var Ag=anObject$7(this),gg="";return Ag.hasIndices&&(gg+="d"),Ag.global&&(gg+="g"),Ag.ignoreCase&&(gg+="i"),Ag.multiline&&(gg+="m"),Ag.dotAll&&(gg+="s"),Ag.unicode&&(gg+="u"),Ag.unicodeSets&&(gg+="v"),Ag.sticky&&(gg+="y"),gg},fails$b=fails$m,globalThis$5=globalThis_1,$RegExp$2=globalThis$5.RegExp,UNSUPPORTED_Y$2=fails$b(function(){var Ag=$RegExp$2("a","y");return Ag.lastIndex=2,Ag.exec("abcd")!==null}),MISSED_STICKY=UNSUPPORTED_Y$2||fails$b(function(){return!$RegExp$2("a","y").sticky}),BROKEN_CARET=UNSUPPORTED_Y$2||fails$b(function(){var Ag=$RegExp$2("^r","gy");return Ag.lastIndex=2,Ag.exec("str")!==null}),regexpStickyHelpers={BROKEN_CARET,MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$2},objectDefineProperties={},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$1=Object.keys||function Ag(gg){return internalObjectKeys(gg,enumBugKeys$1)},DESCRIPTORS$1=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule=objectDefineProperty,anObject$6=anObject$f,toIndexedObject$1=toIndexedObject$5,objectKeys=objectKeys$1;objectDefineProperties.f=DESCRIPTORS$1&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function Ag(gg,eg){anObject$6(gg);for(var Ig=toIndexedObject$1(eg),Cg=objectKeys(eg),tg=Cg.length,ig=0,ng;tg>ig;)definePropertyModule.f(gg,ng=Cg[ig++],Ig[ng]);return gg};var anObject$5=anObject$f,definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$2,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$1("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(Ag){return LT+SCRIPT+GT+Ag+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(Ag){Ag.write(scriptTag("")),Ag.close();var gg=Ag.parentWindow.Object;return Ag=null,gg},NullProtoObjectViaIFrame=function(){var Ag=documentCreateElement$1("iframe"),gg="java"+SCRIPT+":",eg;return Ag.style.display="none",html.appendChild(Ag),Ag.src=String(gg),eg=Ag.contentWindow.document,eg.open(),eg.write(scriptTag("document.F=Object")),eg.close(),eg.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch{}NullProtoObject=typeof document<"u"?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var Ag=enumBugKeys.length;Ag--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[Ag]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=!0;var objectCreate=Object.create||function Ag(gg,eg){var Ig;return gg!==null?(EmptyConstructor[PROTOTYPE]=anObject$5(gg),Ig=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,Ig[IE_PROTO$1]=gg):Ig=NullProtoObject(),eg===void 0?Ig:definePropertiesModule.f(Ig,eg)},fails$a=fails$m,globalThis$4=globalThis_1,$RegExp$1=globalThis$4.RegExp,regexpUnsupportedDotAll=fails$a(function(){var Ag=$RegExp$1(".","s");return!(Ag.dotAll&&Ag.test(`
|
|
1448
1448
|
`)&&Ag.flags==="s")}),fails$9=fails$m,globalThis$3=globalThis_1,$RegExp=globalThis$3.RegExp,regexpUnsupportedNcg=fails$9(function(){var Ag=$RegExp("(?<a>b)","g");return Ag.exec("b").groups.a!=="b"||"b".replace(Ag,"$<a>c")!=="bc"}),call$7=functionCall,uncurryThis$b=functionUncurryThis,toString$8=toString$9,regexpFlags=regexpFlags$1,stickyHelpers$1=regexpStickyHelpers,shared=shared$4,create$2=objectCreate,getInternalState$1=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$3=uncurryThis$b("".charAt),indexOf=uncurryThis$b("".indexOf),replace$2=uncurryThis$b("".replace),stringSlice$5=uncurryThis$b("".slice),UPDATES_LAST_INDEX_WRONG=function(){var Ag=/a/,gg=/b*/g;return call$7(nativeExec,Ag,"a"),call$7(nativeExec,gg,"a"),Ag.lastIndex!==0||gg.lastIndex!==0}(),UNSUPPORTED_Y$1=stickyHelpers$1.BROKEN_CARET,NPCG_INCLUDED=/()??/.exec("")[1]!==void 0,PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG,setGroups=function(Ag,gg){for(var eg=Ag.groups=create$2(null),Ig=0;Ig<gg.length;Ig++){var Cg=gg[Ig];eg[Cg[0]]=Ag[Cg[1]]}};PATCH&&(patchedExec=function(gg){var eg=this,Ig=getInternalState$1(eg),Cg=toString$8(gg),tg=Ig.raw,ig,ng,lg;if(tg)return tg.lastIndex=eg.lastIndex,ig=call$7(patchedExec,tg,Cg),eg.lastIndex=tg.lastIndex,ig&&Ig.groups&&setGroups(ig,Ig.groups),ig;var og=Ig.groups,sg=UNSUPPORTED_Y$1&&eg.sticky,rg=call$7(regexpFlags,eg),cg=eg.source,ag=0,ug=Cg;if(sg){rg=replace$2(rg,"y",""),indexOf(rg,"g")===-1&&(rg+="g"),ug=stringSlice$5(Cg,eg.lastIndex);var dg=eg.lastIndex>0&&charAt$3(Cg,eg.lastIndex-1);eg.lastIndex>0&&(!eg.multiline||eg.multiline&&dg!==`
|