vue-safe-force-graph 2.0.76 → 2.0.77

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.
@@ -144,12 +144,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
144
144
 
145
145
  `,n=this.file.split(t);let r=[];for(let s=0;s<n.length;s++){const o=s===n.length-1?n[s]:this.manageEntityFieldsSpace(n[s]),a=$Y.parse(o,{columns:!0,from:2});r=[...r,...a]}return r=this.reverseSpecialValue(r),r}manageEntityFieldsSpace(t){const n=t.split(`\r
146
146
  `),r=n[0].split(",").length;let s=0,o=[];return o=n.map(a=>(a=this.manageSpecialValue(a),s=r-a.split(",").length,s>0?a.split(",").concat(new Array(s)).join():a)),o.join(`\r
147
- `)}manageSpecialValue(t){t=t.replace(/"{2,}/g,"");const n=/"{1}[^"]*"{1}/g,r=t.match(n);return r!==null&&r.map(s=>(t=t.replace(s,s.replace(/,/g,pv)),s.replace(/,/g,pv))),t}reverseSpecialValue(t){const n=new RegExp(pv,"g");return t.map(r=>{for(const s in r){const o=r[s].replace(n,",");r[s]=o}return r})}convertToGraphData(t){const n=[];let r=t.filter(o=>o.Label===void 0),s=t.filter(o=>o.Label!==void 0);return r=r.map(o=>this.getGraphNode(o)),s=s.map((o,a)=>{const l="Source Entity ID",c="Target Entity ID",u="Label",d=this.getNode(o[l],r)[0],f=this.getNode(o[c],r)[0];return o[u]!==""&&n.push({id:f.id,label:o[u]}),{source:d.id,target:f.id,type:d.type+"-"+f.type,uniqueIndex:a}}),r=r.map(o=>(delete o.entityId,n.map(a=>{a.id===o.id&&(o.name=a.label)}),o)),{nodes:r,links:s}}getGraphNode(t){const n=V4.nodeMapReverse,r=cv.entitys;let s="",o="",a="",l=null,c=null;return r.map(u=>{const d=u.type,f=u.columnsFields[1];t[d]!==void 0&&(o=n[d],s=t[f],a=t[d],l=this.manageNodeDetail(u.columnsFields,t,n[d]),c=this.manageNodeFieldMap(n[d]))}),{id:s,type:o,name:s,entityId:a,detail:l,fieldMap:c,show:!0}}manageNodeFieldMap(t){return this.fieldMap[t]}manageNodeDetail(t,n,r){let s=null,o=!1;if(r!=="nodeType"){s={info:{basic:{}},tags:[]};for(const a in n)if(t.indexOf(a)===-1){o=!0;const l=n[a];a==="tags"&&l!==""?s.tags=l.split(",").map(c=>({name:c,desc:c})):s.info.basic[a]=n[a]}o===!1&&(s=null)}return s}getNode(t,n){return n.filter(r=>r.entityId===t)}outputData(){return this.data}}const Kge="",zY={name:"ButtonList",components:{"force-graph-svg-icon":Qo,addNode:$J,addLink:HJ,intro:XJ,UploadFilled:KM,SearchIcon:DJ},mixins:[kr],props:{showTopSearch:{type:Boolean,default:!1},hideButtonList:{type:Array,default:()=>[]},selection:{type:Array,default:()=>[]},history:{type:Object,default:()=>({dataNow:{}})},moduleDetail:{type:Object,default:()=>{}},requestGraphData:{type:Boolean,default:!0}},emits:["fixNodes","toggleLayout","addNodes","addLink","importCsvData","autoDisplay","toggleMove","deleteNodes","saveSnapshot"],data(){return{maxTrans:0,nowTrans:0,onceTrans:300,dialogVisible:!1,exportFormat:0,formatOptions:[{value:0,label:"JSON"},{value:2,label:"CSV"}],isAllFix:!1,dialogImportVisible:!1,importFileList:[],importFile:null,intro:!1,current:null,addType:"",flageAlias:!0,filterValues:"",relatedMidNum:2}},computed:{buttonList(){var e,t;return[{hover:!1,icon:"hm_icon_add",disable:!this.requestGraphData,fun:this.addNode,name:"新增节点",params:"diy"},{hover:!1,icon:"hm_icon_del",disable:this.selection.length===0||!this.requestGraphData,fun:this.deleteNodes,name:"删除"},{hover:!1,icon:"hm_icon_snapshot",disable:!this.requestGraphData,fun:this.addSnapshot,name:"保存快照",hide:!((t=(e=this.moduleDetail)==null?void 0:e.config)!=null&&t.hasSnapshot)},{hover:!1,icon:"hm_icon_img",disable:!this.requestGraphData,fun:this.saveAsImg,name:"保存图片"},{hover:!1,icon:"hm_icon_export",disable:!this.requestGraphData,fun:this.exportData,name:"数据导出"},{hover:!1,icon:"hm_icon_import",disable:!this.requestGraphData,fun:this.importData,name:"数据导入"},{hover:!1,icon:"hm_icon_undo",disable:this.history.currentIndex<=0||!this.requestGraphData,fun:this.backHistory,name:"撤销"},{hover:!1,icon:"hm_icon_redo",disable:this.history.currentIndex>=this.history.length-1||!this.requestGraphData,fun:this.forwardHistory,name:"恢复"},{hover:!1,icon:"hm_icon_auto",fun:this.autoDisplay,name:"自动布局"},{hover:!1,icon:"hm_icon_fix",fun:this.fixNodes,name:"全局固定",params:!0,hide:this.isAllFix},{hover:!1,icon:"hm_icon_unfix",fun:this.fixNodes,name:"全局解除固定",params:!1,hide:!this.isAllFix},{hover:!1,icon:"hm_icon_tree",fun:this.toggleLayout,name:"树型布局",params:1,hide:this.history.layoutIndex===1},{hover:!1,icon:"hm_icon_force",fun:this.toggleLayout,name:"斥力布局",params:0,hide:this.history.layoutIndex===0}]},buttonListShow(){return this.buttonList.filter(e=>e.hide!==!0&&!this.hideButtonList.includes(e.name))},noSelectNodes(){var r;const e=us(this.history.dataNow.nodes),t=us((r=this.history.dataNow)==null?void 0:r.links),n=e.filter(s=>{if((s==null?void 0:s.type)==="nodeType")return s.childList=this.searchChildren(s,t),s.parentNode=this.searchParent(s,t),!0});return this.deleteParentItem(n)}},mounted(){},methods:{hover(e){this.current=e},out(){this.current=null},autoDisplay(){Ke(this,"autoDisplay")},fixNodes(e=!0){Ke(this,"fixNodes",e),this.isAllFix=e},toggleMove(){Ke(this,"toggleMove")},toggleLayout(e){Ke(this,"toggleLayout",e)},addNode(e,t){this.addType=e,this.$refs.addNode.show(t)},addNodes({node:e,type:t,connectNode:n}){Ke(this,"addNodes",{node:e,type:t,connectNode:n})},addLink({source:e,target:t}){Ke(this,"addLink",{source:e,target:t})},backHistory(){this.$parent.historyBack()},forwardHistory(){this.history.forward()},dataURLToBlob(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let s=r.length;const o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})},downloadURI(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},saveAsImg(){return ot(this,null,function*(){var t,n;this.$parent.bigLoading=!0;const e=yield this.svgToUrl();this.downloadURI(e,`${((n=(t=this.history.dataNow)==null?void 0:t.nodes[0])==null?void 0:n.id)||"img"}_${new Date().getTime()}.png`),this.$parent.bigLoading=!1})},svgToUrl(){return ot(this,null,function*(){this.$parent.centerAndZoom(),this.$parent.addCanvasBg();const t=this.$parent.getCanvasStage().toDataURL({mimeType:"image/png"});return this.$parent.removeCanvasBg(),this.$parent.reset(),t})},svgToBlob(){return ot(this,null,function*(){this.$parent.centerAndZoom(),this.$parent.addCanvasBg();const e=this.$parent.getCanvasStage();e.find("Image").forEach(n=>{const r=n.image();r&&(r.crossOrigin="Anonymous")});const t=yield e.toBlob();return this.$parent.removeCanvasBg(),this.$parent.reset(),t})},deleteNodes(){Ke(this,"deleteNodes")},addSnapshot(){Ke(this,"saveSnapshot")},exportData(){this.handleOpenModal()},handleOpenModal(){this.dialogVisible=!0},handleCloseModal(){this.dialogVisible=!1},handleExportData(){var a,l,c,u;let e=null,t=null,n=null,r=null;this.selection.length>0?(n=it(this.selection),r=[]):(n=it(this.history.dataNow.nodes),r=it(this.history.dataNow.links));const s=n.map(d=>{const{id:f,type:h,detail:g}=d;return{id:f,type:h,detail:g}}),o=r.map(d=>{const{source:f,target:h}=d;return{source:f,target:h}});this.exportFormat===0?(e=JSON.stringify(s),t=`${((l=(a=this.history.dataNow)==null?void 0:a.nodes[0])==null?void 0:l.id)||"file"}_${new Date().getTime()}.json`):(e=this.setMalteGoCsv({nodes:s,links:o}),t=`${((u=(c=this.history.dataNow)==null?void 0:c.nodes[0])==null?void 0:u.id)||"file"}_${new Date().getTime()}.csv`),Kq(e,t),this.handleCloseModal()},importData(){this.handleOpenImportModal()},handleOpenImportModal(){this.dialogImportVisible=!0},handleCloseImportModal(){this.dialogImportVisible=!1,this.importFileList=[],this.importFile=null},handleImportData(){try{const e=this.getFieldMap(),n=new VY(this.importFile,e).outputData();Ke(this,"importCsvData",{nodes:n.nodes,links:n.links})}catch(e){vn({message:e,type:"error"})}this.handleCloseImportModal()},getFieldMap(){const e=this.moduleDetail.detail_field_map,t={};for(const n in e){const r=n.substring(0,n.indexOf("_detail_info"));t[r]=JSON.parse(JSON.stringify(e[n]))}return t},handleFileChange(e){this.importFile=e;const t=new FileReader;t.onload=()=>{t.result&&(this.importFile=t.result)},t.readAsText(e.raw)},handleFileRemove(){this.importFile=null,this.importFileList=[]},setMalteGoCsv(e){return new QJ(e).outputCsvFile()},showIntro(){this.intro=!0},hideIntro(){this.intro=!1},handleAlias(e){this.flageAlias=!e;const t=document.getElementsByClassName("right-menu-box")[0],n=document.getElementsByClassName("graph-box")[0];t&&(e?(t.style.display="none",n.style.width="100%"):(t.style.display="inline-block",n.style.width="1%"))},permissionitem(){return this.requestGraphData?!0:(vn({message:"无可操作权限",type:"warning"}),!1)},handleIconClick(e){this.permissionitem()&&(Bn({cId:"buttonList-"+e.icon,c:"顶部按钮-"+e.name}),e.fun(e.params))},handleSearch2:jo(function(){var n;if(!this.filterValues){Ke(mt,"sendNodesRange",null);return}this.filteredDataList=us(this.noSelectNodes);const e=us((n=this.history.dataNow)==null?void 0:n.links);this.filteredDataList=this.filteredDataList.filter(r=>this.filterValues!==""?(r.parentNode=this.searchParent(r,e),r.childList=r.childList.filter(s=>s.name.toLowerCase().indexOf(this.filterValues.toLowerCase())>-1),r.childList.length>0):!0),this.filteredDataList=this.deleteParentItem(this.filteredDataList);const t=[];this.filteredDataList.forEach(r=>{t.push(this.searchParent(r,e)),t.push(...r.childList),t.push(r)}),Ke(mt,"sendNodesRange",t)},200),handleSearch:jo(function(){this.filteredDataList=us(this.history.dataNow.nodes),this.filteredDataList=this.filteredDataList.filter(t=>this.filterValues?t.name.toLowerCase().indexOf(this.filterValues.toLowerCase())>-1:!0);const e=[];this.filteredDataList.forEach(t=>{e.push(t)}),Ke(mt,"sendNodesRange",e)},200),handleFilterMidNumber(e){gi("=>(ButtonList.vue:758) currentValue",e),e<2&&(this.relatedMidNum=2),this.filteredDataList=us(this.history.dataNow.nodes);const t=[],n=[];this.filteredDataList=this.filteredDataList.forEach(r=>{var s,o,a;if(this.relatedMidNum){const l=(a=(o=(s=r==null?void 0:r.detail)==null?void 0:s.info)==null?void 0:o.basic)==null?void 0:a.mid_count;(l?l>=this.relatedMidNum:!0)?t.push(r):n.push(r)}}),Ke(mt,"buttonClick",{nodes:t,api:{name:"show_nodes"}}),this.$nextTick(()=>{Ke(mt,"buttonClick",{nodes:n,api:{name:"hide_nodes"}})})},searchChildren(e,t){const n=t,r=[];return n&&n.forEach(s=>{s.source.id===e.id&&r.push(s.target)}),r},searchParent(e,t){const n=t;let r=[];return n&&n.forEach(s=>{s.target.id===e.id&&(r=s.source)}),r},groupBy(e,t){const n={};return e.forEach(function(r){const s=JSON.stringify(t(r));n[s]=n[s]||[],n[s].push(r)}),Object.keys(n).map(function(r){return n[r]})},deleteParentItem(e){let t=[];const n=[];return this.groupBy(e,function(r){return[r.parentNode.id]}).map(r=>{t.push(...r)}),t=t.map(r=>(n.some(o=>o===r.parentNode.id)?r.parentNode="":n.push(r.parentNode.id),r)),t}}},qY={class:"button-container"},HY={ref:"container",class:"button-box"},GY={ref:"box",class:"all-button"},WY={key:0,class:"search-content-wrap"},KY={class:"relative-mid-search"},JY={class:"number-input-wrap"},YY=["onClick"],XY={key:1,class:"right-btn-wrap"},ZY={class:"button-one intro-button"},QY={class:"dialog-footer"},eX={class:"dialog-footer"},tX={class:"intro"};function nX(e,t,n,r,s,o){const a=Ge("SearchIcon"),l=Js,c=pV,u=Ge("force-graph-svg-icon"),d=hi,f=Ge("intro"),h=FV,g=xf,v=Ef,y=Jo,_=Kc,w=Ge("UploadFilled"),A=Bt,C=oq,S=Ge("addNode"),x=Ge("addLink");return R(),U("div",qY,[K("div",HY,[K("div",GY,[n.showTopSearch?(R(),U("div",WY,[ie(l,{modelValue:s.filterValues,"onUpdate:modelValue":t[0]||(t[0]=T=>s.filterValues=T),modelModifiers:{trim:!0},class:"search-content",placeholder:"支持查询嫌疑人终端码、虚拟身份、路由mac、域名",onInput:o.handleSearch},{suffix:ne(()=>[t[8]||(t[8]=K("div",{class:"split-line"},null,-1)),ie(a,{onClick:o.handleSearch},null,8,["onClick"])]),_:1},8,["modelValue","onInput"]),K("div",KY,[t[10]||(t[10]=K("span",{class:"search-label"},"关联终端数量",-1)),K("div",JY,[t[9]||(t[9]=K("span",{class:"great-than"},"≥",-1)),ie(c,{modelValue:s.relatedMidNum,"onUpdate:modelValue":t[1]||(t[1]=T=>s.relatedMidNum=T),class:"number-input",min:2,controls:!1,onChange:o.handleFilterMidNumber},null,8,["modelValue","onChange"])])])])):oe("",!0),K("div",null,[(R(!0),U(qe,null,It(o.buttonListShow,(T,N)=>(R(),ye(d,{key:N,class:"item",effect:"dark",content:T.name,placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[K("div",{class:ee(["img-box","button-one "+(T.disable?"disabled":"")]),onClick:I=>o.handleIconClick(T)},[ie(u,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/button22/"+T.icon+".svg"]},null,8,["icon-class"])],10,YY)]),_:2},1032,["content"]))),128))]),!n.hideButtonList.includes("功能介绍")||!n.hideButtonList.includes("展开折叠")?(R(),U("div",XY,[n.hideButtonList.includes("功能介绍")?oe("",!0):(R(),ye(h,{key:0,placement:"bottom-end",width:"auto",trigger:"hover"},{reference:ne(()=>[K("div",ZY,[ie(d,{class:"item",effect:"dark",content:"功能介绍",placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(u,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/button22/hm_icon_help.svg"]},null,8,["icon-class"])]),_:1})])]),default:ne(()=>[ie(f,{config:n.moduleDetail.config||{}},null,8,["config"])]),_:1})),n.hideButtonList.includes("展开折叠")?oe("",!0):(R(),U("div",{key:1,class:"button-one intro-button",onClick:t[2]||(t[2]=T=>o.handleAlias(s.flageAlias)),onMouseenter:t[3]||(t[3]=T=>o.hover(o.buttonList.length+1)),onMouseleave:t[4]||(t[4]=T=>o.out())},[ie(d,{class:"item",effect:"dark",content:s.flageAlias?"右侧折叠":"右侧展开",placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(u,{class:"button-img","icon-class":e.imgPath[s.flageAlias?"./public/d3svg1/button22/hm_icon_alias_colse.svg":"./public/d3svg1/button22/hm_icon_alias.svg"]},null,8,["icon-class"])]),_:1},8,["content"])],32))])):oe("",!0)],512)],512),ie(_,{modelValue:s.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=T=>s.dialogVisible=T),title:"选择导出数据格式","append-to-body":"",width:"400px","before-close":o.handleCloseModal,class:"el-dialog-graph"},{footer:ne(()=>[K("span",QY,[ie(y,{onClick:o.handleCloseModal},{default:ne(()=>t[11]||(t[11]=[Ye("取 消")])),_:1},8,["onClick"]),ie(y,{type:"primary",onClick:o.handleExportData},{default:ne(()=>t[12]||(t[12]=[Ye("导 出")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(v,{modelValue:s.exportFormat,"onUpdate:modelValue":t[5]||(t[5]=T=>s.exportFormat=T),placeholder:"请选择导出数据格式"},{default:ne(()=>[(R(!0),U(qe,null,It(s.formatOptions,T=>(R(),ye(g,{key:T.value,label:T.label,value:T.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue","before-close"]),ie(_,{modelValue:s.dialogImportVisible,"onUpdate:modelValue":t[7]||(t[7]=T=>s.dialogImportVisible=T),title:"导入数据","append-to-body":"",width:"400px","before-close":o.handleCloseImportModal,class:"el-dialog-graph"},{footer:ne(()=>[K("span",eX,[ie(y,{onClick:o.handleCloseImportModal},{default:ne(()=>t[15]||(t[15]=[Ye("取 消")])),_:1},8,["onClick"]),ie(y,{type:"primary",disabled:!s.importFile,onClick:o.handleImportData},{default:ne(()=>t[16]||(t[16]=[Ye("导 入")])),_:1},8,["disabled","onClick"])])]),default:ne(()=>[ie(C,{drag:"",action:"#","auto-upload":!1,accept:".csv","file-list":s.importFileList,"on-change":o.handleFileChange,"on-remove":o.handleFileRemove},{tip:ne(()=>t[13]||(t[13]=[K("div",{class:"el-upload__tip"},"只能上传由 Maltego 软件导出的csv文件",-1)])),default:ne(()=>[ie(A,{class:"el-icon-upload"},{default:ne(()=>[ie(w)]),_:1}),t[14]||(t[14]=K("div",{class:"el-upload__text"},[Ye("将文件拖到此处,或"),K("em",null,"点击上传")],-1))]),_:1},8,["file-list","on-change","on-remove"])]),_:1},8,["modelValue","before-close"]),ie(S,{ref:"addNode","nodes-type":n.moduleDetail&&n.moduleDetail.nodes||[],"add-type":s.addType,onAddNodes:o.addNodes},null,8,["nodes-type","add-type","onAddNodes"]),ie(x,{ref:"addLink",onAddLink:o.addLink},null,8,["onAddLink"]),Lt(K("div",tX,[ie(f,{config:n.moduleDetail.config||{},onMouseenter:o.showIntro,onMouseleave:o.hideIntro},null,8,["config","onMouseenter","onMouseleave"])],512),[[Cn,s.intro]])])}const iX=fn(zY,[["render",nX]]);var gv={exports:{}},mv={},Kt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function n(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof Qs!="undefined"?Qs:typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{},e.Konva={_global:e.glob,version:"9.3.15",isBrowser:n(),isUnminified:/param/.test(function(s){}.toString()),dblClickWindow:400,getAngle(s){return e.Konva.angleDeg?s*t:s},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window!="undefined"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var s;return(s=e.Konva.Transformer)===null||s===void 0?void 0:s.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(s){e.glob.Konva=s}};const r=s=>{e.Konva[s.prototype.getClassName()]=s};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Kt);var En={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Kt;class n{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){var x=this.m;return{x:x[0]*S.x+x[2]*S.y+x[4],y:x[1]*S.x+x[3]*S.y+x[5]}}translate(S,x){return this.m[4]+=this.m[0]*S+this.m[2]*x,this.m[5]+=this.m[1]*S+this.m[3]*x,this}scale(S,x){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=x,this.m[3]*=x,this}rotate(S){var x=Math.cos(S),T=Math.sin(S),N=this.m[0]*x+this.m[2]*T,I=this.m[1]*x+this.m[3]*T,B=this.m[0]*-T+this.m[2]*x,D=this.m[1]*-T+this.m[3]*x;return this.m[0]=N,this.m[1]=I,this.m[2]=B,this.m[3]=D,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,x){var T=this.m[0]+this.m[2]*x,N=this.m[1]+this.m[3]*x,I=this.m[2]+this.m[0]*S,B=this.m[3]+this.m[1]*S;return this.m[0]=T,this.m[1]=N,this.m[2]=I,this.m[3]=B,this}multiply(S){var x=this.m[0]*S.m[0]+this.m[2]*S.m[1],T=this.m[1]*S.m[0]+this.m[3]*S.m[1],N=this.m[0]*S.m[2]+this.m[2]*S.m[3],I=this.m[1]*S.m[2]+this.m[3]*S.m[3],B=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],D=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=x,this.m[1]=T,this.m[2]=N,this.m[3]=I,this.m[4]=B,this.m[5]=D,this}invert(){var S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),x=this.m[3]*S,T=-this.m[1]*S,N=-this.m[2]*S,I=this.m[0]*S,B=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),D=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=x,this.m[1]=T,this.m[2]=N,this.m[3]=I,this.m[4]=B,this.m[5]=D,this}getMatrix(){return this.m}decompose(){var S=this.m[0],x=this.m[1],T=this.m[2],N=this.m[3],I=this.m[4],B=this.m[5],D=S*N-x*T;let M={x:I,y:B,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||x!=0){var G=Math.sqrt(S*S+x*x);M.rotation=x>0?Math.acos(S/G):-Math.acos(S/G),M.scaleX=G,M.scaleY=D/G,M.skewX=(S*T+x*N)/D,M.skewY=0}else if(T!=0||N!=0){var H=Math.sqrt(T*T+N*N);M.rotation=Math.PI/2-(N>0?Math.acos(-T/H):-Math.acos(T/H)),M.scaleX=D/H,M.scaleY=H,M.skewX=0,M.skewY=(S*T+x*N)/D}return M.rotation=e.Util._getRotation(M.rotation),M}}e.Transform=n;var r="[object Array]",s="[object Number]",o="[object String]",a="[object Boolean]",l=Math.PI/180,c=180/Math.PI,u="#",d="",f="0",h="Konva warning: ",g="Konva error: ",v="rgb(",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,w=[];const A=typeof requestAnimationFrame!="undefined"&&requestAnimationFrame||function(C){setTimeout(C,60)};e.Util={_isElement(C){return!!(C&&C.nodeType==1)},_isFunction(C){return!!(C&&C.constructor&&C.call&&C.apply)},_isPlainObject(C){return!!C&&C.constructor===Object},_isArray(C){return Object.prototype.toString.call(C)===r},_isNumber(C){return Object.prototype.toString.call(C)===s&&!isNaN(C)&&isFinite(C)},_isString(C){return Object.prototype.toString.call(C)===o},_isBoolean(C){return Object.prototype.toString.call(C)===a},isObject(C){return C instanceof Object},isValidSelector(C){if(typeof C!="string")return!1;var S=C[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(C){return C===0||C>0?1:-1},requestAnimFrame(C){w.push(C),w.length===1&&A(function(){const S=w;w=[],S.forEach(function(x){x()})})},createCanvasElement(){var C=document.createElement("canvas");try{C.style=C.style||{}}catch(S){}return C},createImageElement(){return document.createElement("img")},_isInDocument(C){for(;C=C.parentNode;)if(C==document)return!0;return!1},_urlToImage(C,S){var x=e.Util.createImageElement();x.onload=function(){S(x)},x.src=C},_rgbToHex(C,S,x){return((1<<24)+(C<<16)+(S<<8)+x).toString(16).slice(1)},_hexToRgb(C){C=C.replace(u,d);var S=parseInt(C,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){for(var C=(Math.random()*16777215<<0).toString(16);C.length<6;)C=f+C;return u+C},getRGB(C){var S;return C in y?(S=y[C],{r:S[0],g:S[1],b:S[2]}):C[0]===u?this._hexToRgb(C.substring(1)):C.substr(0,4)===v?(S=_.exec(C.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(C){return C=C||"black",e.Util._namedColorToRBA(C)||e.Util._hex3ColorToRGBA(C)||e.Util._hex4ColorToRGBA(C)||e.Util._hex6ColorToRGBA(C)||e.Util._hex8ColorToRGBA(C)||e.Util._rgbColorToRGBA(C)||e.Util._rgbaColorToRGBA(C)||e.Util._hslColorToRGBA(C)},_namedColorToRBA(C){var S=y[C.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(C){if(C.indexOf("rgb(")===0){C=C.match(/rgb\(([^)]+)\)/)[1];var S=C.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(C){if(C.indexOf("rgba(")===0){C=C.match(/rgba\(([^)]+)\)/)[1];var S=C.split(/ *, */).map((x,T)=>x.slice(-1)==="%"?T===3?parseInt(x)/100:parseInt(x)/100*255:Number(x));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(C){if(C[0]==="#"&&C.length===9)return{r:parseInt(C.slice(1,3),16),g:parseInt(C.slice(3,5),16),b:parseInt(C.slice(5,7),16),a:parseInt(C.slice(7,9),16)/255}},_hex6ColorToRGBA(C){if(C[0]==="#"&&C.length===7)return{r:parseInt(C.slice(1,3),16),g:parseInt(C.slice(3,5),16),b:parseInt(C.slice(5,7),16),a:1}},_hex4ColorToRGBA(C){if(C[0]==="#"&&C.length===5)return{r:parseInt(C[1]+C[1],16),g:parseInt(C[2]+C[2],16),b:parseInt(C[3]+C[3],16),a:parseInt(C[4]+C[4],16)/255}},_hex3ColorToRGBA(C){if(C[0]==="#"&&C.length===4)return{r:parseInt(C[1]+C[1],16),g:parseInt(C[2]+C[2],16),b:parseInt(C[3]+C[3],16),a:1}},_hslColorToRGBA(C){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(C)){const[S,...x]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(C),T=Number(x[0])/360,N=Number(x[1])/100,I=Number(x[2])/100;let B,D,M;if(N===0)return M=I*255,{r:Math.round(M),g:Math.round(M),b:Math.round(M),a:1};I<.5?B=I*(1+N):B=I+N-I*N;const G=2*I-B,H=[0,0,0];for(let ae=0;ae<3;ae++)D=T+1/3*-(ae-1),D<0&&D++,D>1&&D--,6*D<1?M=G+(B-G)*6*D:2*D<1?M=B:3*D<2?M=G+(B-G)*(2/3-D)*6:M=G,H[ae]=M*255;return{r:Math.round(H[0]),g:Math.round(H[1]),b:Math.round(H[2]),a:1}}},haveIntersection(C,S){return!(S.x>C.x+C.width||S.x+S.width<C.x||S.y>C.y+C.height||S.y+S.height<C.y)},cloneObject(C){var S={};for(var x in C)this._isPlainObject(C[x])?S[x]=this.cloneObject(C[x]):this._isArray(C[x])?S[x]=this.cloneArray(C[x]):S[x]=C[x];return S},cloneArray(C){return C.slice(0)},degToRad(C){return C*l},radToDeg(C){return C*c},_degToRad(C){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(C)},_radToDeg(C){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(C)},_getRotation(C){return t.Konva.angleDeg?e.Util.radToDeg(C):C},_capitalize(C){return C.charAt(0).toUpperCase()+C.slice(1)},throw(C){throw new Error(g+C)},error(C){console.error(g+C)},warn(C){t.Konva.showWarnings&&console.warn(h+C)},each(C,S){for(var x in C)S(x,C[x])},_inRange(C,S,x){return S<=C&&C<x},_getProjectionToSegment(C,S,x,T,N,I){var B,D,M,G=(C-x)*(C-x)+(S-T)*(S-T);if(G==0)B=C,D=S,M=(N-x)*(N-x)+(I-T)*(I-T);else{var H=((N-C)*(x-C)+(I-S)*(T-S))/G;H<0?(B=C,D=S,M=(C-N)*(C-N)+(S-I)*(S-I)):H>1?(B=x,D=T,M=(x-N)*(x-N)+(T-I)*(T-I)):(B=C+H*(x-C),D=S+H*(T-S),M=(B-N)*(B-N)+(D-I)*(D-I))}return[B,D,M]},_getProjectionToLine(C,S,x){var T=e.Util.cloneObject(C),N=Number.MAX_VALUE;return S.forEach(function(I,B){if(!(!x&&B===S.length-1)){var D=S[(B+1)%S.length],M=e.Util._getProjectionToSegment(I.x,I.y,D.x,D.y,C.x,C.y),G=M[0],H=M[1],ae=M[2];ae<N&&(T.x=G,T.y=H,N=ae)}}),T},_prepareArrayForTween(C,S,x){var T,N=[],I=[];if(C.length>S.length){var B=S;S=C,C=B}for(T=0;T<C.length;T+=2)N.push({x:C[T],y:C[T+1]});for(T=0;T<S.length;T+=2)I.push({x:S[T],y:S[T+1]});var D=[];return I.forEach(function(M){var G=e.Util._getProjectionToLine(M,N,x);D.push(G.x),D.push(G.y)}),D},_prepareToStringify(C){var S;C.visitedByCircularReferenceRemoval=!0;for(var x in C)if(C.hasOwnProperty(x)&&C[x]&&typeof C[x]=="object"){if(S=Object.getOwnPropertyDescriptor(C,x),C[x].visitedByCircularReferenceRemoval||e.Util._isElement(C[x]))if(S.configurable)delete C[x];else return null;else if(e.Util._prepareToStringify(C[x])===null)if(S.configurable)delete C[x];else return null}return delete C.visitedByCircularReferenceRemoval,C},_assign(C,S){for(var x in S)C[x]=S[x];return C},_getFirstPointerId(C){return C.touches?C.changedTouches[0].identifier:C.pointerId||999},releaseCanvas(...C){t.Konva.releaseCanvasOnDestroy&&C.forEach(S=>{S.width=0,S.height=0})},drawRoundedRectPath(C,S,x,T){let N=0,I=0,B=0,D=0;typeof T=="number"?N=I=B=D=Math.min(T,S/2,x/2):(N=Math.min(T[0]||0,S/2,x/2),I=Math.min(T[1]||0,S/2,x/2),D=Math.min(T[2]||0,S/2,x/2),B=Math.min(T[3]||0,S/2,x/2)),C.moveTo(N,0),C.lineTo(S-I,0),C.arc(S-I,I,I,Math.PI*3/2,0,!1),C.lineTo(S,x-D),C.arc(S-D,x-D,D,0,Math.PI/2,!1),C.lineTo(B,x),C.arc(B,x-B,B,Math.PI/2,Math.PI,!1),C.lineTo(0,N),C.arc(N,N,N,Math.PI,Math.PI*3/2,!1)}}})(En);var ro={},li={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getComponentValidator=Rt.getBooleanValidator=Rt.getNumberArrayValidator=Rt.getFunctionValidator=Rt.getStringOrGradientValidator=Rt.getStringValidator=Rt.getNumberOrAutoValidator=Rt.getNumberOrArrayOfNumbersValidator=Rt.getNumberValidator=Rt.alphaComponent=Rt.RGBComponent=void 0;const _s=Kt,sn=En;function ws(e){return sn.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||sn.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function rX(e){return e>255?255:e<0?0:Math.round(e)}Rt.RGBComponent=rX;function sX(e){return e>1?1:e<1e-4?1e-4:e}Rt.alphaComponent=sX;function oX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isNumber(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Rt.getNumberValidator=oX;function aX(e){if(_s.Konva.isUnminified)return function(t,n){let r=sn.Util._isNumber(t),s=sn.Util._isArray(t)&&t.length==e;return!r&&!s&&sn.Util.warn(ws(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Rt.getNumberOrArrayOfNumbersValidator=aX;function lX(){if(_s.Konva.isUnminified)return function(e,t){var n=sn.Util._isNumber(e),r=e==="auto";return n||r||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Rt.getNumberOrAutoValidator=lX;function cX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isString(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Rt.getStringValidator=cX;function uX(){if(_s.Konva.isUnminified)return function(e,t){const n=sn.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Rt.getStringOrGradientValidator=uX;function dX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isFunction(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Rt.getFunctionValidator=dX;function fX(){if(_s.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(sn.Util._isArray(e)?e.forEach(function(r){sn.Util._isNumber(r)||sn.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Rt.getNumberArrayValidator=fX;function hX(){if(_s.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Rt.getBooleanValidator=hX;function pX(e){if(_s.Konva.isUnminified)return function(t,n){return t==null||sn.Util.isObject(t)||sn.Util.warn(ws(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Rt.getComponentValidator=pX,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=En,n=Rt;var r="get",s="set";e.Factory={addGetterSetter(o,a,l,c,u){e.Factory.addGetter(o,a,l),e.Factory.addSetter(o,a,c,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,l){var c=r+t.Util._capitalize(a);o.prototype[c]=o.prototype[c]||function(){var u=this.attrs[a];return u===void 0?l:u}},addSetter(o,a,l,c){var u=s+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,l,c)},overWriteSetter(o,a,l,c){var u=s+t.Util._capitalize(a);o.prototype[u]=function(d){return l&&d!==void 0&&d!==null&&(d=l.call(this,d,a)),this._setAttr(a,d),c&&c.call(this),this}},addComponentsGetterSetter(o,a,l,c,u){var d=l.length,f=t.Util._capitalize,h=r+f(a),g=s+f(a),v,y;o.prototype[h]=function(){var w={};for(v=0;v<d;v++)y=l[v],w[y]=this.getAttr(a+f(y));return w};var _=(0,n.getComponentValidator)(l);o.prototype[g]=function(w){var A=this.attrs[a],C;c&&(w=c.call(this,w)),_&&_.call(this,w,a);for(C in w)w.hasOwnProperty(C)&&this._setAttr(a+f(C),w[C]);return w||l.forEach(S=>{this._setAttr(a+f(S),void 0)}),this._fireChangeEvent(a,A,w),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var l=t.Util._capitalize(a),c=s+l,u=r+l;o.prototype[a]=function(){return arguments.length?(this[c](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,l,c){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),d=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(d);var f=this.attrs[a];return f===void 0?l:f},e.Factory.addSetter(o,a,c,function(){t.Util.error(d)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(l,c){var u=o.prototype[c],d=r+t.Util._capitalize(l),f=s+t.Util._capitalize(l);function h(){u.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+c+'" instead.')}o.prototype[l]=h,o.prototype[d]=h,o.prototype[f]=h})},afterSetFilter(){this._filterUpToDate=!1}}}(li);var ur={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.HitContext=Cs.SceneContext=Cs.Context=void 0;const d8=En,gX=Kt;function mX(e){var t=[],n=e.length,r=d8.Util,s,o;for(s=0;s<n;s++)o=e[s],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var f8=",",vX="(",bX=")",yX="([",_X="])",wX=";",CX="()",SX="=",h8=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],EX=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const xX=100;class Jf{constructor(t){this.canvas=t,gX.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,s=r.length,o="",a,l,c,u;for(a=0;a<s;a++)l=r[a],c=l.method,c?(u=l.args,o+=c,t?o+=CX:d8.Util._isArray(u[0])?o+=yX+u.join(f8)+_X:(n&&(u=u.map(d=>typeof d=="number"?Math.floor(d):d)),o+=vX+u.join(f8)+bX)):(o+=l.property,t||(o+=SX+l.val)),o+=wX;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=xX&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,s,o,a){this._context.arc(t,n,r,s,o,a)}arcTo(t,n,r,s,o){this._context.arcTo(t,n,r,s,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,s,o,a){this._context.bezierCurveTo(t,n,r,s,o,a)}clearRect(t,n,r,s){this._context.clearRect(t,n,r,s)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,s){return this._context.createLinearGradient(t,n,r,s)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,s,o,a){return this._context.createRadialGradient(t,n,r,s,o,a)}drawImage(t,n,r,s,o,a,l,c,u){var d=arguments,f=this._context;d.length===3?f.drawImage(t,n,r):d.length===5?f.drawImage(t,n,r,s,o):d.length===9&&f.drawImage(t,n,r,s,o,a,l,c,u)}ellipse(t,n,r,s,o,a,l,c){this._context.ellipse(t,n,r,s,o,a,l,c)}isPointInPath(t,n,r,s){return r?this._context.isPointInPath(r,t,n,s):this._context.isPointInPath(t,n,s)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,s){this._context.fillRect(t,n,r,s)}strokeRect(t,n,r,s){this._context.strokeRect(t,n,r,s)}fillText(t,n,r,s){s?this._context.fillText(t,n,r,s):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,s){return this._context.getImageData(t,n,r,s)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,s){this._context.rect(t,n,r,s)}roundRect(t,n,r,s,o){this._context.roundRect(t,n,r,s,o)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,s){this._context.quadraticCurveTo(t,n,r,s)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,s,o,a){this._context.setTransform(t,n,r,s,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,s){this._context.strokeText(t,n,r,s)}transform(t,n,r,s,o,a){this._context.transform(t,n,r,s,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=h8.length,r=this.setAttr,s,o,a=function(l){var c=t[l],u;t[l]=function(){return o=mX(Array.prototype.slice.call(arguments,0)),u=c.apply(t,arguments),t._trace({method:l,args:o}),u}};for(s=0;s<n;s++)a(h8[s]);t.setAttr=function(){r.apply(t,arguments);var l=arguments[0],c=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(c=c/this.canvas.getPixelRatio()),t._trace({property:l,val:c})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}Cs.Context=Jf,EX.forEach(function(e){Object.defineProperty(Jf.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class AX extends Jf{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const s=t.getFillPatternImage();if(s&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):s?this._fillPattern(t):o?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),s=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(s){for(var a=0;a<s.length;a+=2)o.addColorStop(s[a],s[a+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,s,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,l=(s=t.getShadowOffset())!==null&&s!==void 0?s:{x:0,y:0},c=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),d=c.x*u,f=c.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(d),Math.abs(f))),this.setAttr("shadowOffsetX",l.x*d),this.setAttr("shadowOffsetY",l.y*f)}}Cs.SceneContext=AX;class PX extends Jf{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),s=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",s),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}Cs.HitContext=PX,Object.defineProperty(ur,"__esModule",{value:!0}),ur.HitCanvas=ur.SceneCanvas=ur.Canvas=void 0;const Yf=En,p8=Cs,g8=Kt,TX=li,OX=Rt;var Xf;function NX(){if(Xf)return Xf;var e=Yf.Util.createCanvasElement(),t=e.getContext("2d");return Xf=function(){var n=g8.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),Yf.Util.releaseCanvas(e),Xf}class Zf{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||g8.Konva.pixelRatio||NX();this.pixelRatio=r,this._canvas=Yf.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch(r){try{return this._canvas.toDataURL()}catch(s){return Yf.Util.error("Unable to get data URL. "+s.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ur.Canvas=Zf,TX.Factory.addGetterSetter(Zf,"pixelRatio",void 0,(0,OX.getNumberValidator)());class IX extends Zf{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new p8.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}ur.SceneCanvas=IX;class RX extends Zf{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new p8.HitContext(this),this.setSize(t.width,t.height)}}ur.HitCanvas=RX;var Qf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Kt,n=En;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(s=>{r=s.node}),r},_dragElements:new Map,_drag(r){const s=[];e.DD._dragElements.forEach((o,a)=>{const{node:l}=o,c=l.getStage();c.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=c._changedPointerPositions.find(h=>h.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var d=l.dragDistance(),f=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(f<d||(l.startDrag({evt:r}),!l.isDragging()))return}l._setDragPosition(r,o),s.push(l)}}),s.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const s=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,l=a.getStage();if(r&&l.setPointersPositions(r),!l._changedPointerPositions.find(d=>d.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&s.indexOf(u)===-1&&s.push(u)}),s.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((s,o)=>{s.dragStatus==="stopped"&&s.node.fire("dragend",{type:"dragend",target:s.node,evt:r},!0),s.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(Qf),Object.defineProperty(ro,"__esModule",{value:!0}),ro.Node=void 0;const Tt=En,eu=li,tu=ur,so=Kt,ki=Qf,hn=Rt;var eh="absoluteOpacity",th="allEventListeners",Ss="absoluteTransform",m8="absoluteScale",na="canvas",DX="Change",LX="children",kX="konva",vv="listening",v8="mouseenter",b8="mouseleave",y8="set",_8="Shape",nh=" ",w8="stage",oo="transform",MX="Stage",bv="visible",FX=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(nh);let BX=1;class dt{constructor(t){this._id=BX++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===oo||t===Ss)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),s=t===oo||t===Ss,o=r===void 0||s&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const s=n.map(o=>o+"Change.konva").join(nh);this.on(s,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(na)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Ss&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(na)){const{scene:t,filter:n,hit:r}=this._cache.get(na);Tt.Util.releaseCanvas(t,n,r),this._cache.delete(na)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var s=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,c=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,f=n.hitCanvasPixelRatio||1;if(!s||!o){Tt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const h=Math.abs(Math.round(r.x)-l)>.5?1:0,g=Math.abs(Math.round(r.y)-c)>.5?1:0;s+=u*2+h,o+=u*2+g,l-=u,c-=u;var v=new tu.SceneCanvas({pixelRatio:a,width:s,height:o}),y=new tu.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),_=new tu.HitCanvas({pixelRatio:f,width:s,height:o}),w=v.getContext(),A=_.getContext();return _.isCache=!0,v.isCache=!0,this._cache.delete(na),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(v.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),w.save(),A.save(),w.translate(-l,-c),A.translate(-l,-c),this._isUnderCache=!0,this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(m8),this.drawScene(v,this),this.drawHit(_,this),this._isUnderCache=!1,w.restore(),A.restore(),d&&(w.save(),w.beginPath(),w.rect(0,0,s,o),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(na,{scene:v,filter:y,hit:_,x:l,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(na)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=1/0,o=1/0,a=-1/0,l=-1/0,c=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=c.point(u);s===void 0&&(s=a=d.x,o=l=d.y),s=Math.min(s,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),l=Math.max(l,d.y)}),{x:s,y:o,width:a-s,height:l-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),s=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/s,r.height/s),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,s=n.filter,o=s.getContext(),a,l,c,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;s.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),l=o.getImageData(0,0,s.getWidth(),s.getHeight()),c=0;c<a;c++){if(u=t[c],typeof u!="function"){Tt.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,l),o.putImageData(l,0,0)}}catch(f){Tt.Util.error("Unable to apply filter. "+f.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return s}return r}on(t,n){if(this._cache&&this._cache.delete(th),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(nh),s=r.length,o,a,l,c,u;for(o=0;o<s;o++)a=r[o],l=a.split("."),c=l[0],u=l[1]||"",this.eventListeners[c]||(this.eventListeners[c]=[]),this.eventListeners[c].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(nh),s=r.length,o,a,l,c,u,d;if(this._cache&&this._cache.delete(th),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<s;o++)if(l=r[o],c=l.split("."),u=c[0],d=c[1],u)this.eventListeners[u]&&this._off(u,d,n);else for(a in this.eventListeners)this._off(a,d,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var s=this;this.on(t,function(o){for(var a=o.target.findAncestors(n,!0,s),l=0;l<a.length;l++)o=Tt.Util.cloneObject(o),o.currentTarget=a[l],r.call(a[l],o)})}remove(){return this.isDragging()&&this.stopDrag(),ki.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Ss),this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(m8),this._clearSelfAndDescendantCache(w8),this._clearSelfAndDescendantCache(bv),this._clearSelfAndDescendantCache(vv)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+Tt.Util._capitalize(t);return Tt.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==LX&&(r=y8+Tt.Util._capitalize(n),Tt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(vv,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(bv,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),s=!1;ki.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(s=!0)});var o=!n&&!so.Konva.hitOnDragEnabled&&(s||so.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,s,o,a,l;function c(d){for(s=[],o=d.length,a=0;a<o;a++)l=d[a],r++,l.nodeType!==_8&&(s=s.concat(l.getChildren().slice())),l._id===n._id&&(a=o);s.length>0&&s[0].getDepth()<=t&&c(s)}const u=this.getStage();return n.nodeType!==MX&&u&&c(u.getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(oo),this._clearSelfAndDescendantCache(Ss)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var n=t.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var s=this.getAbsoluteTransform(t).getMatrix(),o=new Tt.Transform,a=this.offset();return o.m=s.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){const a=this._clearTransform(),{x:n,y:r}=a,s=Rs(a,["x","y"]);this.attrs.x=n,this.attrs.y=r,this._clearCache(oo);var o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(t.x,t.y),t={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(s),this.setPosition({x:t.x,y:t.y}),this._clearCache(oo),this._clearSelfAndDescendantCache(Ss),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,s=this.x(),o=this.y();return n!==void 0&&(s+=n),r!==void 0&&(o+=r),this.setPosition({x:s,y:o}),this}_eachAncestorReverse(t,n){var r=[],s=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);s&&(!n||s._id!==n._id);)r.unshift(s),s=s.parent;for(o=r.length,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return Tt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Tt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(eh,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),n,r,s,o,a;const l={attrs:{},className:this.getClassName()};for(n in t)r=t[n],a=Tt.Util.isObject(r)&&!Tt.Util._isPlainObject(r)&&!Tt.Util._isArray(r),!a&&(s=typeof this[n]=="function"&&this[n],delete t[n],o=s?s.call(this):null,t[n]=r,o!==r&&(l.attrs[n]=r));return Tt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var s=[];n&&this._isMatch(t)&&s.push(this);for(var o=this.parent;o;){if(o===r)return s;o._isMatch(t)&&s.push(o),o=o.parent}return s}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,s,o;for(s=0;s<r;s++)if(o=n[s],Tt.Util.isValidSelector(o)||(Tt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Tt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Tt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(w8,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Ss,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new Tt.Transform,this._eachAncestorReverse(function(s){var o=s.transformsEnabled();o==="all"?n.multiply(s.getTransform()):o==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},t),n;n=this._cache.get(Ss)||new Tt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const s=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(s-a,o-l)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const s=this.getAbsoluteTransform(t).decompose();return{x:s.scaleX,y:s.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(oo,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(oo)||new Tt.Transform;r.reset();var s=this.x(),o=this.y(),a=so.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,c=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,d=this.attrs.skewY||0,f=this.attrs.offsetX||0,h=this.attrs.offsetY||0;return(s!==0||o!==0)&&r.translate(s,o),a!==0&&r.rotate(a),(u!==0||d!==0)&&r.skew(u,d),(l!==1||c!==1)&&r.scale(l,c),(f!==0||h!==0)&&r.translate(-1*f,-1*h),r.dirty=!1,r}clone(t){var n=Tt.Util.cloneObject(this.attrs),r,s,o,a,l;for(r in t)n[r]=t[r];var c=new this.constructor(n);for(r in this.eventListeners)for(s=this.eventListeners[r],o=s.length,a=0;a<o;a++)l=s[a],l.name.indexOf(kX)<0&&(c.eventListeners[r]||(c.eventListeners[r]=[]),c.eventListeners[r].push(l));return c}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),s=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),a=t.pixelRatio||1,l=new tu.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),c=l.getContext();const u=new tu.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(s),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(c._context.imageSmoothingEnabled=!1),c.save(),(s||o)&&c.translate(-1*s,-1*o),this.drawScene(l,void 0,u),c.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,s=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(s),s}toImage(t){return new Promise((n,r)=>{try{const s=t==null?void 0:t.callback;s&&delete t.callback,Tt.Util._urlToImage(this.toDataURL(t),function(o){n(o),s==null||s(o)})}catch(s){r(s)}})}toBlob(t){return new Promise((n,r)=>{try{const s=t==null?void 0:t.callback;s&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),s==null||s(o)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(s){r(s)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():so.Konva.dragDistance}_off(t,n,r){var s=this.eventListeners[t],o,a,l;for(o=0;o<s.length;o++)if(a=s[o].name,l=s[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===l)){if(s.splice(o,1),s.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+DX,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[y8+Tt.Util._capitalize(t)];return Tt.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(so.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!Tt.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var s;r!==void 0&&(s=this.attrs[t],s||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,s,r))}_fireAndBubble(t,n,r){n&&this.nodeType===_8&&(n.target=this);var s=(t===v8||t===b8)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!s){this._fire(t,n);var o=(t===v8||t===b8)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,s;const o=(n=this._cache.get(th))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let l=Object.getPrototypeOf(this);for(;l;){const c=(s=(r=l.eventListeners)===null||r===void 0?void 0:r[t])!==null&&s!==void 0?s:[];a.push(...c),l=Object.getPrototypeOf(l)}o[t]=a,this._cache.set(th,o)}return a}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var s=0;s<r.length;s++)r[s].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var s=0;s<o.length;s++)o[s].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),s=this.getAbsolutePosition();if(r){var o=r._getPointerById(n)||r._changedPointerPositions[0]||s;ki.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-s.x,y:o.y-s.y},dragStatus:"ready",pointerId:n})}}startDrag(t,n=!0){ki.DD._dragElements.has(this._id)||this._createDragElement(t);const r=ki.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var s={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,s,t);a?s=a:Tt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==s.x||this._lastPos.y!==s.y)&&(this.setAbsolutePosition(s),this._requestDraw()),this._lastPos=s}}stopDrag(t){const n=ki.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),ki.DD._endDragBefore(t),ki.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=ki.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||so.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var s=!1;ki.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(s=!0)}),s||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=ki.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",s=n&&n.dragStatus==="ready";r?this.stopDrag():s&&ki.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return Tt.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return Tt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=dt.prototype.getClassName.call(t),s=t.children,o,a,l;n&&(t.attrs.container=n),so.Konva[r]||(Tt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const c=so.Konva[r];if(o=new c(t.attrs),s)for(a=s.length,l=0;l<a;l++)o.add(dt._createNode(s[l]));return o}}ro.Node=dt,dt.prototype.nodeType="Node",dt.prototype._attrsAffectingSize=[],dt.prototype.eventListeners={},dt.prototype.on.call(dt.prototype,FX,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(oo),this._clearSelfAndDescendantCache(Ss)}),dt.prototype.on.call(dt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(bv)}),dt.prototype.on.call(dt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(vv)}),dt.prototype.on.call(dt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(eh)});const Gt=eu.Factory.addGetterSetter;Gt(dt,"zIndex"),Gt(dt,"absolutePosition"),Gt(dt,"position"),Gt(dt,"x",0,(0,hn.getNumberValidator)()),Gt(dt,"y",0,(0,hn.getNumberValidator)()),Gt(dt,"globalCompositeOperation","source-over",(0,hn.getStringValidator)()),Gt(dt,"opacity",1,(0,hn.getNumberValidator)()),Gt(dt,"name","",(0,hn.getStringValidator)()),Gt(dt,"id","",(0,hn.getStringValidator)()),Gt(dt,"rotation",0,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"scale",["x","y"]),Gt(dt,"scaleX",1,(0,hn.getNumberValidator)()),Gt(dt,"scaleY",1,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"skew",["x","y"]),Gt(dt,"skewX",0,(0,hn.getNumberValidator)()),Gt(dt,"skewY",0,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"offset",["x","y"]),Gt(dt,"offsetX",0,(0,hn.getNumberValidator)()),Gt(dt,"offsetY",0,(0,hn.getNumberValidator)()),Gt(dt,"dragDistance",null,(0,hn.getNumberValidator)()),Gt(dt,"width",0,(0,hn.getNumberValidator)()),Gt(dt,"height",0,(0,hn.getNumberValidator)()),Gt(dt,"listening",!0,(0,hn.getBooleanValidator)()),Gt(dt,"preventDefault",!0,(0,hn.getBooleanValidator)()),Gt(dt,"filters",null,function(e){return this._filterUpToDate=!1,e}),Gt(dt,"visible",!0,(0,hn.getBooleanValidator)()),Gt(dt,"transformsEnabled","all",(0,hn.getStringValidator)()),Gt(dt,"size"),Gt(dt,"dragBoundFunc"),Gt(dt,"draggable",!1,(0,hn.getBooleanValidator)()),eu.Factory.backCompat(dt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var ia={};Object.defineProperty(ia,"__esModule",{value:!0}),ia.Container=void 0;const ll=li,yv=ro,ih=Rt;class ra extends yv.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(s){t(s)&&r.push(s)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(s=>{const o=s._isMatch(t);return o&&r.push(s),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const s of r){if(n=t(s),n)return!0;if(s.hasChildren()&&(n=s._descendants(t),n))return!0}return!1}toObject(){var t=yv.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=yv.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n,r){var s=this.getLayer(),o=t||s&&s.getCanvas(),a=o&&o.getContext(),l=this._getCanvasCache(),c=l&&l.scene,u=o&&o.isCache;if(!this.isVisible()&&!u)return this;if(c){a.save();var d=this.getAbsoluteTransform(n).getMatrix();a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),s=t||r&&r.hitCanvas,o=s&&s.getContext(),a=this._getCanvasCache(),l=a&&a.hit;if(l){o.save();var c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",s,n);return this}_drawChildren(t,n,r,s){var o,a=n&&n.getContext(),l=this.clipWidth(),c=this.clipHeight(),u=this.clipFunc(),d=typeof l=="number"&&typeof c=="number"||u;const f=r===this;if(d){a.save();var h=this.getAbsoluteTransform(r),g=h.getMatrix();a.transform(g[0],g[1],g[2],g[3],g[4],g[5]),a.beginPath();let w;if(u)w=u.call(this,a,this);else{var v=this.clipX(),y=this.clipY();a.rect(v||0,y||0,l,c)}a.clip.apply(a,w),g=h.copy().invert().getMatrix(),a.transform(g[0],g[1],g[2],g[3],g[4],g[5])}var _=!f&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";_&&(a.save(),a._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(w){w[t](n,r,s)}),_&&a.restore(),d&&a.restore()}getClientRect(t={}){var n,r=t.skipTransform,s=t.relativeTo,o,a,l,c,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(y){if(y.visible()){var _=y.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,l=_.x+_.width,c=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),l=Math.max(l,_.x+_.width),c=Math.max(c,_.y+_.height)))}});for(var f=this.find("Shape"),h=!1,g=0;g<f.length;g++){var v=f[g];if(v._isVisible(this)){h=!0;break}}return h&&o!==void 0?u={x:o,y:a,width:l-o,height:c-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,s)}}ia.Container=ra,ll.Factory.addComponentsGetterSetter(ra,"clip",["x","y","width","height"]),ll.Factory.addGetterSetter(ra,"clipX",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipY",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipWidth",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipHeight",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipFunc");var C8={},mi={};Object.defineProperty(mi,"__esModule",{value:!0}),mi.releaseCapture=mi.setPointerCapture=mi.hasPointerCapture=mi.createEvent=mi.getCapturedShape=void 0;const jX=Kt,nu=new Map,S8=jX.Konva._global.PointerEvent!==void 0;function UX(e){return nu.get(e)}mi.getCapturedShape=UX;function _v(e){return{evt:e,pointerId:e.pointerId}}mi.createEvent=_v;function $X(e,t){return nu.get(e)===t}mi.hasPointerCapture=$X;function VX(e,t){E8(e),t.getStage()&&(nu.set(e,t),S8&&t._fire("gotpointercapture",_v(new PointerEvent("gotpointercapture"))))}mi.setPointerCapture=VX;function E8(e,t){const n=nu.get(e);if(!n)return;const r=n.getStage();r&&r.content,nu.delete(e),S8&&n._fire("lostpointercapture",_v(new PointerEvent("lostpointercapture")))}mi.releaseCapture=E8,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=En,n=li,r=ia,s=Kt,o=ur,a=Qf,l=Kt,c=mi;var u="Stage",d="string",f="px",h="mouseout",g="mouseleave",v="mouseover",y="mouseenter",_="mousemove",w="mousedown",A="mouseup",C="pointermove",S="pointerdown",x="pointerup",T="pointercancel",N="lostpointercapture",I="pointerout",B="pointerleave",D="pointerover",M="pointerenter",G="contextmenu",H="touchstart",ae="touchend",X="touchmove",k="touchcancel",z="wheel",W=5,Z=[[y,"_pointerenter"],[w,"_pointerdown"],[_,"_pointermove"],[A,"_pointerup"],[g,"_pointerleave"],[H,"_pointerdown"],[X,"_pointermove"],[ae,"_pointerup"],[k,"_pointercancel"],[v,"_pointerover"],[z,"_wheel"],[G,"_contextmenu"],[S,"_pointerdown"],[C,"_pointermove"],[x,"_pointerup"],[T,"_pointercancel"],[N,"_lostpointercapture"]];const j={mouse:{[I]:h,[B]:g,[D]:v,[M]:y,[C]:_,[S]:w,[x]:A,[T]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[I]:"touchout",[B]:"touchleave",[D]:"touchover",[M]:"touchenter",[C]:X,[S]:H,[x]:ae,[T]:k,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[I]:I,[B]:B,[D]:D,[M]:M,[C]:C,[S]:S,[x]:x,[T]:T,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},we=_e=>_e.indexOf("pointer")>=0?"pointer":_e.indexOf("touch")>=0?"touch":"mouse",ge=_e=>{const q=we(_e);if(q==="pointer")return s.Konva.pointerEventsEnabled&&j.pointer;if(q==="touch")return j.touch;if(q==="mouse")return j.mouse};function re(_e={}){return(_e.clipFunc||_e.clipWidth||_e.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),_e}const ce="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Se extends r.Container{constructor(q){super(re(q)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{re(this.attrs)}),this._checkVisibility()}_validateAdd(q){const Q=q.getType()==="Layer",fe=q.getType()==="FastLayer";Q||fe||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const q=this.visible()?"":"none";this.content.style.display=q}setContainer(q){if(typeof q===d){if(q.charAt(0)==="."){var Q=q.slice(1);q=document.getElementsByClassName(Q)[0]}else{var fe;q.charAt(0)!=="#"?fe=q:fe=q.slice(1),q=document.getElementById(fe)}if(!q)throw"Can not find container in document with id "+fe}return this._setAttr("container",q),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),q.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var q=this.children,Q=q.length,fe;for(fe=0;fe<Q;fe++)q[fe].clear();return this}clone(q){return q||(q={}),q.container=typeof document!="undefined"&&document.createElement("div"),r.Container.prototype.clone.call(this,q)}destroy(){super.destroy();var q=this.content;q&&t.Util._isInDocument(q)&&this.container().removeChild(q);var Q=e.stages.indexOf(this);return Q>-1&&e.stages.splice(Q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const q=this._pointerPositions[0]||this._changedPointerPositions[0];return q?{x:q.x,y:q.y}:(t.Util.warn(ce),null)}_getPointerById(q){return this._pointerPositions.find(Q=>Q.id===q)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(q){q=q||{},q.x=q.x||0,q.y=q.y||0,q.width=q.width||this.width(),q.height=q.height||this.height();var Q=new o.SceneCanvas({width:q.width,height:q.height,pixelRatio:q.pixelRatio||1}),fe=Q.getContext()._context,Re=this.children;return(q.x||q.y)&&fe.translate(-1*q.x,-1*q.y),Re.forEach(function(Le){if(Le.isVisible()){var Je=Le._toKonvaCanvas(q);fe.drawImage(Je._canvas,q.x,q.y,Je.getWidth()/Je.getPixelRatio(),Je.getHeight()/Je.getPixelRatio())}}),Q}getIntersection(q){if(!q)return null;var Q=this.children,fe=Q.length,Re=fe-1,Le;for(Le=Re;Le>=0;Le--){const Je=Q[Le].getIntersection(q);if(Je)return Je}return null}_resizeDOM(){var q=this.width(),Q=this.height();this.content&&(this.content.style.width=q+f,this.content.style.height=Q+f),this.bufferCanvas.setSize(q,Q),this.bufferHitCanvas.setSize(q,Q),this.children.forEach(fe=>{fe.setSize({width:q,height:Q}),fe.draw()})}add(q,...Q){if(arguments.length>1){for(var fe=0;fe<arguments.length;fe++)this.add(arguments[fe]);return this}super.add(q);var Re=this.children.length;return Re>W&&t.Util.warn("The stage has "+Re+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),q.setSize({width:this.width(),height:this.height()}),q.draw(),s.Konva.isBrowser&&this.content.appendChild(q.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(q){return c.hasPointerCapture(q,this)}setPointerCapture(q){c.setPointerCapture(q,this)}releaseCapture(q){c.releaseCapture(q,this)}getLayers(){return this.children}_bindContentEvents(){s.Konva.isBrowser&&Z.forEach(([q,Q])=>{this.content.addEventListener(q,fe=>{this[Q](fe)},{passive:!1})})}_pointerenter(q){this.setPointersPositions(q);const Q=ge(q.type);Q&&this._fire(Q.pointerenter,{evt:q,target:this,currentTarget:this})}_pointerover(q){this.setPointersPositions(q);const Q=ge(q.type);Q&&this._fire(Q.pointerover,{evt:q,target:this,currentTarget:this})}_getTargetShape(q){let Q=this[q+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(q){const Q=ge(q.type),fe=we(q.type);if(Q){this.setPointersPositions(q);var Re=this._getTargetShape(fe),Le=!(s.Konva.isDragging()||s.Konva.isTransforming())||s.Konva.hitOnDragEnabled;Re&&Le?(Re._fireAndBubble(Q.pointerout,{evt:q}),Re._fireAndBubble(Q.pointerleave,{evt:q}),this._fire(Q.pointerleave,{evt:q,target:this,currentTarget:this}),this[fe+"targetShape"]=null):Le&&(this._fire(Q.pointerleave,{evt:q,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:q,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(q){const Q=ge(q.type),fe=we(q.type);if(Q){this.setPointersPositions(q);var Re=!1;this._changedPointerPositions.forEach(Le=>{var Je=this.getIntersection(Le);if(a.DD.justDragged=!1,s.Konva["_"+fe+"ListenClick"]=!0,!Je||!Je.isListening()){this[fe+"ClickStartShape"]=void 0;return}s.Konva.capturePointerEventsEnabled&&Je.setPointerCapture(Le.id),this[fe+"ClickStartShape"]=Je,Je._fireAndBubble(Q.pointerdown,{evt:q,pointerId:Le.id}),Re=!0;const V=q.type.indexOf("touch")>=0;Je.preventDefault()&&q.cancelable&&V&&q.preventDefault()}),Re||this._fire(Q.pointerdown,{evt:q,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(q){const Q=ge(q.type),fe=we(q.type);if(!Q)return;s.Konva.isDragging()&&a.DD.node.preventDefault()&&q.cancelable&&q.preventDefault(),this.setPointersPositions(q);var Re=!(s.Konva.isDragging()||s.Konva.isTransforming())||s.Konva.hitOnDragEnabled;if(!Re)return;var Le={};let Je=!1;var V=this._getTargetShape(fe);this._changedPointerPositions.forEach(Y=>{const le=c.getCapturedShape(Y.id)||this.getIntersection(Y),xe=Y.id,de={evt:q,pointerId:xe};var pe=V!==le;if(pe&&V&&(V._fireAndBubble(Q.pointerout,me({},de),le),V._fireAndBubble(Q.pointerleave,me({},de),le)),le){if(Le[le._id])return;Le[le._id]=!0}le&&le.isListening()?(Je=!0,pe&&(le._fireAndBubble(Q.pointerover,me({},de),V),le._fireAndBubble(Q.pointerenter,me({},de),V),this[fe+"targetShape"]=le),le._fireAndBubble(Q.pointermove,me({},de))):V&&(this._fire(Q.pointerover,{evt:q,target:this,currentTarget:this,pointerId:xe}),this[fe+"targetShape"]=null)}),Je||this._fire(Q.pointermove,{evt:q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(q){const Q=ge(q.type),fe=we(q.type);if(!Q)return;this.setPointersPositions(q);const Re=this[fe+"ClickStartShape"],Le=this[fe+"ClickEndShape"];var Je={};let V=!1;this._changedPointerPositions.forEach(Y=>{const le=c.getCapturedShape(Y.id)||this.getIntersection(Y);if(le){if(le.releaseCapture(Y.id),Je[le._id])return;Je[le._id]=!0}const xe=Y.id,de={evt:q,pointerId:xe};let pe=!1;s.Konva["_"+fe+"InDblClickWindow"]?(pe=!0,clearTimeout(this[fe+"DblTimeout"])):a.DD.justDragged||(s.Konva["_"+fe+"InDblClickWindow"]=!0,clearTimeout(this[fe+"DblTimeout"])),this[fe+"DblTimeout"]=setTimeout(function(){s.Konva["_"+fe+"InDblClickWindow"]=!1},s.Konva.dblClickWindow),le&&le.isListening()?(V=!0,this[fe+"ClickEndShape"]=le,le._fireAndBubble(Q.pointerup,me({},de)),s.Konva["_"+fe+"ListenClick"]&&Re&&Re===le&&(le._fireAndBubble(Q.pointerclick,me({},de)),pe&&Le&&Le===le&&le._fireAndBubble(Q.pointerdblclick,me({},de)))):(this[fe+"ClickEndShape"]=null,s.Konva["_"+fe+"ListenClick"]&&this._fire(Q.pointerclick,{evt:q,target:this,currentTarget:this,pointerId:xe}),pe&&this._fire(Q.pointerdblclick,{evt:q,target:this,currentTarget:this,pointerId:xe}))}),V||this._fire(Q.pointerup,{evt:q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s.Konva["_"+fe+"ListenClick"]=!1,q.cancelable&&fe!=="touch"&&q.preventDefault()}_contextmenu(q){this.setPointersPositions(q);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(G,{evt:q}):this._fire(G,{evt:q,target:this,currentTarget:this})}_wheel(q){this.setPointersPositions(q);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(z,{evt:q}):this._fire(z,{evt:q,target:this,currentTarget:this})}_pointercancel(q){this.setPointersPositions(q);const Q=c.getCapturedShape(q.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(x,c.createEvent(q)),c.releaseCapture(q.pointerId)}_lostpointercapture(q){c.releaseCapture(q.pointerId)}setPointersPositions(q){var Q=this._getContentPosition(),fe=null,Re=null;q=q||window.event,q.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(q.touches,Le=>{this._pointerPositions.push({id:Le.identifier,x:(Le.clientX-Q.left)/Q.scaleX,y:(Le.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(q.changedTouches||q.touches,Le=>{this._changedPointerPositions.push({id:Le.identifier,x:(Le.clientX-Q.left)/Q.scaleX,y:(Le.clientY-Q.top)/Q.scaleY})})):(fe=(q.clientX-Q.left)/Q.scaleX,Re=(q.clientY-Q.top)/Q.scaleY,this.pointerPos={x:fe,y:Re},this._pointerPositions=[{x:fe,y:Re,id:t.Util._getFirstPointerId(q)}],this._changedPointerPositions=[{x:fe,y:Re,id:t.Util._getFirstPointerId(q)}])}_setPointerPosition(q){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(q)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var q=this.content.getBoundingClientRect();return{top:q.top,left:q.left,scaleX:q.width/this.content.clientWidth||1,scaleY:q.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!s.Konva.isBrowser){var q=this.container();if(!q)throw"Stage has no container. A container is required.";q.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),q.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(q){q.batchDraw()}),this}}e.Stage=Se,Se.prototype.nodeType=u,(0,l._registerNode)(Se),n.Factory.addGetterSetter(Se,"container"),s.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(_e=>{_e.batchDraw()})})}(C8);var iu={},Es={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Kt,n=En,r=li,s=ro,o=Rt,a=Kt,l=mi;var c="hasShadow",u="shadowRGBA",d="patternImage",f="linearGradient",h="radialGradient";let g;function v(){return g||(g=n.Util.createCanvasElement().getContext("2d"),g)}e.shapes={};function y(B){const D=this.attrs.fillRule;D?B.fill(D):B.fill()}function _(B){B.stroke()}function w(B){const D=this.attrs.fillRule;D?B.fill(D):B.fill()}function A(B){B.stroke()}function C(){this._clearCache(c)}function S(){this._clearCache(u)}function x(){this._clearCache(d)}function T(){this._clearCache(f)}function N(){this._clearCache(h)}class I extends s.Node{constructor(D){super(D);let M;for(;M=n.Util.getRandomColor(),!(M&&!(M in e.shapes)););this.colorKey=M,e.shapes[M]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(d,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var D=v();const M=D.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(M&&M.setTransform){const G=new n.Transform;G.translate(this.fillPatternX(),this.fillPatternY()),G.rotate(t.Konva.getAngle(this.fillPatternRotation())),G.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),G.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const H=G.getMatrix(),ae=typeof DOMMatrix=="undefined"?{a:H[0],b:H[1],c:H[2],d:H[3],e:H[4],f:H[5]}:new DOMMatrix(H);M.setTransform(ae)}return M}}_getLinearGradient(){return this._getCache(f,this.__getLinearGradient)}__getLinearGradient(){var D=this.fillLinearGradientColorStops();if(D){for(var M=v(),G=this.fillLinearGradientStartPoint(),H=this.fillLinearGradientEndPoint(),ae=M.createLinearGradient(G.x,G.y,H.x,H.y),X=0;X<D.length;X+=2)ae.addColorStop(D[X],D[X+1]);return ae}}_getRadialGradient(){return this._getCache(h,this.__getRadialGradient)}__getRadialGradient(){var D=this.fillRadialGradientColorStops();if(D){for(var M=v(),G=this.fillRadialGradientStartPoint(),H=this.fillRadialGradientEndPoint(),ae=M.createRadialGradient(G.x,G.y,this.fillRadialGradientStartRadius(),H.x,H.y,this.fillRadialGradientEndRadius()),X=0;X<D.length;X+=2)ae.addColorStop(D[X],D[X+1]);return ae}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var D=n.Util.colorToRGBA(this.shadowColor());if(D)return"rgba("+D.r+","+D.g+","+D.b+","+D.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const D=this.hitStrokeWidth();return D==="auto"?this.hasStroke():this.strokeEnabled()&&!!D}intersects(D){var M=this.getStage();if(!M)return!1;const G=M.bufferHitCanvas;return G.getContext().clear(),this.drawHit(G,void 0,!0),G.context.getImageData(Math.round(D.x),Math.round(D.y),1,1).data[3]>0}destroy(){return s.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(D){var M;if(!((M=this.attrs.perfectDrawEnabled)!==null&&M!==void 0?M:!0))return!1;const H=D||this.hasFill(),ae=this.hasStroke(),X=this.getAbsoluteOpacity()!==1;if(H&&ae&&X)return!0;const k=this.hasShadow(),z=this.shadowForStrokeEnabled();return!!(H&&ae&&k&&z)}setStrokeHitEnabled(D){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),D?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var D=this.size();return{x:this._centroid?-D.width/2:0,y:this._centroid?-D.height/2:0,width:D.width,height:D.height}}getClientRect(D={}){let M=!1,G=this.getParent();for(;G;){if(G.isCached()){M=!0;break}G=G.getParent()}const H=D.skipTransform,ae=D.relativeTo||M&&this.getStage()||void 0,X=this.getSelfRect(),z=!D.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=X.width+z,Z=X.height+z,j=!D.skipShadow&&this.hasShadow(),we=j?this.shadowOffsetX():0,ge=j?this.shadowOffsetY():0,re=W+Math.abs(we),ce=Z+Math.abs(ge),Se=j&&this.shadowBlur()||0,_e=re+Se*2,q=ce+Se*2,Q={width:_e,height:q,x:-(z/2+Se)+Math.min(we,0)+X.x,y:-(z/2+Se)+Math.min(ge,0)+X.y};return H?Q:this._transformedRect(Q,ae)}drawScene(D,M,G){var H=this.getLayer(),ae=D||H.getCanvas(),X=ae.getContext(),k=this._getCanvasCache(),z=this.getSceneFunc(),W=this.hasShadow(),Z,j,we=ae.isCache,ge=M===this;if(!this.isVisible()&&!ge)return this;if(k){X.save();var re=this.getAbsoluteTransform(M).getMatrix();return X.transform(re[0],re[1],re[2],re[3],re[4],re[5]),this._drawCachedSceneCanvas(X),X.restore(),this}if(!z)return this;if(X.save(),this._useBufferCanvas()&&!we){Z=this.getStage();const _e=G||Z.bufferCanvas;j=_e.getContext(),j.clear(),j.save(),j._applyLineJoin(this);var ce=this.getAbsoluteTransform(M).getMatrix();j.transform(ce[0],ce[1],ce[2],ce[3],ce[4],ce[5]),z.call(this,j,this),j.restore();var Se=_e.pixelRatio;W&&X._applyShadow(this),X._applyOpacity(this),X._applyGlobalCompositeOperation(this),X.drawImage(_e._canvas,0,0,_e.width/Se,_e.height/Se)}else{if(X._applyLineJoin(this),!ge){var ce=this.getAbsoluteTransform(M).getMatrix();X.transform(ce[0],ce[1],ce[2],ce[3],ce[4],ce[5]),X._applyOpacity(this),X._applyGlobalCompositeOperation(this)}W&&X._applyShadow(this),z.call(this,X,this)}return X.restore(),this}drawHit(D,M,G=!1){if(!this.shouldDrawHit(M,G))return this;var H=this.getLayer(),ae=D||H.hitCanvas,X=ae&&ae.getContext(),k=this.hitFunc()||this.sceneFunc(),z=this._getCanvasCache(),W=z&&z.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){X.save();var Z=this.getAbsoluteTransform(M).getMatrix();return X.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),this._drawCachedHitCanvas(X),X.restore(),this}if(!k)return this;if(X.save(),X._applyLineJoin(this),!(this===M)){var we=this.getAbsoluteTransform(M).getMatrix();X.transform(we[0],we[1],we[2],we[3],we[4],we[5])}return k.call(this,X,this),X.restore(),this}drawHitFromCache(D=0){var M=this._getCanvasCache(),G=this._getCachedSceneCanvas(),H=M.hit,ae=H.getContext(),X=H.getWidth(),k=H.getHeight(),z,W,Z,j,we,ge;ae.clear(),ae.drawImage(G._canvas,0,0,X,k);try{for(z=ae.getImageData(0,0,X,k),W=z.data,Z=W.length,j=n.Util._hexToRgb(this.colorKey),we=0;we<Z;we+=4)ge=W[we+3],ge>D?(W[we]=j.r,W[we+1]=j.g,W[we+2]=j.b,W[we+3]=255):W[we+3]=0;ae.putImageData(z,0,0)}catch(re){n.Util.error("Unable to draw hit graph from cached scene canvas. "+re.message)}return this}hasPointerCapture(D){return l.hasPointerCapture(D,this)}setPointerCapture(D){l.setPointerCapture(D,this)}releaseCapture(D){l.releaseCapture(D,this)}}e.Shape=I,I.prototype._fillFunc=y,I.prototype._strokeFunc=_,I.prototype._fillFuncHit=w,I.prototype._strokeFuncHit=A,I.prototype._centroid=!1,I.prototype.nodeType="Shape",(0,a._registerNode)(I),I.prototype.eventListeners={},I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",C),I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",x),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",N),r.Factory.addGetterSetter(I,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(I,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(I,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"lineJoin"),r.Factory.addGetterSetter(I,"lineCap"),r.Factory.addGetterSetter(I,"sceneFunc"),r.Factory.addGetterSetter(I,"hitFunc"),r.Factory.addGetterSetter(I,"dash"),r.Factory.addGetterSetter(I,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(I,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(I,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternImage"),r.Factory.addGetterSetter(I,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(I,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(I,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(I,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(I,"fillEnabled",!0),r.Factory.addGetterSetter(I,"strokeEnabled",!0),r.Factory.addGetterSetter(I,"shadowEnabled",!0),r.Factory.addGetterSetter(I,"dashEnabled",!0),r.Factory.addGetterSetter(I,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(I,"fillPriority","color"),r.Factory.addComponentsGetterSetter(I,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(I,"fillPatternRotation",0),r.Factory.addGetterSetter(I,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(I,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Es),Object.defineProperty(iu,"__esModule",{value:!0}),iu.Layer=void 0;const xs=En,wv=ia,cl=ro,Cv=li,x8=ur,zX=Rt,qX=Es,HX=Kt;var GX="#",WX="beforeDraw",KX="draw",A8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],JX=A8.length;class ul extends wv.Container{constructor(t){super(t),this.canvas=new x8.SceneCanvas,this.hitCanvas=new x8.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){cl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=cl.Node.prototype.moveUp.call(this);if(!t)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(cl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(cl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return cl.Node.prototype.remove.call(this),t&&t.parentNode&&xs.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&xs.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),cl.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){xs.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){xs.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,xs.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let s=0;s<JX;s++){const o=A8[s],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),l=a.shape;if(l)return l;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,s=r[3];if(s===255){const o=xs.Util._rgbToHex(r[0],r[1],r[2]),a=qX.shapes[GX+o];return a?{shape:a}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),s=t||r&&r.getCanvas();return this._fire(WX,{node:this}),this.clearBeforeDraw()&&s.getContext().clear(),wv.Container.prototype.drawScene.call(this,s,n),this._fire(KX,{node:this}),this}drawHit(t,n){var r=this.getLayer(),s=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),wv.Container.prototype.drawHit.call(this,s,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){xs.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return xs.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return xs.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}iu.Layer=ul,ul.prototype.nodeType="Layer",(0,HX._registerNode)(ul),Cv.Factory.addGetterSetter(ul,"imageSmoothingEnabled",!0),Cv.Factory.addGetterSetter(ul,"clearBeforeDraw",!0),Cv.Factory.addGetterSetter(ul,"hitGraphEnabled",!0,(0,zX.getBooleanValidator)());var rh={};Object.defineProperty(rh,"__esModule",{value:!0}),rh.FastLayer=void 0;const YX=En,XX=iu,ZX=Kt;class Sv extends XX.Layer{constructor(t){super(t),this.listening(!1),YX.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}rh.FastLayer=Sv,Sv.prototype.nodeType="FastLayer",(0,ZX._registerNode)(Sv);var sh={};Object.defineProperty(sh,"__esModule",{value:!0}),sh.Group=void 0;const QX=En,eZ=ia,tZ=Kt;class Ev extends eZ.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&QX.Util.throw("You may only add groups and shapes to groups.")}}sh.Group=Ev,Ev.prototype.nodeType="Group",(0,tZ._registerNode)(Ev);var ru={};Object.defineProperty(ru,"__esModule",{value:!0}),ru.Animation=void 0;const xv=Kt,P8=En,Av=function(){return xv.glob.performance&&xv.glob.performance.now?function(){return xv.glob.performance.now()}:function(){return new Date().getTime()}}();class Br{constructor(t,n){this.id=Br.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Av(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let s=0;s<r;s++)if(n[s]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const n=Br.animations,r=n.length;for(let s=0;s<r;s++)if(n[s].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Av(),Br._addAnimation(this),this}stop(){return Br._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const n=t.id,r=this.animations,s=r.length;for(let o=0;o<s;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const t={},n=this.animations;for(let r=0;r<n.length;r++){const s=n[r],o=s.layers,a=s.func;s._updateFrameObject(Av());const l=o.length;let c;if(a?c=a.call(s,s.frame)!==!1:c=!0,!!c)for(let u=0;u<l;u++){const d=o[u];d._id!==void 0&&(t[d._id]=d)}}for(let r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=Br;t.animations.length?(t._runFrames(),P8.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,P8.Util.requestAnimFrame(this._animationLoop))}}ru.Animation=Br,Br.animations=[],Br.animIdCounter=0,Br.animRunning=!1;var T8={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=En,n=ru,r=ro,s=Kt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,l=2,c=3,u=0,d=["fill","stroke","shadowColor"];class f{constructor(v,y,_,w,A,C,S){this.prop=v,this.propFunc=y,this.begin=w,this._pos=w,this.duration=C,this._change=0,this.prevPos=0,this.yoyo=S,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=A-this.begin,this.pause()}fire(v){var y=this[v];y&&y()}setTime(v){v>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():v<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=v,this.update())}getTime(){return this._time}setPosition(v){this.prevPos=this._pos,this.propFunc(v),this._pos=v}getPosition(v){return v===void 0&&(v=this._time),this.func(v,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(v){this.pause(),this._time=v,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var v=this.getTimer()-this._startTime;this.state===l?this.setTime(v):this.state===c&&this.setTime(this.duration-v)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class h{constructor(v){var y=this,_=v.node,w=_._id,A,C=v.easing||e.Easings.Linear,S=!!v.yoyo,x;typeof v.duration=="undefined"?A=.3:v.duration===0?A=.001:A=v.duration,this.node=_,this._id=u++;var T=_.getLayer()||(_ instanceof s.Konva.Stage?_.getLayers():null);T||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){y.tween.onEnterFrame()},T),this.tween=new f(x,function(N){y._tweenFunc(N)},C,0,1,A*1e3,S),this._addListeners(),h.attrs[w]||(h.attrs[w]={}),h.attrs[w][this._id]||(h.attrs[w][this._id]={}),h.tweens[w]||(h.tweens[w]={});for(x in v)o[x]===void 0&&this._addAttr(x,v[x]);this.reset(),this.onFinish=v.onFinish,this.onReset=v.onReset,this.onUpdate=v.onUpdate}_addAttr(v,y){var _=this.node,w=_._id,A,C,S,x,T,N,I,B;if(S=h.tweens[w][v],S&&delete h.attrs[w][S][v],A=_.getAttr(v),t.Util._isArray(y))if(C=[],T=Math.max(y.length,A.length),v==="points"&&y.length!==A.length&&(y.length>A.length?(I=A,A=t.Util._prepareArrayForTween(A,y,_.closed())):(N=y,y=t.Util._prepareArrayForTween(y,A,_.closed()))),v.indexOf("fill")===0)for(x=0;x<T;x++)if(x%2===0)C.push(y[x]-A[x]);else{var D=t.Util.colorToRGBA(A[x]);B=t.Util.colorToRGBA(y[x]),A[x]=D,C.push({r:B.r-D.r,g:B.g-D.g,b:B.b-D.b,a:B.a-D.a})}else for(x=0;x<T;x++)C.push(y[x]-A[x]);else d.indexOf(v)!==-1?(A=t.Util.colorToRGBA(A),B=t.Util.colorToRGBA(y),C={r:B.r-A.r,g:B.g-A.g,b:B.b-A.b,a:B.a-A.a}):C=y-A;h.attrs[w][this._id][v]={start:A,diff:C,end:y,trueEnd:N,trueStart:I},h.tweens[w][v]=this._id}_tweenFunc(v){var y=this.node,_=h.attrs[y._id][this._id],w,A,C,S,x,T,N,I;for(w in _){if(A=_[w],C=A.start,S=A.diff,I=A.end,t.Util._isArray(C))if(x=[],N=Math.max(C.length,I.length),w.indexOf("fill")===0)for(T=0;T<N;T++)T%2===0?x.push((C[T]||0)+S[T]*v):x.push("rgba("+Math.round(C[T].r+S[T].r*v)+","+Math.round(C[T].g+S[T].g*v)+","+Math.round(C[T].b+S[T].b*v)+","+(C[T].a+S[T].a*v)+")");else for(T=0;T<N;T++)x.push((C[T]||0)+S[T]*v);else d.indexOf(w)!==-1?x="rgba("+Math.round(C.r+S.r*v)+","+Math.round(C.g+S.g*v)+","+Math.round(C.b+S.b*v)+","+(C.a+S.a*v)+")":x=C+S*v;y.setAttr(w,x)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var v=this.node,y=h.attrs[v._id][this._id];y.points&&y.points.trueEnd&&v.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var v=this.node,y=h.attrs[v._id][this._id];y.points&&y.points.trueStart&&v.points(y.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(v){return this.tween.seek(v*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var v=this.node._id,y=this._id,_=h.tweens[v],w;this.pause();for(w in _)delete h.tweens[v][w];delete h.attrs[v][y]}}e.Tween=h,h.attrs={},h.tweens={},r.Node.prototype.to=function(g){var v=g.onFinish;g.node=this,g.onFinish=function(){this.destroy(),v&&v()};var y=new h(g);y.play()},e.Easings={BackEaseIn(g,v,y,_){var w=1.70158;return y*(g/=_)*g*((w+1)*g-w)+v},BackEaseOut(g,v,y,_){var w=1.70158;return y*((g=g/_-1)*g*((w+1)*g+w)+1)+v},BackEaseInOut(g,v,y,_){var w=1.70158;return(g/=_/2)<1?y/2*(g*g*(((w*=1.525)+1)*g-w))+v:y/2*((g-=2)*g*(((w*=1.525)+1)*g+w)+2)+v},ElasticEaseIn(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_)===1?v+y:(A||(A=_*.3),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),-(w*Math.pow(2,10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A))+v)},ElasticEaseOut(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_)===1?v+y:(A||(A=_*.3),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),w*Math.pow(2,-10*g)*Math.sin((g*_-C)*(2*Math.PI)/A)+y+v)},ElasticEaseInOut(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_/2)===2?v+y:(A||(A=_*(.3*1.5)),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),g<1?-.5*(w*Math.pow(2,10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A))+v:w*Math.pow(2,-10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A)*.5+y+v)},BounceEaseOut(g,v,y,_){return(g/=_)<1/2.75?y*(7.5625*g*g)+v:g<2/2.75?y*(7.5625*(g-=1.5/2.75)*g+.75)+v:g<2.5/2.75?y*(7.5625*(g-=2.25/2.75)*g+.9375)+v:y*(7.5625*(g-=2.625/2.75)*g+.984375)+v},BounceEaseIn(g,v,y,_){return y-e.Easings.BounceEaseOut(_-g,0,y,_)+v},BounceEaseInOut(g,v,y,_){return g<_/2?e.Easings.BounceEaseIn(g*2,0,y,_)*.5+v:e.Easings.BounceEaseOut(g*2-_,0,y,_)*.5+y*.5+v},EaseIn(g,v,y,_){return y*(g/=_)*g+v},EaseOut(g,v,y,_){return-y*(g/=_)*(g-2)+v},EaseInOut(g,v,y,_){return(g/=_/2)<1?y/2*g*g+v:-y/2*(--g*(g-2)-1)+v},StrongEaseIn(g,v,y,_){return y*(g/=_)*g*g*g*g+v},StrongEaseOut(g,v,y,_){return y*((g=g/_-1)*g*g*g*g+1)+v},StrongEaseInOut(g,v,y,_){return(g/=_/2)<1?y/2*g*g*g*g*g+v:y/2*((g-=2)*g*g*g*g+2)+v},Linear(g,v,y,_){return y*g/_+v}}})(T8),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Kt,n=En,r=ro,s=ia,o=C8,a=iu,l=rh,c=sh,u=Qf,d=Es,f=ru,h=T8,g=Cs,v=ur;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:s.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:l.FastLayer,Group:c.Group,DD:u.DD,Shape:d.Shape,shapes:d.shapes,Animation:f.Animation,Tween:h.Tween,Easings:h.Easings,Context:g.Context,Canvas:v.Canvas}),e.default=e.Konva}(mv),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=mv;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=mv;e.exports=r.Konva}(gv,gv.exports);var nZ=gv.exports;const zt=EC(nZ);var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Rect=void 0;const iZ=li,rZ=Es,sZ=Kt,oZ=En,aZ=Rt;class oh extends rZ.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),s=this.height();t.beginPath(),n?oZ.Util.drawRoundedRectPath(t,r,s,n):t.rect(0,0,r,s),t.closePath(),t.fillStrokeShape(this)}}Pv.Rect=oh,oh.prototype.className="Rect",(0,sZ._registerNode)(oh),iZ.Factory.addGetterSetter(oh,"cornerRadius",0,(0,aZ.getNumberOrArrayOfNumbersValidator)(4));var Tv={};Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.Circle=void 0;const lZ=li,cZ=Es,uZ=Rt,dZ=Kt;class dl extends cZ.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Tv.Circle=dl,dl.prototype._centroid=!0,dl.prototype.className="Circle",dl.prototype._attrsAffectingSize=["radius"],(0,dZ._registerNode)(dl),lZ.Factory.addGetterSetter(dl,"radius",0,(0,uZ.getNumberValidator)());var Ov={};Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.Image=void 0;const Nv=En,sa=li,fZ=Es,hZ=Kt,su=Rt;let jr=class oP extends fZ.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const t=!!this.cornerRadius(),n=this.hasShadow();return t&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),s=this.cornerRadius(),o=this.attrs.image;let a;if(o){const l=this.attrs.cropWidth,c=this.attrs.cropHeight;l&&c?a=[o,this.cropX(),this.cropY(),l,c,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||s)&&(t.beginPath(),s?Nv.Util.drawRoundedRectPath(t,n,r,s):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(s&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),s=this.cornerRadius();t.beginPath(),s?Nv.Util.drawRoundedRectPath(t,n,r,s):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var s=Nv.Util.createImageElement();s.onload=function(){var o=new oP({image:s});n(o)},s.onerror=r,s.crossOrigin="Anonymous",s.src=t}};Ov.Image=jr,jr.prototype.className="Image",(0,hZ._registerNode)(jr),sa.Factory.addGetterSetter(jr,"cornerRadius",0,(0,su.getNumberOrArrayOfNumbersValidator)(4)),sa.Factory.addGetterSetter(jr,"image"),sa.Factory.addComponentsGetterSetter(jr,"crop",["x","y","width","height"]),sa.Factory.addGetterSetter(jr,"cropX",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropY",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropWidth",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropHeight",0,(0,su.getNumberValidator)());var ou={};Object.defineProperty(ou,"__esModule",{value:!0}),ou.Text=ou.stringToArray=void 0;const Iv=En,jn=li,pZ=Es,Rv=Kt,ao=Rt,gZ=Kt;function O8(e){return[...e].reduce((t,n,r,s)=>(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?t.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(s[r+1]||""))?t.push(n+s[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?t[t.length-1]+=n:t.push(n),t),[])}ou.stringToArray=O8;var fl="auto",mZ="center",N8="inherit",au="justify",vZ="Change.konva",bZ="2d",I8="-",R8="left",yZ="text",_Z="Text",wZ="top",CZ="bottom",D8="middle",L8="normal",SZ="px ",ah=" ",EZ="right",k8="rtl",xZ="word",AZ="char",M8="none",Dv="…",F8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],PZ=F8.length;function TZ(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var lh;function Lv(){return lh||(lh=Iv.Util.createCanvasElement().getContext(bZ),lh)}function OZ(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function NZ(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function IZ(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class on extends pZ.Shape{constructor(t){super(IZ(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<PZ;n++)this.on(F8[n]+vZ,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var s=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,l=this.verticalAlign(),c=this.direction(),u=0,d=this.align(),f=this.getWidth(),h=this.letterSpacing(),g=this.fill(),v=this.textDecoration(),y=v.indexOf("underline")!==-1,_=v.indexOf("line-through")!==-1,w;c=c===N8?t.direction:c;var A=a/2,C=D8;if(Rv.Konva._fixTextRendering){var S=this.measureSize("M");C="alphabetic",A=(S.fontBoundingBoxAscent-S.fontBoundingBoxDescent)/2+a/2}var x=0,T=0;for(c===k8&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",C),t.setAttr("textAlign",R8),l===D8?u=(this.getHeight()-r*a-s*2)/2:l===CZ&&(u=this.getHeight()-r*a-s*2),t.translate(s,u+s),w=0;w<r;w++){var x=0,T=0,N=n[w],I=N.text,B=N.width,D=N.lastInParagraph,M,G,H;if(t.save(),d===EZ?x+=f-B-s*2:d===mZ&&(x+=(f-B-s*2)/2),y){t.save(),t.beginPath();let Z=Rv.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2);const j=x,we=A+T+Z;t.moveTo(j,we),M=I.split(" ").length-1,G=M===0,H=d===au&&!D?f-s*2:B,t.lineTo(j+Math.round(H),we),t.lineWidth=o/15;const ge=this._getLinearGradient();t.strokeStyle=ge||g,t.stroke(),t.restore()}if(_){t.save(),t.beginPath();let Z=Rv.Konva._fixTextRendering?-Math.round(o/4):0;t.moveTo(x,A+T+Z),M=I.split(" ").length-1,G=M===0,H=d===au&&D&&!G?f-s*2:B,t.lineTo(x+Math.round(H),A+T+Z),t.lineWidth=o/15;const j=this._getLinearGradient();t.strokeStyle=j||g,t.stroke(),t.restore()}if(c!==k8&&(h!==0||d===au)){M=I.split(" ").length-1;for(var ae=O8(I),X=0;X<ae.length;X++){var k=ae[X];k===" "&&!D&&d===au&&(x+=(f-s*2-B)/M),this._partialTextX=x,this._partialTextY=A+T,this._partialText=k,t.fillStrokeShape(this),x+=this.measureSize(k).width+h}}else h!==0&&t.setAttr("letterSpacing",`${h}px`),this._partialTextX=x,this._partialTextY=A+T,this._partialText=I,t.fillStrokeShape(this);t.restore(),r>1&&(A+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=Iv.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(yZ,n),this}getWidth(){var t=this.attrs.width===fl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===fl||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Iv.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n,r,s,o,a,l,c,u,d,f,h,g=Lv(),v=this.fontSize(),y;g.save(),g.font=this._getContextFont(),y=g.measureText(t),g.restore();const _=v/100;return{actualBoundingBoxAscent:(n=y.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*_,actualBoundingBoxDescent:(r=y.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(s=y.actualBoundingBoxLeft)!==null&&s!==void 0?s:-7.421875*_,actualBoundingBoxRight:(o=y.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*_,alphabeticBaseline:(a=y.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(l=y.emHeightAscent)!==null&&l!==void 0?l:100*_,emHeightDescent:(c=y.emHeightDescent)!==null&&c!==void 0?c:-20*_,fontBoundingBoxAscent:(u=y.fontBoundingBoxAscent)!==null&&u!==void 0?u:91*_,fontBoundingBoxDescent:(d=y.fontBoundingBoxDescent)!==null&&d!==void 0?d:21*_,hangingBaseline:(f=y.hangingBaseline)!==null&&f!==void 0?f:72.80000305175781*_,ideographicBaseline:(h=y.ideographicBaseline)!==null&&h!==void 0?h:-21*_,width:y.width,height:v}}_getContextFont(){return this.fontStyle()+ah+this.fontVariant()+ah+(this.fontSize()+SZ)+TZ(this.fontFamily())}_addTextLine(t){this.align()===au&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return Lv().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
147
+ `)}manageSpecialValue(t){t=t.replace(/"{2,}/g,"");const n=/"{1}[^"]*"{1}/g,r=t.match(n);return r!==null&&r.map(s=>(t=t.replace(s,s.replace(/,/g,pv)),s.replace(/,/g,pv))),t}reverseSpecialValue(t){const n=new RegExp(pv,"g");return t.map(r=>{for(const s in r){const o=r[s].replace(n,",");r[s]=o}return r})}convertToGraphData(t){const n=[];let r=t.filter(o=>o.Label===void 0),s=t.filter(o=>o.Label!==void 0);return r=r.map(o=>this.getGraphNode(o)),s=s.map((o,a)=>{const l="Source Entity ID",c="Target Entity ID",u="Label",d=this.getNode(o[l],r)[0],f=this.getNode(o[c],r)[0];return o[u]!==""&&n.push({id:f.id,label:o[u]}),{source:d.id,target:f.id,type:d.type+"-"+f.type,uniqueIndex:a}}),r=r.map(o=>(delete o.entityId,n.map(a=>{a.id===o.id&&(o.name=a.label)}),o)),{nodes:r,links:s}}getGraphNode(t){const n=V4.nodeMapReverse,r=cv.entitys;let s="",o="",a="",l=null,c=null;return r.map(u=>{const d=u.type,f=u.columnsFields[1];t[d]!==void 0&&(o=n[d],s=t[f],a=t[d],l=this.manageNodeDetail(u.columnsFields,t,n[d]),c=this.manageNodeFieldMap(n[d]))}),{id:s,type:o,name:s,entityId:a,detail:l,fieldMap:c,show:!0}}manageNodeFieldMap(t){return this.fieldMap[t]}manageNodeDetail(t,n,r){let s=null,o=!1;if(r!=="nodeType"){s={info:{basic:{}},tags:[]};for(const a in n)if(t.indexOf(a)===-1){o=!0;const l=n[a];a==="tags"&&l!==""?s.tags=l.split(",").map(c=>({name:c,desc:c})):s.info.basic[a]=n[a]}o===!1&&(s=null)}return s}getNode(t,n){return n.filter(r=>r.entityId===t)}outputData(){return this.data}}const Kge="",zY={name:"ButtonList",components:{"force-graph-svg-icon":Qo,addNode:$J,addLink:HJ,intro:XJ,UploadFilled:KM,SearchIcon:DJ},mixins:[kr],props:{showTopSearch:{type:Boolean,default:!1},hideButtonList:{type:Array,default:()=>[]},selection:{type:Array,default:()=>[]},history:{type:Object,default:()=>({dataNow:{}})},moduleDetail:{type:Object,default:()=>{}},requestGraphData:{type:Boolean,default:!0}},emits:["fixNodes","toggleLayout","addNodes","addLink","importCsvData","autoDisplay","toggleMove","deleteNodes","saveSnapshot"],data(){return{maxTrans:0,nowTrans:0,onceTrans:300,dialogVisible:!1,exportFormat:0,formatOptions:[{value:0,label:"JSON"},{value:2,label:"CSV"}],isAllFix:!1,dialogImportVisible:!1,importFileList:[],importFile:null,intro:!1,current:null,addType:"",flageAlias:!0,filterValues:"",relatedMidNum:2}},computed:{buttonList(){var e,t;return[{hover:!1,icon:"hm_icon_add",disable:!this.requestGraphData,fun:this.addNode,name:"新增节点",params:"diy"},{hover:!1,icon:"hm_icon_del",disable:this.selection.length===0||!this.requestGraphData,fun:this.deleteNodes,name:"删除"},{hover:!1,icon:"hm_icon_snapshot",disable:!this.requestGraphData,fun:this.addSnapshot,name:"保存快照",hide:!((t=(e=this.moduleDetail)==null?void 0:e.config)!=null&&t.hasSnapshot)},{hover:!1,icon:"hm_icon_img",disable:!this.requestGraphData,fun:this.saveAsImg,name:"保存图片"},{hover:!1,icon:"hm_icon_export",disable:!this.requestGraphData,fun:this.exportData,name:"数据导出"},{hover:!1,icon:"hm_icon_import",disable:!this.requestGraphData,fun:this.importData,name:"数据导入"},{hover:!1,icon:"hm_icon_undo",disable:this.history.currentIndex<=0||!this.requestGraphData,fun:this.backHistory,name:"撤销"},{hover:!1,icon:"hm_icon_redo",disable:this.history.currentIndex>=this.history.length-1||!this.requestGraphData,fun:this.forwardHistory,name:"恢复"},{hover:!1,icon:"hm_icon_auto",fun:this.autoDisplay,name:"自动布局"},{hover:!1,icon:"hm_icon_fix",fun:this.fixNodes,name:"全局固定",params:!0,hide:this.isAllFix},{hover:!1,icon:"hm_icon_unfix",fun:this.fixNodes,name:"全局解除固定",params:!1,hide:!this.isAllFix},{hover:!1,icon:"hm_icon_tree",fun:this.toggleLayout,name:"树型布局",params:1,hide:this.history.layoutIndex===1},{hover:!1,icon:"hm_icon_force",fun:this.toggleLayout,name:"斥力布局",params:0,hide:this.history.layoutIndex===0}]},buttonListShow(){return this.buttonList.filter(e=>e.hide!==!0&&!this.hideButtonList.includes(e.name))},noSelectNodes(){var r;const e=us(this.history.dataNow.nodes),t=us((r=this.history.dataNow)==null?void 0:r.links),n=e.filter(s=>{if((s==null?void 0:s.type)==="nodeType")return s.childList=this.searchChildren(s,t),s.parentNode=this.searchParent(s,t),!0});return this.deleteParentItem(n)}},mounted(){},methods:{hover(e){this.current=e},out(){this.current=null},autoDisplay(){Ke(this,"autoDisplay")},fixNodes(e=!0){Ke(this,"fixNodes",e),this.isAllFix=e},toggleMove(){Ke(this,"toggleMove")},toggleLayout(e){Ke(this,"toggleLayout",e)},addNode(e,t){this.addType=e,this.$refs.addNode.show(t)},addNodes({node:e,type:t,connectNode:n}){Ke(this,"addNodes",{node:e,type:t,connectNode:n})},addLink({source:e,target:t}){Ke(this,"addLink",{source:e,target:t})},backHistory(){this.$parent.historyBack()},forwardHistory(){this.history.forward()},dataURLToBlob(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]);let s=r.length;const o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})},downloadURI(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},saveAsImg(){return ot(this,null,function*(){var t,n;this.$parent.bigLoading=!0;const e=yield this.svgToUrl();this.downloadURI(e,`${((n=(t=this.history.dataNow)==null?void 0:t.nodes[0])==null?void 0:n.id)||"img"}_${new Date().getTime()}.png`),this.$parent.bigLoading=!1})},svgToUrl(){return ot(this,null,function*(){this.$parent.centerAndZoom();const t=this.$parent.getCanvasStage().toDataURL({mimeType:"image/png"});return this.$parent.reset(),t})},svgToBlob(){return ot(this,null,function*(){this.$parent.centerAndZoom();const e=this.$parent.getCanvasStage();e.find("Image").forEach(n=>{const r=n.image();r&&(r.crossOrigin="Anonymous")});const t=yield e.toBlob();return this.$parent.reset(),t})},deleteNodes(){Ke(this,"deleteNodes")},addSnapshot(){Ke(this,"saveSnapshot")},exportData(){this.handleOpenModal()},handleOpenModal(){this.dialogVisible=!0},handleCloseModal(){this.dialogVisible=!1},handleExportData(){var a,l,c,u;let e=null,t=null,n=null,r=null;this.selection.length>0?(n=it(this.selection),r=[]):(n=it(this.history.dataNow.nodes),r=it(this.history.dataNow.links));const s=n.map(d=>{const{id:f,type:h,detail:g}=d;return{id:f,type:h,detail:g}}),o=r.map(d=>{const{source:f,target:h}=d;return{source:f,target:h}});this.exportFormat===0?(e=JSON.stringify(s),t=`${((l=(a=this.history.dataNow)==null?void 0:a.nodes[0])==null?void 0:l.id)||"file"}_${new Date().getTime()}.json`):(e=this.setMalteGoCsv({nodes:s,links:o}),t=`${((u=(c=this.history.dataNow)==null?void 0:c.nodes[0])==null?void 0:u.id)||"file"}_${new Date().getTime()}.csv`),Kq(e,t),this.handleCloseModal()},importData(){this.handleOpenImportModal()},handleOpenImportModal(){this.dialogImportVisible=!0},handleCloseImportModal(){this.dialogImportVisible=!1,this.importFileList=[],this.importFile=null},handleImportData(){try{const e=this.getFieldMap(),n=new VY(this.importFile,e).outputData();Ke(this,"importCsvData",{nodes:n.nodes,links:n.links})}catch(e){vn({message:e,type:"error"})}this.handleCloseImportModal()},getFieldMap(){const e=this.moduleDetail.detail_field_map,t={};for(const n in e){const r=n.substring(0,n.indexOf("_detail_info"));t[r]=JSON.parse(JSON.stringify(e[n]))}return t},handleFileChange(e){this.importFile=e;const t=new FileReader;t.onload=()=>{t.result&&(this.importFile=t.result)},t.readAsText(e.raw)},handleFileRemove(){this.importFile=null,this.importFileList=[]},setMalteGoCsv(e){return new QJ(e).outputCsvFile()},showIntro(){this.intro=!0},hideIntro(){this.intro=!1},handleAlias(e){this.flageAlias=!e;const t=document.getElementsByClassName("right-menu-box")[0],n=document.getElementsByClassName("graph-box")[0];t&&(e?(t.style.display="none",n.style.width="100%"):(t.style.display="inline-block",n.style.width="1%"))},permissionitem(){return this.requestGraphData?!0:(vn({message:"无可操作权限",type:"warning"}),!1)},handleIconClick(e){this.permissionitem()&&(Bn({cId:"buttonList-"+e.icon,c:"顶部按钮-"+e.name}),e.fun(e.params))},handleSearch2:jo(function(){var n;if(!this.filterValues){Ke(mt,"sendNodesRange",null);return}this.filteredDataList=us(this.noSelectNodes);const e=us((n=this.history.dataNow)==null?void 0:n.links);this.filteredDataList=this.filteredDataList.filter(r=>this.filterValues!==""?(r.parentNode=this.searchParent(r,e),r.childList=r.childList.filter(s=>s.name.toLowerCase().indexOf(this.filterValues.toLowerCase())>-1),r.childList.length>0):!0),this.filteredDataList=this.deleteParentItem(this.filteredDataList);const t=[];this.filteredDataList.forEach(r=>{t.push(this.searchParent(r,e)),t.push(...r.childList),t.push(r)}),Ke(mt,"sendNodesRange",t)},200),handleSearch:jo(function(){this.filteredDataList=us(this.history.dataNow.nodes),this.filteredDataList=this.filteredDataList.filter(t=>this.filterValues?t.name.toLowerCase().indexOf(this.filterValues.toLowerCase())>-1:!0);const e=[];this.filteredDataList.forEach(t=>{e.push(t)}),Ke(mt,"sendNodesRange",e)},200),handleFilterMidNumber(e){gi("=>(ButtonList.vue:758) currentValue",e),e<2&&(this.relatedMidNum=2),this.filteredDataList=us(this.history.dataNow.nodes);const t=[],n=[];this.filteredDataList=this.filteredDataList.forEach(r=>{var s,o,a;if(this.relatedMidNum){const l=(a=(o=(s=r==null?void 0:r.detail)==null?void 0:s.info)==null?void 0:o.basic)==null?void 0:a.mid_count;(l?l>=this.relatedMidNum:!0)?t.push(r):n.push(r)}}),Ke(mt,"buttonClick",{nodes:t,api:{name:"show_nodes"}}),this.$nextTick(()=>{Ke(mt,"buttonClick",{nodes:n,api:{name:"hide_nodes"}})})},searchChildren(e,t){const n=t,r=[];return n&&n.forEach(s=>{s.source.id===e.id&&r.push(s.target)}),r},searchParent(e,t){const n=t;let r=[];return n&&n.forEach(s=>{s.target.id===e.id&&(r=s.source)}),r},groupBy(e,t){const n={};return e.forEach(function(r){const s=JSON.stringify(t(r));n[s]=n[s]||[],n[s].push(r)}),Object.keys(n).map(function(r){return n[r]})},deleteParentItem(e){let t=[];const n=[];return this.groupBy(e,function(r){return[r.parentNode.id]}).map(r=>{t.push(...r)}),t=t.map(r=>(n.some(o=>o===r.parentNode.id)?r.parentNode="":n.push(r.parentNode.id),r)),t}}},qY={class:"button-container"},HY={ref:"container",class:"button-box"},GY={ref:"box",class:"all-button"},WY={key:0,class:"search-content-wrap"},KY={class:"relative-mid-search"},JY={class:"number-input-wrap"},YY=["onClick"],XY={key:1,class:"right-btn-wrap"},ZY={class:"button-one intro-button"},QY={class:"dialog-footer"},eX={class:"dialog-footer"},tX={class:"intro"};function nX(e,t,n,r,s,o){const a=Ge("SearchIcon"),l=Js,c=pV,u=Ge("force-graph-svg-icon"),d=hi,f=Ge("intro"),h=FV,g=xf,v=Ef,y=Jo,_=Kc,w=Ge("UploadFilled"),A=Bt,C=oq,S=Ge("addNode"),x=Ge("addLink");return R(),U("div",qY,[K("div",HY,[K("div",GY,[n.showTopSearch?(R(),U("div",WY,[ie(l,{modelValue:s.filterValues,"onUpdate:modelValue":t[0]||(t[0]=T=>s.filterValues=T),modelModifiers:{trim:!0},class:"search-content",placeholder:"支持查询嫌疑人终端码、虚拟身份、路由mac、域名",onInput:o.handleSearch},{suffix:ne(()=>[t[8]||(t[8]=K("div",{class:"split-line"},null,-1)),ie(a,{onClick:o.handleSearch},null,8,["onClick"])]),_:1},8,["modelValue","onInput"]),K("div",KY,[t[10]||(t[10]=K("span",{class:"search-label"},"关联终端数量",-1)),K("div",JY,[t[9]||(t[9]=K("span",{class:"great-than"},"≥",-1)),ie(c,{modelValue:s.relatedMidNum,"onUpdate:modelValue":t[1]||(t[1]=T=>s.relatedMidNum=T),class:"number-input",min:2,controls:!1,onChange:o.handleFilterMidNumber},null,8,["modelValue","onChange"])])])])):oe("",!0),K("div",null,[(R(!0),U(qe,null,It(o.buttonListShow,(T,N)=>(R(),ye(d,{key:N,class:"item",effect:"dark",content:T.name,placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[K("div",{class:ee(["img-box","button-one "+(T.disable?"disabled":"")]),onClick:I=>o.handleIconClick(T)},[ie(u,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/button22/"+T.icon+".svg"]},null,8,["icon-class"])],10,YY)]),_:2},1032,["content"]))),128))]),!n.hideButtonList.includes("功能介绍")||!n.hideButtonList.includes("展开折叠")?(R(),U("div",XY,[n.hideButtonList.includes("功能介绍")?oe("",!0):(R(),ye(h,{key:0,placement:"bottom-end",width:"auto",trigger:"hover"},{reference:ne(()=>[K("div",ZY,[ie(d,{class:"item",effect:"dark",content:"功能介绍",placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(u,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/button22/hm_icon_help.svg"]},null,8,["icon-class"])]),_:1})])]),default:ne(()=>[ie(f,{config:n.moduleDetail.config||{}},null,8,["config"])]),_:1})),n.hideButtonList.includes("展开折叠")?oe("",!0):(R(),U("div",{key:1,class:"button-one intro-button",onClick:t[2]||(t[2]=T=>o.handleAlias(s.flageAlias)),onMouseenter:t[3]||(t[3]=T=>o.hover(o.buttonList.length+1)),onMouseleave:t[4]||(t[4]=T=>o.out())},[ie(d,{class:"item",effect:"dark",content:s.flageAlias?"右侧折叠":"右侧展开",placement:"bottom","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(u,{class:"button-img","icon-class":e.imgPath[s.flageAlias?"./public/d3svg1/button22/hm_icon_alias_colse.svg":"./public/d3svg1/button22/hm_icon_alias.svg"]},null,8,["icon-class"])]),_:1},8,["content"])],32))])):oe("",!0)],512)],512),ie(_,{modelValue:s.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=T=>s.dialogVisible=T),title:"选择导出数据格式","append-to-body":"",width:"400px","before-close":o.handleCloseModal,class:"el-dialog-graph"},{footer:ne(()=>[K("span",QY,[ie(y,{onClick:o.handleCloseModal},{default:ne(()=>t[11]||(t[11]=[Ye("取 消")])),_:1},8,["onClick"]),ie(y,{type:"primary",onClick:o.handleExportData},{default:ne(()=>t[12]||(t[12]=[Ye("导 出")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(v,{modelValue:s.exportFormat,"onUpdate:modelValue":t[5]||(t[5]=T=>s.exportFormat=T),placeholder:"请选择导出数据格式"},{default:ne(()=>[(R(!0),U(qe,null,It(s.formatOptions,T=>(R(),ye(g,{key:T.value,label:T.label,value:T.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue","before-close"]),ie(_,{modelValue:s.dialogImportVisible,"onUpdate:modelValue":t[7]||(t[7]=T=>s.dialogImportVisible=T),title:"导入数据","append-to-body":"",width:"400px","before-close":o.handleCloseImportModal,class:"el-dialog-graph"},{footer:ne(()=>[K("span",eX,[ie(y,{onClick:o.handleCloseImportModal},{default:ne(()=>t[15]||(t[15]=[Ye("取 消")])),_:1},8,["onClick"]),ie(y,{type:"primary",disabled:!s.importFile,onClick:o.handleImportData},{default:ne(()=>t[16]||(t[16]=[Ye("导 入")])),_:1},8,["disabled","onClick"])])]),default:ne(()=>[ie(C,{drag:"",action:"#","auto-upload":!1,accept:".csv","file-list":s.importFileList,"on-change":o.handleFileChange,"on-remove":o.handleFileRemove},{tip:ne(()=>t[13]||(t[13]=[K("div",{class:"el-upload__tip"},"只能上传由 Maltego 软件导出的csv文件",-1)])),default:ne(()=>[ie(A,{class:"el-icon-upload"},{default:ne(()=>[ie(w)]),_:1}),t[14]||(t[14]=K("div",{class:"el-upload__text"},[Ye("将文件拖到此处,或"),K("em",null,"点击上传")],-1))]),_:1},8,["file-list","on-change","on-remove"])]),_:1},8,["modelValue","before-close"]),ie(S,{ref:"addNode","nodes-type":n.moduleDetail&&n.moduleDetail.nodes||[],"add-type":s.addType,onAddNodes:o.addNodes},null,8,["nodes-type","add-type","onAddNodes"]),ie(x,{ref:"addLink",onAddLink:o.addLink},null,8,["onAddLink"]),Lt(K("div",tX,[ie(f,{config:n.moduleDetail.config||{},onMouseenter:o.showIntro,onMouseleave:o.hideIntro},null,8,["config","onMouseenter","onMouseleave"])],512),[[Cn,s.intro]])])}const iX=fn(zY,[["render",nX]]);var gv={exports:{}},mv={},Kt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function n(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof Qs!="undefined"?Qs:typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{},e.Konva={_global:e.glob,version:"9.3.15",isBrowser:n(),isUnminified:/param/.test(function(s){}.toString()),dblClickWindow:400,getAngle(s){return e.Konva.angleDeg?s*t:s},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window!="undefined"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var s;return(s=e.Konva.Transformer)===null||s===void 0?void 0:s.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(s){e.glob.Konva=s}};const r=s=>{e.Konva[s.prototype.getClassName()]=s};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Kt);var En={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Kt;class n{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){var x=this.m;return{x:x[0]*S.x+x[2]*S.y+x[4],y:x[1]*S.x+x[3]*S.y+x[5]}}translate(S,x){return this.m[4]+=this.m[0]*S+this.m[2]*x,this.m[5]+=this.m[1]*S+this.m[3]*x,this}scale(S,x){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=x,this.m[3]*=x,this}rotate(S){var x=Math.cos(S),T=Math.sin(S),N=this.m[0]*x+this.m[2]*T,I=this.m[1]*x+this.m[3]*T,B=this.m[0]*-T+this.m[2]*x,D=this.m[1]*-T+this.m[3]*x;return this.m[0]=N,this.m[1]=I,this.m[2]=B,this.m[3]=D,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,x){var T=this.m[0]+this.m[2]*x,N=this.m[1]+this.m[3]*x,I=this.m[2]+this.m[0]*S,B=this.m[3]+this.m[1]*S;return this.m[0]=T,this.m[1]=N,this.m[2]=I,this.m[3]=B,this}multiply(S){var x=this.m[0]*S.m[0]+this.m[2]*S.m[1],T=this.m[1]*S.m[0]+this.m[3]*S.m[1],N=this.m[0]*S.m[2]+this.m[2]*S.m[3],I=this.m[1]*S.m[2]+this.m[3]*S.m[3],B=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],D=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=x,this.m[1]=T,this.m[2]=N,this.m[3]=I,this.m[4]=B,this.m[5]=D,this}invert(){var S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),x=this.m[3]*S,T=-this.m[1]*S,N=-this.m[2]*S,I=this.m[0]*S,B=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),D=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=x,this.m[1]=T,this.m[2]=N,this.m[3]=I,this.m[4]=B,this.m[5]=D,this}getMatrix(){return this.m}decompose(){var S=this.m[0],x=this.m[1],T=this.m[2],N=this.m[3],I=this.m[4],B=this.m[5],D=S*N-x*T;let M={x:I,y:B,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||x!=0){var G=Math.sqrt(S*S+x*x);M.rotation=x>0?Math.acos(S/G):-Math.acos(S/G),M.scaleX=G,M.scaleY=D/G,M.skewX=(S*T+x*N)/D,M.skewY=0}else if(T!=0||N!=0){var H=Math.sqrt(T*T+N*N);M.rotation=Math.PI/2-(N>0?Math.acos(-T/H):-Math.acos(T/H)),M.scaleX=D/H,M.scaleY=H,M.skewX=0,M.skewY=(S*T+x*N)/D}return M.rotation=e.Util._getRotation(M.rotation),M}}e.Transform=n;var r="[object Array]",s="[object Number]",o="[object String]",a="[object Boolean]",l=Math.PI/180,c=180/Math.PI,u="#",d="",f="0",h="Konva warning: ",g="Konva error: ",v="rgb(",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,w=[];const A=typeof requestAnimationFrame!="undefined"&&requestAnimationFrame||function(C){setTimeout(C,60)};e.Util={_isElement(C){return!!(C&&C.nodeType==1)},_isFunction(C){return!!(C&&C.constructor&&C.call&&C.apply)},_isPlainObject(C){return!!C&&C.constructor===Object},_isArray(C){return Object.prototype.toString.call(C)===r},_isNumber(C){return Object.prototype.toString.call(C)===s&&!isNaN(C)&&isFinite(C)},_isString(C){return Object.prototype.toString.call(C)===o},_isBoolean(C){return Object.prototype.toString.call(C)===a},isObject(C){return C instanceof Object},isValidSelector(C){if(typeof C!="string")return!1;var S=C[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(C){return C===0||C>0?1:-1},requestAnimFrame(C){w.push(C),w.length===1&&A(function(){const S=w;w=[],S.forEach(function(x){x()})})},createCanvasElement(){var C=document.createElement("canvas");try{C.style=C.style||{}}catch(S){}return C},createImageElement(){return document.createElement("img")},_isInDocument(C){for(;C=C.parentNode;)if(C==document)return!0;return!1},_urlToImage(C,S){var x=e.Util.createImageElement();x.onload=function(){S(x)},x.src=C},_rgbToHex(C,S,x){return((1<<24)+(C<<16)+(S<<8)+x).toString(16).slice(1)},_hexToRgb(C){C=C.replace(u,d);var S=parseInt(C,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){for(var C=(Math.random()*16777215<<0).toString(16);C.length<6;)C=f+C;return u+C},getRGB(C){var S;return C in y?(S=y[C],{r:S[0],g:S[1],b:S[2]}):C[0]===u?this._hexToRgb(C.substring(1)):C.substr(0,4)===v?(S=_.exec(C.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(C){return C=C||"black",e.Util._namedColorToRBA(C)||e.Util._hex3ColorToRGBA(C)||e.Util._hex4ColorToRGBA(C)||e.Util._hex6ColorToRGBA(C)||e.Util._hex8ColorToRGBA(C)||e.Util._rgbColorToRGBA(C)||e.Util._rgbaColorToRGBA(C)||e.Util._hslColorToRGBA(C)},_namedColorToRBA(C){var S=y[C.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(C){if(C.indexOf("rgb(")===0){C=C.match(/rgb\(([^)]+)\)/)[1];var S=C.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(C){if(C.indexOf("rgba(")===0){C=C.match(/rgba\(([^)]+)\)/)[1];var S=C.split(/ *, */).map((x,T)=>x.slice(-1)==="%"?T===3?parseInt(x)/100:parseInt(x)/100*255:Number(x));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(C){if(C[0]==="#"&&C.length===9)return{r:parseInt(C.slice(1,3),16),g:parseInt(C.slice(3,5),16),b:parseInt(C.slice(5,7),16),a:parseInt(C.slice(7,9),16)/255}},_hex6ColorToRGBA(C){if(C[0]==="#"&&C.length===7)return{r:parseInt(C.slice(1,3),16),g:parseInt(C.slice(3,5),16),b:parseInt(C.slice(5,7),16),a:1}},_hex4ColorToRGBA(C){if(C[0]==="#"&&C.length===5)return{r:parseInt(C[1]+C[1],16),g:parseInt(C[2]+C[2],16),b:parseInt(C[3]+C[3],16),a:parseInt(C[4]+C[4],16)/255}},_hex3ColorToRGBA(C){if(C[0]==="#"&&C.length===4)return{r:parseInt(C[1]+C[1],16),g:parseInt(C[2]+C[2],16),b:parseInt(C[3]+C[3],16),a:1}},_hslColorToRGBA(C){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(C)){const[S,...x]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(C),T=Number(x[0])/360,N=Number(x[1])/100,I=Number(x[2])/100;let B,D,M;if(N===0)return M=I*255,{r:Math.round(M),g:Math.round(M),b:Math.round(M),a:1};I<.5?B=I*(1+N):B=I+N-I*N;const G=2*I-B,H=[0,0,0];for(let ae=0;ae<3;ae++)D=T+1/3*-(ae-1),D<0&&D++,D>1&&D--,6*D<1?M=G+(B-G)*6*D:2*D<1?M=B:3*D<2?M=G+(B-G)*(2/3-D)*6:M=G,H[ae]=M*255;return{r:Math.round(H[0]),g:Math.round(H[1]),b:Math.round(H[2]),a:1}}},haveIntersection(C,S){return!(S.x>C.x+C.width||S.x+S.width<C.x||S.y>C.y+C.height||S.y+S.height<C.y)},cloneObject(C){var S={};for(var x in C)this._isPlainObject(C[x])?S[x]=this.cloneObject(C[x]):this._isArray(C[x])?S[x]=this.cloneArray(C[x]):S[x]=C[x];return S},cloneArray(C){return C.slice(0)},degToRad(C){return C*l},radToDeg(C){return C*c},_degToRad(C){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(C)},_radToDeg(C){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(C)},_getRotation(C){return t.Konva.angleDeg?e.Util.radToDeg(C):C},_capitalize(C){return C.charAt(0).toUpperCase()+C.slice(1)},throw(C){throw new Error(g+C)},error(C){console.error(g+C)},warn(C){t.Konva.showWarnings&&console.warn(h+C)},each(C,S){for(var x in C)S(x,C[x])},_inRange(C,S,x){return S<=C&&C<x},_getProjectionToSegment(C,S,x,T,N,I){var B,D,M,G=(C-x)*(C-x)+(S-T)*(S-T);if(G==0)B=C,D=S,M=(N-x)*(N-x)+(I-T)*(I-T);else{var H=((N-C)*(x-C)+(I-S)*(T-S))/G;H<0?(B=C,D=S,M=(C-N)*(C-N)+(S-I)*(S-I)):H>1?(B=x,D=T,M=(x-N)*(x-N)+(T-I)*(T-I)):(B=C+H*(x-C),D=S+H*(T-S),M=(B-N)*(B-N)+(D-I)*(D-I))}return[B,D,M]},_getProjectionToLine(C,S,x){var T=e.Util.cloneObject(C),N=Number.MAX_VALUE;return S.forEach(function(I,B){if(!(!x&&B===S.length-1)){var D=S[(B+1)%S.length],M=e.Util._getProjectionToSegment(I.x,I.y,D.x,D.y,C.x,C.y),G=M[0],H=M[1],ae=M[2];ae<N&&(T.x=G,T.y=H,N=ae)}}),T},_prepareArrayForTween(C,S,x){var T,N=[],I=[];if(C.length>S.length){var B=S;S=C,C=B}for(T=0;T<C.length;T+=2)N.push({x:C[T],y:C[T+1]});for(T=0;T<S.length;T+=2)I.push({x:S[T],y:S[T+1]});var D=[];return I.forEach(function(M){var G=e.Util._getProjectionToLine(M,N,x);D.push(G.x),D.push(G.y)}),D},_prepareToStringify(C){var S;C.visitedByCircularReferenceRemoval=!0;for(var x in C)if(C.hasOwnProperty(x)&&C[x]&&typeof C[x]=="object"){if(S=Object.getOwnPropertyDescriptor(C,x),C[x].visitedByCircularReferenceRemoval||e.Util._isElement(C[x]))if(S.configurable)delete C[x];else return null;else if(e.Util._prepareToStringify(C[x])===null)if(S.configurable)delete C[x];else return null}return delete C.visitedByCircularReferenceRemoval,C},_assign(C,S){for(var x in S)C[x]=S[x];return C},_getFirstPointerId(C){return C.touches?C.changedTouches[0].identifier:C.pointerId||999},releaseCanvas(...C){t.Konva.releaseCanvasOnDestroy&&C.forEach(S=>{S.width=0,S.height=0})},drawRoundedRectPath(C,S,x,T){let N=0,I=0,B=0,D=0;typeof T=="number"?N=I=B=D=Math.min(T,S/2,x/2):(N=Math.min(T[0]||0,S/2,x/2),I=Math.min(T[1]||0,S/2,x/2),D=Math.min(T[2]||0,S/2,x/2),B=Math.min(T[3]||0,S/2,x/2)),C.moveTo(N,0),C.lineTo(S-I,0),C.arc(S-I,I,I,Math.PI*3/2,0,!1),C.lineTo(S,x-D),C.arc(S-D,x-D,D,0,Math.PI/2,!1),C.lineTo(B,x),C.arc(B,x-B,B,Math.PI/2,Math.PI,!1),C.lineTo(0,N),C.arc(N,N,N,Math.PI,Math.PI*3/2,!1)}}})(En);var ro={},li={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getComponentValidator=Rt.getBooleanValidator=Rt.getNumberArrayValidator=Rt.getFunctionValidator=Rt.getStringOrGradientValidator=Rt.getStringValidator=Rt.getNumberOrAutoValidator=Rt.getNumberOrArrayOfNumbersValidator=Rt.getNumberValidator=Rt.alphaComponent=Rt.RGBComponent=void 0;const _s=Kt,sn=En;function ws(e){return sn.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||sn.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function rX(e){return e>255?255:e<0?0:Math.round(e)}Rt.RGBComponent=rX;function sX(e){return e>1?1:e<1e-4?1e-4:e}Rt.alphaComponent=sX;function oX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isNumber(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Rt.getNumberValidator=oX;function aX(e){if(_s.Konva.isUnminified)return function(t,n){let r=sn.Util._isNumber(t),s=sn.Util._isArray(t)&&t.length==e;return!r&&!s&&sn.Util.warn(ws(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Rt.getNumberOrArrayOfNumbersValidator=aX;function lX(){if(_s.Konva.isUnminified)return function(e,t){var n=sn.Util._isNumber(e),r=e==="auto";return n||r||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Rt.getNumberOrAutoValidator=lX;function cX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isString(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Rt.getStringValidator=cX;function uX(){if(_s.Konva.isUnminified)return function(e,t){const n=sn.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Rt.getStringOrGradientValidator=uX;function dX(){if(_s.Konva.isUnminified)return function(e,t){return sn.Util._isFunction(e)||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Rt.getFunctionValidator=dX;function fX(){if(_s.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(sn.Util._isArray(e)?e.forEach(function(r){sn.Util._isNumber(r)||sn.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Rt.getNumberArrayValidator=fX;function hX(){if(_s.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||sn.Util.warn(ws(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Rt.getBooleanValidator=hX;function pX(e){if(_s.Konva.isUnminified)return function(t,n){return t==null||sn.Util.isObject(t)||sn.Util.warn(ws(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Rt.getComponentValidator=pX,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=En,n=Rt;var r="get",s="set";e.Factory={addGetterSetter(o,a,l,c,u){e.Factory.addGetter(o,a,l),e.Factory.addSetter(o,a,c,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,l){var c=r+t.Util._capitalize(a);o.prototype[c]=o.prototype[c]||function(){var u=this.attrs[a];return u===void 0?l:u}},addSetter(o,a,l,c){var u=s+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,l,c)},overWriteSetter(o,a,l,c){var u=s+t.Util._capitalize(a);o.prototype[u]=function(d){return l&&d!==void 0&&d!==null&&(d=l.call(this,d,a)),this._setAttr(a,d),c&&c.call(this),this}},addComponentsGetterSetter(o,a,l,c,u){var d=l.length,f=t.Util._capitalize,h=r+f(a),g=s+f(a),v,y;o.prototype[h]=function(){var w={};for(v=0;v<d;v++)y=l[v],w[y]=this.getAttr(a+f(y));return w};var _=(0,n.getComponentValidator)(l);o.prototype[g]=function(w){var A=this.attrs[a],C;c&&(w=c.call(this,w)),_&&_.call(this,w,a);for(C in w)w.hasOwnProperty(C)&&this._setAttr(a+f(C),w[C]);return w||l.forEach(S=>{this._setAttr(a+f(S),void 0)}),this._fireChangeEvent(a,A,w),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var l=t.Util._capitalize(a),c=s+l,u=r+l;o.prototype[a]=function(){return arguments.length?(this[c](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,l,c){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),d=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(d);var f=this.attrs[a];return f===void 0?l:f},e.Factory.addSetter(o,a,c,function(){t.Util.error(d)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(l,c){var u=o.prototype[c],d=r+t.Util._capitalize(l),f=s+t.Util._capitalize(l);function h(){u.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+c+'" instead.')}o.prototype[l]=h,o.prototype[d]=h,o.prototype[f]=h})},afterSetFilter(){this._filterUpToDate=!1}}}(li);var ur={},Cs={};Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.HitContext=Cs.SceneContext=Cs.Context=void 0;const d8=En,gX=Kt;function mX(e){var t=[],n=e.length,r=d8.Util,s,o;for(s=0;s<n;s++)o=e[s],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var f8=",",vX="(",bX=")",yX="([",_X="])",wX=";",CX="()",SX="=",h8=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],EX=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const xX=100;class Jf{constructor(t){this.canvas=t,gX.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,s=r.length,o="",a,l,c,u;for(a=0;a<s;a++)l=r[a],c=l.method,c?(u=l.args,o+=c,t?o+=CX:d8.Util._isArray(u[0])?o+=yX+u.join(f8)+_X:(n&&(u=u.map(d=>typeof d=="number"?Math.floor(d):d)),o+=vX+u.join(f8)+bX)):(o+=l.property,t||(o+=SX+l.val)),o+=wX;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=xX&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,s,o,a){this._context.arc(t,n,r,s,o,a)}arcTo(t,n,r,s,o){this._context.arcTo(t,n,r,s,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,s,o,a){this._context.bezierCurveTo(t,n,r,s,o,a)}clearRect(t,n,r,s){this._context.clearRect(t,n,r,s)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,s){return this._context.createLinearGradient(t,n,r,s)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,s,o,a){return this._context.createRadialGradient(t,n,r,s,o,a)}drawImage(t,n,r,s,o,a,l,c,u){var d=arguments,f=this._context;d.length===3?f.drawImage(t,n,r):d.length===5?f.drawImage(t,n,r,s,o):d.length===9&&f.drawImage(t,n,r,s,o,a,l,c,u)}ellipse(t,n,r,s,o,a,l,c){this._context.ellipse(t,n,r,s,o,a,l,c)}isPointInPath(t,n,r,s){return r?this._context.isPointInPath(r,t,n,s):this._context.isPointInPath(t,n,s)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,s){this._context.fillRect(t,n,r,s)}strokeRect(t,n,r,s){this._context.strokeRect(t,n,r,s)}fillText(t,n,r,s){s?this._context.fillText(t,n,r,s):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,s){return this._context.getImageData(t,n,r,s)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,s){this._context.rect(t,n,r,s)}roundRect(t,n,r,s,o){this._context.roundRect(t,n,r,s,o)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,s){this._context.quadraticCurveTo(t,n,r,s)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,s,o,a){this._context.setTransform(t,n,r,s,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,s){this._context.strokeText(t,n,r,s)}transform(t,n,r,s,o,a){this._context.transform(t,n,r,s,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=h8.length,r=this.setAttr,s,o,a=function(l){var c=t[l],u;t[l]=function(){return o=mX(Array.prototype.slice.call(arguments,0)),u=c.apply(t,arguments),t._trace({method:l,args:o}),u}};for(s=0;s<n;s++)a(h8[s]);t.setAttr=function(){r.apply(t,arguments);var l=arguments[0],c=arguments[1];(l==="shadowOffsetX"||l==="shadowOffsetY"||l==="shadowBlur")&&(c=c/this.canvas.getPixelRatio()),t._trace({property:l,val:c})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}Cs.Context=Jf,EX.forEach(function(e){Object.defineProperty(Jf.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class AX extends Jf{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const s=t.getFillPatternImage();if(s&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):s?this._fillPattern(t):o?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),s=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(s){for(var a=0;a<s.length;a+=2)o.addColorStop(s[a],s[a+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,s,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,l=(s=t.getShadowOffset())!==null&&s!==void 0?s:{x:0,y:0},c=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),d=c.x*u,f=c.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(d),Math.abs(f))),this.setAttr("shadowOffsetX",l.x*d),this.setAttr("shadowOffsetY",l.y*f)}}Cs.SceneContext=AX;class PX extends Jf{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),s=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",s),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}Cs.HitContext=PX,Object.defineProperty(ur,"__esModule",{value:!0}),ur.HitCanvas=ur.SceneCanvas=ur.Canvas=void 0;const Yf=En,p8=Cs,g8=Kt,TX=li,OX=Rt;var Xf;function NX(){if(Xf)return Xf;var e=Yf.Util.createCanvasElement(),t=e.getContext("2d");return Xf=function(){var n=g8.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),Yf.Util.releaseCanvas(e),Xf}class Zf{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||g8.Konva.pixelRatio||NX();this.pixelRatio=r,this._canvas=Yf.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch(r){try{return this._canvas.toDataURL()}catch(s){return Yf.Util.error("Unable to get data URL. "+s.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ur.Canvas=Zf,TX.Factory.addGetterSetter(Zf,"pixelRatio",void 0,(0,OX.getNumberValidator)());class IX extends Zf{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new p8.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}ur.SceneCanvas=IX;class RX extends Zf{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new p8.HitContext(this),this.setSize(t.width,t.height)}}ur.HitCanvas=RX;var Qf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Kt,n=En;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(s=>{r=s.node}),r},_dragElements:new Map,_drag(r){const s=[];e.DD._dragElements.forEach((o,a)=>{const{node:l}=o,c=l.getStage();c.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=c._changedPointerPositions.find(h=>h.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var d=l.dragDistance(),f=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(f<d||(l.startDrag({evt:r}),!l.isDragging()))return}l._setDragPosition(r,o),s.push(l)}}),s.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const s=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,l=a.getStage();if(r&&l.setPointersPositions(r),!l._changedPointerPositions.find(d=>d.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&s.indexOf(u)===-1&&s.push(u)}),s.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((s,o)=>{s.dragStatus==="stopped"&&s.node.fire("dragend",{type:"dragend",target:s.node,evt:r},!0),s.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(Qf),Object.defineProperty(ro,"__esModule",{value:!0}),ro.Node=void 0;const Tt=En,eu=li,tu=ur,so=Kt,ki=Qf,hn=Rt;var eh="absoluteOpacity",th="allEventListeners",Ss="absoluteTransform",m8="absoluteScale",na="canvas",DX="Change",LX="children",kX="konva",vv="listening",v8="mouseenter",b8="mouseleave",y8="set",_8="Shape",nh=" ",w8="stage",oo="transform",MX="Stage",bv="visible",FX=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(nh);let BX=1;class dt{constructor(t){this._id=BX++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===oo||t===Ss)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),s=t===oo||t===Ss,o=r===void 0||s&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const s=n.map(o=>o+"Change.konva").join(nh);this.on(s,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(na)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===Ss&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(na)){const{scene:t,filter:n,hit:r}=this._cache.get(na);Tt.Util.releaseCanvas(t,n,r),this._cache.delete(na)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var s=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,c=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,f=n.hitCanvasPixelRatio||1;if(!s||!o){Tt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const h=Math.abs(Math.round(r.x)-l)>.5?1:0,g=Math.abs(Math.round(r.y)-c)>.5?1:0;s+=u*2+h,o+=u*2+g,l-=u,c-=u;var v=new tu.SceneCanvas({pixelRatio:a,width:s,height:o}),y=new tu.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),_=new tu.HitCanvas({pixelRatio:f,width:s,height:o}),w=v.getContext(),A=_.getContext();return _.isCache=!0,v.isCache=!0,this._cache.delete(na),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(v.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),w.save(),A.save(),w.translate(-l,-c),A.translate(-l,-c),this._isUnderCache=!0,this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(m8),this.drawScene(v,this),this.drawHit(_,this),this._isUnderCache=!1,w.restore(),A.restore(),d&&(w.save(),w.beginPath(),w.rect(0,0,s,o),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(na,{scene:v,filter:y,hit:_,x:l,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(na)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=1/0,o=1/0,a=-1/0,l=-1/0,c=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=c.point(u);s===void 0&&(s=a=d.x,o=l=d.y),s=Math.min(s,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),l=Math.max(l,d.y)}),{x:s,y:o,width:a-s,height:l-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),s=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/s,r.height/s),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,s=n.filter,o=s.getContext(),a,l,c,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;s.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),l=o.getImageData(0,0,s.getWidth(),s.getHeight()),c=0;c<a;c++){if(u=t[c],typeof u!="function"){Tt.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,l),o.putImageData(l,0,0)}}catch(f){Tt.Util.error("Unable to apply filter. "+f.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return s}return r}on(t,n){if(this._cache&&this._cache.delete(th),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(nh),s=r.length,o,a,l,c,u;for(o=0;o<s;o++)a=r[o],l=a.split("."),c=l[0],u=l[1]||"",this.eventListeners[c]||(this.eventListeners[c]=[]),this.eventListeners[c].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(nh),s=r.length,o,a,l,c,u,d;if(this._cache&&this._cache.delete(th),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<s;o++)if(l=r[o],c=l.split("."),u=c[0],d=c[1],u)this.eventListeners[u]&&this._off(u,d,n);else for(a in this.eventListeners)this._off(a,d,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var s=this;this.on(t,function(o){for(var a=o.target.findAncestors(n,!0,s),l=0;l<a.length;l++)o=Tt.Util.cloneObject(o),o.currentTarget=a[l],r.call(a[l],o)})}remove(){return this.isDragging()&&this.stopDrag(),ki.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Ss),this._clearSelfAndDescendantCache(eh),this._clearSelfAndDescendantCache(m8),this._clearSelfAndDescendantCache(w8),this._clearSelfAndDescendantCache(bv),this._clearSelfAndDescendantCache(vv)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+Tt.Util._capitalize(t);return Tt.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==LX&&(r=y8+Tt.Util._capitalize(n),Tt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(vv,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(bv,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),s=!1;ki.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(s=!0)});var o=!n&&!so.Konva.hitOnDragEnabled&&(s||so.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,s,o,a,l;function c(d){for(s=[],o=d.length,a=0;a<o;a++)l=d[a],r++,l.nodeType!==_8&&(s=s.concat(l.getChildren().slice())),l._id===n._id&&(a=o);s.length>0&&s[0].getDepth()<=t&&c(s)}const u=this.getStage();return n.nodeType!==MX&&u&&c(u.getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(oo),this._clearSelfAndDescendantCache(Ss)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var n=t.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var s=this.getAbsoluteTransform(t).getMatrix(),o=new Tt.Transform,a=this.offset();return o.m=s.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){const a=this._clearTransform(),{x:n,y:r}=a,s=Rs(a,["x","y"]);this.attrs.x=n,this.attrs.y=r,this._clearCache(oo);var o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(t.x,t.y),t={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(s),this.setPosition({x:t.x,y:t.y}),this._clearCache(oo),this._clearSelfAndDescendantCache(Ss),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,s=this.x(),o=this.y();return n!==void 0&&(s+=n),r!==void 0&&(o+=r),this.setPosition({x:s,y:o}),this}_eachAncestorReverse(t,n){var r=[],s=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);s&&(!n||s._id!==n._id);)r.unshift(s),s=s.parent;for(o=r.length,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Tt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return Tt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&Tt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(eh,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),n,r,s,o,a;const l={attrs:{},className:this.getClassName()};for(n in t)r=t[n],a=Tt.Util.isObject(r)&&!Tt.Util._isPlainObject(r)&&!Tt.Util._isArray(r),!a&&(s=typeof this[n]=="function"&&this[n],delete t[n],o=s?s.call(this):null,t[n]=r,o!==r&&(l.attrs[n]=r));return Tt.Util._prepareToStringify(l)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var s=[];n&&this._isMatch(t)&&s.push(this);for(var o=this.parent;o;){if(o===r)return s;o._isMatch(t)&&s.push(o),o=o.parent}return s}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,s,o;for(s=0;s<r;s++)if(o=n[s],Tt.Util.isValidSelector(o)||(Tt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Tt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Tt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(w8,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():null}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(Ss,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new Tt.Transform,this._eachAncestorReverse(function(s){var o=s.transformsEnabled();o==="all"?n.multiply(s.getTransform()):o==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},t),n;n=this._cache.get(Ss)||new Tt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const s=this.attrs.x||0,o=this.attrs.y||0,a=this.attrs.offsetX||0,l=this.attrs.offsetY||0;n.translate(s-a,o-l)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const s=this.getAbsoluteTransform(t).decompose();return{x:s.scaleX,y:s.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(oo,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(oo)||new Tt.Transform;r.reset();var s=this.x(),o=this.y(),a=so.Konva.getAngle(this.rotation()),l=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,c=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,d=this.attrs.skewY||0,f=this.attrs.offsetX||0,h=this.attrs.offsetY||0;return(s!==0||o!==0)&&r.translate(s,o),a!==0&&r.rotate(a),(u!==0||d!==0)&&r.skew(u,d),(l!==1||c!==1)&&r.scale(l,c),(f!==0||h!==0)&&r.translate(-1*f,-1*h),r.dirty=!1,r}clone(t){var n=Tt.Util.cloneObject(this.attrs),r,s,o,a,l;for(r in t)n[r]=t[r];var c=new this.constructor(n);for(r in this.eventListeners)for(s=this.eventListeners[r],o=s.length,a=0;a<o;a++)l=s[a],l.name.indexOf(kX)<0&&(c.eventListeners[r]||(c.eventListeners[r]=[]),c.eventListeners[r].push(l));return c}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),s=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),a=t.pixelRatio||1,l=new tu.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),c=l.getContext();const u=new tu.SceneCanvas({width:l.width/l.pixelRatio+Math.abs(s),height:l.height/l.pixelRatio+Math.abs(o),pixelRatio:l.pixelRatio});return t.imageSmoothingEnabled===!1&&(c._context.imageSmoothingEnabled=!1),c.save(),(s||o)&&c.translate(-1*s,-1*o),this.drawScene(l,void 0,u),c.restore(),l}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,s=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(s),s}toImage(t){return new Promise((n,r)=>{try{const s=t==null?void 0:t.callback;s&&delete t.callback,Tt.Util._urlToImage(this.toDataURL(t),function(o){n(o),s==null||s(o)})}catch(s){r(s)}})}toBlob(t){return new Promise((n,r)=>{try{const s=t==null?void 0:t.callback;s&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),s==null||s(o)},t==null?void 0:t.mimeType,t==null?void 0:t.quality)}catch(s){r(s)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():so.Konva.dragDistance}_off(t,n,r){var s=this.eventListeners[t],o,a,l;for(o=0;o<s.length;o++)if(a=s[o].name,l=s[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===l)){if(s.splice(o,1),s.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+DX,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[y8+Tt.Util._capitalize(t)];return Tt.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(so.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!Tt.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var s;r!==void 0&&(s=this.attrs[t],s||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,s,r))}_fireAndBubble(t,n,r){n&&this.nodeType===_8&&(n.target=this);var s=(t===v8||t===b8)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!s){this._fire(t,n);var o=(t===v8||t===b8)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,s;const o=(n=this._cache.get(th))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let l=Object.getPrototypeOf(this);for(;l;){const c=(s=(r=l.eventListeners)===null||r===void 0?void 0:r[t])!==null&&s!==void 0?s:[];a.push(...c),l=Object.getPrototypeOf(l)}o[t]=a,this._cache.set(th,o)}return a}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var s=0;s<r.length;s++)r[s].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var s=0;s<o.length;s++)o[s].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),s=this.getAbsolutePosition();if(r){var o=r._getPointerById(n)||r._changedPointerPositions[0]||s;ki.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-s.x,y:o.y-s.y},dragStatus:"ready",pointerId:n})}}startDrag(t,n=!0){ki.DD._dragElements.has(this._id)||this._createDragElement(t);const r=ki.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var s={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,s,t);a?s=a:Tt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==s.x||this._lastPos.y!==s.y)&&(this.setAbsolutePosition(s),this._requestDraw()),this._lastPos=s}}stopDrag(t){const n=ki.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),ki.DD._endDragBefore(t),ki.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=ki.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||so.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var s=!1;ki.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(s=!0)}),s||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=ki.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",s=n&&n.dragStatus==="ready";r?this.stopDrag():s&&ki.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return Tt.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return Tt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=dt.prototype.getClassName.call(t),s=t.children,o,a,l;n&&(t.attrs.container=n),so.Konva[r]||(Tt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const c=so.Konva[r];if(o=new c(t.attrs),s)for(a=s.length,l=0;l<a;l++)o.add(dt._createNode(s[l]));return o}}ro.Node=dt,dt.prototype.nodeType="Node",dt.prototype._attrsAffectingSize=[],dt.prototype.eventListeners={},dt.prototype.on.call(dt.prototype,FX,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(oo),this._clearSelfAndDescendantCache(Ss)}),dt.prototype.on.call(dt.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(bv)}),dt.prototype.on.call(dt.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(vv)}),dt.prototype.on.call(dt.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(eh)});const Gt=eu.Factory.addGetterSetter;Gt(dt,"zIndex"),Gt(dt,"absolutePosition"),Gt(dt,"position"),Gt(dt,"x",0,(0,hn.getNumberValidator)()),Gt(dt,"y",0,(0,hn.getNumberValidator)()),Gt(dt,"globalCompositeOperation","source-over",(0,hn.getStringValidator)()),Gt(dt,"opacity",1,(0,hn.getNumberValidator)()),Gt(dt,"name","",(0,hn.getStringValidator)()),Gt(dt,"id","",(0,hn.getStringValidator)()),Gt(dt,"rotation",0,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"scale",["x","y"]),Gt(dt,"scaleX",1,(0,hn.getNumberValidator)()),Gt(dt,"scaleY",1,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"skew",["x","y"]),Gt(dt,"skewX",0,(0,hn.getNumberValidator)()),Gt(dt,"skewY",0,(0,hn.getNumberValidator)()),eu.Factory.addComponentsGetterSetter(dt,"offset",["x","y"]),Gt(dt,"offsetX",0,(0,hn.getNumberValidator)()),Gt(dt,"offsetY",0,(0,hn.getNumberValidator)()),Gt(dt,"dragDistance",null,(0,hn.getNumberValidator)()),Gt(dt,"width",0,(0,hn.getNumberValidator)()),Gt(dt,"height",0,(0,hn.getNumberValidator)()),Gt(dt,"listening",!0,(0,hn.getBooleanValidator)()),Gt(dt,"preventDefault",!0,(0,hn.getBooleanValidator)()),Gt(dt,"filters",null,function(e){return this._filterUpToDate=!1,e}),Gt(dt,"visible",!0,(0,hn.getBooleanValidator)()),Gt(dt,"transformsEnabled","all",(0,hn.getStringValidator)()),Gt(dt,"size"),Gt(dt,"dragBoundFunc"),Gt(dt,"draggable",!1,(0,hn.getBooleanValidator)()),eu.Factory.backCompat(dt,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var ia={};Object.defineProperty(ia,"__esModule",{value:!0}),ia.Container=void 0;const ll=li,yv=ro,ih=Rt;class ra extends yv.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(s){t(s)&&r.push(s)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(s=>{const o=s._isMatch(t);return o&&r.push(s),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const s of r){if(n=t(s),n)return!0;if(s.hasChildren()&&(n=s._descendants(t),n))return!0}return!1}toObject(){var t=yv.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=yv.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n,r){var s=this.getLayer(),o=t||s&&s.getCanvas(),a=o&&o.getContext(),l=this._getCanvasCache(),c=l&&l.scene,u=o&&o.isCache;if(!this.isVisible()&&!u)return this;if(c){a.save();var d=this.getAbsoluteTransform(n).getMatrix();a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),s=t||r&&r.hitCanvas,o=s&&s.getContext(),a=this._getCanvasCache(),l=a&&a.hit;if(l){o.save();var c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",s,n);return this}_drawChildren(t,n,r,s){var o,a=n&&n.getContext(),l=this.clipWidth(),c=this.clipHeight(),u=this.clipFunc(),d=typeof l=="number"&&typeof c=="number"||u;const f=r===this;if(d){a.save();var h=this.getAbsoluteTransform(r),g=h.getMatrix();a.transform(g[0],g[1],g[2],g[3],g[4],g[5]),a.beginPath();let w;if(u)w=u.call(this,a,this);else{var v=this.clipX(),y=this.clipY();a.rect(v||0,y||0,l,c)}a.clip.apply(a,w),g=h.copy().invert().getMatrix(),a.transform(g[0],g[1],g[2],g[3],g[4],g[5])}var _=!f&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";_&&(a.save(),a._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(w){w[t](n,r,s)}),_&&a.restore(),d&&a.restore()}getClientRect(t={}){var n,r=t.skipTransform,s=t.relativeTo,o,a,l,c,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(y){if(y.visible()){var _=y.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,l=_.x+_.width,c=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),l=Math.max(l,_.x+_.width),c=Math.max(c,_.y+_.height)))}});for(var f=this.find("Shape"),h=!1,g=0;g<f.length;g++){var v=f[g];if(v._isVisible(this)){h=!0;break}}return h&&o!==void 0?u={x:o,y:a,width:l-o,height:c-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,s)}}ia.Container=ra,ll.Factory.addComponentsGetterSetter(ra,"clip",["x","y","width","height"]),ll.Factory.addGetterSetter(ra,"clipX",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipY",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipWidth",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipHeight",void 0,(0,ih.getNumberValidator)()),ll.Factory.addGetterSetter(ra,"clipFunc");var C8={},mi={};Object.defineProperty(mi,"__esModule",{value:!0}),mi.releaseCapture=mi.setPointerCapture=mi.hasPointerCapture=mi.createEvent=mi.getCapturedShape=void 0;const jX=Kt,nu=new Map,S8=jX.Konva._global.PointerEvent!==void 0;function UX(e){return nu.get(e)}mi.getCapturedShape=UX;function _v(e){return{evt:e,pointerId:e.pointerId}}mi.createEvent=_v;function $X(e,t){return nu.get(e)===t}mi.hasPointerCapture=$X;function VX(e,t){E8(e),t.getStage()&&(nu.set(e,t),S8&&t._fire("gotpointercapture",_v(new PointerEvent("gotpointercapture"))))}mi.setPointerCapture=VX;function E8(e,t){const n=nu.get(e);if(!n)return;const r=n.getStage();r&&r.content,nu.delete(e),S8&&n._fire("lostpointercapture",_v(new PointerEvent("lostpointercapture")))}mi.releaseCapture=E8,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=En,n=li,r=ia,s=Kt,o=ur,a=Qf,l=Kt,c=mi;var u="Stage",d="string",f="px",h="mouseout",g="mouseleave",v="mouseover",y="mouseenter",_="mousemove",w="mousedown",A="mouseup",C="pointermove",S="pointerdown",x="pointerup",T="pointercancel",N="lostpointercapture",I="pointerout",B="pointerleave",D="pointerover",M="pointerenter",G="contextmenu",H="touchstart",ae="touchend",X="touchmove",k="touchcancel",z="wheel",W=5,Z=[[y,"_pointerenter"],[w,"_pointerdown"],[_,"_pointermove"],[A,"_pointerup"],[g,"_pointerleave"],[H,"_pointerdown"],[X,"_pointermove"],[ae,"_pointerup"],[k,"_pointercancel"],[v,"_pointerover"],[z,"_wheel"],[G,"_contextmenu"],[S,"_pointerdown"],[C,"_pointermove"],[x,"_pointerup"],[T,"_pointercancel"],[N,"_lostpointercapture"]];const j={mouse:{[I]:h,[B]:g,[D]:v,[M]:y,[C]:_,[S]:w,[x]:A,[T]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[I]:"touchout",[B]:"touchleave",[D]:"touchover",[M]:"touchenter",[C]:X,[S]:H,[x]:ae,[T]:k,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[I]:I,[B]:B,[D]:D,[M]:M,[C]:C,[S]:S,[x]:x,[T]:T,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},we=_e=>_e.indexOf("pointer")>=0?"pointer":_e.indexOf("touch")>=0?"touch":"mouse",ge=_e=>{const q=we(_e);if(q==="pointer")return s.Konva.pointerEventsEnabled&&j.pointer;if(q==="touch")return j.touch;if(q==="mouse")return j.mouse};function re(_e={}){return(_e.clipFunc||_e.clipWidth||_e.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),_e}const ce="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class Se extends r.Container{constructor(q){super(re(q)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{re(this.attrs)}),this._checkVisibility()}_validateAdd(q){const Q=q.getType()==="Layer",fe=q.getType()==="FastLayer";Q||fe||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const q=this.visible()?"":"none";this.content.style.display=q}setContainer(q){if(typeof q===d){if(q.charAt(0)==="."){var Q=q.slice(1);q=document.getElementsByClassName(Q)[0]}else{var fe;q.charAt(0)!=="#"?fe=q:fe=q.slice(1),q=document.getElementById(fe)}if(!q)throw"Can not find container in document with id "+fe}return this._setAttr("container",q),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),q.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var q=this.children,Q=q.length,fe;for(fe=0;fe<Q;fe++)q[fe].clear();return this}clone(q){return q||(q={}),q.container=typeof document!="undefined"&&document.createElement("div"),r.Container.prototype.clone.call(this,q)}destroy(){super.destroy();var q=this.content;q&&t.Util._isInDocument(q)&&this.container().removeChild(q);var Q=e.stages.indexOf(this);return Q>-1&&e.stages.splice(Q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const q=this._pointerPositions[0]||this._changedPointerPositions[0];return q?{x:q.x,y:q.y}:(t.Util.warn(ce),null)}_getPointerById(q){return this._pointerPositions.find(Q=>Q.id===q)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(q){q=q||{},q.x=q.x||0,q.y=q.y||0,q.width=q.width||this.width(),q.height=q.height||this.height();var Q=new o.SceneCanvas({width:q.width,height:q.height,pixelRatio:q.pixelRatio||1}),fe=Q.getContext()._context,Re=this.children;return(q.x||q.y)&&fe.translate(-1*q.x,-1*q.y),Re.forEach(function(Le){if(Le.isVisible()){var Je=Le._toKonvaCanvas(q);fe.drawImage(Je._canvas,q.x,q.y,Je.getWidth()/Je.getPixelRatio(),Je.getHeight()/Je.getPixelRatio())}}),Q}getIntersection(q){if(!q)return null;var Q=this.children,fe=Q.length,Re=fe-1,Le;for(Le=Re;Le>=0;Le--){const Je=Q[Le].getIntersection(q);if(Je)return Je}return null}_resizeDOM(){var q=this.width(),Q=this.height();this.content&&(this.content.style.width=q+f,this.content.style.height=Q+f),this.bufferCanvas.setSize(q,Q),this.bufferHitCanvas.setSize(q,Q),this.children.forEach(fe=>{fe.setSize({width:q,height:Q}),fe.draw()})}add(q,...Q){if(arguments.length>1){for(var fe=0;fe<arguments.length;fe++)this.add(arguments[fe]);return this}super.add(q);var Re=this.children.length;return Re>W&&t.Util.warn("The stage has "+Re+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),q.setSize({width:this.width(),height:this.height()}),q.draw(),s.Konva.isBrowser&&this.content.appendChild(q.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(q){return c.hasPointerCapture(q,this)}setPointerCapture(q){c.setPointerCapture(q,this)}releaseCapture(q){c.releaseCapture(q,this)}getLayers(){return this.children}_bindContentEvents(){s.Konva.isBrowser&&Z.forEach(([q,Q])=>{this.content.addEventListener(q,fe=>{this[Q](fe)},{passive:!1})})}_pointerenter(q){this.setPointersPositions(q);const Q=ge(q.type);Q&&this._fire(Q.pointerenter,{evt:q,target:this,currentTarget:this})}_pointerover(q){this.setPointersPositions(q);const Q=ge(q.type);Q&&this._fire(Q.pointerover,{evt:q,target:this,currentTarget:this})}_getTargetShape(q){let Q=this[q+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(q){const Q=ge(q.type),fe=we(q.type);if(Q){this.setPointersPositions(q);var Re=this._getTargetShape(fe),Le=!(s.Konva.isDragging()||s.Konva.isTransforming())||s.Konva.hitOnDragEnabled;Re&&Le?(Re._fireAndBubble(Q.pointerout,{evt:q}),Re._fireAndBubble(Q.pointerleave,{evt:q}),this._fire(Q.pointerleave,{evt:q,target:this,currentTarget:this}),this[fe+"targetShape"]=null):Le&&(this._fire(Q.pointerleave,{evt:q,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:q,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(q){const Q=ge(q.type),fe=we(q.type);if(Q){this.setPointersPositions(q);var Re=!1;this._changedPointerPositions.forEach(Le=>{var Je=this.getIntersection(Le);if(a.DD.justDragged=!1,s.Konva["_"+fe+"ListenClick"]=!0,!Je||!Je.isListening()){this[fe+"ClickStartShape"]=void 0;return}s.Konva.capturePointerEventsEnabled&&Je.setPointerCapture(Le.id),this[fe+"ClickStartShape"]=Je,Je._fireAndBubble(Q.pointerdown,{evt:q,pointerId:Le.id}),Re=!0;const V=q.type.indexOf("touch")>=0;Je.preventDefault()&&q.cancelable&&V&&q.preventDefault()}),Re||this._fire(Q.pointerdown,{evt:q,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(q){const Q=ge(q.type),fe=we(q.type);if(!Q)return;s.Konva.isDragging()&&a.DD.node.preventDefault()&&q.cancelable&&q.preventDefault(),this.setPointersPositions(q);var Re=!(s.Konva.isDragging()||s.Konva.isTransforming())||s.Konva.hitOnDragEnabled;if(!Re)return;var Le={};let Je=!1;var V=this._getTargetShape(fe);this._changedPointerPositions.forEach(Y=>{const le=c.getCapturedShape(Y.id)||this.getIntersection(Y),xe=Y.id,de={evt:q,pointerId:xe};var pe=V!==le;if(pe&&V&&(V._fireAndBubble(Q.pointerout,me({},de),le),V._fireAndBubble(Q.pointerleave,me({},de),le)),le){if(Le[le._id])return;Le[le._id]=!0}le&&le.isListening()?(Je=!0,pe&&(le._fireAndBubble(Q.pointerover,me({},de),V),le._fireAndBubble(Q.pointerenter,me({},de),V),this[fe+"targetShape"]=le),le._fireAndBubble(Q.pointermove,me({},de))):V&&(this._fire(Q.pointerover,{evt:q,target:this,currentTarget:this,pointerId:xe}),this[fe+"targetShape"]=null)}),Je||this._fire(Q.pointermove,{evt:q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(q){const Q=ge(q.type),fe=we(q.type);if(!Q)return;this.setPointersPositions(q);const Re=this[fe+"ClickStartShape"],Le=this[fe+"ClickEndShape"];var Je={};let V=!1;this._changedPointerPositions.forEach(Y=>{const le=c.getCapturedShape(Y.id)||this.getIntersection(Y);if(le){if(le.releaseCapture(Y.id),Je[le._id])return;Je[le._id]=!0}const xe=Y.id,de={evt:q,pointerId:xe};let pe=!1;s.Konva["_"+fe+"InDblClickWindow"]?(pe=!0,clearTimeout(this[fe+"DblTimeout"])):a.DD.justDragged||(s.Konva["_"+fe+"InDblClickWindow"]=!0,clearTimeout(this[fe+"DblTimeout"])),this[fe+"DblTimeout"]=setTimeout(function(){s.Konva["_"+fe+"InDblClickWindow"]=!1},s.Konva.dblClickWindow),le&&le.isListening()?(V=!0,this[fe+"ClickEndShape"]=le,le._fireAndBubble(Q.pointerup,me({},de)),s.Konva["_"+fe+"ListenClick"]&&Re&&Re===le&&(le._fireAndBubble(Q.pointerclick,me({},de)),pe&&Le&&Le===le&&le._fireAndBubble(Q.pointerdblclick,me({},de)))):(this[fe+"ClickEndShape"]=null,s.Konva["_"+fe+"ListenClick"]&&this._fire(Q.pointerclick,{evt:q,target:this,currentTarget:this,pointerId:xe}),pe&&this._fire(Q.pointerdblclick,{evt:q,target:this,currentTarget:this,pointerId:xe}))}),V||this._fire(Q.pointerup,{evt:q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s.Konva["_"+fe+"ListenClick"]=!1,q.cancelable&&fe!=="touch"&&q.preventDefault()}_contextmenu(q){this.setPointersPositions(q);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(G,{evt:q}):this._fire(G,{evt:q,target:this,currentTarget:this})}_wheel(q){this.setPointersPositions(q);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(z,{evt:q}):this._fire(z,{evt:q,target:this,currentTarget:this})}_pointercancel(q){this.setPointersPositions(q);const Q=c.getCapturedShape(q.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(x,c.createEvent(q)),c.releaseCapture(q.pointerId)}_lostpointercapture(q){c.releaseCapture(q.pointerId)}setPointersPositions(q){var Q=this._getContentPosition(),fe=null,Re=null;q=q||window.event,q.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(q.touches,Le=>{this._pointerPositions.push({id:Le.identifier,x:(Le.clientX-Q.left)/Q.scaleX,y:(Le.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(q.changedTouches||q.touches,Le=>{this._changedPointerPositions.push({id:Le.identifier,x:(Le.clientX-Q.left)/Q.scaleX,y:(Le.clientY-Q.top)/Q.scaleY})})):(fe=(q.clientX-Q.left)/Q.scaleX,Re=(q.clientY-Q.top)/Q.scaleY,this.pointerPos={x:fe,y:Re},this._pointerPositions=[{x:fe,y:Re,id:t.Util._getFirstPointerId(q)}],this._changedPointerPositions=[{x:fe,y:Re,id:t.Util._getFirstPointerId(q)}])}_setPointerPosition(q){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(q)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var q=this.content.getBoundingClientRect();return{top:q.top,left:q.left,scaleX:q.width/this.content.clientWidth||1,scaleY:q.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!s.Konva.isBrowser){var q=this.container();if(!q)throw"Stage has no container. A container is required.";q.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),q.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(q){q.batchDraw()}),this}}e.Stage=Se,Se.prototype.nodeType=u,(0,l._registerNode)(Se),n.Factory.addGetterSetter(Se,"container"),s.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(_e=>{_e.batchDraw()})})}(C8);var iu={},Es={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Kt,n=En,r=li,s=ro,o=Rt,a=Kt,l=mi;var c="hasShadow",u="shadowRGBA",d="patternImage",f="linearGradient",h="radialGradient";let g;function v(){return g||(g=n.Util.createCanvasElement().getContext("2d"),g)}e.shapes={};function y(B){const D=this.attrs.fillRule;D?B.fill(D):B.fill()}function _(B){B.stroke()}function w(B){const D=this.attrs.fillRule;D?B.fill(D):B.fill()}function A(B){B.stroke()}function C(){this._clearCache(c)}function S(){this._clearCache(u)}function x(){this._clearCache(d)}function T(){this._clearCache(f)}function N(){this._clearCache(h)}class I extends s.Node{constructor(D){super(D);let M;for(;M=n.Util.getRandomColor(),!(M&&!(M in e.shapes)););this.colorKey=M,e.shapes[M]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(d,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var D=v();const M=D.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(M&&M.setTransform){const G=new n.Transform;G.translate(this.fillPatternX(),this.fillPatternY()),G.rotate(t.Konva.getAngle(this.fillPatternRotation())),G.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),G.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const H=G.getMatrix(),ae=typeof DOMMatrix=="undefined"?{a:H[0],b:H[1],c:H[2],d:H[3],e:H[4],f:H[5]}:new DOMMatrix(H);M.setTransform(ae)}return M}}_getLinearGradient(){return this._getCache(f,this.__getLinearGradient)}__getLinearGradient(){var D=this.fillLinearGradientColorStops();if(D){for(var M=v(),G=this.fillLinearGradientStartPoint(),H=this.fillLinearGradientEndPoint(),ae=M.createLinearGradient(G.x,G.y,H.x,H.y),X=0;X<D.length;X+=2)ae.addColorStop(D[X],D[X+1]);return ae}}_getRadialGradient(){return this._getCache(h,this.__getRadialGradient)}__getRadialGradient(){var D=this.fillRadialGradientColorStops();if(D){for(var M=v(),G=this.fillRadialGradientStartPoint(),H=this.fillRadialGradientEndPoint(),ae=M.createRadialGradient(G.x,G.y,this.fillRadialGradientStartRadius(),H.x,H.y,this.fillRadialGradientEndRadius()),X=0;X<D.length;X+=2)ae.addColorStop(D[X],D[X+1]);return ae}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var D=n.Util.colorToRGBA(this.shadowColor());if(D)return"rgba("+D.r+","+D.g+","+D.b+","+D.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const D=this.hitStrokeWidth();return D==="auto"?this.hasStroke():this.strokeEnabled()&&!!D}intersects(D){var M=this.getStage();if(!M)return!1;const G=M.bufferHitCanvas;return G.getContext().clear(),this.drawHit(G,void 0,!0),G.context.getImageData(Math.round(D.x),Math.round(D.y),1,1).data[3]>0}destroy(){return s.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(D){var M;if(!((M=this.attrs.perfectDrawEnabled)!==null&&M!==void 0?M:!0))return!1;const H=D||this.hasFill(),ae=this.hasStroke(),X=this.getAbsoluteOpacity()!==1;if(H&&ae&&X)return!0;const k=this.hasShadow(),z=this.shadowForStrokeEnabled();return!!(H&&ae&&k&&z)}setStrokeHitEnabled(D){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),D?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var D=this.size();return{x:this._centroid?-D.width/2:0,y:this._centroid?-D.height/2:0,width:D.width,height:D.height}}getClientRect(D={}){let M=!1,G=this.getParent();for(;G;){if(G.isCached()){M=!0;break}G=G.getParent()}const H=D.skipTransform,ae=D.relativeTo||M&&this.getStage()||void 0,X=this.getSelfRect(),z=!D.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,W=X.width+z,Z=X.height+z,j=!D.skipShadow&&this.hasShadow(),we=j?this.shadowOffsetX():0,ge=j?this.shadowOffsetY():0,re=W+Math.abs(we),ce=Z+Math.abs(ge),Se=j&&this.shadowBlur()||0,_e=re+Se*2,q=ce+Se*2,Q={width:_e,height:q,x:-(z/2+Se)+Math.min(we,0)+X.x,y:-(z/2+Se)+Math.min(ge,0)+X.y};return H?Q:this._transformedRect(Q,ae)}drawScene(D,M,G){var H=this.getLayer(),ae=D||H.getCanvas(),X=ae.getContext(),k=this._getCanvasCache(),z=this.getSceneFunc(),W=this.hasShadow(),Z,j,we=ae.isCache,ge=M===this;if(!this.isVisible()&&!ge)return this;if(k){X.save();var re=this.getAbsoluteTransform(M).getMatrix();return X.transform(re[0],re[1],re[2],re[3],re[4],re[5]),this._drawCachedSceneCanvas(X),X.restore(),this}if(!z)return this;if(X.save(),this._useBufferCanvas()&&!we){Z=this.getStage();const _e=G||Z.bufferCanvas;j=_e.getContext(),j.clear(),j.save(),j._applyLineJoin(this);var ce=this.getAbsoluteTransform(M).getMatrix();j.transform(ce[0],ce[1],ce[2],ce[3],ce[4],ce[5]),z.call(this,j,this),j.restore();var Se=_e.pixelRatio;W&&X._applyShadow(this),X._applyOpacity(this),X._applyGlobalCompositeOperation(this),X.drawImage(_e._canvas,0,0,_e.width/Se,_e.height/Se)}else{if(X._applyLineJoin(this),!ge){var ce=this.getAbsoluteTransform(M).getMatrix();X.transform(ce[0],ce[1],ce[2],ce[3],ce[4],ce[5]),X._applyOpacity(this),X._applyGlobalCompositeOperation(this)}W&&X._applyShadow(this),z.call(this,X,this)}return X.restore(),this}drawHit(D,M,G=!1){if(!this.shouldDrawHit(M,G))return this;var H=this.getLayer(),ae=D||H.hitCanvas,X=ae&&ae.getContext(),k=this.hitFunc()||this.sceneFunc(),z=this._getCanvasCache(),W=z&&z.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),W){X.save();var Z=this.getAbsoluteTransform(M).getMatrix();return X.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),this._drawCachedHitCanvas(X),X.restore(),this}if(!k)return this;if(X.save(),X._applyLineJoin(this),!(this===M)){var we=this.getAbsoluteTransform(M).getMatrix();X.transform(we[0],we[1],we[2],we[3],we[4],we[5])}return k.call(this,X,this),X.restore(),this}drawHitFromCache(D=0){var M=this._getCanvasCache(),G=this._getCachedSceneCanvas(),H=M.hit,ae=H.getContext(),X=H.getWidth(),k=H.getHeight(),z,W,Z,j,we,ge;ae.clear(),ae.drawImage(G._canvas,0,0,X,k);try{for(z=ae.getImageData(0,0,X,k),W=z.data,Z=W.length,j=n.Util._hexToRgb(this.colorKey),we=0;we<Z;we+=4)ge=W[we+3],ge>D?(W[we]=j.r,W[we+1]=j.g,W[we+2]=j.b,W[we+3]=255):W[we+3]=0;ae.putImageData(z,0,0)}catch(re){n.Util.error("Unable to draw hit graph from cached scene canvas. "+re.message)}return this}hasPointerCapture(D){return l.hasPointerCapture(D,this)}setPointerCapture(D){l.setPointerCapture(D,this)}releaseCapture(D){l.releaseCapture(D,this)}}e.Shape=I,I.prototype._fillFunc=y,I.prototype._strokeFunc=_,I.prototype._fillFuncHit=w,I.prototype._strokeFuncHit=A,I.prototype._centroid=!1,I.prototype.nodeType="Shape",(0,a._registerNode)(I),I.prototype.eventListeners={},I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",C),I.prototype.on.call(I.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",x),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T),I.prototype.on.call(I.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",N),r.Factory.addGetterSetter(I,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(I,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(I,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(I,"lineJoin"),r.Factory.addGetterSetter(I,"lineCap"),r.Factory.addGetterSetter(I,"sceneFunc"),r.Factory.addGetterSetter(I,"hitFunc"),r.Factory.addGetterSetter(I,"dash"),r.Factory.addGetterSetter(I,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(I,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(I,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternImage"),r.Factory.addGetterSetter(I,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(I,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(I,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(I,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(I,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(I,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(I,"fillEnabled",!0),r.Factory.addGetterSetter(I,"strokeEnabled",!0),r.Factory.addGetterSetter(I,"shadowEnabled",!0),r.Factory.addGetterSetter(I,"dashEnabled",!0),r.Factory.addGetterSetter(I,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(I,"fillPriority","color"),r.Factory.addComponentsGetterSetter(I,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(I,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(I,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(I,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(I,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(I,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(I,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(I,"fillPatternRotation",0),r.Factory.addGetterSetter(I,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(I,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Es),Object.defineProperty(iu,"__esModule",{value:!0}),iu.Layer=void 0;const xs=En,wv=ia,cl=ro,Cv=li,x8=ur,zX=Rt,qX=Es,HX=Kt;var GX="#",WX="beforeDraw",KX="draw",A8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],JX=A8.length;class ul extends wv.Container{constructor(t){super(t),this.canvas=new x8.SceneCanvas,this.hitCanvas=new x8.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){cl.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=cl.Node.prototype.moveUp.call(this);if(!t)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(cl.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(cl.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return cl.Node.prototype.remove.call(this),t&&t.parentNode&&xs.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&xs.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),cl.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){xs.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){xs.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,xs.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let s=0;s<JX;s++){const o=A8[s],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),l=a.shape;if(l)return l;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,s=r[3];if(s===255){const o=xs.Util._rgbToHex(r[0],r[1],r[2]),a=qX.shapes[GX+o];return a?{shape:a}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),s=t||r&&r.getCanvas();return this._fire(WX,{node:this}),this.clearBeforeDraw()&&s.getContext().clear(),wv.Container.prototype.drawScene.call(this,s,n),this._fire(KX,{node:this}),this}drawHit(t,n){var r=this.getLayer(),s=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),wv.Container.prototype.drawHit.call(this,s,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){xs.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return xs.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return xs.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}iu.Layer=ul,ul.prototype.nodeType="Layer",(0,HX._registerNode)(ul),Cv.Factory.addGetterSetter(ul,"imageSmoothingEnabled",!0),Cv.Factory.addGetterSetter(ul,"clearBeforeDraw",!0),Cv.Factory.addGetterSetter(ul,"hitGraphEnabled",!0,(0,zX.getBooleanValidator)());var rh={};Object.defineProperty(rh,"__esModule",{value:!0}),rh.FastLayer=void 0;const YX=En,XX=iu,ZX=Kt;class Sv extends XX.Layer{constructor(t){super(t),this.listening(!1),YX.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}rh.FastLayer=Sv,Sv.prototype.nodeType="FastLayer",(0,ZX._registerNode)(Sv);var sh={};Object.defineProperty(sh,"__esModule",{value:!0}),sh.Group=void 0;const QX=En,eZ=ia,tZ=Kt;class Ev extends eZ.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&QX.Util.throw("You may only add groups and shapes to groups.")}}sh.Group=Ev,Ev.prototype.nodeType="Group",(0,tZ._registerNode)(Ev);var ru={};Object.defineProperty(ru,"__esModule",{value:!0}),ru.Animation=void 0;const xv=Kt,P8=En,Av=function(){return xv.glob.performance&&xv.glob.performance.now?function(){return xv.glob.performance.now()}:function(){return new Date().getTime()}}();class Br{constructor(t,n){this.id=Br.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Av(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let s=0;s<r;s++)if(n[s]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){const n=Br.animations,r=n.length;for(let s=0;s<r;s++)if(n[s].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Av(),Br._addAnimation(this),this}stop(){return Br._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){const n=t.id,r=this.animations,s=r.length;for(let o=0;o<s;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const t={},n=this.animations;for(let r=0;r<n.length;r++){const s=n[r],o=s.layers,a=s.func;s._updateFrameObject(Av());const l=o.length;let c;if(a?c=a.call(s,s.frame)!==!1:c=!0,!!c)for(let u=0;u<l;u++){const d=o[u];d._id!==void 0&&(t[d._id]=d)}}for(let r in t)t.hasOwnProperty(r)&&t[r].batchDraw()}static _animationLoop(){const t=Br;t.animations.length?(t._runFrames(),P8.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,P8.Util.requestAnimFrame(this._animationLoop))}}ru.Animation=Br,Br.animations=[],Br.animIdCounter=0,Br.animRunning=!1;var T8={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=En,n=ru,r=ro,s=Kt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,l=2,c=3,u=0,d=["fill","stroke","shadowColor"];class f{constructor(v,y,_,w,A,C,S){this.prop=v,this.propFunc=y,this.begin=w,this._pos=w,this.duration=C,this._change=0,this.prevPos=0,this.yoyo=S,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=A-this.begin,this.pause()}fire(v){var y=this[v];y&&y()}setTime(v){v>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():v<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=v,this.update())}getTime(){return this._time}setPosition(v){this.prevPos=this._pos,this.propFunc(v),this._pos=v}getPosition(v){return v===void 0&&(v=this._time),this.func(v,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(v){this.pause(),this._time=v,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var v=this.getTimer()-this._startTime;this.state===l?this.setTime(v):this.state===c&&this.setTime(this.duration-v)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class h{constructor(v){var y=this,_=v.node,w=_._id,A,C=v.easing||e.Easings.Linear,S=!!v.yoyo,x;typeof v.duration=="undefined"?A=.3:v.duration===0?A=.001:A=v.duration,this.node=_,this._id=u++;var T=_.getLayer()||(_ instanceof s.Konva.Stage?_.getLayers():null);T||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){y.tween.onEnterFrame()},T),this.tween=new f(x,function(N){y._tweenFunc(N)},C,0,1,A*1e3,S),this._addListeners(),h.attrs[w]||(h.attrs[w]={}),h.attrs[w][this._id]||(h.attrs[w][this._id]={}),h.tweens[w]||(h.tweens[w]={});for(x in v)o[x]===void 0&&this._addAttr(x,v[x]);this.reset(),this.onFinish=v.onFinish,this.onReset=v.onReset,this.onUpdate=v.onUpdate}_addAttr(v,y){var _=this.node,w=_._id,A,C,S,x,T,N,I,B;if(S=h.tweens[w][v],S&&delete h.attrs[w][S][v],A=_.getAttr(v),t.Util._isArray(y))if(C=[],T=Math.max(y.length,A.length),v==="points"&&y.length!==A.length&&(y.length>A.length?(I=A,A=t.Util._prepareArrayForTween(A,y,_.closed())):(N=y,y=t.Util._prepareArrayForTween(y,A,_.closed()))),v.indexOf("fill")===0)for(x=0;x<T;x++)if(x%2===0)C.push(y[x]-A[x]);else{var D=t.Util.colorToRGBA(A[x]);B=t.Util.colorToRGBA(y[x]),A[x]=D,C.push({r:B.r-D.r,g:B.g-D.g,b:B.b-D.b,a:B.a-D.a})}else for(x=0;x<T;x++)C.push(y[x]-A[x]);else d.indexOf(v)!==-1?(A=t.Util.colorToRGBA(A),B=t.Util.colorToRGBA(y),C={r:B.r-A.r,g:B.g-A.g,b:B.b-A.b,a:B.a-A.a}):C=y-A;h.attrs[w][this._id][v]={start:A,diff:C,end:y,trueEnd:N,trueStart:I},h.tweens[w][v]=this._id}_tweenFunc(v){var y=this.node,_=h.attrs[y._id][this._id],w,A,C,S,x,T,N,I;for(w in _){if(A=_[w],C=A.start,S=A.diff,I=A.end,t.Util._isArray(C))if(x=[],N=Math.max(C.length,I.length),w.indexOf("fill")===0)for(T=0;T<N;T++)T%2===0?x.push((C[T]||0)+S[T]*v):x.push("rgba("+Math.round(C[T].r+S[T].r*v)+","+Math.round(C[T].g+S[T].g*v)+","+Math.round(C[T].b+S[T].b*v)+","+(C[T].a+S[T].a*v)+")");else for(T=0;T<N;T++)x.push((C[T]||0)+S[T]*v);else d.indexOf(w)!==-1?x="rgba("+Math.round(C.r+S.r*v)+","+Math.round(C.g+S.g*v)+","+Math.round(C.b+S.b*v)+","+(C.a+S.a*v)+")":x=C+S*v;y.setAttr(w,x)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var v=this.node,y=h.attrs[v._id][this._id];y.points&&y.points.trueEnd&&v.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var v=this.node,y=h.attrs[v._id][this._id];y.points&&y.points.trueStart&&v.points(y.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(v){return this.tween.seek(v*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var v=this.node._id,y=this._id,_=h.tweens[v],w;this.pause();for(w in _)delete h.tweens[v][w];delete h.attrs[v][y]}}e.Tween=h,h.attrs={},h.tweens={},r.Node.prototype.to=function(g){var v=g.onFinish;g.node=this,g.onFinish=function(){this.destroy(),v&&v()};var y=new h(g);y.play()},e.Easings={BackEaseIn(g,v,y,_){var w=1.70158;return y*(g/=_)*g*((w+1)*g-w)+v},BackEaseOut(g,v,y,_){var w=1.70158;return y*((g=g/_-1)*g*((w+1)*g+w)+1)+v},BackEaseInOut(g,v,y,_){var w=1.70158;return(g/=_/2)<1?y/2*(g*g*(((w*=1.525)+1)*g-w))+v:y/2*((g-=2)*g*(((w*=1.525)+1)*g+w)+2)+v},ElasticEaseIn(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_)===1?v+y:(A||(A=_*.3),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),-(w*Math.pow(2,10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A))+v)},ElasticEaseOut(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_)===1?v+y:(A||(A=_*.3),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),w*Math.pow(2,-10*g)*Math.sin((g*_-C)*(2*Math.PI)/A)+y+v)},ElasticEaseInOut(g,v,y,_,w,A){var C=0;return g===0?v:(g/=_/2)===2?v+y:(A||(A=_*(.3*1.5)),!w||w<Math.abs(y)?(w=y,C=A/4):C=A/(2*Math.PI)*Math.asin(y/w),g<1?-.5*(w*Math.pow(2,10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A))+v:w*Math.pow(2,-10*(g-=1))*Math.sin((g*_-C)*(2*Math.PI)/A)*.5+y+v)},BounceEaseOut(g,v,y,_){return(g/=_)<1/2.75?y*(7.5625*g*g)+v:g<2/2.75?y*(7.5625*(g-=1.5/2.75)*g+.75)+v:g<2.5/2.75?y*(7.5625*(g-=2.25/2.75)*g+.9375)+v:y*(7.5625*(g-=2.625/2.75)*g+.984375)+v},BounceEaseIn(g,v,y,_){return y-e.Easings.BounceEaseOut(_-g,0,y,_)+v},BounceEaseInOut(g,v,y,_){return g<_/2?e.Easings.BounceEaseIn(g*2,0,y,_)*.5+v:e.Easings.BounceEaseOut(g*2-_,0,y,_)*.5+y*.5+v},EaseIn(g,v,y,_){return y*(g/=_)*g+v},EaseOut(g,v,y,_){return-y*(g/=_)*(g-2)+v},EaseInOut(g,v,y,_){return(g/=_/2)<1?y/2*g*g+v:-y/2*(--g*(g-2)-1)+v},StrongEaseIn(g,v,y,_){return y*(g/=_)*g*g*g*g+v},StrongEaseOut(g,v,y,_){return y*((g=g/_-1)*g*g*g*g+1)+v},StrongEaseInOut(g,v,y,_){return(g/=_/2)<1?y/2*g*g*g*g*g+v:y/2*((g-=2)*g*g*g*g+2)+v},Linear(g,v,y,_){return y*g/_+v}}})(T8),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Kt,n=En,r=ro,s=ia,o=C8,a=iu,l=rh,c=sh,u=Qf,d=Es,f=ru,h=T8,g=Cs,v=ur;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:s.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:l.FastLayer,Group:c.Group,DD:u.DD,Shape:d.Shape,shapes:d.shapes,Animation:f.Animation,Tween:h.Tween,Easings:h.Easings,Context:g.Context,Canvas:v.Canvas}),e.default=e.Konva}(mv),function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=mv;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=mv;e.exports=r.Konva}(gv,gv.exports);var nZ=gv.exports;const zt=EC(nZ);var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.Rect=void 0;const iZ=li,rZ=Es,sZ=Kt,oZ=En,aZ=Rt;class oh extends rZ.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),s=this.height();t.beginPath(),n?oZ.Util.drawRoundedRectPath(t,r,s,n):t.rect(0,0,r,s),t.closePath(),t.fillStrokeShape(this)}}Pv.Rect=oh,oh.prototype.className="Rect",(0,sZ._registerNode)(oh),iZ.Factory.addGetterSetter(oh,"cornerRadius",0,(0,aZ.getNumberOrArrayOfNumbersValidator)(4));var Tv={};Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.Circle=void 0;const lZ=li,cZ=Es,uZ=Rt,dZ=Kt;class dl extends cZ.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}Tv.Circle=dl,dl.prototype._centroid=!0,dl.prototype.className="Circle",dl.prototype._attrsAffectingSize=["radius"],(0,dZ._registerNode)(dl),lZ.Factory.addGetterSetter(dl,"radius",0,(0,uZ.getNumberValidator)());var Ov={};Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.Image=void 0;const Nv=En,sa=li,fZ=Es,hZ=Kt,su=Rt;let jr=class oP extends fZ.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const t=!!this.cornerRadius(),n=this.hasShadow();return t&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),s=this.cornerRadius(),o=this.attrs.image;let a;if(o){const l=this.attrs.cropWidth,c=this.attrs.cropHeight;l&&c?a=[o,this.cropX(),this.cropY(),l,c,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||s)&&(t.beginPath(),s?Nv.Util.drawRoundedRectPath(t,n,r,s):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(s&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),s=this.cornerRadius();t.beginPath(),s?Nv.Util.drawRoundedRectPath(t,n,r,s):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var s=Nv.Util.createImageElement();s.onload=function(){var o=new oP({image:s});n(o)},s.onerror=r,s.crossOrigin="Anonymous",s.src=t}};Ov.Image=jr,jr.prototype.className="Image",(0,hZ._registerNode)(jr),sa.Factory.addGetterSetter(jr,"cornerRadius",0,(0,su.getNumberOrArrayOfNumbersValidator)(4)),sa.Factory.addGetterSetter(jr,"image"),sa.Factory.addComponentsGetterSetter(jr,"crop",["x","y","width","height"]),sa.Factory.addGetterSetter(jr,"cropX",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropY",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropWidth",0,(0,su.getNumberValidator)()),sa.Factory.addGetterSetter(jr,"cropHeight",0,(0,su.getNumberValidator)());var ou={};Object.defineProperty(ou,"__esModule",{value:!0}),ou.Text=ou.stringToArray=void 0;const Iv=En,jn=li,pZ=Es,Rv=Kt,ao=Rt,gZ=Kt;function O8(e){return[...e].reduce((t,n,r,s)=>(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?t.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(s[r+1]||""))?t.push(n+s[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?t[t.length-1]+=n:t.push(n),t),[])}ou.stringToArray=O8;var fl="auto",mZ="center",N8="inherit",au="justify",vZ="Change.konva",bZ="2d",I8="-",R8="left",yZ="text",_Z="Text",wZ="top",CZ="bottom",D8="middle",L8="normal",SZ="px ",ah=" ",EZ="right",k8="rtl",xZ="word",AZ="char",M8="none",Dv="…",F8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],PZ=F8.length;function TZ(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var lh;function Lv(){return lh||(lh=Iv.Util.createCanvasElement().getContext(bZ),lh)}function OZ(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function NZ(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function IZ(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class on extends pZ.Shape{constructor(t){super(IZ(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<PZ;n++)this.on(F8[n]+vZ,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var s=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,l=this.verticalAlign(),c=this.direction(),u=0,d=this.align(),f=this.getWidth(),h=this.letterSpacing(),g=this.fill(),v=this.textDecoration(),y=v.indexOf("underline")!==-1,_=v.indexOf("line-through")!==-1,w;c=c===N8?t.direction:c;var A=a/2,C=D8;if(Rv.Konva._fixTextRendering){var S=this.measureSize("M");C="alphabetic",A=(S.fontBoundingBoxAscent-S.fontBoundingBoxDescent)/2+a/2}var x=0,T=0;for(c===k8&&t.setAttr("direction",c),t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",C),t.setAttr("textAlign",R8),l===D8?u=(this.getHeight()-r*a-s*2)/2:l===CZ&&(u=this.getHeight()-r*a-s*2),t.translate(s,u+s),w=0;w<r;w++){var x=0,T=0,N=n[w],I=N.text,B=N.width,D=N.lastInParagraph,M,G,H;if(t.save(),d===EZ?x+=f-B-s*2:d===mZ&&(x+=(f-B-s*2)/2),y){t.save(),t.beginPath();let Z=Rv.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2);const j=x,we=A+T+Z;t.moveTo(j,we),M=I.split(" ").length-1,G=M===0,H=d===au&&!D?f-s*2:B,t.lineTo(j+Math.round(H),we),t.lineWidth=o/15;const ge=this._getLinearGradient();t.strokeStyle=ge||g,t.stroke(),t.restore()}if(_){t.save(),t.beginPath();let Z=Rv.Konva._fixTextRendering?-Math.round(o/4):0;t.moveTo(x,A+T+Z),M=I.split(" ").length-1,G=M===0,H=d===au&&D&&!G?f-s*2:B,t.lineTo(x+Math.round(H),A+T+Z),t.lineWidth=o/15;const j=this._getLinearGradient();t.strokeStyle=j||g,t.stroke(),t.restore()}if(c!==k8&&(h!==0||d===au)){M=I.split(" ").length-1;for(var ae=O8(I),X=0;X<ae.length;X++){var k=ae[X];k===" "&&!D&&d===au&&(x+=(f-s*2-B)/M),this._partialTextX=x,this._partialTextY=A+T,this._partialText=k,t.fillStrokeShape(this),x+=this.measureSize(k).width+h}}else h!==0&&t.setAttr("letterSpacing",`${h}px`),this._partialTextX=x,this._partialTextY=A+T,this._partialText=I,t.fillStrokeShape(this);t.restore(),r>1&&(A+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=Iv.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(yZ,n),this}getWidth(){var t=this.attrs.width===fl||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===fl||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Iv.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n,r,s,o,a,l,c,u,d,f,h,g=Lv(),v=this.fontSize(),y;g.save(),g.font=this._getContextFont(),y=g.measureText(t),g.restore();const _=v/100;return{actualBoundingBoxAscent:(n=y.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*_,actualBoundingBoxDescent:(r=y.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(s=y.actualBoundingBoxLeft)!==null&&s!==void 0?s:-7.421875*_,actualBoundingBoxRight:(o=y.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*_,alphabeticBaseline:(a=y.alphabeticBaseline)!==null&&a!==void 0?a:0,emHeightAscent:(l=y.emHeightAscent)!==null&&l!==void 0?l:100*_,emHeightDescent:(c=y.emHeightDescent)!==null&&c!==void 0?c:-20*_,fontBoundingBoxAscent:(u=y.fontBoundingBoxAscent)!==null&&u!==void 0?u:91*_,fontBoundingBoxDescent:(d=y.fontBoundingBoxDescent)!==null&&d!==void 0?d:21*_,hangingBaseline:(f=y.hangingBaseline)!==null&&f!==void 0?f:72.80000305175781*_,ideographicBaseline:(h=y.ideographicBaseline)!==null&&h!==void 0?h:-21*_,width:y.width,height:v}}_getContextFont(){return this.fontStyle()+ah+this.fontVariant()+ah+(this.fontSize()+SZ)+TZ(this.fontFamily())}_addTextLine(t){this.align()===au&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return Lv().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
148
148
  `),n=+this.fontSize(),r=0,s=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,l=o!==fl&&o!==void 0,c=a!==fl&&a!==void 0,u=this.padding(),d=o-u*2,f=a-u*2,h=0,g=this.wrap(),v=g!==M8,y=g!==AZ&&v,_=this.ellipsis();this.textArr=[],Lv().font=this._getContextFont();for(var w=_?this._getTextWidth(Dv):0,A=0,C=t.length;A<C;++A){var S=t[A],x=this._getTextWidth(S);if(l&&x>d)for(;S.length>0;){for(var T=0,N=S.length,I="",B=0;T<N;){var D=T+N>>>1,M=S.slice(0,D+1),G=this._getTextWidth(M)+w;G<=d?(T=D+1,I=M,B=G):N=D}if(I){if(y){var H,ae=S[I.length],X=ae===ah||ae===I8;X&&B<=d?H=I.length:H=Math.max(I.lastIndexOf(ah),I.lastIndexOf(I8))+1,H>0&&(T=H,I=I.slice(0,T),B=this._getTextWidth(I))}I=I.trimRight(),this._addTextLine(I),r=Math.max(r,B),h+=s;var k=this._shouldHandleEllipsis(h);if(k){this._tryToAddEllipsisToLastLine();break}if(S=S.slice(T),S=S.trimLeft(),S.length>0&&(x=this._getTextWidth(S),x<=d)){this._addTextLine(S),h+=s,r=Math.max(r,x);break}}else break}else this._addTextLine(S),h+=s,r=Math.max(r,x),this._shouldHandleEllipsis(h)&&A<C-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),c&&h+s>f)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,s=this.attrs.height,o=s!==fl&&s!==void 0,a=this.padding(),l=s-a*2,c=this.wrap(),u=c!==M8;return!u||o&&t+r>l}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==fl&&t!==void 0,r=this.padding(),s=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var l=this._getTextWidth(a.text+Dv)<s;l||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+Dv)}}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const t=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return t&&n?!0:super._useBufferCanvas()}}ou.Text=on,on.prototype._fillFunc=OZ,on.prototype._strokeFunc=NZ,on.prototype.className=_Z,on.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,gZ._registerNode)(on),jn.Factory.overWriteSetter(on,"width",(0,ao.getNumberOrAutoValidator)()),jn.Factory.overWriteSetter(on,"height",(0,ao.getNumberOrAutoValidator)()),jn.Factory.addGetterSetter(on,"direction",N8),jn.Factory.addGetterSetter(on,"fontFamily","Arial"),jn.Factory.addGetterSetter(on,"fontSize",12,(0,ao.getNumberValidator)()),jn.Factory.addGetterSetter(on,"fontStyle",L8),jn.Factory.addGetterSetter(on,"fontVariant",L8),jn.Factory.addGetterSetter(on,"padding",0,(0,ao.getNumberValidator)()),jn.Factory.addGetterSetter(on,"align",R8),jn.Factory.addGetterSetter(on,"verticalAlign",wZ),jn.Factory.addGetterSetter(on,"lineHeight",1,(0,ao.getNumberValidator)()),jn.Factory.addGetterSetter(on,"wrap",xZ),jn.Factory.addGetterSetter(on,"ellipsis",!1,(0,ao.getBooleanValidator)()),jn.Factory.addGetterSetter(on,"letterSpacing",0,(0,ao.getNumberValidator)()),jn.Factory.addGetterSetter(on,"text","",(0,ao.getStringValidator)()),jn.Factory.addGetterSetter(on,"textDecoration","");var kv={},ch={};Object.defineProperty(ch,"__esModule",{value:!0}),ch.Line=void 0;const uh=li,RZ=Es,B8=Rt,DZ=Kt;function Mv(e,t,n,r,s,o,a){var l=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),c=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2)),u=a*l/(l+c),d=a*c/(l+c),f=n-u*(s-e),h=r-u*(o-t),g=n+d*(s-e),v=r+d*(o-t);return[f,h,g,v]}function j8(e,t){var n=e.length,r=[],s,o;for(s=2;s<n-2;s+=2)o=Mv(e[s-2],e[s-1],e[s],e[s+1],e[s+2],e[s+3],t),!isNaN(o[0])&&(r.push(o[0]),r.push(o[1]),r.push(e[s]),r.push(e[s+1]),r.push(o[2]),r.push(o[3]));return r}class lo extends RZ.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,s=this.tension(),o=this.closed(),a=this.bezier(),l,c,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),s!==0&&r>4){for(l=this.getTensionPoints(),c=l.length,u=o?0:4,o||t.quadraticCurveTo(l[0],l[1],l[2],l[3]);u<c-2;)t.bezierCurveTo(l[u++],l[u++],l[u++],l[u++],l[u++],l[u++]);o||t.quadraticCurveTo(l[c-2],l[c-1],n[r-2],n[r-1])}else if(a)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():j8(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),s=Mv(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=Mv(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),a=j8(t,r),l=[s[2],s[3]].concat(a).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],s[0],s[1],t[0],t[1]]);return l}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],s=t[1],o=t[1],a,l,c=0;c<t.length/2;c++)a=t[c*2],l=t[c*2+1],n=Math.min(n,a),r=Math.max(r,a),s=Math.min(s,l),o=Math.max(o,l);return{x:n,y:s,width:r-n,height:o-s}}}ch.Line=lo,lo.prototype.className="Line",lo.prototype._attrsAffectingSize=["points","bezier","tension"],(0,DZ._registerNode)(lo),uh.Factory.addGetterSetter(lo,"closed",!1),uh.Factory.addGetterSetter(lo,"bezier",!1),uh.Factory.addGetterSetter(lo,"tension",0,(0,B8.getNumberValidator)()),uh.Factory.addGetterSetter(lo,"points",[],(0,B8.getNumberArrayValidator)());var dh={},U8={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,l,c)=>{let u,d,f;u=c/2,d=0;for(let g=0;g<20;g++)f=u*e.tValues[20][g]+u,d+=e.cValues[20][g]*r(a,l,f);return u*d};e.getCubicArcLength=t;const n=(a,l,c)=>{c===void 0&&(c=1);const u=a[0]-2*a[1]+a[2],d=l[0]-2*l[1]+l[2],f=2*a[1]-2*a[0],h=2*l[1]-2*l[0],g=4*(u*u+d*d),v=4*(u*f+d*h),y=f*f+h*h;if(g===0)return c*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(l[2]-l[0],2));const _=v/(2*g),w=y/g,A=c+_,C=w-_*_,S=A*A+C>0?Math.sqrt(A*A+C):0,x=_*_+C>0?Math.sqrt(_*_+C):0,T=_+Math.sqrt(_*_+C)!==0?C*Math.log(Math.abs((A+S)/(_+x))):0;return Math.sqrt(g)/2*(A*S-_*x+T)};e.getQuadraticArcLength=n;function r(a,l,c){const u=s(1,c,a),d=s(1,c,l),f=u*u+d*d;return Math.sqrt(f)}const s=(a,l,c)=>{const u=c.length-1;let d,f;if(u===0)return 0;if(a===0){f=0;for(let h=0;h<=u;h++)f+=e.binomialCoefficients[u][h]*Math.pow(1-l,u-h)*Math.pow(l,h)*c[h];return f}else{d=new Array(u);for(let h=0;h<u;h++)d[h]=u*(c[h+1]-c[h]);return s(a-1,l,d)}},o=(a,l,c)=>{let u=1,d=a/l,f=(a-c(d))/l,h=0;for(;u>.001;){const g=c(d+f),v=Math.abs(a-g)/l;if(v<u)u=v,d+=f;else{const y=c(d-f),_=Math.abs(a-y)/l;_<u?(u=_,d-=f):f/=2}if(h++,h>500)break}return d};e.t2length=o})(U8),Object.defineProperty(dh,"__esModule",{value:!0}),dh.Path=void 0;const LZ=li,kZ=Es,MZ=Kt,hl=U8;class _n extends kZ.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=_n.parsePathData(this.data()),this.pathLength=_n.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,s=0;s<n.length;s++){var o=n[s].command,a=n[s].points;switch(o){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var l=a[0],c=a[1],u=a[2],d=a[3],f=a[4],h=a[5],g=a[6],v=a[7],y=u>d?u:d,_=u>d?1:u/d,w=u>d?d/u:1;t.translate(l,c),t.rotate(g),t.scale(_,w),t.arc(0,0,y,f,f+h,1-v),t.scale(1/_,1/w),t.rotate(-g),t.translate(-l,-c);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],f=u.points[5],h=u.points[4]+f,g=Math.PI/180;if(Math.abs(d-h)<g&&(g=Math.abs(d-h)),f<0)for(let v=d-g;v>h;v-=g){const y=_n.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],v,0);t.push(y.x,y.y)}else for(let v=d+g;v<h;v+=g){const y=_n.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],v,0);t.push(y.x,y.y)}}else if(u.command==="C")for(let v=0;v<=1;v+=.01){const y=_n.getPointOnCubicBezier(v,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(y.x,y.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],s=t[1],o=t[1],a,l,c=0;c<t.length/2;c++)a=t[c*2],l=t[c*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(l)||(s=Math.min(s,l),o=Math.max(o,l));return{x:n,y:s,width:r-n,height:o-s}}getLength(){return this.pathLength}getPointAtLength(t){return _n.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,s){return Math.sqrt((r-t)*(r-t)+(s-n)*(s-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,s=0,o=n.length;if(!o)return null;for(;s<o&&t>n[s].pathLength;)t-=n[s].pathLength,++s;if(s===o)return r=n[s-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[s].points.slice(0,2),{x:r[0],y:r[1]};var a=n[s],l=a.points;switch(a.command){case"L":return _n.getPointOnLine(t,a.start.x,a.start.y,l[0],l[1]);case"C":return _n.getPointOnCubicBezier((0,hl.t2length)(t,_n.getPathLength(n),y=>(0,hl.getCubicArcLength)([a.start.x,l[0],l[2],l[4]],[a.start.y,l[1],l[3],l[5]],y)),a.start.x,a.start.y,l[0],l[1],l[2],l[3],l[4],l[5]);case"Q":return _n.getPointOnQuadraticBezier((0,hl.t2length)(t,_n.getPathLength(n),y=>(0,hl.getQuadraticArcLength)([a.start.x,l[0],l[2]],[a.start.y,l[1],l[3]],y)),a.start.x,a.start.y,l[0],l[1],l[2],l[3]);case"A":var c=l[0],u=l[1],d=l[2],f=l[3],h=l[4],g=l[5],v=l[6];return h+=g*t/a.pathLength,_n.getPointOnEllipticalArc(c,u,d,f,h,v)}return null}static getPointOnLine(t,n,r,s,o,a,l){a=a!=null?a:n,l=l!=null?l:r;const c=this.getLineLength(n,r,s,o);if(c<1e-10)return{x:n,y:r};if(s===n)return{x:a,y:l+(o>r?t:-t)};const u=(o-r)/(s-n),d=Math.sqrt(t*t/(1+u*u))*(s<n?-1:1),f=u*d;if(Math.abs(l-r-u*(a-n))<1e-10)return{x:a+d,y:l+f};const h=((a-n)*(s-n)+(l-r)*(o-r))/(c*c),g=n+h*(s-n),v=r+h*(o-r),y=this.getLineLength(a,l,g,v),_=Math.sqrt(t*t-y*y),w=Math.sqrt(_*_/(1+u*u))*(s<n?-1:1),A=u*w;return{x:g+w,y:v+A}}static getPointOnCubicBezier(t,n,r,s,o,a,l,c,u){function d(_){return _*_*_}function f(_){return 3*_*_*(1-_)}function h(_){return 3*_*(1-_)*(1-_)}function g(_){return(1-_)*(1-_)*(1-_)}var v=c*d(t)+a*f(t)+s*h(t)+n*g(t),y=u*d(t)+l*f(t)+o*h(t)+r*g(t);return{x:v,y}}static getPointOnQuadraticBezier(t,n,r,s,o,a,l){function c(g){return g*g}function u(g){return 2*g*(1-g)}function d(g){return(1-g)*(1-g)}var f=a*c(t)+s*u(t)+n*d(t),h=l*c(t)+o*u(t)+r*d(t);return{x:f,y:h}}static getPointOnEllipticalArc(t,n,r,s,o,a){var l=Math.cos(a),c=Math.sin(a),u={x:r*Math.cos(o),y:s*Math.sin(o)};return{x:t+(u.x*l-u.y*c),y:n+(u.x*c+u.y*l)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var s=0;s<r.length;s++)n=n.replace(new RegExp(r[s],"g"),"|"+r[s]);var o=n.split("|"),a=[],l=[],c=0,u=0,d=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,f;for(s=1;s<o.length;s++){var h=o[s],g=h.charAt(0);for(h=h.slice(1),l.length=0;f=d.exec(h);)l.push(f[0]);for(var v=[],y=0,_=l.length;y<_;y++){if(l[y]==="00"){v.push(0,0);continue}var w=parseFloat(l[y]);isNaN(w)?v.push(0):v.push(w)}for(;v.length>0&&!isNaN(v[0]);){var A="",C=[],S=c,x=u,T,N,I,B,D,M,G,H,ae,X;switch(g){case"l":c+=v.shift(),u+=v.shift(),A="L",C.push(c,u);break;case"L":c=v.shift(),u=v.shift(),C.push(c,u);break;case"m":var k=v.shift(),z=v.shift();if(c+=k,u+=z,A="M",a.length>2&&a[a.length-1].command==="z"){for(var W=a.length-2;W>=0;W--)if(a[W].command==="M"){c=a[W].points[0]+k,u=a[W].points[1]+z;break}}C.push(c,u),g="l";break;case"M":c=v.shift(),u=v.shift(),A="M",C.push(c,u),g="L";break;case"h":c+=v.shift(),A="L",C.push(c,u);break;case"H":c=v.shift(),A="L",C.push(c,u);break;case"v":u+=v.shift(),A="L",C.push(c,u);break;case"V":u=v.shift(),A="L",C.push(c,u);break;case"C":C.push(v.shift(),v.shift(),v.shift(),v.shift()),c=v.shift(),u=v.shift(),C.push(c,u);break;case"c":C.push(c+v.shift(),u+v.shift(),c+v.shift(),u+v.shift()),c+=v.shift(),u+=v.shift(),A="C",C.push(c,u);break;case"S":N=c,I=u,T=a[a.length-1],T.command==="C"&&(N=c+(c-T.points[2]),I=u+(u-T.points[3])),C.push(N,I,v.shift(),v.shift()),c=v.shift(),u=v.shift(),A="C",C.push(c,u);break;case"s":N=c,I=u,T=a[a.length-1],T.command==="C"&&(N=c+(c-T.points[2]),I=u+(u-T.points[3])),C.push(N,I,c+v.shift(),u+v.shift()),c+=v.shift(),u+=v.shift(),A="C",C.push(c,u);break;case"Q":C.push(v.shift(),v.shift()),c=v.shift(),u=v.shift(),C.push(c,u);break;case"q":C.push(c+v.shift(),u+v.shift()),c+=v.shift(),u+=v.shift(),A="Q",C.push(c,u);break;case"T":N=c,I=u,T=a[a.length-1],T.command==="Q"&&(N=c+(c-T.points[0]),I=u+(u-T.points[1])),c=v.shift(),u=v.shift(),A="Q",C.push(N,I,c,u);break;case"t":N=c,I=u,T=a[a.length-1],T.command==="Q"&&(N=c+(c-T.points[0]),I=u+(u-T.points[1])),c+=v.shift(),u+=v.shift(),A="Q",C.push(N,I,c,u);break;case"A":B=v.shift(),D=v.shift(),M=v.shift(),G=v.shift(),H=v.shift(),ae=c,X=u,c=v.shift(),u=v.shift(),A="A",C=this.convertEndpointToCenterParameterization(ae,X,c,u,G,H,B,D,M);break;case"a":B=v.shift(),D=v.shift(),M=v.shift(),G=v.shift(),H=v.shift(),ae=c,X=u,c+=v.shift(),u+=v.shift(),A="A",C=this.convertEndpointToCenterParameterization(ae,X,c,u,G,H,B,D,M);break}a.push({command:A||g,points:C,start:{x:S,y:x},pathLength:this.calcLength(S,x,A||g,C)})}(g==="z"||g==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,s){var o,a,l,c,u=_n;switch(r){case"L":return u.getLineLength(t,n,s[0],s[1]);case"C":return(0,hl.getCubicArcLength)([t,s[0],s[2],s[4]],[n,s[1],s[3],s[5]],1);case"Q":return(0,hl.getQuadraticArcLength)([t,s[0],s[2]],[n,s[1],s[3]],1);case"A":o=0;var d=s[4],f=s[5],h=s[4]+f,g=Math.PI/180;if(Math.abs(d-h)<g&&(g=Math.abs(d-h)),a=u.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],d,0),f<0)for(c=d-g;c>h;c-=g)l=u.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],c,0),o+=u.getLineLength(a.x,a.y,l.x,l.y),a=l;else for(c=d+g;c<h;c+=g)l=u.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],c,0),o+=u.getLineLength(a.x,a.y,l.x,l.y),a=l;return l=u.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],h,0),o+=u.getLineLength(a.x,a.y,l.x,l.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,s,o,a,l,c,u){var d=u*(Math.PI/180),f=Math.cos(d)*(t-r)/2+Math.sin(d)*(n-s)/2,h=-1*Math.sin(d)*(t-r)/2+Math.cos(d)*(n-s)/2,g=f*f/(l*l)+h*h/(c*c);g>1&&(l*=Math.sqrt(g),c*=Math.sqrt(g));var v=Math.sqrt((l*l*(c*c)-l*l*(h*h)-c*c*(f*f))/(l*l*(h*h)+c*c*(f*f)));o===a&&(v*=-1),isNaN(v)&&(v=0);var y=v*l*h/c,_=v*-c*f/l,w=(t+r)/2+Math.cos(d)*y-Math.sin(d)*_,A=(n+s)/2+Math.sin(d)*y+Math.cos(d)*_,C=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},S=function(D,M){return(D[0]*M[0]+D[1]*M[1])/(C(D)*C(M))},x=function(D,M){return(D[0]*M[1]<D[1]*M[0]?-1:1)*Math.acos(S(D,M))},T=x([1,0],[(f-y)/l,(h-_)/c]),N=[(f-y)/l,(h-_)/c],I=[(-1*f-y)/l,(-1*h-_)/c],B=x(N,I);return S(N,I)<=-1&&(B=Math.PI),S(N,I)>=1&&(B=0),a===0&&B>0&&(B=B-2*Math.PI),a===1&&B<0&&(B=B+2*Math.PI),[w,A,l,c,T,B,d,a]}}dh.Path=_n,_n.prototype.className="Path",_n.prototype._attrsAffectingSize=["data"],(0,MZ._registerNode)(_n),LZ.Factory.addGetterSetter(_n,"data"),Object.defineProperty(kv,"__esModule",{value:!0}),kv.Arrow=void 0;const fh=li,FZ=ch,$8=Rt,BZ=Kt,V8=dh;class oa extends FZ.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),s=r,o=this.tension()!==0&&r.length>4;o&&(s=this.getTensionPoints());var a=this.pointerLength(),l=r.length,c,u;if(o){const h=[s[s.length-4],s[s.length-3],s[s.length-2],s[s.length-1],r[l-2],r[l-1]],g=V8.Path.calcLength(s[s.length-4],s[s.length-3],"C",h),v=V8.Path.getPointOnQuadraticBezier(Math.min(1,1-a/g),h[0],h[1],h[2],h[3],h[4],h[5]);c=r[l-2]-v.x,u=r[l-1]-v.y}else c=r[l-2]-r[l-4],u=r[l-1]-r[l-3];var d=(Math.atan2(u,c)+n)%n,f=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[l-2],r[l-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(c=(s[0]+s[2])/2-r[0],u=(s[1]+s[3])/2-r[1]):(c=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-c)+n)%n),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}kv.Arrow=oa,oa.prototype.className="Arrow",(0,BZ._registerNode)(oa),fh.Factory.addGetterSetter(oa,"pointerLength",10,(0,$8.getNumberValidator)()),fh.Factory.addGetterSetter(oa,"pointerWidth",10,(0,$8.getNumberValidator)()),fh.Factory.addGetterSetter(oa,"pointerAtBeginning",!1),fh.Factory.addGetterSetter(oa,"pointerAtEnding",!0);function z8(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function s(){var o,a=n.length,l,c=0,u=0;for(o=0;o<a;++o)l=n[o],c+=l.x,u+=l.y;for(c=(c/a-e)*r,u=(u/a-t)*r,o=0;o<a;++o)l=n[o],l.x-=c,l.y-=u}return s.initialize=function(o){n=o},s.x=function(o){return arguments.length?(e=+o,s):e},s.y=function(o){return arguments.length?(t=+o,s):t},s.strength=function(o){return arguments.length?(r=+o,s):r},s}function jZ(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return q8(this.cover(t,n),t,n,e)}function q8(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var s,o=e._root,a={data:r},l=e._x0,c=e._y0,u=e._x1,d=e._y1,f,h,g,v,y,_,w,A;if(!o)return e._root=a,e;for(;o.length;)if((y=t>=(f=(l+u)/2))?l=f:u=f,(_=n>=(h=(c+d)/2))?c=h:d=h,s=o,!(o=o[w=_<<1|y]))return s[w]=a,e;if(g=+e._x.call(null,o.data),v=+e._y.call(null,o.data),t===g&&n===v)return a.next=o,s?s[w]=a:e._root=a,e;do s=s?s[w]=new Array(4):e._root=new Array(4),(y=t>=(f=(l+u)/2))?l=f:u=f,(_=n>=(h=(c+d)/2))?c=h:d=h;while((w=_<<1|y)===(A=(v>=h)<<1|g>=f));return s[A]=o,s[w]=a,e}function UZ(e){var t,n,r=e.length,s,o,a=new Array(r),l=new Array(r),c=1/0,u=1/0,d=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(s=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=s,l[n]=o,s<c&&(c=s),s>d&&(d=s),o<u&&(u=o),o>f&&(f=o));if(c>d||u>f)return this;for(this.cover(c,u).cover(d,f),n=0;n<r;++n)q8(this,a[n],l[n],e[n]);return this}function $Z(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,s=this._x1,o=this._y1;if(isNaN(n))s=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var a=s-n||1,l=this._root,c,u;n>e||e>=s||r>t||t>=o;)switch(u=(t<r)<<1|e<n,c=new Array(4),c[u]=l,l=c,a*=2,u){case 0:s=n+a,o=r+a;break;case 1:n=s-a,o=r+a;break;case 2:s=n+a,r=o-a;break;case 3:n=s-a,r=o-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=s,this._y1=o,this}function VZ(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function zZ(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Yn(e,t,n,r,s){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=s}function qZ(e,t,n){var r,s=this._x0,o=this._y0,a,l,c,u,d=this._x1,f=this._y1,h=[],g=this._root,v,y;for(g&&h.push(new Yn(g,s,o,d,f)),n==null?n=1/0:(s=e-n,o=t-n,d=e+n,f=t+n,n*=n);v=h.pop();)if(!(!(g=v.node)||(a=v.x0)>d||(l=v.y0)>f||(c=v.x1)<s||(u=v.y1)<o))if(g.length){var _=(a+c)/2,w=(l+u)/2;h.push(new Yn(g[3],_,w,c,u),new Yn(g[2],a,w,_,u),new Yn(g[1],_,l,c,w),new Yn(g[0],a,l,_,w)),(y=(t>=w)<<1|e>=_)&&(v=h[h.length-1],h[h.length-1]=h[h.length-1-y],h[h.length-1-y]=v)}else{var A=e-+this._x.call(null,g.data),C=t-+this._y.call(null,g.data),S=A*A+C*C;if(S<n){var x=Math.sqrt(n=S);s=e-x,o=t-x,d=e+x,f=t+x,r=g.data}}return r}function HZ(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,r,s,o,a=this._x0,l=this._y0,c=this._x1,u=this._y1,d,f,h,g,v,y,_,w;if(!n)return this;if(n.length)for(;;){if((v=d>=(h=(a+c)/2))?a=h:c=h,(y=f>=(g=(l+u)/2))?l=g:u=g,t=n,!(n=n[_=y<<1|v]))return this;if(!n.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(r=t,w=_)}for(;n.data!==e;)if(s=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,s?(o?s.next=o:delete s.next,this):t?(o?t[_]=o:delete t[_],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[w]=n:this._root=n),this):(this._root=o,this)}function GZ(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function WZ(){return this._root}function KZ(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function JZ(e){var t=[],n,r=this._root,s,o,a,l,c;for(r&&t.push(new Yn(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,a=n.y0,l=n.x1,c=n.y1)&&r.length){var u=(o+l)/2,d=(a+c)/2;(s=r[3])&&t.push(new Yn(s,u,d,l,c)),(s=r[2])&&t.push(new Yn(s,o,d,u,c)),(s=r[1])&&t.push(new Yn(s,u,a,l,d)),(s=r[0])&&t.push(new Yn(s,o,a,u,d))}return this}function YZ(e){var t=[],n=[],r;for(this._root&&t.push(new Yn(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var s=r.node;if(s.length){var o,a=r.x0,l=r.y0,c=r.x1,u=r.y1,d=(a+c)/2,f=(l+u)/2;(o=s[0])&&t.push(new Yn(o,a,l,d,f)),(o=s[1])&&t.push(new Yn(o,d,l,c,f)),(o=s[2])&&t.push(new Yn(o,a,f,d,u)),(o=s[3])&&t.push(new Yn(o,d,f,c,u))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function XZ(e){return e[0]}function ZZ(e){return arguments.length?(this._x=e,this):this._x}function QZ(e){return e[1]}function eQ(e){return arguments.length?(this._y=e,this):this._y}function Fv(e,t,n){var r=new Bv(t==null?XZ:t,n==null?QZ:n,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Bv(e,t,n,r,s,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=s,this._y1=o,this._root=void 0}function H8(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Xn=Fv.prototype=Bv.prototype;Xn.copy=function(){var e=new Bv(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=H8(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var s=0;s<4;++s)(r=t.source[s])&&(r.length?n.push({source:r,target:t.target[s]=new Array(4)}):t.target[s]=H8(r));return e},Xn.add=jZ,Xn.addAll=UZ,Xn.cover=$Z,Xn.data=VZ,Xn.extent=zZ,Xn.find=qZ,Xn.remove=HZ,Xn.removeAll=GZ,Xn.root=WZ,Xn.size=KZ,Xn.visit=JZ,Xn.visitAfter=YZ,Xn.x=ZZ,Xn.y=eQ;function Zn(e){return function(){return e}}function co(e){return(e()-.5)*1e-6}function tQ(e){return e.x+e.vx}function nQ(e){return e.y+e.vy}function iQ(e){var t,n,r,s=1,o=1;typeof e!="function"&&(e=Zn(e==null?1:+e));function a(){for(var u,d=t.length,f,h,g,v,y,_,w=0;w<o;++w)for(f=Fv(t,tQ,nQ).visitAfter(l),u=0;u<d;++u)h=t[u],y=n[h.index],_=y*y,g=h.x+h.vx,v=h.y+h.vy,f.visit(A);function A(C,S,x,T,N){var I=C.data,B=C.r,D=y+B;if(I){if(I.index>h.index){var M=g-I.x-I.vx,G=v-I.y-I.vy,H=M*M+G*G;H<D*D&&(M===0&&(M=co(r),H+=M*M),G===0&&(G=co(r),H+=G*G),H=(D-(H=Math.sqrt(H)))/H*s,h.vx+=(M*=H)*(D=(B*=B)/(_+B)),h.vy+=(G*=H)*D,I.vx-=M*(D=1-D),I.vy-=G*D)}return}return S>g+D||T<g-D||x>v+D||N<v-D}}function l(u){if(u.data)return u.r=n[u.data.index];for(var d=u.r=0;d<4;++d)u[d]&&u[d].r>u.r&&(u.r=u[d].r)}function c(){if(t){var u,d=t.length,f;for(n=new Array(d),u=0;u<d;++u)f=t[u],n[f.index]=+e(f,u,t)}}return a.initialize=function(u,d){t=u,r=d,c()},a.iterations=function(u){return arguments.length?(o=+u,a):o},a.strength=function(u){return arguments.length?(s=+u,a):s},a.radius=function(u){return arguments.length?(e=typeof u=="function"?u:Zn(+u),c(),a):e},a}function rQ(e){return e.index}function G8(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function sQ(e){var t=rQ,n=f,r,s=Zn(30),o,a,l,c,u,d=1;e==null&&(e=[]);function f(_){return 1/Math.min(l[_.source.index],l[_.target.index])}function h(_){for(var w=0,A=e.length;w<d;++w)for(var C=0,S,x,T,N,I,B,D;C<A;++C)S=e[C],x=S.source,T=S.target,N=T.x+T.vx-x.x-x.vx||co(u),I=T.y+T.vy-x.y-x.vy||co(u),B=Math.sqrt(N*N+I*I),B=(B-o[C])/B*_*r[C],N*=B,I*=B,T.vx-=N*(D=c[C]),T.vy-=I*D,x.vx+=N*(D=1-D),x.vy+=I*D}function g(){if(a){var _,w=a.length,A=e.length,C=new Map(a.map((x,T)=>[t(x,T,a),x])),S;for(_=0,l=new Array(w);_<A;++_)S=e[_],S.index=_,typeof S.source!="object"&&(S.source=G8(C,S.source)),typeof S.target!="object"&&(S.target=G8(C,S.target)),l[S.source.index]=(l[S.source.index]||0)+1,l[S.target.index]=(l[S.target.index]||0)+1;for(_=0,c=new Array(A);_<A;++_)S=e[_],c[_]=l[S.source.index]/(l[S.source.index]+l[S.target.index]);r=new Array(A),v(),o=new Array(A),y()}}function v(){if(a)for(var _=0,w=e.length;_<w;++_)r[_]=+n(e[_],_,e)}function y(){if(a)for(var _=0,w=e.length;_<w;++_)o[_]=+s(e[_],_,e)}return h.initialize=function(_,w){a=_,u=w,g()},h.links=function(_){return arguments.length?(e=_,g(),h):e},h.id=function(_){return arguments.length?(t=_,h):t},h.iterations=function(_){return arguments.length?(d=+_,h):d},h.strength=function(_){return arguments.length?(n=typeof _=="function"?_:Zn(+_),v(),h):n},h.distance=function(_){return arguments.length?(s=typeof _=="function"?_:Zn(+_),y(),h):s},h}var oQ={value:()=>{}};function W8(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new hh(n)}function hh(e){this._=e}function aQ(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}hh.prototype=W8.prototype={constructor:hh,on:function(e,t){var n=this._,r=aQ(e+"",n),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=lQ(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)n[s]=K8(n[s],e.name,t);else if(t==null)for(s in n)n[s]=K8(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new hh(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function lQ(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function K8(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=oQ,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var pl=0,lu=0,cu=0,J8=1e3,ph,uu,gh=0,aa=0,mh=0,du=typeof performance=="object"&&performance.now?performance:Date,Y8=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function X8(){return aa||(Y8(cQ),aa=du.now()+mh)}function cQ(){aa=0}function jv(){this._call=this._time=this._next=null}jv.prototype=Z8.prototype={constructor:jv,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?X8():+n)+(t==null?0:+t),!this._next&&uu!==this&&(uu?uu._next=this:ph=this,uu=this),this._call=e,this._time=n,Uv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Uv())}};function Z8(e,t,n){var r=new jv;return r.restart(e,t,n),r}function uQ(){X8(),++pl;for(var e=ph,t;e;)(t=aa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pl}function Q8(){aa=(gh=du.now())+mh,pl=lu=0;try{uQ()}finally{pl=0,fQ(),aa=0}}function dQ(){var e=du.now(),t=e-gh;t>J8&&(mh-=t,gh=e)}function fQ(){for(var e,t=ph,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ph=n);uu=e,Uv(r)}function Uv(e){if(!pl){lu&&(lu=clearTimeout(lu));var t=e-aa;t>24?(e<1/0&&(lu=setTimeout(Q8,e-du.now()-mh)),cu&&(cu=clearInterval(cu))):(cu||(gh=du.now(),cu=setInterval(dQ,J8)),pl=1,Y8(Q8))}}const hQ=1664525,pQ=1013904223,e5=4294967296;function gQ(){let e=1;return()=>(e=(hQ*e+pQ)%e5)/e5}function mQ(e){return e.x}function vQ(e){return e.y}var bQ=10,yQ=Math.PI*(3-Math.sqrt(5));function _Q(e){var t,n=1,r=.001,s=1-Math.pow(r,1/300),o=0,a=.6,l=new Map,c=Z8(f),u=W8("tick","end"),d=gQ();e==null&&(e=[]);function f(){h(),u.call("tick",t),n<r&&(c.stop(),u.call("end",t))}function h(y){var _,w=e.length,A;y===void 0&&(y=1);for(var C=0;C<y;++C)for(n+=(o-n)*s,l.forEach(function(S){S(n)}),_=0;_<w;++_)A=e[_],A.fx==null?(isNaN(A.vx)&&(A.vx=0),A.x+=A.vx*=a):(A.x=A.fx,A.vx=0),A.fy==null?(isNaN(A.vy)&&(A.vy=0),A.y+=A.vy*=a):(A.y=A.fy,A.vy=0);return t}function g(){for(var y=0,_=e.length,w;y<_;++y){if(w=e[y],w.index=y,w.fx!=null&&(w.x=w.fx),w.fy!=null&&(w.y=w.fy),isNaN(w.x)||isNaN(w.y)){var A=bQ*Math.sqrt(.5+y),C=y*yQ;w.x=A*Math.cos(C),w.y=A*Math.sin(C)}(isNaN(w.vx)||isNaN(w.vy))&&(w.vx=w.vy=0)}}function v(y){return y.initialize&&y.initialize(e,d),y}return g(),t={tick:h,restart:function(){return c.restart(f),t},stop:function(){return c.stop(),t},nodes:function(y){return arguments.length?(e=y,g(),l.forEach(v),t):e},alpha:function(y){return arguments.length?(n=+y,t):n},alphaMin:function(y){return arguments.length?(r=+y,t):r},alphaDecay:function(y){return arguments.length?(s=+y,t):+s},alphaTarget:function(y){return arguments.length?(o=+y,t):o},velocityDecay:function(y){return arguments.length?(a=1-y,t):1-a},randomSource:function(y){return arguments.length?(d=y,l.forEach(v),t):d},force:function(y,_){return arguments.length>1?(_==null?l.delete(y):l.set(y,v(_)),t):l.get(y)},find:function(y,_,w){var A=0,C=e.length,S,x,T,N,I;for(w==null?w=1/0:w*=w,A=0;A<C;++A)N=e[A],S=y-N.x,x=_-N.y,T=S*S+x*x,T<w&&(I=N,w=T);return I},on:function(y,_){return arguments.length>1?(u.on(y,_),t):u.on(y)}}}function wQ(){var e,t,n,r,s=Zn(-30),o,a=1,l=1/0,c=.81;function u(g){var v,y=e.length,_=Fv(e,mQ,vQ).visitAfter(f);for(r=g,v=0;v<y;++v)t=e[v],_.visit(h)}function d(){if(e){var g,v=e.length,y;for(o=new Array(v),g=0;g<v;++g)y=e[g],o[y.index]=+s(y,g,e)}}function f(g){var v=0,y,_,w=0,A,C,S;if(g.length){for(A=C=S=0;S<4;++S)(y=g[S])&&(_=Math.abs(y.value))&&(v+=y.value,w+=_,A+=_*y.x,C+=_*y.y);g.x=A/w,g.y=C/w}else{y=g,y.x=y.data.x,y.y=y.data.y;do v+=o[y.data.index];while(y=y.next)}g.value=v}function h(g,v,y,_){if(!g.value)return!0;var w=g.x-t.x,A=g.y-t.y,C=_-v,S=w*w+A*A;if(C*C/c<S)return S<l&&(w===0&&(w=co(n),S+=w*w),A===0&&(A=co(n),S+=A*A),S<a&&(S=Math.sqrt(a*S)),t.vx+=w*g.value*r/S,t.vy+=A*g.value*r/S),!0;if(g.length||S>=l)return;(g.data!==t||g.next)&&(w===0&&(w=co(n),S+=w*w),A===0&&(A=co(n),S+=A*A),S<a&&(S=Math.sqrt(a*S)));do g.data!==t&&(C=o[g.data.index]*r/S,t.vx+=w*C,t.vy+=A*C);while(g=g.next)}return u.initialize=function(g,v){e=g,n=v,d()},u.strength=function(g){return arguments.length?(s=typeof g=="function"?g:Zn(+g),d(),u):s},u.distanceMin=function(g){return arguments.length?(a=g*g,u):Math.sqrt(a)},u.distanceMax=function(g){return arguments.length?(l=g*g,u):Math.sqrt(l)},u.theta=function(g){return arguments.length?(c=g*g,u):Math.sqrt(c)},u}function CQ(e){var t=Zn(.1),n,r,s;typeof e!="function"&&(e=Zn(e==null?0:+e));function o(l){n.length!==s.length&&a();for(var c=0,u=n.length,d;c<u;++c)d=n[c],d.vx,d.vx+=(s[c]-d.x)*r[c]*l}function a(){if(n){var l,c=n.length;for(r=new Array(c),s=new Array(c),l=0;l<c;++l)r[l]=isNaN(s[l]=+e(n[l],l,n))?0:+t(n[l],l,n)}}return o.initialize=function(l){n=l,a()},o.strength=function(l){return arguments.length?(t=typeof l=="function"?l:Zn(+l),a(),o):t},o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Zn(+l),a(),o):e},o}function SQ(e){var t=Zn(.1),n,r,s;typeof e!="function"&&(e=Zn(e==null?0:+e));function o(l){n.length!==s.length&&a();for(var c=0,u=n.length,d;c<u;++c)d=n[c],d.vy+=(s[c]-d.y)*r[c]*l}function a(){if(n){var l,c=n.length;for(r=new Array(c),s=new Array(c),l=0;l<c;++l)r[l]=isNaN(s[l]=+e(n[l],l,n))?0:+t(n[l],l,n)}}return o.initialize=function(l){n=l,a()},o.strength=function(l){return arguments.length?(t=typeof l=="function"?l:Zn(+l),a(),o):t},o.y=function(l){return arguments.length?(e=typeof l=="function"?l:Zn(+l),a(),o):e},o}const Jge="",Yge="",Xge="",Zge="";function EQ(e,t,n){return t=yh(t),o5(e,t5()?Reflect.construct(t,n||[],yh(e).constructor):t.apply(e,n))}function t5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(t5=function(){return!!e})()}function n5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n5(Object(n),!0).forEach(function(r){As(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dr(){dr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(k,z,W){k[z]=W.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(k,z,W){return Object.defineProperty(k,z,{value:W,enumerable:!0,configurable:!0,writable:!0}),k[z]}try{u({},"")}catch(k){u=function(z,W,Z){return z[W]=Z}}function d(k,z,W,Z){var j=z&&z.prototype instanceof w?z:w,we=Object.create(j.prototype),ge=new ae(Z||[]);return s(we,"_invoke",{value:D(k,W,ge)}),we}function f(k,z,W){try{return{type:"normal",arg:k.call(z,W)}}catch(Z){return{type:"throw",arg:Z}}}t.wrap=d;var h="suspendedStart",g="suspendedYield",v="executing",y="completed",_={};function w(){}function A(){}function C(){}var S={};u(S,a,function(){return this});var x=Object.getPrototypeOf,T=x&&x(x(X([])));T&&T!==n&&r.call(T,a)&&(S=T);var N=C.prototype=w.prototype=Object.create(S);function I(k){["next","throw","return"].forEach(function(z){u(k,z,function(W){return this._invoke(z,W)})})}function B(k,z){function W(j,we,ge,re){var ce=f(k[j],k,we);if(ce.type!=="throw"){var Se=ce.arg,_e=Se.value;return _e&&typeof _e=="object"&&r.call(_e,"__await")?z.resolve(_e.__await).then(function(q){W("next",q,ge,re)},function(q){W("throw",q,ge,re)}):z.resolve(_e).then(function(q){Se.value=q,ge(Se)},function(q){return W("throw",q,ge,re)})}re(ce.arg)}var Z;s(this,"_invoke",{value:function(j,we){function ge(){return new z(function(re,ce){W(j,we,re,ce)})}return Z=Z?Z.then(ge,ge):ge()}})}function D(k,z,W){var Z=h;return function(j,we){if(Z===v)throw new Error("Generator is already running");if(Z===y){if(j==="throw")throw we;return{value:e,done:!0}}for(W.method=j,W.arg=we;;){var ge=W.delegate;if(ge){var re=M(ge,W);if(re){if(re===_)continue;return re}}if(W.method==="next")W.sent=W._sent=W.arg;else if(W.method==="throw"){if(Z===h)throw Z=y,W.arg;W.dispatchException(W.arg)}else W.method==="return"&&W.abrupt("return",W.arg);Z=v;var ce=f(k,z,W);if(ce.type==="normal"){if(Z=W.done?y:g,ce.arg===_)continue;return{value:ce.arg,done:W.done}}ce.type==="throw"&&(Z=y,W.method="throw",W.arg=ce.arg)}}}function M(k,z){var W=z.method,Z=k.iterator[W];if(Z===e)return z.delegate=null,W==="throw"&&k.iterator.return&&(z.method="return",z.arg=e,M(k,z),z.method==="throw")||W!=="return"&&(z.method="throw",z.arg=new TypeError("The iterator does not provide a '"+W+"' method")),_;var j=f(Z,k.iterator,z.arg);if(j.type==="throw")return z.method="throw",z.arg=j.arg,z.delegate=null,_;var we=j.arg;return we?we.done?(z[k.resultName]=we.value,z.next=k.nextLoc,z.method!=="return"&&(z.method="next",z.arg=e),z.delegate=null,_):we:(z.method="throw",z.arg=new TypeError("iterator result is not an object"),z.delegate=null,_)}function G(k){var z={tryLoc:k[0]};1 in k&&(z.catchLoc=k[1]),2 in k&&(z.finallyLoc=k[2],z.afterLoc=k[3]),this.tryEntries.push(z)}function H(k){var z=k.completion||{};z.type="normal",delete z.arg,k.completion=z}function ae(k){this.tryEntries=[{tryLoc:"root"}],k.forEach(G,this),this.reset(!0)}function X(k){if(k||k===""){var z=k[a];if(z)return z.call(k);if(typeof k.next=="function")return k;if(!isNaN(k.length)){var W=-1,Z=function j(){for(;++W<k.length;)if(r.call(k,W))return j.value=k[W],j.done=!1,j;return j.value=e,j.done=!0,j};return Z.next=Z}}throw new TypeError(typeof k+" is not iterable")}return A.prototype=C,s(N,"constructor",{value:C,configurable:!0}),s(C,"constructor",{value:A,configurable:!0}),A.displayName=u(C,c,"GeneratorFunction"),t.isGeneratorFunction=function(k){var z=typeof k=="function"&&k.constructor;return!!z&&(z===A||(z.displayName||z.name)==="GeneratorFunction")},t.mark=function(k){return Object.setPrototypeOf?Object.setPrototypeOf(k,C):(k.__proto__=C,u(k,c,"GeneratorFunction")),k.prototype=Object.create(N),k},t.awrap=function(k){return{__await:k}},I(B.prototype),u(B.prototype,l,function(){return this}),t.AsyncIterator=B,t.async=function(k,z,W,Z,j){j===void 0&&(j=Promise);var we=new B(d(k,z,W,Z),j);return t.isGeneratorFunction(z)?we:we.next().then(function(ge){return ge.done?ge.value:we.next()})},I(N),u(N,c,"Generator"),u(N,a,function(){return this}),u(N,"toString",function(){return"[object Generator]"}),t.keys=function(k){var z=Object(k),W=[];for(var Z in z)W.push(Z);return W.reverse(),function j(){for(;W.length;){var we=W.pop();if(we in z)return j.value=we,j.done=!1,j}return j.done=!0,j}},t.values=X,ae.prototype={constructor:ae,reset:function(k){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(H),!k)for(var z in this)z.charAt(0)==="t"&&r.call(this,z)&&!isNaN(+z.slice(1))&&(this[z]=e)},stop:function(){this.done=!0;var k=this.tryEntries[0].completion;if(k.type==="throw")throw k.arg;return this.rval},dispatchException:function(k){if(this.done)throw k;var z=this;function W(ce,Se){return we.type="throw",we.arg=k,z.next=ce,Se&&(z.method="next",z.arg=e),!!Se}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var j=this.tryEntries[Z],we=j.completion;if(j.tryLoc==="root")return W("end");if(j.tryLoc<=this.prev){var ge=r.call(j,"catchLoc"),re=r.call(j,"finallyLoc");if(ge&&re){if(this.prev<j.catchLoc)return W(j.catchLoc,!0);if(this.prev<j.finallyLoc)return W(j.finallyLoc)}else if(ge){if(this.prev<j.catchLoc)return W(j.catchLoc,!0)}else{if(!re)throw new Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return W(j.finallyLoc)}}}},abrupt:function(k,z){for(var W=this.tryEntries.length-1;W>=0;--W){var Z=this.tryEntries[W];if(Z.tryLoc<=this.prev&&r.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var j=Z;break}}j&&(k==="break"||k==="continue")&&j.tryLoc<=z&&z<=j.finallyLoc&&(j=null);var we=j?j.completion:{};return we.type=k,we.arg=z,j?(this.method="next",this.next=j.finallyLoc,_):this.complete(we)},complete:function(k,z){if(k.type==="throw")throw k.arg;return k.type==="break"||k.type==="continue"?this.next=k.arg:k.type==="return"?(this.rval=this.arg=k.arg,this.method="return",this.next="end"):k.type==="normal"&&z&&(this.next=z),_},finish:function(k){for(var z=this.tryEntries.length-1;z>=0;--z){var W=this.tryEntries[z];if(W.finallyLoc===k)return this.complete(W.completion,W.afterLoc),H(W),_}},catch:function(k){for(var z=this.tryEntries.length-1;z>=0;--z){var W=this.tryEntries[z];if(W.tryLoc===k){var Z=W.completion;if(Z.type==="throw"){var j=Z.arg;H(W)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(k,z,W){return this.delegate={iterator:X(k),resultName:z,nextLoc:W},this.method==="next"&&(this.arg=e),_}},t}function i5(e){var t=function(n,r){if(typeof n!="object"||!n)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var o=s.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}function r5(e,t,n,r,s,o,a){try{var l=e[o](a),c=l.value}catch(u){return void n(u)}l.done?t(c):Promise.resolve(c).then(r,s)}function hu(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var o=e.apply(t,n);function a(c){r5(o,r,s,a,l,"next",c)}function l(c){r5(o,r,s,a,l,"throw",c)}a(void 0)})}}function vh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i5(r.key),r)}}function bh(e,t,n){return t&&s5(e.prototype,t),n&&s5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function As(e,t,n){return(t=i5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yh(e){return yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yh(e)}function $v(e,t){return $v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},$v(e,t)}function pu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o5(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pu(e)}function xQ(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var s=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,l,c,u=[],d=!0,f=!1;try{if(l=(s=s.call(n)).next,r===0){if(Object(s)!==s)return;d=!1}else for(;!(d=(o=l.call(s)).done)&&(u.push(o.value),u.length!==r);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(f)throw a}}return u}}(e,t)||a5(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
149
149
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a5(e,t){if(e){if(typeof e=="string")return l5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l5(e,t):void 0}}function l5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vv(e,t){var n=typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a5(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,s=function(){};return{s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
150
150
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){l=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(l)throw o}}}}function _h(e,t,n){return u5(e,t),d5(n,"get"),function(r,s){return s.get?s.get.call(r):s.value}(e,n)}function c5(e,t,n,r){return u5(e,t),d5(n,"set"),function(s,o,a){if(o.set)o.set.call(s,a);else{if(!o.writable)throw new TypeError("attempted to set read only private field");o.value=a}}(e,n,r),r}function u5(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function d5(e,t){if(e===void 0)throw new TypeError("attempted to "+t+" private static field before its declaration")}function AQ(e){var t=function(n,r){if(typeof n!="object"||!n)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var o=s.call(n,"string");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e);return typeof t=="symbol"?t:String(t)}function PQ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AQ(r.key),r)}}function TQ(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var s=n==null?null:typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,l,c,u=[],d=!0,f=!1;try{if(l=(s=s.call(n)).next,r===0){if(Object(s)!==s)return;d=!1}else for(;!(d=(o=l.call(s)).done)&&(u.push(o.value),u.length!==r);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(f)throw a}}return u}}(e,t)||function(n,r){if(n){if(typeof n=="string")return f5(n,r);var s=Object.prototype.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?f5(n,r):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
151
151
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function f5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var gu=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},tn=function(e){try{return!!e()}catch(t){return!0}},Nn=!tn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),wh=!tn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),h5=wh,p5=Function.prototype,zv=p5.call,OQ=h5&&p5.bind.bind(zv,zv),Xt=h5?OQ:function(e){return function(){return zv.apply(e,arguments)}},mu=function(e){return e==null},NQ=mu,IQ=TypeError,Ch=function(e){if(NQ(e))throw new IQ("Can't call method on "+e);return e},RQ=Ch,DQ=Object,la=function(e){return DQ(RQ(e))},LQ=la,kQ=Xt({}.hasOwnProperty),vi=Object.hasOwn||function(e,t){return kQ(LQ(e),t)},qv=Nn,MQ=vi,g5=Function.prototype,FQ=qv&&Object.getOwnPropertyDescriptor,Hv=MQ(g5,"name"),vu={EXISTS:Hv,PROPER:Hv&&function(){}.name==="something",CONFIGURABLE:Hv&&(!qv||qv&&FQ(g5,"name").configurable)},m5={exports:{}},Gv=typeof document=="object"&&document.all,an=Gv===void 0&&Gv!==void 0?function(e){return typeof e=="function"||e===Gv}:function(e){return typeof e=="function"},bu=function(e){return e&&e.Math===Math&&e},nn=bu(typeof globalThis=="object"&&globalThis)||bu(typeof window=="object"&&window)||bu(typeof self=="object"&&self)||bu(typeof gu=="object"&&gu)||bu(typeof gu=="object"&&gu)||function(){return this}()||Function("return this")(),v5=nn,BQ=Object.defineProperty,Wv=function(e,t){try{BQ(v5,e,{value:t,configurable:!0,writable:!0})}catch(n){v5[e]=t}return t},jQ=Wv,b5="__core-js_shared__",Kv=nn[b5]||jQ(b5,{}),UQ=an,Jv=Kv,$Q=Xt(Function.toString);UQ(Jv.inspectSource)||(Jv.inspectSource=function(e){return $Q(e)});var uo,Sh,Yv=Jv.inspectSource,VQ=an,y5=nn.WeakMap,zQ=VQ(y5)&&/native code/.test(String(y5)),qQ=an,Mi=function(e){return typeof e=="object"?e!==null:qQ(e)},Ur={},_5=Mi,Xv=nn.document,HQ=_5(Xv)&&_5(Xv.createElement),Eh=function(e){return HQ?Xv.createElement(e):{}},GQ=Eh,w5=!Nn&&!tn(function(){return Object.defineProperty(GQ("div"),"a",{get:function(){return 7}}).a!==7}),C5=Nn&&tn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),WQ=Mi,KQ=String,JQ=TypeError,Un=function(e){if(WQ(e))return e;throw new JQ(KQ(e)+" is not an object")},YQ=wh,xh=Function.prototype.call,In=YQ?xh.bind(xh):function(){return xh.apply(xh,arguments)},Zv=nn,XQ=an,ca=function(e,t){return arguments.length<2?(n=Zv[e],XQ(n)?n:void 0):Zv[e]&&Zv[e][t];var n},Ah=Xt({}.isPrototypeOf),Ph=typeof navigator!="undefined"&&String(navigator.userAgent)||"",S5=nn,Qv=Ph,E5=S5.process,x5=S5.Deno,A5=E5&&E5.versions||x5&&x5.version,P5=A5&&A5.v8;P5&&(Sh=(uo=P5.split("."))[0]>0&&uo[0]<4?1:+(uo[0]+uo[1])),!Sh&&Qv&&(!(uo=Qv.match(/Edge\/(\d+)/))||uo[1]>=74)&&(uo=Qv.match(/Chrome\/(\d+)/))&&(Sh=+uo[1]);var Th=Sh,T5=Th,ZQ=tn,QQ=nn.String,O5=!!Object.getOwnPropertySymbols&&!ZQ(function(){var e=Symbol("symbol detection");return!QQ(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&T5&&T5<41}),N5=O5&&!Symbol.sham&&typeof Symbol.iterator=="symbol",eee=ca,tee=an,nee=Ah,iee=Object,I5=N5?function(e){return typeof e=="symbol"}:function(e){var t=eee("Symbol");return tee(t)&&nee(t.prototype,iee(e))},ree=String,Oh=function(e){try{return ree(e)}catch(t){return"Object"}},see=an,oee=Oh,aee=TypeError,fo=function(e){if(see(e))return e;throw new aee(oee(e)+" is not a function")},lee=fo,cee=mu,Nh=function(e,t){var n=e[t];return cee(n)?void 0:lee(n)},e1=In,t1=an,n1=Mi,uee=TypeError,R5={exports:{}},D5=Kv;(R5.exports=function(e,t){return D5[e]||(D5[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.35.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"});var i1=R5.exports,dee=Xt,fee=0,hee=Math.random(),pee=dee(1 .toString),L5=function(e){return"Symbol("+(e===void 0?"":e)+")_"+pee(++fee+hee,36)},gee=i1,k5=vi,mee=L5,vee=O5,bee=N5,gl=nn.Symbol,r1=gee("wks"),yee=bee?gl.for||gl:gl&&gl.withoutSetter||mee,pn=function(e){return k5(r1,e)||(r1[e]=vee&&k5(gl,e)?gl[e]:yee("Symbol."+e)),r1[e]},_ee=In,M5=Mi,F5=I5,wee=Nh,Cee=TypeError,See=pn("toPrimitive"),Eee=function(e,t){if(!M5(e)||F5(e))return e;var n,r=wee(e,See);if(r){if(t===void 0&&(t="default"),n=_ee(r,e,t),!M5(n)||F5(n))return n;throw new Cee("Can't convert object to primitive value")}return t===void 0&&(t="number"),function(s,o){var a,l;if(o==="string"&&t1(a=s.toString)&&!n1(l=e1(a,s))||t1(a=s.valueOf)&&!n1(l=e1(a,s))||o!=="string"&&t1(a=s.toString)&&!n1(l=e1(a,s)))return l;throw new uee("Can't convert object to primitive value")}(e,t)},xee=I5,s1=function(e){var t=Eee(e,"string");return xee(t)?t:t+""},Aee=Nn,Pee=w5,Tee=C5,Ih=Un,B5=s1,Oee=TypeError,o1=Object.defineProperty,Nee=Object.getOwnPropertyDescriptor,a1="enumerable",l1="configurable",c1="writable";Ur.f=Aee?Tee?function(e,t,n){if(Ih(e),t=B5(t),Ih(n),typeof e=="function"&&t==="prototype"&&"value"in n&&c1 in n&&!n[c1]){var r=Nee(e,t);r&&r[c1]&&(e[t]=n.value,n={configurable:l1 in n?n[l1]:r[l1],enumerable:a1 in n?n[a1]:r[a1],writable:!1})}return o1(e,t,n)}:o1:function(e,t,n){if(Ih(e),t=B5(t),Ih(n),Pee)try{return o1(e,t,n)}catch(r){}if("get"in n||"set"in n)throw new Oee("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Rh,yu,Dh,_u=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Iee=Ur,Ree=_u,wu=Nn?function(e,t,n){return Iee.f(e,t,Ree(1,n))}:function(e,t,n){return e[t]=n,e},Dee=L5,j5=i1("keys"),u1=function(e){return j5[e]||(j5[e]=Dee(e))},d1={},Lee=zQ,U5=nn,kee=Mi,Mee=wu,f1=vi,h1=Kv,Fee=u1,Bee=d1,$5="Object already initialized",p1=U5.TypeError,jee=U5.WeakMap;if(Lee||h1.state){var $r=h1.state||(h1.state=new jee);$r.get=$r.get,$r.has=$r.has,$r.set=$r.set,Rh=function(e,t){if($r.has(e))throw new p1($5);return t.facade=e,$r.set(e,t),t},yu=function(e){return $r.get(e)||{}},Dh=function(e){return $r.has(e)}}else{var ml=Fee("state");Bee[ml]=!0,Rh=function(e,t){if(f1(e,ml))throw new p1($5);return t.facade=e,Mee(e,ml,t),t},yu=function(e){return f1(e,ml)?e[ml]:{}},Dh=function(e){return f1(e,ml)}}var ho={set:Rh,get:yu,has:Dh,enforce:function(e){return Dh(e)?yu(e):Rh(e,{})},getterFor:function(e){return function(t){var n;if(!kee(t)||(n=yu(t)).type!==e)throw new p1("Incompatible receiver, "+e+" required");return n}}},g1=Xt,Uee=tn,$ee=an,Lh=vi,m1=Nn,Vee=vu.CONFIGURABLE,zee=Yv,qee=ho.enforce,Hee=ho.get,V5=String,kh=Object.defineProperty,Gee=g1("".slice),Wee=g1("".replace),Kee=g1([].join),Jee=m1&&!Uee(function(){return kh(function(){},"length",{value:8}).length!==8}),Yee=String(String).split("String"),Xee=m5.exports=function(e,t,n){Gee(V5(t),0,7)==="Symbol("&&(t="["+Wee(V5(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!Lh(e,"name")||Vee&&e.name!==t)&&(m1?kh(e,"name",{value:t,configurable:!0}):e.name=t),Jee&&n&&Lh(n,"arity")&&e.length!==n.arity&&kh(e,"length",{value:n.arity});try{n&&Lh(n,"constructor")&&n.constructor?m1&&kh(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(s){}var r=qee(e);return Lh(r,"source")||(r.source=Kee(Yee,typeof t=="string"?t:"")),e};Function.prototype.toString=Xee(function(){return $ee(this)&&Hee(this).source||zee(this)},"toString");var z5=m5.exports,q5=z5,Zee=Ur,Mh=function(e,t,n){return n.get&&q5(n.get,t,{getter:!0}),n.set&&q5(n.set,t,{setter:!0}),Zee.f(e,t,n)},Qee=Nn,ete=vu.EXISTS,H5=Xt,tte=Mh,G5=Function.prototype,nte=H5(G5.toString),W5=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,ite=H5(W5.exec);Qee&&!ete&&tte(G5,"name",{configurable:!0,get:function(){try{return ite(W5,nte(this))[1]}catch(e){return""}}});var v1={},Fh={},K5={}.propertyIsEnumerable,J5=Object.getOwnPropertyDescriptor,rte=J5&&!K5.call({1:2},1);Fh.f=rte?function(e){var t=J5(this,e);return!!t&&t.enumerable}:K5;var Y5=Xt,ste=Y5({}.toString),ote=Y5("".slice),vl=function(e){return ote(ste(e),8,-1)},ate=tn,lte=vl,b1=Object,cte=Xt("".split),y1=ate(function(){return!b1("z").propertyIsEnumerable(0)})?function(e){return lte(e)==="String"?cte(e,""):b1(e)}:b1,ute=y1,dte=Ch,bl=function(e){return ute(dte(e))},fte=Nn,hte=In,pte=Fh,gte=_u,mte=bl,vte=s1,bte=vi,yte=w5,X5=Object.getOwnPropertyDescriptor;v1.f=fte?X5:function(e,t){if(e=mte(e),t=vte(t),yte)try{return X5(e,t)}catch(n){}if(bte(e,t))return gte(!hte(pte.f,e,t),e[t])};var _te=an,wte=Ur,Cte=z5,Ste=Wv,fr=function(e,t,n,r){r||(r={});var s=r.enumerable,o=r.name!==void 0?r.name:t;if(_te(n)&&Cte(n,o,r),r.global)s?e[t]=n:Ste(t,n);else{try{r.unsafe?e[t]&&(s=!0):delete e[t]}catch(a){}s?e[t]=n:wte.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Z5={},Ete=Math.ceil,xte=Math.floor,Ate=Math.trunc||function(e){var t=+e;return(t>0?xte:Ete)(t)},Bh=function(e){var t=+e;return t!=t||t===0?0:Ate(t)},Pte=Bh,Tte=Math.max,Ote=Math.min,Nte=Bh,Ite=Math.min,Q5=function(e){return e>0?Ite(Nte(e),9007199254740991):0},Rte=Q5,Cu=function(e){return Rte(e.length)},Dte=bl,Lte=Cu,eE=function(e){return function(t,n,r){var s,o=Dte(t),a=Lte(o),l=function(c,u){var d=Pte(c);return d<0?Tte(d+u,0):Ote(d,u)}(r,a);if(e&&n!=n){for(;a>l;)if((s=o[l++])!=s)return!0}else for(;a>l;l++)if((e||l in o)&&o[l]===n)return e||l||0;return!e&&-1}},kte={includes:eE(!0),indexOf:eE(!1)},_1=vi,Mte=bl,Fte=kte.indexOf,Bte=d1,tE=Xt([].push),nE=function(e,t){var n,r=Mte(e),s=0,o=[];for(n in r)!_1(Bte,n)&&_1(r,n)&&tE(o,n);for(;t.length>s;)_1(r,n=t[s++])&&(~Fte(o,n)||tE(o,n));return o},w1=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],jte=nE,Ute=w1.concat("length","prototype");Z5.f=Object.getOwnPropertyNames||function(e){return jte(e,Ute)};var C1={};C1.f=Object.getOwnPropertySymbols;var $te=ca,Vte=Z5,zte=C1,qte=Un,Hte=Xt([].concat),Gte=$te("Reflect","ownKeys")||function(e){var t=Vte.f(qte(e)),n=zte.f;return n?Hte(t,n(e)):t},iE=vi,Wte=Gte,Kte=v1,Jte=Ur,Yte=tn,Xte=an,Zte=/#|\.prototype\./,Su=function(e,t){var n=ene[Qte(e)];return n===nne||n!==tne&&(Xte(t)?Yte(t):!!t)},Qte=Su.normalize=function(e){return String(e).replace(Zte,".").toLowerCase()},ene=Su.data={},tne=Su.NATIVE="N",nne=Su.POLYFILL="P",rE=Su,S1=nn,ine=v1.f,rne=wu,sne=fr,one=Wv,ane=function(e,t,n){for(var r=Wte(t),s=Jte.f,o=Kte.f,a=0;a<r.length;a++){var l=r[a];iE(e,l)||n&&iE(n,l)||s(e,l,o(t,l))}},lne=rE,bi=function(e,t){var n,r,s,o,a,l=e.target,c=e.global,u=e.stat;if(n=c?S1:u?S1[l]||one(l,{}):(S1[l]||{}).prototype)for(r in t){if(o=t[r],s=e.dontCallGetSet?(a=ine(n,r))&&a.value:n[r],!lne(c?r:l+(u?".":"#")+r,e.forced)&&s!==void 0){if(typeof o==typeof s)continue;ane(o,s)}(e.sham||s&&s.sham)&&rne(o,"sham",!0),sne(n,r,o,e)}},sE={};sE[pn("toStringTag")]="z";var E1=String(sE)==="[object z]",cne=E1,une=an,jh=vl,dne=pn("toStringTag"),fne=Object,hne=jh(function(){return arguments}())==="Arguments",Eu=cne?jh:function(e){var t,n,r;return e===void 0?"Undefined":e===null?"Null":typeof(n=function(s,o){try{return s[o]}catch(a){}}(t=fne(e),dne))=="string"?n:hne?jh(t):(r=jh(t))==="Object"&&une(t.callee)?"Arguments":r},pne=Eu,gne=String,ua=function(e){if(pne(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return gne(e)},mne=Un,oE=function(){var e=mne(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},x1=tn,A1=nn.RegExp,P1=x1(function(){var e=A1("a","y");return e.lastIndex=2,e.exec("abcd")!==null}),vne=P1||x1(function(){return!A1("a","y").sticky}),bne={BROKEN_CARET:P1||x1(function(){var e=A1("^r","gy");return e.lastIndex=2,e.exec("str")!==null}),MISSED_STICKY:vne,UNSUPPORTED_Y:P1},aE={},yne=nE,_ne=w1,T1=Object.keys||function(e){return yne(e,_ne)},wne=Nn,Cne=C5,Sne=Ur,Ene=Un,xne=bl,Ane=T1;aE.f=wne&&!Cne?Object.defineProperties:function(e,t){Ene(e);for(var n,r=xne(t),s=Ane(t),o=s.length,a=0;o>a;)Sne.f(e,n=s[a++],r[n]);return e};var Uh,lE=ca("document","documentElement"),Pne=Un,Tne=aE,cE=w1,One=d1,Nne=lE,Ine=Eh,O1="prototype",N1="script",uE=u1("IE_PROTO"),I1=function(){},dE=function(e){return"<"+N1+">"+e+"</"+N1+">"},fE=function(e){e.write(dE("")),e.close();var t=e.parentWindow.Object;return e=null,t},$h=function(){try{Uh=new ActiveXObject("htmlfile")}catch(s){}var e,t,n;$h=typeof document!="undefined"?document.domain&&Uh?fE(Uh):(t=Ine("iframe"),n="java"+N1+":",t.style.display="none",Nne.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(dE("document.F=Object")),e.close(),e.F):fE(Uh);for(var r=cE.length;r--;)delete $h[O1][cE[r]];return $h()};One[uE]=!0;var hE,R1,Vh=Object.create||function(e,t){var n;return e!==null?(I1[O1]=Pne(e),n=new I1,I1[O1]=null,n[uE]=e):n=$h(),t===void 0?n:Tne.f(n,t)},Rne=tn,Dne=nn.RegExp,Lne=Rne(function(){var e=Dne(".","s");return!(e.dotAll&&e.test(`
152
152
  `)&&e.flags==="s")}),kne=tn,Mne=nn.RegExp,Fne=kne(function(){var e=Mne("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),yl=In,zh=Xt,Bne=ua,jne=oE,Une=bne,$ne=Vh,Vne=ho.get,zne=Lne,qne=Fne,Hne=i1("native-string-replace",String.prototype.replace),qh=RegExp.prototype.exec,D1=qh,Gne=zh("".charAt),Wne=zh("".indexOf),Kne=zh("".replace),L1=zh("".slice),k1=(R1=/b*/g,yl(qh,hE=/a/,"a"),yl(qh,R1,"a"),hE.lastIndex!==0||R1.lastIndex!==0),pE=Une.BROKEN_CARET,M1=/()??/.exec("")[1]!==void 0;(k1||M1||pE||zne||qne)&&(D1=function(e){var t,n,r,s,o,a,l,c=this,u=Vne(c),d=Bne(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=yl(D1,f,d),c.lastIndex=f.lastIndex,t;var h=u.groups,g=pE&&c.sticky,v=yl(jne,c),y=c.source,_=0,w=d;if(g&&(v=Kne(v,"y",""),Wne(v,"g")===-1&&(v+="g"),w=L1(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&Gne(d,c.lastIndex-1)!==`
153
153
  `)&&(y="(?: "+y+")",w=" "+w,_++),n=new RegExp("^(?:"+y+")",v)),M1&&(n=new RegExp("^"+y+"$(?!\\s)",v)),k1&&(r=c.lastIndex),s=yl(qh,g?n:c,w),g?s?(s.input=L1(s.input,_),s[0]=L1(s[0],_),s.index=c.lastIndex,c.lastIndex+=s[0].length):c.lastIndex=0:k1&&s&&(c.lastIndex=c.global?s.index+s[0].length:r),M1&&s&&s.length>1&&yl(Hne,s[0],n,function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(s[o]=void 0)}),s&&h)for(s.groups=a=$ne(null),o=0;o<h.length;o++)a[(l=h[o])[0]]=s[l[1]];return s});var Hh=D1;bi({target:"RegExp",proto:!0,forced:/./.exec!==Hh},{exec:Hh});var Jne=wh,gE=Function.prototype,mE=gE.apply,vE=gE.call,bE=typeof Reflect=="object"&&Reflect.apply||(Jne?vE.bind(mE):function(){return vE.apply(mE,arguments)}),Yne=vl,Xne=Xt,F1=function(e){if(Yne(e)==="Function")return Xne(e)},yE=F1,_E=fr,Zne=Hh,wE=tn,CE=pn,Qne=wu,eie=CE("species"),B1=RegExp.prototype,j1=Xt,tie=Bh,nie=ua,iie=Ch,rie=j1("".charAt),SE=j1("".charCodeAt),sie=j1("".slice),EE=function(e){return function(t,n){var r,s,o=nie(iie(t)),a=tie(n),l=o.length;return a<0||a>=l?e?"":void 0:(r=SE(o,a))<55296||r>56319||a+1===l||(s=SE(o,a+1))<56320||s>57343?e?rie(o,a):r:e?sie(o,a,a+2):s-56320+(r-55296<<10)+65536}},U1={codeAt:EE(!1),charAt:EE(!0)},oie=U1.charAt,$1=Xt,aie=la,lie=Math.floor,V1=$1("".charAt),cie=$1("".replace),z1=$1("".slice),uie=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,die=/\$([$&'`]|\d{1,2})/g,xE=In,fie=Un,hie=an,pie=vl,gie=Hh,mie=TypeError,vie=bE,AE=In,Gh=Xt,bie=tn,yie=Un,_ie=an,wie=mu,Cie=Bh,Sie=Q5,_l=ua,Eie=Ch,xie=function(e,t,n){return t+(n?oie(e,t).length:1)},Aie=Nh,Pie=function(e,t,n,r,s,o){var a=n+e.length,l=r.length,c=die;return s!==void 0&&(s=aie(s),c=uie),cie(o,c,function(u,d){var f;switch(V1(d,0)){case"$":return"$";case"&":return e;case"`":return z1(t,0,n);case"'":return z1(t,a);case"<":f=s[z1(d,1,-1)];break;default:var h=+d;if(h===0)return u;if(h>l){var g=lie(h/10);return g===0?u:g<=l?r[g-1]===void 0?V1(d,1):r[g-1]+V1(d,1):u}f=r[h-1]}return f===void 0?"":f})},Tie=function(e,t){var n=e.exec;if(hie(n)){var r=xE(n,e,t);return r!==null&&fie(r),r}if(pie(e)==="RegExp")return xE(gie,e,t);throw new mie("RegExp#exec called on incompatible receiver")},q1=pn("replace"),Oie=Math.max,Nie=Math.min,Iie=Gh([].concat),H1=Gh([].push),PE=Gh("".indexOf),TE=Gh("".slice),Rie="a".replace(/./,"$0")==="$0",OE=!!/./[q1]&&/./[q1]("a","$0")==="";(function(e,t,n,r){var s=CE(e),o=!wE(function(){var u={};return u[s]=function(){return 7},""[e](u)!==7}),a=o&&!wE(function(){var u=!1,d=/a/;return e==="split"&&((d={}).constructor={},d.constructor[eie]=function(){return d},d.flags="",d[s]=/./[s]),d.exec=function(){return u=!0,null},d[s](""),!u});if(!o||!a||n){var l=yE(/./[s]),c=t(s,""[e],function(u,d,f,h,g){var v=yE(u),y=d.exec;return y===Zne||y===B1.exec?o&&!g?{done:!0,value:l(d,f,h)}:{done:!0,value:v(f,d,h)}:{done:!1}});_E(String.prototype,e,c[0]),_E(B1,s,c[1])}r&&Qne(B1[s],"sham",!0)})("replace",function(e,t,n){var r=OE?"$":"$0";return[function(s,o){var a=Eie(this),l=wie(s)?void 0:Aie(s,q1);return l?AE(l,s,a,o):AE(t,_l(a),s,o)},function(s,o){var a=yie(this),l=_l(s);if(typeof o=="string"&&PE(o,r)===-1&&PE(o,"$<")===-1){var c=n(t,a,l,o);if(c.done)return c.value}var u=_ie(o);u||(o=_l(o));var d,f=a.global;f&&(d=a.unicode,a.lastIndex=0);for(var h,g=[];(h=Tie(a,l))!==null&&(H1(g,h),f);)_l(h[0])===""&&(a.lastIndex=xie(l,Sie(a.lastIndex),d));for(var v,y="",_=0,w=0;w<g.length;w++){for(var A,C=_l((h=g[w])[0]),S=Oie(Nie(Cie(h.index),l.length),0),x=[],T=1;T<h.length;T++)H1(x,(v=h[T])===void 0?v:String(v));var N=h.groups;if(u){var I=Iie([C],x,S,l);N!==void 0&&H1(I,N),A=_l(vie(o,void 0,I))}else A=Pie(C,l,S,x,N,o);S>=_&&(y+=TE(l,_,S)+A,_=S+C.length)}return y+TE(l,_)}]},!!bie(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"})||!Rie||OE);var Die=pn,Lie=Vh,kie=Ur.f,G1=Die("unscopables"),W1=Array.prototype;W1[G1]===void 0&&kie(W1,G1,{configurable:!0,value:Lie(null)});var da,NE,IE,xu={},Mie=!tn(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Fie=vi,Bie=an,jie=la,Uie=Mie,RE=u1("IE_PROTO"),K1=Object,$ie=K1.prototype,J1=Uie?K1.getPrototypeOf:function(e){var t=jie(e);if(Fie(t,RE))return t[RE];var n=t.constructor;return Bie(n)&&t instanceof n?n.prototype:t instanceof K1?$ie:null},Vie=tn,zie=an,qie=Mi,DE=J1,Hie=fr,Y1=pn("iterator"),LE=!1;[].keys&&("next"in(IE=[].keys())?(NE=DE(DE(IE)))!==Object.prototype&&(da=NE):LE=!0);var Gie=!qie(da)||Vie(function(){var e={};return da[Y1].call(e)!==e});Gie&&(da={}),zie(da[Y1])||Hie(da,Y1,function(){return this});var X1={IteratorPrototype:da,BUGGY_SAFARI_ITERATORS:LE},Wie=Ur.f,Kie=vi,kE=pn("toStringTag"),wl=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Kie(e,kE)&&Wie(e,kE,{configurable:!0,value:t})},Jie=X1.IteratorPrototype,Yie=Vh,Xie=_u,Zie=wl,Qie=xu,ere=function(){return this},ME=function(e,t,n,r){var s=t+" Iterator";return e.prototype=Yie(Jie,{next:Xie(+!r,n)}),Zie(e,s,!1),Qie[s]=ere,e},tre=Xt,nre=fo,ire=Mi,rre=String,sre=TypeError,ore=Un,are=function(e){if(function(t){return ire(t)||t===null}(e))return e;throw new sre("Can't set "+rre(e)+" as a prototype")},FE=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=function(r,s,o){try{return tre(nre(Object.getOwnPropertyDescriptor(r,s)[o]))}catch(a){}}(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(r){}return function(r,s){return ore(r),are(s),t?e(r,s):r.__proto__=s,r}}():void 0),lre=bi,cre=In,ure=an,dre=ME,BE=J1,jE=FE,fre=wl,hre=wu,Z1=fr,pre=xu,gre=vu.PROPER,mre=vu.CONFIGURABLE,UE=X1.IteratorPrototype,Wh=X1.BUGGY_SAFARI_ITERATORS,Au=pn("iterator"),$E="keys",Pu="values",VE="entries",vre=function(){return this},zE=function(e,t,n,r,s,o,a){dre(n,t,r);var l,c,u,d=function(w){if(w===s&&y)return y;if(!Wh&&w&&w in g)return g[w];switch(w){case $E:case Pu:case VE:return function(){return new n(this,w)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,g=e.prototype,v=g[Au]||g["@@iterator"]||s&&g[s],y=!Wh&&v||d(s),_=t==="Array"&&g.entries||v;if(_&&(l=BE(_.call(new e)))!==Object.prototype&&l.next&&(BE(l)!==UE&&(jE?jE(l,UE):ure(l[Au])||Z1(l,Au,vre)),fre(l,f,!0)),gre&&s===Pu&&v&&v.name!==Pu&&(mre?hre(g,"name",Pu):(h=!0,y=function(){return cre(v,this)})),s)if(c={values:d(Pu),keys:o?y:d($E),entries:d(VE)},a)for(u in c)(Wh||h||!(u in g))&&Z1(g,u,c[u]);else lre({target:t,proto:!0,forced:Wh||h},c);return g[Au]!==y&&Z1(g,Au,y,{name:s}),pre[t]=y,c},Q1=function(e,t){return{value:e,done:t}},bre=bl,eb=function(e){W1[G1][e]=!0},qE=xu,HE=ho,yre=Ur.f,_re=zE,Kh=Q1,wre=Nn,GE="Array Iterator",Cre=HE.set,Sre=HE.getterFor(GE),Ere=_re(Array,"Array",function(e,t){Cre(this,{type:GE,target:bre(e),index:0,kind:t})},function(){var e=Sre(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Kh(void 0,!0);switch(e.kind){case"keys":return Kh(n,!1);case"values":return Kh(t[n],!1)}return Kh([n,t[n]],!1)},"values"),WE=qE.Arguments=qE.Array;if(eb("keys"),eb("values"),eb("entries"),wre&&WE.name!=="values")try{yre(WE,"name",{value:"values"})}catch(e){}var xre=Eu,Are=E1?{}.toString:function(){return"[object "+xre(this)+"]"};E1||fr(Object.prototype,"toString",Are,{unsafe:!0});var Pre=U1.charAt,Tre=ua,KE=ho,Ore=zE,JE=Q1,YE="String Iterator",Nre=KE.set,Ire=KE.getterFor(YE);Ore(String,"String",function(e){Nre(this,{type:YE,string:Tre(e),index:0})},function(){var e,t=Ire(this),n=t.string,r=t.index;return r>=n.length?JE(void 0,!0):(e=Pre(n,r),t.index+=e.length,JE(e,!1))});var tb=Eh("span").classList,XE=tb&&tb.constructor&&tb.constructor.prototype,Rre=XE===Object.prototype?void 0:XE,ZE=nn,QE={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Dre=Rre,Tu=Ere,ex=wu,Lre=wl,nb=pn("iterator"),ib=Tu.values,tx=function(e,t){if(e){if(e[nb]!==ib)try{ex(e,nb,ib)}catch(r){e[nb]=ib}if(Lre(e,t,!0),QE[t]){for(var n in Tu)if(e[n]!==Tu[n])try{ex(e,n,Tu[n])}catch(r){e[n]=Tu[n]}}}};for(var rb in QE)tx(ZE[rb]&&ZE[rb].prototype,rb);tx(Dre,"DOMTokenList");var kre=tn,Mre=Nn,Fre=pn("iterator"),nx=!kre(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),r="";return e.pathname="c%20d",t.forEach(function(s,o){t.delete("b"),r+=o+s}),n.delete("a",2),n.delete("b",void 0),!t.size&&!Mre||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Fre]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||r!=="a1c3"||new URL("http://x",void 0).host!=="x"}),Bre=fo,jre=wh,Ure=F1(F1.bind),fa=function(e,t){return Bre(e),t===void 0?e:jre?Ure(e,t):function(){return e.apply(t,arguments)}},$re=Ah,Vre=TypeError,sb=function(e,t){if($re(t,e))return e;throw new Vre("Incorrect invocation")},ix=Nn,zre=Xt,qre=In,Hre=tn,ob=T1,Gre=C1,Wre=Fh,Kre=la,Jre=y1,Cl=Object.assign,rx=Object.defineProperty,Yre=zre([].concat),Xre=!Cl||Hre(function(){if(ix&&Cl({b:1},Cl(rx({},"a",{enumerable:!0,get:function(){rx(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(s){t[s]=s}),Cl({},e)[n]!==7||ob(Cl({},t)).join("")!==r})?function(e,t){for(var n=Kre(e),r=arguments.length,s=1,o=Gre.f,a=Wre.f;r>s;)for(var l,c=Jre(arguments[s++]),u=o?Yre(ob(c),o(c)):ob(c),d=u.length,f=0;d>f;)l=u[f++],ix&&!qre(a,c,l)||(n[l]=c[l]);return n}:Cl,Zre=In,sx=Un,Qre=Nh,ox=function(e,t,n){var r,s;sx(e);try{if(!(r=Qre(e,"return"))){if(t==="throw")throw n;return n}r=Zre(r,e)}catch(o){s=!0,r=o}if(t==="throw")throw n;if(s)throw r;return sx(r),n},ese=Un,tse=ox,nse=xu,ise=pn("iterator"),rse=Array.prototype,ax=function(e){return e!==void 0&&(nse.Array===e||rse[ise]===e)},sse=Xt,ose=tn,lx=an,ase=Eu,lse=Yv,cx=function(){},cse=[],ux=ca("Reflect","construct"),ab=/^\s*(?:class|function)\b/,use=sse(ab.exec),dse=!ab.test(cx),Ou=function(e){if(!lx(e))return!1;try{return ux(cx,cse,e),!0}catch(t){return!1}},dx=function(e){if(!lx(e))return!1;switch(ase(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return dse||!!use(ab,lse(e))}catch(t){return!0}};dx.sham=!0;var lb=!ux||ose(function(){var e;return Ou(Ou.call)||!Ou(Object)||!Ou(function(){e=!0})||e})?dx:Ou,fse=s1,hse=Ur,pse=_u,fx=function(e,t,n){var r=fse(t);r in e?hse.f(e,r,pse(0,n)):e[r]=n},gse=Eu,hx=Nh,mse=mu,vse=xu,bse=pn("iterator"),Jh=function(e){if(!mse(e))return hx(e,bse)||hx(e,"@@iterator")||vse[gse(e)]},yse=In,_se=fo,wse=Un,Cse=Oh,Sse=Jh,Ese=TypeError,cb=function(e,t){var n=arguments.length<2?Sse(e):t;if(_se(n))return wse(yse(n,e));throw new Ese(Cse(e)+" is not iterable")},xse=fa,Ase=In,Pse=la,Tse=function(e,t,n,r){try{return r?t(ese(n)[0],n[1]):t(n)}catch(s){tse(e,"throw",s)}},Ose=ax,Nse=lb,Ise=Cu,px=fx,Rse=cb,Dse=Jh,gx=Array,ub=Xt([].slice),ha=Xt,db=2147483647,Lse=/[^\0-\u007E]/,mx=/[.\u3002\uFF0E\uFF61]/g,vx="Overflow: input needs wider integers to process",bx=RangeError,kse=ha(mx.exec),Sl=Math.floor,fb=String.fromCharCode,yx=ha("".charCodeAt),_x=ha([].join),po=ha([].push),Mse=ha("".replace),Fse=ha("".split),Bse=ha("".toLowerCase),wx=function(e){return e+22+75*(e<26)},jse=function(e,t,n){var r=0;for(e=n?Sl(e/700):e>>1,e+=Sl(e/t);e>455;)e=Sl(e/35),r+=36;return Sl(r+36*e/(e+38))},Use=function(e){var t=[];e=function(w){for(var A=[],C=0,S=w.length;C<S;){var x=yx(w,C++);if(x>=55296&&x<=56319&&C<S){var T=yx(w,C++);(64512&T)==56320?po(A,((1023&x)<<10)+(1023&T)+65536):(po(A,x),C--)}else po(A,x)}return A}(e);var n,r,s=e.length,o=128,a=0,l=72;for(n=0;n<e.length;n++)(r=e[n])<128&&po(t,fb(r));var c=t.length,u=c;for(c&&po(t,"-");u<s;){var d=db;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<d&&(d=r);var f=u+1;if(d-o>Sl((db-a)/f))throw new bx(vx);for(a+=(d-o)*f,o=d,n=0;n<e.length;n++){if((r=e[n])<o&&++a>db)throw new bx(vx);if(r===o){for(var h=a,g=36;;){var v=g<=l?1:g>=l+26?26:g-l;if(h<v)break;var y=h-v,_=36-v;po(t,fb(wx(v+y%_))),h=Sl(y/_),g+=36}po(t,fb(wx(h))),l=jse(a,f,u===c),a=0,u++}}a++,o++}return _x(t,"")},$se=TypeError,hb=function(e,t){if(e<t)throw new $se("Not enough arguments");return e},Cx=nn,Vse=Nn,zse=Object.getOwnPropertyDescriptor,Sx=function(e){if(!Vse)return Cx[e];var t=zse(Cx,e);return t&&t.value},qse=fr,Ex=ub,Hse=Math.floor,pb=function(e,t){var n=e.length;if(n<8)for(var r,s,o=1;o<n;){for(s=o,r=e[o];s&&t(e[s-1],r)>0;)e[s]=e[--s];s!==o++&&(e[s]=r)}else for(var a=Hse(n/2),l=pb(Ex(e,0,a),t),c=pb(Ex(e,a),t),u=l.length,d=c.length,f=0,h=0;f<u||h<d;)e[f+h]=f<u&&h<d?t(l[f],c[h])<=0?l[f++]:c[h++]:f<u?l[f++]:c[h++];return e},gb=bi,Yh=nn,mb=Sx,Xh=In,Vr=Xt,Nu=Nn,xx=nx,Ax=fr,Gse=Mh,Wse=wl,Kse=ME,vb=ho,Px=sb,bb=an,Jse=vi,Yse=fa,Xse=Eu,Zse=Un,Tx=Mi,Qn=ua,Qse=Vh,Ox=_u,Nx=cb,eoe=Jh,Zh=Q1,El=hb,toe=pb,noe=pn("iterator"),xl="URLSearchParams",Ix=xl+"Iterator",Rx=vb.set,Fi=vb.getterFor(xl),ioe=vb.getterFor(Ix),Dx=mb("fetch"),Qh=mb("Request"),Iu=mb("Headers"),yb=Qh&&Qh.prototype,Lx=Iu&&Iu.prototype,roe=Yh.RegExp,soe=Yh.TypeError,kx=Yh.decodeURIComponent,ooe=Yh.encodeURIComponent,aoe=Vr("".charAt),Mx=Vr([].join),pa=Vr([].push),_b=Vr("".replace),loe=Vr([].shift),Fx=Vr([].splice),Bx=Vr("".split),coe=Vr("".slice),uoe=/\+/g,jx=Array(4),doe=function(e){return jx[e-1]||(jx[e-1]=roe("((?:%[\\da-f]{2}){"+e+"})","gi"))},foe=function(e){try{return kx(e)}catch(t){return e}},Ux=function(e){var t=_b(e,uoe," "),n=4;try{return kx(t)}catch(r){for(;n;)t=_b(t,doe(n--),foe);return t}},hoe=/[!'()~]|%20/g,poe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},goe=function(e){return poe[e]},$x=function(e){return _b(ooe(e),hoe,goe)},wb=Kse(function(e,t){Rx(this,{type:Ix,target:Fi(e).entries,index:0,kind:t})},xl,function(){var e=ioe(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Zh(void 0,!0);var r=t[n];switch(e.kind){case"keys":return Zh(r.key,!1);case"values":return Zh(r.value,!1)}return Zh([r.key,r.value],!1)},!0),Vx=function(e){this.entries=[],this.url=null,e!==void 0&&(Tx(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?aoe(e,0)==="?"?coe(e,1):e:Qn(e)))};Vx.prototype={type:xl,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,s,o,a,l,c=this.entries,u=eoe(e);if(u)for(n=(t=Nx(e,u)).next;!(r=Xh(n,t)).done;){if(o=(s=Nx(Zse(r.value))).next,(a=Xh(o,s)).done||(l=Xh(o,s)).done||!Xh(o,s).done)throw new soe("Expected sequence with length 2");pa(c,{key:Qn(a.value),value:Qn(l.value)})}else for(var d in e)Jse(e,d)&&pa(c,{key:d,value:Qn(e[d])})},parseQuery:function(e){if(e)for(var t,n,r=this.entries,s=Bx(e,"&"),o=0;o<s.length;)(t=s[o++]).length&&(n=Bx(t,"="),pa(r,{key:Ux(loe(n)),value:Ux(Mx(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],pa(n,$x(e.key)+"="+$x(e.value));return Mx(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ep=function(){Px(this,Al);var e=Rx(this,new Vx(arguments.length>0?arguments[0]:void 0));Nu||(this.size=e.entries.length)},Al=ep.prototype;if(function(e,t,n){for(var r in t)qse(e,r,t[r],n)}(Al,{append:function(e,t){var n=Fi(this);El(arguments.length,2),pa(n.entries,{key:Qn(e),value:Qn(t)}),Nu||this.length++,n.updateURL()},delete:function(e){for(var t=Fi(this),n=El(arguments.length,1),r=t.entries,s=Qn(e),o=n<2?void 0:arguments[1],a=o===void 0?o:Qn(o),l=0;l<r.length;){var c=r[l];if(c.key!==s||a!==void 0&&c.value!==a)l++;else if(Fx(r,l,1),a!==void 0)break}Nu||(this.size=r.length),t.updateURL()},get:function(e){var t=Fi(this).entries;El(arguments.length,1);for(var n=Qn(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){var t=Fi(this).entries;El(arguments.length,1);for(var n=Qn(e),r=[],s=0;s<t.length;s++)t[s].key===n&&pa(r,t[s].value);return r},has:function(e){for(var t=Fi(this).entries,n=El(arguments.length,1),r=Qn(e),s=n<2?void 0:arguments[1],o=s===void 0?s:Qn(s),a=0;a<t.length;){var l=t[a++];if(l.key===r&&(o===void 0||l.value===o))return!0}return!1},set:function(e,t){var n=Fi(this);El(arguments.length,1);for(var r,s=n.entries,o=!1,a=Qn(e),l=Qn(t),c=0;c<s.length;c++)(r=s[c]).key===a&&(o?Fx(s,c--,1):(o=!0,r.value=l));o||pa(s,{key:a,value:l}),Nu||(this.size=s.length),n.updateURL()},sort:function(){var e=Fi(this);toe(e.entries,function(t,n){return t.key>n.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,n=Fi(this).entries,r=Yse(e,arguments.length>1?arguments[1]:void 0),s=0;s<n.length;)r((t=n[s++]).value,t.key,this)},keys:function(){return new wb(this,"keys")},values:function(){return new wb(this,"values")},entries:function(){return new wb(this,"entries")}},{enumerable:!0}),Ax(Al,noe,Al.entries,{name:"entries"}),Ax(Al,"toString",function(){return Fi(this).serialize()},{enumerable:!0}),Nu&&Gse(Al,"size",{get:function(){return Fi(this).entries.length},configurable:!0,enumerable:!0}),Wse(ep,xl),gb({global:!0,constructor:!0,forced:!xx},{URLSearchParams:ep}),!xx&&bb(Iu)){var moe=Vr(Lx.has),voe=Vr(Lx.set),zx=function(e){if(Tx(e)){var t,n=e.body;if(Xse(n)===xl)return t=e.headers?new Iu(e.headers):new Iu,moe(t,"content-type")||voe(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Qse(e,{body:Ox(0,Qn(n)),headers:Ox(0,t)})}return e};if(bb(Dx)&&gb({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Dx(e,arguments.length>1?zx(arguments[1]):{})}}),bb(Qh)){var Cb=function(e){return Px(this,yb),new Qh(e,arguments.length>1?zx(arguments[1]):{})};yb.constructor=Cb,Cb.prototype=yb,gb({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Cb})}}var Bi,boe=bi,Sb=Nn,yoe=nx,Eb=nn,qx=fa,ji=Xt,tp=fr,Ui=Mh,_oe=sb,xb=vi,Ab=Xre,Pl=function(e){var t=Pse(e),n=Nse(this),r=arguments.length,s=r>1?arguments[1]:void 0,o=s!==void 0;o&&(s=xse(s,r>2?arguments[2]:void 0));var a,l,c,u,d,f,h=Dse(t),g=0;if(!h||this===gx&&Ose(h))for(a=Ise(t),l=n?new this(a):gx(a);a>g;g++)f=o?s(t[g],g):t[g],px(l,g,f);else for(d=(u=Rse(t,h)).next,l=n?new this:[];!(c=Ase(d,u)).done;g++)f=o?Tse(u,s,[c.value,g],!0):c.value,px(l,g,f);return l.length=g,l},hr=ub,woe=U1.codeAt,Ps=ua,Coe=wl,Soe=hb,Hx={URLSearchParams:ep,getState:Fi},Gx=ho,Eoe=Gx.set,np=Gx.getterFor("URL"),xoe=Hx.URLSearchParams,Aoe=Hx.getState,Ru=Eb.URL,Pb=Eb.TypeError,ip=Eb.parseInt,Poe=Math.floor,Wx=Math.pow,$i=ji("".charAt),pr=ji(/./.exec),Du=ji([].join),Toe=ji(1 .toString),Ooe=ji([].pop),Tl=ji([].push),Tb=ji("".replace),Noe=ji([].shift),Ioe=ji("".split),Lu=ji("".slice),rp=ji("".toLowerCase),Roe=ji([].unshift),Ob="Invalid scheme",ga="Invalid host",Kx="Invalid port",Jx=/[a-z]/i,Doe=/[\d+-.a-z]/i,Nb=/\d/,Loe=/^0x/i,koe=/^[0-7]+$/,Moe=/^\d+$/,Yx=/^[\da-f]+$/i,Foe=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Boe=/[\0\t\n\r #/:<>?@[\\\]^|]/,joe=/^[\u0000-\u0020]+/,Uoe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,$oe=/[\t\n\r]/g,ku=function(e){var t,n,r,s;if(typeof e=="number"){for(t=[],n=0;n<4;n++)Roe(t,e%256),e=Poe(e/256);return Du(t,".")}if(typeof e=="object"){for(t="",r=function(o){for(var a=null,l=1,c=null,u=0,d=0;d<8;d++)o[d]!==0?(u>l&&(a=c,l=u),c=null,u=0):(c===null&&(c=d),++u);return u>l&&(a=c,l=u),a}(e),n=0;n<8;n++)s&&e[n]===0||(s&&(s=!1),r===n?(t+=n?":":"::",s=!0):(t+=Toe(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},sp={},Xx=Ab({},sp,{" ":1,'"':1,"<":1,">":1,"`":1}),Zx=Ab({},Xx,{"#":1,"?":1,"{":1,"}":1}),Ib=Ab({},Zx,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),go=function(e,t){var n=woe(e,0);return n>32&&n<127&&!xb(t,e)?e:encodeURIComponent(e)},op={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Mu=function(e,t){var n;return e.length===2&&pr(Jx,$i(e,0))&&((n=$i(e,1))===":"||!t&&n==="|")},Qx=function(e){var t;return e.length>1&&Mu(Lu(e,0,2))&&(e.length===2||(t=$i(e,2))==="/"||t==="\\"||t==="?"||t==="#")},Voe=function(e){return e==="."||rp(e)==="%2e"},Rb={},e7={},Db={},t7={},n7={},Lb={},i7={},r7={},ap={},lp={},kb={},Mb={},Fb={},Bb={},s7={},jb={},Ol={},zr={},o7={},ma={},Ts={},Ub=function(e,t,n){var r,s,o,a=Ps(e);if(t){if(s=this.parse(a))throw new Pb(s);this.searchParams=null}else{if(n!==void 0&&(r=new Ub(n,!0)),s=this.parse(a,null,r))throw new Pb(s);(o=Aoe(new xoe)).bindURL(this),this.searchParams=o}};Ub.prototype={type:"URL",parse:function(e,t,n){var r,s,o,a,l,c=this,u=t||Rb,d=0,f="",h=!1,g=!1,v=!1;for(e=Ps(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=Tb(e,joe,""),e=Tb(e,Uoe,"$1")),e=Tb(e,$oe,""),r=Pl(e);d<=r.length;){switch(s=r[d],u){case Rb:if(!s||!pr(Jx,s)){if(t)return Ob;u=Db;continue}f+=rp(s),u=e7;break;case e7:if(s&&(pr(Doe,s)||s==="+"||s==="-"||s==="."))f+=rp(s);else{if(s!==":"){if(t)return Ob;f="",u=Db,d=0;continue}if(t&&(c.isSpecial()!==xb(op,f)||f==="file"&&(c.includesCredentials()||c.port!==null)||c.scheme==="file"&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&op[c.scheme]===c.port&&(c.port=null));f="",c.scheme==="file"?u=Bb:c.isSpecial()&&n&&n.scheme===c.scheme?u=t7:c.isSpecial()?u=r7:r[d+1]==="/"?(u=n7,d++):(c.cannotBeABaseURL=!0,Tl(c.path,""),u=o7)}break;case Db:if(!n||n.cannotBeABaseURL&&s!=="#")return Ob;if(n.cannotBeABaseURL&&s==="#"){c.scheme=n.scheme,c.path=hr(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=Ts;break}u=n.scheme==="file"?Bb:Lb;continue;case t7:if(s!=="/"||r[d+1]!=="/"){u=Lb;continue}u=ap,d++;break;case n7:if(s==="/"){u=lp;break}u=zr;continue;case Lb:if(c.scheme=n.scheme,s===Bi)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=hr(n.path),c.query=n.query;else if(s==="/"||s==="\\"&&c.isSpecial())u=i7;else if(s==="?")c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=hr(n.path),c.query="",u=ma;else{if(s!=="#"){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=hr(n.path),c.path.length--,u=zr;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=hr(n.path),c.query=n.query,c.fragment="",u=Ts}break;case i7:if(!c.isSpecial()||s!=="/"&&s!=="\\"){if(s!=="/"){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=zr;continue}u=lp}else u=ap;break;case r7:if(u=ap,s!=="/"||$i(f,d+1)!=="/")continue;d++;break;case ap:if(s!=="/"&&s!=="\\"){u=lp;continue}break;case lp:if(s==="@"){h&&(f="%40"+f),h=!0,o=Pl(f);for(var y=0;y<o.length;y++){var _=o[y];if(_!==":"||v){var w=go(_,Ib);v?c.password+=w:c.username+=w}else v=!0}f=""}else if(s===Bi||s==="/"||s==="?"||s==="#"||s==="\\"&&c.isSpecial()){if(h&&f==="")return"Invalid authority";d-=Pl(f).length+1,f="",u=kb}else f+=s;break;case kb:case Mb:if(t&&c.scheme==="file"){u=jb;continue}if(s!==":"||g){if(s===Bi||s==="/"||s==="?"||s==="#"||s==="\\"&&c.isSpecial()){if(c.isSpecial()&&f==="")return ga;if(t&&f===""&&(c.includesCredentials()||c.port!==null))return;if(a=c.parseHost(f))return a;if(f="",u=Ol,t)return;continue}s==="["?g=!0:s==="]"&&(g=!1),f+=s}else{if(f==="")return ga;if(a=c.parseHost(f))return a;if(f="",u=Fb,t===Mb)return}break;case Fb:if(!pr(Nb,s)){if(s===Bi||s==="/"||s==="?"||s==="#"||s==="\\"&&c.isSpecial()||t){if(f!==""){var A=ip(f,10);if(A>65535)return Kx;c.port=c.isSpecial()&&A===op[c.scheme]?null:A,f=""}if(t)return;u=Ol;continue}return Kx}f+=s;break;case Bb:if(c.scheme="file",s==="/"||s==="\\")u=s7;else{if(!n||n.scheme!=="file"){u=zr;continue}switch(s){case Bi:c.host=n.host,c.path=hr(n.path),c.query=n.query;break;case"?":c.host=n.host,c.path=hr(n.path),c.query="",u=ma;break;case"#":c.host=n.host,c.path=hr(n.path),c.query=n.query,c.fragment="",u=Ts;break;default:Qx(Du(hr(r,d),""))||(c.host=n.host,c.path=hr(n.path),c.shortenPath()),u=zr;continue}}break;case s7:if(s==="/"||s==="\\"){u=jb;break}n&&n.scheme==="file"&&!Qx(Du(hr(r,d),""))&&(Mu(n.path[0],!0)?Tl(c.path,n.path[0]):c.host=n.host),u=zr;continue;case jb:if(s===Bi||s==="/"||s==="\\"||s==="?"||s==="#"){if(!t&&Mu(f))u=zr;else if(f===""){if(c.host="",t)return;u=Ol}else{if(a=c.parseHost(f))return a;if(c.host==="localhost"&&(c.host=""),t)return;f="",u=Ol}continue}f+=s;break;case Ol:if(c.isSpecial()){if(u=zr,s!=="/"&&s!=="\\")continue}else if(t||s!=="?")if(t||s!=="#"){if(s!==Bi&&(u=zr,s!=="/"))continue}else c.fragment="",u=Ts;else c.query="",u=ma;break;case zr:if(s===Bi||s==="/"||s==="\\"&&c.isSpecial()||!t&&(s==="?"||s==="#")){if((l=rp(l=f))===".."||l==="%2e."||l===".%2e"||l==="%2e%2e"?(c.shortenPath(),s==="/"||s==="\\"&&c.isSpecial()||Tl(c.path,"")):Voe(f)?s==="/"||s==="\\"&&c.isSpecial()||Tl(c.path,""):(c.scheme==="file"&&!c.path.length&&Mu(f)&&(c.host&&(c.host=""),f=$i(f,0)+":"),Tl(c.path,f)),f="",c.scheme==="file"&&(s===Bi||s==="?"||s==="#"))for(;c.path.length>1&&c.path[0]==="";)Noe(c.path);s==="?"?(c.query="",u=ma):s==="#"&&(c.fragment="",u=Ts)}else f+=go(s,Zx);break;case o7:s==="?"?(c.query="",u=ma):s==="#"?(c.fragment="",u=Ts):s!==Bi&&(c.path[0]+=go(s,sp));break;case ma:t||s!=="#"?s!==Bi&&(s==="'"&&c.isSpecial()?c.query+="%27":c.query+=s==="#"?"%23":go(s,sp)):(c.fragment="",u=Ts);break;case Ts:s!==Bi&&(c.fragment+=go(s,Xx))}d++}},parseHost:function(e){var t,n,r;if($i(e,0)==="["){if($i(e,e.length-1)!=="]"||(t=function(s){var o,a,l,c,u,d,f,h=[0,0,0,0,0,0,0,0],g=0,v=null,y=0,_=function(){return $i(s,y)};if(_()===":"){if($i(s,1)!==":")return;y+=2,v=++g}for(;_();){if(g===8)return;if(_()!==":"){for(o=a=0;a<4&&pr(Yx,_());)o=16*o+ip(_(),16),y++,a++;if(_()==="."){if(a===0||(y-=a,g>6))return;for(l=0;_();){if(c=null,l>0){if(!(_()==="."&&l<4))return;y++}if(!pr(Nb,_()))return;for(;pr(Nb,_());){if(u=ip(_(),10),c===null)c=u;else{if(c===0)return;c=10*c+u}if(c>255)return;y++}h[g]=256*h[g]+c,++l!=2&&l!==4||g++}if(l!==4)return;break}if(_()===":"){if(y++,!_())return}else if(_())return;h[g++]=o}else{if(v!==null)return;y++,v=++g}}if(v!==null)for(d=g-v,g=7;g!==0&&d>0;)f=h[g],h[g--]=h[v+d-1],h[v+--d]=f;else if(g!==8)return;return h}(Lu(e,1,-1)),!t))return ga;this.host=t}else if(this.isSpecial()){if(e=function(s){var o,a,l=[],c=Fse(Mse(Bse(s),mx,"."),".");for(o=0;o<c.length;o++)a=c[o],po(l,kse(Lse,a)?"xn--"+Use(a):a);return _x(l,".")}(e),pr(Foe,e)||(t=function(s){var o,a,l,c,u,d,f,h=Ioe(s,".");if(h.length&&h[h.length-1]===""&&h.length--,(o=h.length)>4)return s;for(a=[],l=0;l<o;l++){if((c=h[l])==="")return s;if(u=10,c.length>1&&$i(c,0)==="0"&&(u=pr(Loe,c)?16:8,c=Lu(c,u===8?1:2)),c==="")d=0;else{if(!pr(u===10?Moe:u===8?koe:Yx,c))return s;d=ip(c,u)}Tl(a,d)}for(l=0;l<o;l++)if(d=a[l],l===o-1){if(d>=Wx(256,5-o))return null}else if(d>255)return null;for(f=Ooe(a),l=0;l<a.length;l++)f+=a[l]*Wx(256,3-l);return f}(e),t===null))return ga;this.host=t}else{if(pr(Boe,e))return ga;for(t="",n=Pl(e),r=0;r<n.length;r++)t+=go(n[r],sp);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return xb(op,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||this.scheme==="file"&&t===1&&Mu(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,s=e.host,o=e.port,a=e.path,l=e.query,c=e.fragment,u=t+":";return s!==null?(u+="//",e.includesCredentials()&&(u+=n+(r?":"+r:"")+"@"),u+=ku(s),o!==null&&(u+=":"+o)):t==="file"&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+Du(a,"/"):"",l!==null&&(u+="?"+l),c!==null&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw new Pb(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Nl(e.path[0]).origin}catch(n){return"null"}return e!=="file"&&this.isSpecial()?e+"://"+ku(this.host)+(t!==null?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ps(e)+":",Rb)},getUsername:function(){return this.username},setUsername:function(e){var t=Pl(Ps(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=go(t[n],Ib)}},getPassword:function(){return this.password},setPassword:function(e){var t=Pl(Ps(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=go(t[n],Ib)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ku(e):ku(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,kb)},getHostname:function(){var e=this.host;return e===null?"":ku(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Mb)},getPort:function(){var e=this.port;return e===null?"":Ps(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||((e=Ps(e))===""?this.port=null:this.parse(e,Fb))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Du(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ol))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){(e=Ps(e))===""?this.query=null:($i(e,0)==="?"&&(e=Lu(e,1)),this.query="",this.parse(e,ma)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){(e=Ps(e))!==""?($i(e,0)==="#"&&(e=Lu(e,1)),this.fragment="",this.parse(e,Ts)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Nl=function(e){var t=_oe(this,ei),n=Soe(arguments.length,1)>1?arguments[1]:void 0,r=Eoe(t,new Ub(e,!1,n));Sb||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},ei=Nl.prototype,Vi=function(e,t){return{get:function(){return np(this)[e]()},set:t&&function(n){return np(this)[t](n)},configurable:!0,enumerable:!0}};if(Sb&&(Ui(ei,"href",Vi("serialize","setHref")),Ui(ei,"origin",Vi("getOrigin")),Ui(ei,"protocol",Vi("getProtocol","setProtocol")),Ui(ei,"username",Vi("getUsername","setUsername")),Ui(ei,"password",Vi("getPassword","setPassword")),Ui(ei,"host",Vi("getHost","setHost")),Ui(ei,"hostname",Vi("getHostname","setHostname")),Ui(ei,"port",Vi("getPort","setPort")),Ui(ei,"pathname",Vi("getPathname","setPathname")),Ui(ei,"search",Vi("getSearch","setSearch")),Ui(ei,"searchParams",Vi("getSearchParams")),Ui(ei,"hash",Vi("getHash","setHash"))),tp(ei,"toJSON",function(){return np(this).serialize()},{enumerable:!0}),tp(ei,"toString",function(){return np(this).serialize()},{enumerable:!0}),Ru){var a7=Ru.createObjectURL,l7=Ru.revokeObjectURL;a7&&tp(Nl,"createObjectURL",qx(a7,Ru)),l7&&tp(Nl,"revokeObjectURL",qx(l7,Ru))}Coe(Nl,"URL"),boe({global:!0,constructor:!0,forced:!yoe,sham:!Sb},{URL:Nl});var zoe=vl,c7=Array.isArray||function(e){return zoe(e)==="Array"},qoe=TypeError,u7=c7,Hoe=lb,Goe=Mi,Woe=pn("species"),d7=Array,f7=function(e,t){return new(function(n){var r;return u7(n)&&(r=n.constructor,(Hoe(r)&&(r===d7||u7(r.prototype))||Goe(r)&&(r=r[Woe])===null)&&(r=void 0)),r===void 0?d7:r}(e))(t===0?0:t)},Koe=tn,Joe=Th,Yoe=pn("species"),h7=function(e){return Joe>=51||!Koe(function(){var t=[];return(t.constructor={})[Yoe]=function(){return{foo:1}},t[e](Boolean).foo!==1})},Xoe=bi,Zoe=tn,Qoe=c7,eae=Mi,tae=la,nae=Cu,p7=function(e){if(e>9007199254740991)throw qoe("Maximum allowed index exceeded");return e},g7=fx,iae=f7,rae=h7,sae=Th,m7=pn("isConcatSpreadable"),oae=sae>=51||!Zoe(function(){var e=[];return e[m7]=!1,e.concat()[0]!==e}),aae=function(e){if(!eae(e))return!1;var t=e[m7];return t!==void 0?!!t:Qoe(e)};Xoe({target:"Array",proto:!0,arity:1,forced:!oae||!rae("concat")},{concat:function(e){var t,n,r,s,o,a=tae(this),l=iae(a,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(aae(o=t===-1?a:arguments[t]))for(s=nae(o),p7(c+s),n=0;n<s;n++,c++)n in o&&g7(l,c,o[n]);else p7(c+1),g7(l,c++,o);return l.length=c,l}});var lae=fa,cae=y1,uae=la,dae=Cu,fae=f7,v7=Xt([].push),mo=function(e){var t=e===1,n=e===2,r=e===3,s=e===4,o=e===6,a=e===7,l=e===5||o;return function(c,u,d,f){for(var h,g,v=uae(c),y=cae(v),_=dae(y),w=lae(u,d),A=0,C=f||fae,S=t?C(c,_):n||a?C(c,0):void 0;_>A;A++)if((l||A in y)&&(g=w(h=y[A],A,v),e))if(t)S[A]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return A;case 2:v7(S,h)}else switch(e){case 4:return!1;case 7:v7(S,h)}return o?-1:r||s?s:S}},hae=[mo(0),mo(1),mo(2),mo(3),mo(4),mo(5),mo(6),mo(7)][1];bi({target:"Array",proto:!0,forced:!h7("map")},{map:function(e){return hae(this,e,arguments.length>1?arguments[1]:void 0)}});var b7=Nn,pae=tn,y7=Xt,gae=J1,mae=T1,vae=bl,_7=y7(Fh.f),bae=y7([].push),yae=b7&&pae(function(){var e=Object.create(null);return e[2]=2,!_7(e,2)}),w7=function(e){return function(t){for(var n,r=vae(t),s=mae(r),o=yae&&gae(r)===null,a=s.length,l=0,c=[];a>l;)n=s[l++],b7&&!(o?n in r:_7(r,n))||bae(c,e?[n,r[n]]:r[n]);return c}},_ae=[w7(!0),w7(!1)][0];bi({target:"Object",stat:!0},{entries:function(e){return _ae(e)}});var wae=In,Cae=vi,Sae=Ah,Eae=oE,C7=RegExp.prototype,xae=vu.PROPER,Aae=fr,Pae=Un,S7=ua,Tae=tn,$b="toString",E7=RegExp.prototype,x7=E7[$b],Oae=Tae(function(){return x7.call({source:"a",flags:"b"})!=="/a/b"}),Nae=xae&&x7.name!==$b;(Oae||Nae)&&Aae(E7,$b,function(){var e=Pae(this);return"/"+S7(e.source)+"/"+S7(function(t){var n=t.flags;return n!==void 0||"flags"in C7||Cae(t,"flags")||!Sae(C7,t)?n:wae(Eae,t)}(e))},{unsafe:!0});var Fu,Il,A7,Vb,cp=vl(nn.process)==="process",Iae=ca,Rae=Mh,Dae=Nn,P7=pn("species"),Lae=lb,kae=Oh,Mae=TypeError,T7=Un,Fae=mu,Bae=pn("species"),O7=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ph),yi=nn,jae=bE,Uae=fa,N7=an,$ae=vi,I7=tn,R7=lE,Vae=ub,D7=Eh,zae=hb,qae=O7,Hae=cp,zb=yi.setImmediate,qb=yi.clearImmediate,Gae=yi.process,Hb=yi.Dispatch,Wae=yi.Function,L7=yi.MessageChannel,Kae=yi.String,Gb=0,Bu={},k7="onreadystatechange";I7(function(){Fu=yi.location});var Wb=function(e){if($ae(Bu,e)){var t=Bu[e];delete Bu[e],t()}},Kb=function(e){return function(){Wb(e)}},M7=function(e){Wb(e.data)},F7=function(e){yi.postMessage(Kae(e),Fu.protocol+"//"+Fu.host)};zb&&qb||(zb=function(e){zae(arguments.length,1);var t=N7(e)?e:Wae(e),n=Vae(arguments,1);return Bu[++Gb]=function(){jae(t,void 0,n)},Il(Gb),Gb},qb=function(e){delete Bu[e]},Hae?Il=function(e){Gae.nextTick(Kb(e))}:Hb&&Hb.now?Il=function(e){Hb.now(Kb(e))}:L7&&!qae?(Vb=(A7=new L7).port2,A7.port1.onmessage=M7,Il=Uae(Vb.postMessage,Vb)):yi.addEventListener&&N7(yi.postMessage)&&!yi.importScripts&&Fu&&Fu.protocol!=="file:"&&!I7(F7)?(Il=F7,yi.addEventListener("message",M7,!1)):Il=k7 in D7("script")?function(e){R7.appendChild(D7("script"))[k7]=function(){R7.removeChild(this),Wb(e)}}:function(e){setTimeout(Kb(e),0)});var B7={set:zb,clear:qb},j7=function(){this.head=null,this.tail=null};j7.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return(this.head=e.next)===null&&(this.tail=null),e.item}};var Rl,Jb,Yb,Xb,U7,$7=j7,Jae=/ipad|iphone|ipod/i.test(Ph)&&typeof Pebble!="undefined",Yae=/web0s(?!.*chrome)/i.test(Ph),Dl=nn,Xae=Sx,V7=fa,Zb=B7.set,Zae=$7,Qae=O7,ele=Jae,tle=Yae,Qb=cp,z7=Dl.MutationObserver||Dl.WebKitMutationObserver,q7=Dl.document,H7=Dl.process,up=Dl.Promise,ey=Xae("queueMicrotask");if(!ey){var dp=new Zae,fp=function(){var e,t;for(Qb&&(e=H7.domain)&&e.exit();t=dp.get();)try{t()}catch(n){throw dp.head&&Rl(),n}e&&e.enter()};Qae||Qb||tle||!z7||!q7?!ele&&up&&up.resolve?((Xb=up.resolve(void 0)).constructor=up,U7=V7(Xb.then,Xb),Rl=function(){U7(fp)}):Qb?Rl=function(){H7.nextTick(fp)}:(Zb=V7(Zb,Dl),Rl=function(){Zb(fp)}):(Jb=!0,Yb=q7.createTextNode(""),new z7(fp).observe(Yb,{characterData:!0}),Rl=function(){Yb.data=Jb=!Jb}),ey=function(e){dp.head||Rl(),dp.add(e)}}var nle=ey,ty=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},hp=nn.Promise,G7=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",ile=!G7&&!cp&&typeof window=="object"&&typeof document=="object",rle=nn,ju=hp,sle=an,ole=rE,ale=Yv,lle=pn,cle=ile,ule=G7,ny=Th;ju&&ju.prototype;var dle=lle("species"),W7=!1,K7=sle(rle.PromiseRejectionEvent),fle=ole("Promise",function(){var e=ale(ju),t=e!==String(ju);if(!t&&ny===66)return!0;if(!ny||ny<51||!/native code/.test(e)){var n=new ju(function(s){s(1)}),r=function(s){s(function(){},function(){})};if((n.constructor={})[dle]=r,!(W7=n.then(function(){})instanceof r))return!0}return!t&&(cle||ule)&&!K7}),va={CONSTRUCTOR:fle,REJECTION_EVENT:K7,SUBCLASSING:W7},Ll={},J7=fo,hle=TypeError,ple=function(e){var t,n;this.promise=new e(function(r,s){if(t!==void 0||n!==void 0)throw new hle("Bad Promise constructor");t=r,n=s}),this.resolve=J7(t),this.reject=J7(n)};Ll.f=function(e){return new ple(e)};var iy,Y7,X7,gle=bi,pp=cp,vo=nn,kl=In,Z7=fr,Q7=FE,mle=wl,vle=fo,gp=an,ble=Mi,yle=sb,_le=function(e,t){var n,r=T7(e).constructor;return r===void 0||Fae(n=T7(r)[Bae])?t:function(s){if(Lae(s))return s;throw new Mae(kae(s)+" is not a constructor")}(n)},eA=B7.set,ry=nle,wle=ty,Cle=$7,tA=ho,mp=hp,nA=Ll,vp="Promise",iA=va.CONSTRUCTOR,Sle=va.REJECTION_EVENT,Ele=va.SUBCLASSING,sy=tA.getterFor(vp),xle=tA.set,Ml=mp&&mp.prototype,Fl=mp,bp=Ml,rA=vo.TypeError,oy=vo.document,ay=vo.process,ly=nA.f,Ale=ly,Ple=!!(oy&&oy.createEvent&&vo.dispatchEvent),sA="unhandledrejection",oA=function(e){var t;return!(!ble(e)||!gp(t=e.then))&&t},aA=function(e,t){var n,r,s,o=t.value,a=t.state===1,l=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{l?(a||(t.rejection===2&&Ole(t),t.rejection=1),l===!0?n=o:(d&&d.enter(),n=l(o),d&&(d.exit(),s=!0)),n===e.promise?u(new rA("Promise-chain cycle")):(r=oA(n))?kl(r,n,c,u):c(n)):u(o)}catch(f){d&&!s&&d.exit(),u(f)}},lA=function(e,t){e.notified||(e.notified=!0,ry(function(){for(var n,r=e.reactions;n=r.get();)aA(n,e);e.notified=!1,t&&!e.rejection&&Tle(e)}))},cA=function(e,t,n){var r,s;Ple?((r=oy.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),vo.dispatchEvent(r)):r={promise:t,reason:n},!Sle&&(s=vo["on"+e])?s(r):e===sA&&function(o,a){try{arguments.length===1?console.error(o):console.error(o,a)}catch(l){}}("Unhandled promise rejection",n)},Tle=function(e){kl(eA,vo,function(){var t,n=e.facade,r=e.value;if(uA(e)&&(t=wle(function(){pp?ay.emit("unhandledRejection",r,n):cA(sA,n,r)}),e.rejection=pp||uA(e)?2:1,t.error))throw t.value})},uA=function(e){return e.rejection!==1&&!e.parent},Ole=function(e){kl(eA,vo,function(){var t=e.facade;pp?ay.emit("rejectionHandled",t):cA("rejectionhandled",t,e.value)})},Bl=function(e,t,n){return function(r){e(t,r,n)}},jl=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,lA(e,!0))},cy=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new rA("Promise can't be resolved itself");var r=oA(t);r?ry(function(){var s={done:!1};try{kl(r,t,Bl(cy,s,e),Bl(jl,s,e))}catch(o){jl(s,o,e)}}):(e.value=t,e.state=1,lA(e,!1))}catch(s){jl({done:!1},s,e)}}};if(iA&&(bp=(Fl=function(e){yle(this,bp),vle(e),kl(iy,this);var t=sy(this);try{e(Bl(cy,t),Bl(jl,t))}catch(n){jl(t,n)}}).prototype,(iy=function(e){xle(this,{type:vp,done:!1,notified:!1,parent:!1,reactions:new Cle,rejection:!1,state:0,value:void 0})}).prototype=Z7(bp,"then",function(e,t){var n=sy(this),r=ly(_le(this,Fl));return n.parent=!0,r.ok=!gp(e)||e,r.fail=gp(t)&&t,r.domain=pp?ay.domain:void 0,n.state===0?n.reactions.add(r):ry(function(){aA(r,n)}),r.promise}),Y7=function(){var e=new iy,t=sy(e);this.promise=e,this.resolve=Bl(cy,t),this.reject=Bl(jl,t)},nA.f=ly=function(e){return e===Fl||e===void 0?new Y7(e):Ale(e)},gp(mp)&&Ml!==Object.prototype)){X7=Ml.then,Ele||Z7(Ml,"then",function(e,t){var n=this;return new Fl(function(r,s){kl(X7,n,r,s)}).then(e,t)},{unsafe:!0});try{delete Ml.constructor}catch(e){}Q7&&Q7(Ml,bp)}gle({global:!0,constructor:!0,wrap:!0,forced:iA},{Promise:Fl}),mle(Fl,vp,!1),function(e){var t=Iae(e);Dae&&t&&!t[P7]&&Rae(t,P7,{configurable:!0,get:function(){return this}})}(vp);var Nle=fa,Ile=In,Rle=Un,Dle=Oh,Lle=ax,kle=Cu,dA=Ah,Mle=cb,Fle=Jh,fA=ox,Ble=TypeError,yp=function(e,t){this.stopped=e,this.result=t},hA=yp.prototype,pA=function(e,t,n){var r,s,o,a,l,c,u,d=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),g=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),y=Nle(t,d),_=function(A){return r&&fA(r,"normal",A),new yp(!0,A)},w=function(A){return f?(Rle(A),v?y(A[0],A[1],_):y(A[0],A[1])):v?y(A,_):y(A)};if(h)r=e.iterator;else if(g)r=e;else{if(!(s=Fle(e)))throw new Ble(Dle(e)+" is not iterable");if(Lle(s)){for(o=0,a=kle(e);a>o;o++)if((l=w(e[o]))&&dA(hA,l))return l;return new yp(!1)}r=Mle(e,s)}for(c=h?e.next:r.next;!(u=Ile(c,r)).done;){try{l=w(u.value)}catch(A){fA(r,"throw",A)}if(typeof l=="object"&&l&&dA(hA,l))return l}return new yp(!1)},gA=pn("iterator"),mA=!1;try{var jle=0,vA={next:function(){return{done:!!jle++}},return:function(){mA=!0}};vA[gA]=function(){return this},Array.from(vA,function(){throw 2})}catch(e){}var Ule=hp,bA=va.CONSTRUCTOR||!function(e,t){try{if(!t&&!mA)return!1}catch(s){return!1}var n=!1;try{var r={};r[gA]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(s){}return n}(function(e){Ule.all(e).then(void 0,function(){})}),$le=In,Vle=fo,zle=Ll,qle=ty,Hle=pA;bi({target:"Promise",stat:!0,forced:bA},{all:function(e){var t=this,n=zle.f(t),r=n.resolve,s=n.reject,o=qle(function(){var a=Vle(t.resolve),l=[],c=0,u=1;Hle(e,function(d){var f=c++,h=!1;u++,$le(a,t,d).then(function(g){h||(h=!0,l[f]=g,--u||r(l))},s)}),--u||r(l)});return o.error&&s(o.value),n.promise}});var Gle=bi,Wle=va.CONSTRUCTOR,uy=hp,Kle=ca,Jle=an,Yle=fr,yA=uy&&uy.prototype;if(Gle({target:"Promise",proto:!0,forced:Wle,real:!0},{catch:function(e){return this.then(void 0,e)}}),Jle(uy)){var _A=Kle("Promise").prototype.catch;yA.catch!==_A&&Yle(yA,"catch",_A,{unsafe:!0})}var Xle=In,Zle=fo,Qle=Ll,ece=ty,tce=pA;bi({target:"Promise",stat:!0,forced:bA},{race:function(e){var t=this,n=Qle.f(t),r=n.reject,s=ece(function(){var o=Zle(t.resolve);tce(e,function(a){Xle(o,t,a).then(n.resolve,r)})});return s.error&&r(s.value),n.promise}});var nce=Ll;bi({target:"Promise",stat:!0,forced:va.CONSTRUCTOR},{reject:function(e){var t=nce.f(this);return(0,t.reject)(e),t.promise}});var ice=Un,rce=Mi,sce=Ll,oce=bi,ace=va.CONSTRUCTOR;ca("Promise"),oce({target:"Promise",stat:!0,forced:ace},{resolve:function(e){return function(t,n){if(ice(t),rce(n)&&n.constructor===t)return n;var r=sce.f(t);return(0,r.resolve)(n),r.promise}(this,e)}});var _p,Uu,wA={exports:{}},CA={exports:{}};_p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Uu={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&Uu.rotl(e,8)|4278255360&Uu.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=Uu.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],s=0;s<4;s++)8*n+6*s<=8*e.length?t.push(_p.charAt(r>>>6*(3-s)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)r!=0&&t.push((_p.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|_p.indexOf(e.charAt(n))>>>6-2*r);return t}},CA.exports=Uu;var lce=CA.exports,dy={utf8:{stringToBytes:function(e){return dy.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(dy.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},SA=dy,cce=function(e){return e!=null&&(EA(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&EA(t.slice(0,0))}(e)||!!e._isBuffer)};function EA(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}(function(){var e=lce,t=SA.utf8,n=cce,r=SA.bin,s=function(o,a){o.constructor==String?o=a&&a.encoding==="binary"?r.stringToBytes(o):t.stringToBytes(o):n(o)?o=Array.prototype.slice.call(o,0):Array.isArray(o)||o.constructor===Uint8Array||(o=o.toString());for(var l=e.bytesToWords(o),c=8*o.length,u=1732584193,d=-271733879,f=-1732584194,h=271733878,g=0;g<l.length;g++)l[g]=16711935&(l[g]<<8|l[g]>>>24)|4278255360&(l[g]<<24|l[g]>>>8);l[c>>>5]|=128<<c%32,l[14+(c+64>>>9<<4)]=c;var v=s._ff,y=s._gg,_=s._hh,w=s._ii;for(g=0;g<l.length;g+=16){var A=u,C=d,S=f,x=h;u=v(u,d,f,h,l[g+0],7,-680876936),h=v(h,u,d,f,l[g+1],12,-389564586),f=v(f,h,u,d,l[g+2],17,606105819),d=v(d,f,h,u,l[g+3],22,-1044525330),u=v(u,d,f,h,l[g+4],7,-176418897),h=v(h,u,d,f,l[g+5],12,1200080426),f=v(f,h,u,d,l[g+6],17,-1473231341),d=v(d,f,h,u,l[g+7],22,-45705983),u=v(u,d,f,h,l[g+8],7,1770035416),h=v(h,u,d,f,l[g+9],12,-1958414417),f=v(f,h,u,d,l[g+10],17,-42063),d=v(d,f,h,u,l[g+11],22,-1990404162),u=v(u,d,f,h,l[g+12],7,1804603682),h=v(h,u,d,f,l[g+13],12,-40341101),f=v(f,h,u,d,l[g+14],17,-1502002290),u=y(u,d=v(d,f,h,u,l[g+15],22,1236535329),f,h,l[g+1],5,-165796510),h=y(h,u,d,f,l[g+6],9,-1069501632),f=y(f,h,u,d,l[g+11],14,643717713),d=y(d,f,h,u,l[g+0],20,-373897302),u=y(u,d,f,h,l[g+5],5,-701558691),h=y(h,u,d,f,l[g+10],9,38016083),f=y(f,h,u,d,l[g+15],14,-660478335),d=y(d,f,h,u,l[g+4],20,-405537848),u=y(u,d,f,h,l[g+9],5,568446438),h=y(h,u,d,f,l[g+14],9,-1019803690),f=y(f,h,u,d,l[g+3],14,-187363961),d=y(d,f,h,u,l[g+8],20,1163531501),u=y(u,d,f,h,l[g+13],5,-1444681467),h=y(h,u,d,f,l[g+2],9,-51403784),f=y(f,h,u,d,l[g+7],14,1735328473),u=_(u,d=y(d,f,h,u,l[g+12],20,-1926607734),f,h,l[g+5],4,-378558),h=_(h,u,d,f,l[g+8],11,-2022574463),f=_(f,h,u,d,l[g+11],16,1839030562),d=_(d,f,h,u,l[g+14],23,-35309556),u=_(u,d,f,h,l[g+1],4,-1530992060),h=_(h,u,d,f,l[g+4],11,1272893353),f=_(f,h,u,d,l[g+7],16,-155497632),d=_(d,f,h,u,l[g+10],23,-1094730640),u=_(u,d,f,h,l[g+13],4,681279174),h=_(h,u,d,f,l[g+0],11,-358537222),f=_(f,h,u,d,l[g+3],16,-722521979),d=_(d,f,h,u,l[g+6],23,76029189),u=_(u,d,f,h,l[g+9],4,-640364487),h=_(h,u,d,f,l[g+12],11,-421815835),f=_(f,h,u,d,l[g+15],16,530742520),u=w(u,d=_(d,f,h,u,l[g+2],23,-995338651),f,h,l[g+0],6,-198630844),h=w(h,u,d,f,l[g+7],10,1126891415),f=w(f,h,u,d,l[g+14],15,-1416354905),d=w(d,f,h,u,l[g+5],21,-57434055),u=w(u,d,f,h,l[g+12],6,1700485571),h=w(h,u,d,f,l[g+3],10,-1894986606),f=w(f,h,u,d,l[g+10],15,-1051523),d=w(d,f,h,u,l[g+1],21,-2054922799),u=w(u,d,f,h,l[g+8],6,1873313359),h=w(h,u,d,f,l[g+15],10,-30611744),f=w(f,h,u,d,l[g+6],15,-1560198380),d=w(d,f,h,u,l[g+13],21,1309151649),u=w(u,d,f,h,l[g+4],6,-145523070),h=w(h,u,d,f,l[g+11],10,-1120210379),f=w(f,h,u,d,l[g+2],15,718787259),d=w(d,f,h,u,l[g+9],21,-343485551),u=u+A>>>0,d=d+C>>>0,f=f+S>>>0,h=h+x>>>0}return e.endian([u,d,f,h])};s._ff=function(o,a,l,c,u,d,f){var h=o+(a&l|~a&c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._gg=function(o,a,l,c,u,d,f){var h=o+(a&c|l&~c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._hh=function(o,a,l,c,u,d,f){var h=o+(a^l^c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._ii=function(o,a,l,c,u,d,f){var h=o+(l^(a|~c))+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._blocksize=16,s._digestsize=16,wA.exports=function(o,a){if(o==null)throw new Error("Illegal argument "+o);var l=e.wordsToBytes(s(o,a));return a&&a.asBytes?l:a&&a.asString?r.bytesToString(l):e.bytesToHex(l)}})();var xA=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(wA.exports),fy={exports:{}};(function(e,t){(function(n,r){var s="function",o="undefined",a="object",l="string",c="major",u="model",d="name",f="type",h="vendor",g="version",v="architecture",y="console",_="mobile",w="tablet",A="smarttv",C="wearable",S="embedded",x="Amazon",T="Apple",N="ASUS",I="BlackBerry",B="Browser",D="Chrome",M="Firefox",G="Google",H="Huawei",ae="LG",X="Microsoft",k="Motorola",z="Opera",W="Samsung",Z="Sharp",j="Sony",we="Xiaomi",ge="Zebra",re="Facebook",ce="Chromium OS",Se="Mac OS",_e=function(de){for(var pe={},Ce=0;Ce<de.length;Ce++)pe[de[Ce].toUpperCase()]=de[Ce];return pe},q=function(de,pe){return typeof de===l&&Q(pe).indexOf(Q(de))!==-1},Q=function(de){return de.toLowerCase()},fe=function(de,pe){if(typeof de===l)return de=de.replace(/^\s\s*/,""),typeof pe===o?de:de.substring(0,500)},Re=function(de,pe){for(var Ce,Ae,Te,be,Ve,te,Oe=0;Oe<pe.length&&!Ve;){var ze=pe[Oe],Qe=pe[Oe+1];for(Ce=Ae=0;Ce<ze.length&&!Ve&&ze[Ce];)if(Ve=ze[Ce++].exec(de))for(Te=0;Te<Qe.length;Te++)te=Ve[++Ae],typeof(be=Qe[Te])===a&&be.length>0?be.length===2?typeof be[1]==s?this[be[0]]=be[1].call(this,te):this[be[0]]=be[1]:be.length===3?typeof be[1]!==s||be[1].exec&&be[1].test?this[be[0]]=te?te.replace(be[1],be[2]):r:this[be[0]]=te?be[1].call(this,te,be[2]):r:be.length===4&&(this[be[0]]=te?be[3].call(this,te.replace(be[1],be[2])):r):this[be]=te||r;Oe+=2}},Le=function(de,pe){for(var Ce in pe)if(typeof pe[Ce]===a&&pe[Ce].length>0){for(var Ae=0;Ae<pe[Ce].length;Ae++)if(q(pe[Ce][Ae],de))return Ce==="?"?r:Ce}else if(q(pe[Ce],de))return Ce==="?"?r:Ce;return de},Je={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},V={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,g],[/opios[\/ ]+([\w\.]+)/i],[g,[d,z+" Mini"]],[/\bopr\/([\w\.]+)/i],[g,[d,z]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[d,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[d,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[g,[d,"Smart Lenovo "+B]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+B],g],[/\bfocus\/([\w\.]+)/i],[g,[d,M+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[d,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[d,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[d,"MIUI "+B]],[/fxios\/([-\w\.]+)/i],[g,[d,M]],[/\bqihu|(qi?ho?o?|360)browser/i],[[d,"360 "+B]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1 "+B],g],[/samsungbrowser\/([\w\.]+)/i],[g,[d,W+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],g],[/metasr[\/ ]?([\d\.]+)/i],[g,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[d,g],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,re],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[d,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[d,D+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,D+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[d,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[g,Le,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[d,M+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[d,g],[/(cobalt)\/([\w\.]+)/i],[d,[g,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[v,"amd64"]],[/(ia32(?=;))/i],[[v,Q]],[/((?:i[346]|x)86)[;\)]/i],[[v,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[v,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[v,"armhf"]],[/windows (ce|mobile); ppc;/i],[[v,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[v,/ower/,"",Q]],[/(sun4\w)[;\)]/i],[[v,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[v,Q]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[h,W],[f,w]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,W],[f,_]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[h,T],[f,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,T],[f,w]],[/(macintosh);/i],[u,[h,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,Z],[f,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,H],[f,w]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[h,H],[f,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[h,we],[f,_]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,we],[f,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[f,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[f,_]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[f,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[h,k],[f,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,k],[f,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,ae],[f,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,ae],[f,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[f,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[f,_]],[/(pixel c)\b/i],[u,[h,G],[f,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,G],[f,_]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,j],[f,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,j],[f,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[f,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,x],[f,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,x],[f,_]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[f,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,I],[f,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,N],[f,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,N],[f,_]],[/(nexus 9)/i],[u,[h,"HTC"],[f,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[f,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[f,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[f,_]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[h,"Ulefone"],[f,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[f,_]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,u,[f,w]],[/(surface duo)/i],[u,[h,X],[f,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[f,_]],[/(u304aa)/i],[u,[h,"AT&T"],[f,_]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[f,_]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[f,w]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[f,w]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[f,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[f,w]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[f,w]],[/\b(k88) b/i],[u,[h,"ZTE"],[f,w]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[f,_]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[f,_]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[f,w]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[f,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[f,w]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[f,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[f,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[f,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[f,_]],[/\b(ph-1) /i],[u,[h,"Essential"],[f,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[f,w]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[f,w]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[f,w]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[f,w]],[/(sprint) (\w+)/i],[h,u,[f,_]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,X],[f,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,ge],[f,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,ge],[f,_]],[/smart-tv.+(samsung)/i],[h,[f,A]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,W],[f,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,ae],[f,A]],[/(apple) ?tv/i],[h,[u,T+" TV"],[f,A]],[/crkey/i],[[u,D+"cast"],[h,G],[f,A]],[/droid.+aft(\w+)( bui|\))/i],[u,[h,x],[f,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[h,Z],[f,A]],[/(bravia[\w ]+)( bui|\))/i],[u,[h,j],[f,A]],[/(mitv-\w{5}) bui/i],[u,[h,we],[f,A]],[/Hbbtv.*(technisat) (.*);/i],[h,u,[f,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,fe],[u,fe],[f,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[f,y]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[f,y]],[/(playstation [345portablevi]+)/i],[u,[h,j],[f,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,X],[f,y]],[/((pebble))app/i],[h,u,[f,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[h,T],[f,C]],[/droid.+; (glass) \d/i],[u,[h,G],[f,C]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,ge],[f,C]],[/(quest( 2| pro)?)/i],[u,[h,re],[f,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[f,S]],[/(aeobc)\b/i],[u,[h,x],[f,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[f,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[f,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,_]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[d,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,g],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[d,[g,Le,Je]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Le,Je],[d,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,Se],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,d],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[d,g],[/\(bb(10);/i],[g,[d,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[d,M+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[d,D+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,ce],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,g],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,g]]},Y=function(de,pe){if(typeof de===a&&(pe=de,de=r),!(this instanceof Y))return new Y(de,pe).getResult();var Ce=typeof n!==o&&n.navigator?n.navigator:r,Ae=de||(Ce&&Ce.userAgent?Ce.userAgent:""),Te=Ce&&Ce.userAgentData?Ce.userAgentData:r,be=pe?function(te,Oe){var ze={};for(var Qe in te)Oe[Qe]&&Oe[Qe].length%2==0?ze[Qe]=Oe[Qe].concat(te[Qe]):ze[Qe]=te[Qe];return ze}(V,pe):V,Ve=Ce&&Ce.userAgent==Ae;return this.getBrowser=function(){var te={};return te[d]=r,te[g]=r,Re.call(te,Ae,be.browser),te[c]=function(Oe){return typeof Oe===l?Oe.replace(/[^\d\.]/g,"").split(".")[0]:r}(te[g]),Ve&&Ce&&Ce.brave&&typeof Ce.brave.isBrave==s&&(te[d]="Brave"),te},this.getCPU=function(){var te={};return te[v]=r,Re.call(te,Ae,be.cpu),te},this.getDevice=function(){var te={};return te[h]=r,te[u]=r,te[f]=r,Re.call(te,Ae,be.device),Ve&&!te[f]&&Te&&Te.mobile&&(te[f]=_),Ve&&te[u]=="Macintosh"&&Ce&&typeof Ce.standalone!==o&&Ce.maxTouchPoints&&Ce.maxTouchPoints>2&&(te[u]="iPad",te[f]=w),te},this.getEngine=function(){var te={};return te[d]=r,te[g]=r,Re.call(te,Ae,be.engine),te},this.getOS=function(){var te={};return te[d]=r,te[g]=r,Re.call(te,Ae,be.os),Ve&&!te[d]&&Te&&Te.platform!="Unknown"&&(te[d]=Te.platform.replace(/chrome os/i,ce).replace(/macos/i,Se)),te},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ae},this.setUA=function(te){return Ae=typeof te===l&&te.length>500?fe(te,500):te,this},this.setUA(Ae),this};Y.VERSION="1.0.37",Y.BROWSER=_e([d,g,c]),Y.CPU=_e([v]),Y.DEVICE=_e([u,h,f,y,_,A,w,C,S]),Y.ENGINE=Y.OS=_e([d,g]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var le=typeof n!==o&&(n.jQuery||n.Zepto);if(le&&!le.ua){var xe=new Y;le.ua=xe.getResult(),le.ua.get=function(){return xe.getUA()},le.ua.set=function(de){xe.setUA(de);var pe=xe.getResult();for(var Ce in pe)le.ua[Ce]=pe[Ce]}}})(typeof window=="object"?window:gu)})(fy,fy.exports);var uce=fy.exports,dce=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(function(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")})(this,e);var s=r.appKey,o=r.ratio,a=o===void 0?10:o,l=r.env,c=l===void 0?"production":l,u=r.appVersion,d=u===void 0?"0.0.1":u,f=r.whiteScreenConfig,h=f===void 0?{target:document.body,screenshot:!0,score:1.5,domDepth:6}:f;this.appKey=s,this.sdkVersion="1.1.6",this.ratio=Math.max(0,Math.min(a,100)),this.env=c,this.appVersion=d,this.whiteScreenConfig=h,this.sid=this.sessionid(),this.timeDifference=0,this.host="qapm.360.cn"}var t,n;return t=e,n=[{key:"getUA",value:function(){var r,s=new uce.UAParser().getResult();if(s.browser.name==="360 Browser"){var o=window.navigator.userAgent;/360EE/.test(o)&&(s.browser.name="360极速浏览器"),/360SE/.test(o)&&(s.browser.name="360安全浏览器")}return{os:s.os.name,osVersion:s.os.version,browser:s.browser.name,browserVersion:s.browser.version,ua:s.ua,device:s.device.model||"Unknow",deviceType:s.device.type||"Pc",network:(r=window.navigator)===null||r===void 0||(r=r.connection)===null||r===void 0?void 0:r.effectiveType}}},{key:"uid",value:function(){if(localStorage.getItem("__QAPM_UID__"))return localStorage.getItem("__QAPM_UID__");var r=this.mid()||xA(""+Date.now()+1e9*Math.random());return localStorage.setItem("__QAPM_UID__",r),r}},{key:"mid",value:function(){var r="";try{r=external.GetMID(external.GetSID(window))}catch(s){}if(!r)try{r=window.wdextcmd.GetMid()}catch(s){}return r||""}},{key:"sessionid",value:function(){return xA(""+Date.now()+1e9*Math.random())}},{key:"isIE",value:function(){var r=window.navigator.userAgent;return r.indexOf("MSIE")!==-1||r.indexOf("Trident")!==-1}},{key:"padLeft",value:function(r,s,o){for(var a=r+"";a.length<s;)a=(o||"0")+a;return a}},{key:"formatTime",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Y-m-d H:i:s";return r?(typeof r!="number"&&typeof r!="string"||r.length===10&&(r*=1e3),r=new Date(r),s.replace(/Y/g,this.padLeft(r.getFullYear(),4)).replace(/m/g,this.padLeft(r.getMonth()+1,2)).replace(/d/g,this.padLeft(r.getDate(),2)).replace(/H/g,this.padLeft(r.getHours(),2)).replace(/i/g,this.padLeft(r.getMinutes(),2)).replace(/s/g,this.padLeft(r.getSeconds(),2))):""}},{key:"formatDate",value:function(r){return this.formatTime(r,"Y-m-d")}},{key:"getTime",value:function(){var r=new Date().getTime()+this.timeDifference;return{time:this.formatTime(r)||r,date:this.formatDate(r)||r}}},{key:"calcRatio",value:function(){return Math.floor(100*Math.random())<this.ratio}},{key:"initTime",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};try{var s=new URL("".concat(window.location.protocol,"//").concat(this.host,"/time"));Object.entries(r).map(function(o){var a=TQ(o,2),l=a[0],c=a[1];s.searchParams.set(l,c)}),this.fetch(s.toString())}catch(o){console.error("initTime Error",o)}}},{key:"fetch",get:function(){return window.fetch?window.fetch.bind(window):function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(o,a){var l=new XMLHttpRequest;s.keepalive&&(l.keepalive=!0),l.open(s.method||"GET",r),l.onload=function(){o({text:function(){return Promise.resolve(l.responseText)}})},l.onerror=function(){a(l)},l.send(s.body)})}}}],n&&PQ(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),AA=function(e,t){if(PerformanceObserver)if((PerformanceObserver.supportedEntryTypes||[]).includes(e))try{new PerformanceObserver(function(n){n&&t(n)}).observe({type:e,buffered:!0})}catch(n){t("err")}else t("err");else t("err")},Rn=function(e){var t=Math.min(Math.max(e,0),15e3);return Number.isNaN(t)?0:t%1!=0?Number(t.toFixed(2)):t},fce=function(){function e(t){vh(this,e),As(this,"performanceData",{fcp:0,fp:0,lcp:0}),As(this,"commit",function(){}),this.webCoreIns=t}return bh(e,[{key:"init",value:function(){try{if(!((t=window.performance)&&t.getEntriesByType&&t.timing))return;this.calcPerformanceTime()}catch(n){}var t}},{key:"calcNavigation",value:function(t){}},{key:"calcPerformanceTime",value:function(){var t=this;Promise.all([new Promise(function(n,r){var s=window.performance.timing,o=null;window.addEventListener("load",function a(){if(s.loadEventEnd>0){clearTimeout(o);var l=Rn(s.unloadEnd-s.unloadStart),c=Rn(s.redirectStart-s.redirectEnd),u=Rn(s.domainLookupStart-s.fetchStart),d=Rn(s.domainLookupEnd-s.domainLookupStart),f=Rn(s.connectEnd-s.connectStart),h=Rn(s.secureConnectionStart==0?0:s.connectEnd-s.secureConnectionStart),g=Rn(s.responseStart-s.requestStart),v=Rn(s.domInteractive-s.fetchStart),y=Rn(s.responseEnd-s.responseStart),_=Rn(s.domContentLoadedEventEnd-s.fetchStart),w=Rn(s.domInteractive-s.responseEnd),A=Rn(s.loadEventStart-s.domContentLoadedEventEnd),C=Rn(s.loadEventEnd-s.loadEventStart),S=Rn(s.loadEventEnd-s.fetchStart);n({unloadTime:l,redirectTime:c,appCacheTime:u,dnsTime:d,tcpTime:f,sslTime:h,ttfb:g,contentTime:y,domParseTime:w,tti:v,domReadyTime:_,loadEventTime:C,loadFinishTime:S,loadResourceTime:A,resource:""})}else o=setTimeout(a,100)},!1)}),new Promise(function(n,r){AA("paint",function(s){var o=0,a=0;if(s!=="err"){var l,c=Vv(s.getEntries());try{for(c.s();!(l=c.n()).done;){var u=l.value,d=u.name,f=u.startTime;d==="first-paint"&&(o=Rn(f)),d==="first-contentful-paint"&&(a=Rn(f))}}catch(h){c.e(h)}finally{c.f()}}n({fp:o,fcp:a})})}).catch(function(n){return console.log(n)}),new Promise(function(n,r){AA("largest-contentful-paint",function(s){if(s=="err")n({lcp:0});else{var o,a=Vv(s.getEntries());try{for(a.s();!(o=a.n()).done;){var l=o.value;n({lcp:Rn(l.startTime)})}}catch(c){a.e(c)}finally{a.f()}}})}).catch(function(n){return console.log(n)})]).then(function(){var n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(r,s){return fu(fu({},r),s)},t.performanceData);n.type="performance",t.webCoreIns.commit(n)}).catch(function(n){console.log(n)})}},{key:"calcResourceTime",value:function(){}}]),e}(),hce=["SCRIPT","STYLE","META","HEAD"];function hy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document.body,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;if(!e||n>r||hce.indexOf(e.tagName)>-1||s&&t>s)return n;var o=function(a,l){if(!l||!document.querySelector(a.tagName))return 0;var c=a.getBoundingClientRect(),u=c.top,d=c.height;return u>window.innerHeight||d<=0?0:1/Math.pow(2,l-1)}(e,t);return[].reduceRight.call(e.children,function(a,l){return hy(l,t+1,a,r,s)},n+o)}var pce=0,py={},gce=function(e){if(!e)return Promise.reject("empty url");var t=py[e];return t?Promise.resolve(t):new Promise(function(n,r){var s=document.createElement("script");if(s.id="script".concat(pce++),s.src=e,s.async="async",s.src.indexOf("http")!==0)throw Error("load-script只能加载http/https协议的url,当前协议是".concat(location.protocol));s.onerror=function(o){$("#".concat(s.id)).remove(),r(o)},s.readyState?s.onreadystatechange=function(o){s.readyState!="loaded"&&s.readyState!="complete"||(s.onreadystatechange=null,py[e]=o,n(o))}:s.onload=function(o){py[e]=o,n(o)},document.body.appendChild(s)})};function mce(e,t){return PA.apply(this,arguments)}function PA(){return(PA=hu(dr().mark(function e(t,n){var r,s,o;return dr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,gce("https://html2canvas.hertzen.com/dist/html2canvas.min.js");case 2:return a.next=4,html2canvas(document.body,{useCORS:!0});case 4:return r=a.sent,s=r.toDataURL("image/jpeg",.3),o=vce(s),a.next=9,bce(o,t,n);case 9:return a.abrupt("return",a.sent);case 10:case"end":return a.stop()}},e)}))).apply(this,arguments)}function vce(e){for(var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]),s=r.length,o=new Uint8Array(s);s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:n})}function bce(e,t,n){return TA.apply(this,arguments)}function TA(){return(TA=hu(dr().mark(function e(t,n,r){var s,o;return dr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return(s=new FormData).append("filename",t,"".concat(r,".png")),s.append("https",1),a.next=5,n("//qapm.360.cn/api/upload/uploadImg",{method:"POST",body:s,keepalive:!0}).then(function(l){return l.json()});case 5:return o=a.sent,a.abrupt("return",o);case 7:case"end":return a.stop()}},e)}))).apply(this,arguments)}var yce=function(){function e(n){vh(this,e),As(this,"isLoaded",!1),As(this,"timer",null),As(this,"whiteCount",0),As(this,"maxLoopNumber",2),As(this,"isReport",!1),this.webCoreIns=n;var r=n.config.whiteScreenConfig||{},s=r.target,o=r.score,a=o===void 0?1.5:o;r.screenshot;var l=r.domDepth,c=l===void 0?6:l;this.target=s,this.score=a,this.screenshot=!1,this.domDepth=c,this.fetch=n.fetch}var t;return bh(e,[{key:"init",value:function(){var n=this;window.addEventListener("load",function(){n.isLoaded=!0,n.handle()}),window.addEventListener("error",function(){n.isLoaded&&(n.whiteCount=n.maxLoopNumber,n.handle())})}},{key:"getTarget",value:function(){var n;try{n=this.target?document.querySelector(this.target):document.body}catch(r){console.log("sdk入参target有误:",this.target)}return n||console.log("sdk入参target有误:",this.target),n||document.body}},{key:"handle",value:function(){var n=hy(this.getTarget(),0,0,this.score,this.domDepth);this.whiteCount+=1,n<=this.score?this.openLoopToJudge(n):this.whiteCount=0}},{key:"openLoopToJudge",value:function(n){var r=this;this.whiteCount>=this.maxLoopNumber?this.commit(n):this.timer=setTimeout(function(){var s=hy(r.target,0,0,r.score,r.domDepth);r.whiteCount+=1,s<=r.score?(clearTimeout(r.timer),r.timer=null,r.openLoopToJudge(s)):(clearTimeout(r.timer),r.timer=null,r.whiteCount=0)},1e3)}},{key:"commit",value:(t=hu(dr().mark(function n(r){return dr().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.isReport){s.next=2;break}return s.abrupt("return");case 2:this.isReport=!0,this.screenshot&&mce(this.fetch,this.webCoreIns.sid),this.webCoreIns.commit({type:"whiteScreen",score:r});case 5:case"end":return s.stop()}},n,this)})),function(n){return t.apply(this,arguments)})}]),e}(),_ce=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wp="js",$u="resource",OA="unhandledrejection",Cp="cors",NA="vue",IA="react";function wce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sp,Vu,RA={exports:{}},DA={exports:{}};Sp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vu={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&Vu.rotl(e,8)|4278255360&Vu.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=Vu.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],s=0;s<4;s++)8*n+6*s<=8*e.length?t.push(Sp.charAt(r>>>6*(3-s)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)r!=0&&t.push((Sp.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|Sp.indexOf(e.charAt(n))>>>6-2*r);return t}},DA.exports=Vu;var Cce=DA.exports,gy={utf8:{stringToBytes:function(e){return gy.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(gy.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},LA=gy,Sce=function(e){return e!=null&&(kA(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&kA(t.slice(0,0))}(e)||!!e._isBuffer)};function kA(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}(function(){var e=Cce,t=LA.utf8,n=Sce,r=LA.bin,s=function(o,a){o.constructor==String?o=a&&a.encoding==="binary"?r.stringToBytes(o):t.stringToBytes(o):n(o)?o=Array.prototype.slice.call(o,0):Array.isArray(o)||o.constructor===Uint8Array||(o=o.toString());for(var l=e.bytesToWords(o),c=8*o.length,u=1732584193,d=-271733879,f=-1732584194,h=271733878,g=0;g<l.length;g++)l[g]=16711935&(l[g]<<8|l[g]>>>24)|4278255360&(l[g]<<24|l[g]>>>8);l[c>>>5]|=128<<c%32,l[14+(c+64>>>9<<4)]=c;var v=s._ff,y=s._gg,_=s._hh,w=s._ii;for(g=0;g<l.length;g+=16){var A=u,C=d,S=f,x=h;u=v(u,d,f,h,l[g+0],7,-680876936),h=v(h,u,d,f,l[g+1],12,-389564586),f=v(f,h,u,d,l[g+2],17,606105819),d=v(d,f,h,u,l[g+3],22,-1044525330),u=v(u,d,f,h,l[g+4],7,-176418897),h=v(h,u,d,f,l[g+5],12,1200080426),f=v(f,h,u,d,l[g+6],17,-1473231341),d=v(d,f,h,u,l[g+7],22,-45705983),u=v(u,d,f,h,l[g+8],7,1770035416),h=v(h,u,d,f,l[g+9],12,-1958414417),f=v(f,h,u,d,l[g+10],17,-42063),d=v(d,f,h,u,l[g+11],22,-1990404162),u=v(u,d,f,h,l[g+12],7,1804603682),h=v(h,u,d,f,l[g+13],12,-40341101),f=v(f,h,u,d,l[g+14],17,-1502002290),u=y(u,d=v(d,f,h,u,l[g+15],22,1236535329),f,h,l[g+1],5,-165796510),h=y(h,u,d,f,l[g+6],9,-1069501632),f=y(f,h,u,d,l[g+11],14,643717713),d=y(d,f,h,u,l[g+0],20,-373897302),u=y(u,d,f,h,l[g+5],5,-701558691),h=y(h,u,d,f,l[g+10],9,38016083),f=y(f,h,u,d,l[g+15],14,-660478335),d=y(d,f,h,u,l[g+4],20,-405537848),u=y(u,d,f,h,l[g+9],5,568446438),h=y(h,u,d,f,l[g+14],9,-1019803690),f=y(f,h,u,d,l[g+3],14,-187363961),d=y(d,f,h,u,l[g+8],20,1163531501),u=y(u,d,f,h,l[g+13],5,-1444681467),h=y(h,u,d,f,l[g+2],9,-51403784),f=y(f,h,u,d,l[g+7],14,1735328473),u=_(u,d=y(d,f,h,u,l[g+12],20,-1926607734),f,h,l[g+5],4,-378558),h=_(h,u,d,f,l[g+8],11,-2022574463),f=_(f,h,u,d,l[g+11],16,1839030562),d=_(d,f,h,u,l[g+14],23,-35309556),u=_(u,d,f,h,l[g+1],4,-1530992060),h=_(h,u,d,f,l[g+4],11,1272893353),f=_(f,h,u,d,l[g+7],16,-155497632),d=_(d,f,h,u,l[g+10],23,-1094730640),u=_(u,d,f,h,l[g+13],4,681279174),h=_(h,u,d,f,l[g+0],11,-358537222),f=_(f,h,u,d,l[g+3],16,-722521979),d=_(d,f,h,u,l[g+6],23,76029189),u=_(u,d,f,h,l[g+9],4,-640364487),h=_(h,u,d,f,l[g+12],11,-421815835),f=_(f,h,u,d,l[g+15],16,530742520),u=w(u,d=_(d,f,h,u,l[g+2],23,-995338651),f,h,l[g+0],6,-198630844),h=w(h,u,d,f,l[g+7],10,1126891415),f=w(f,h,u,d,l[g+14],15,-1416354905),d=w(d,f,h,u,l[g+5],21,-57434055),u=w(u,d,f,h,l[g+12],6,1700485571),h=w(h,u,d,f,l[g+3],10,-1894986606),f=w(f,h,u,d,l[g+10],15,-1051523),d=w(d,f,h,u,l[g+1],21,-2054922799),u=w(u,d,f,h,l[g+8],6,1873313359),h=w(h,u,d,f,l[g+15],10,-30611744),f=w(f,h,u,d,l[g+6],15,-1560198380),d=w(d,f,h,u,l[g+13],21,1309151649),u=w(u,d,f,h,l[g+4],6,-145523070),h=w(h,u,d,f,l[g+11],10,-1120210379),f=w(f,h,u,d,l[g+2],15,718787259),d=w(d,f,h,u,l[g+9],21,-343485551),u=u+A>>>0,d=d+C>>>0,f=f+S>>>0,h=h+x>>>0}return e.endian([u,d,f,h])};s._ff=function(o,a,l,c,u,d,f){var h=o+(a&l|~a&c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._gg=function(o,a,l,c,u,d,f){var h=o+(a&c|l&~c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._hh=function(o,a,l,c,u,d,f){var h=o+(a^l^c)+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._ii=function(o,a,l,c,u,d,f){var h=o+(l^(a|~c))+(u>>>0)+f;return(h<<d|h>>>32-d)+a},s._blocksize=16,s._digestsize=16,RA.exports=function(o,a){if(o==null)throw new Error("Illegal argument "+o);var l=e.wordsToBytes(s(o,a));return a&&a.asBytes?l:a&&a.asString?r.bytesToString(l):e.bytesToHex(l)}})();var Ece=wce(RA.exports);function xce(e){var t=e.match(_ce);return t?{filename:t[2],functionName:t[1]||"",lineno:parseInt(t[3],10)||void 0,colno:parseInt(t[4],10)||void 0}:{}}function Ep(e){var t=(e||{stack:""}).stack;if(!t)return[];var n,r=[],s=Vv(t.split(`
154
- `).slice(1));try{for(s.s();!(n=s.n()).done;){var o=xce(n.value);o&&r.push(o)}}catch(a){s.e(a)}finally{s.f()}return r.slice(0,10)}var Ul=function(e){return Ece(e).toString()},my=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Cp:wp:$u},Ace=function(){function e(t){vh(this,e),As(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return bh(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=r.type,o=r.event,a=n[s];a&&a(o)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(my(r)===Cp){var s={errorType:Cp,errorMessage:r.message,errorSummary:"CorsError",errorId:Ul("".concat(Cp,"-").concat(r.message))};t.commit(s)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(my(t)===$u){var n=t.target||t.srcElement,r=n.src||n.href,s=JSON.stringify($u+": "+r||"UnKnown Resource"),o={errorType:$u,errorMessage:s,errorSummary:"ResourceError",errorId:Ul("".concat($u,"-").concat(s))};this.commit(o)}}},{key:"onJSError",value:function(t){var n,r;if(my(t)===wp){var s=JSON.stringify(t.message),o=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!l)return c;try{var u=new URL(l);return u.pathname&&u.pathname.endsWith(".js")?l:c}catch(d){return l}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),a={errorType:wp,errorMessage:s,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Ep(t.error)),errorId:Ul("".concat(wp,"-").concat(s,"-").concat(o))};this.commit(a)}}},{key:"onPromiseError",value:function(t){var n,r,s=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),o=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",a={errorType:OA,errorMessage:s,errorSummary:o,errorStack:JSON.stringify(Ep(t.reason)),errorId:Ul("".concat(OA,"-").concat(s,"-").concat(o))};this.commit(a)}},{key:"onVueError",value:function(t,n,r){var s=JSON.stringify(t.message),o={errorType:NA,errorMessage:s,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ep(t)),errorId:Ul("".concat(NA,"-").concat(s,"-").concat(t.name))};this.commit(o)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),s={errorType:IA,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ep(t)),errorId:Ul("".concat(IA,"-").concat(r,"-").concat(t.name))};this.commit(s)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(fu({type:"error"},t)))}}]),e}(),Pce=function(e){function t(){var s,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return vh(this,t),(s=EQ(this,t,[o])).config=o,s.isReport()?(s.PerformancePluginInstance=new fce(pu(s)),s.WhiteScreenPluginInstance=new yce(pu(s)),s.ErrorPluginInstance=new Ace(pu(s)),s.plugins=[s.PerformancePluginInstance,s.WhiteScreenPluginInstance,s.ErrorPluginInstance],s.init(),c5(t,t,$l,pu(s)),s):o5(s)}var n,r;return function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(o&&o.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),o&&$v(s,o)}(t,dce),bh(t,[{key:"isReport",value:function(){var s=this.isIE(),o=this.calcRatio();return this.config.appKey&&o&&!s}},{key:"init",value:(r=hu(dr().mark(function s(){return dr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(a){try{a.init()}catch(l){console.error("initPlugin Error",l)}});case 2:case"end":return o.stop()}},s,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=this.uid(),a=this.getTime(),l=a.time,c=a.date,u=this.getUA(),d=window.location,f=d.host,h=d.origin,g=d.pathname;return fu(fu({uid:o,sid:this.sid,url:window.location.href,host:f,fullPath:h+g,sdkVersion:this.sdkVersion,createDate:c,appKey:this.config.appKey,createTime:l,appVersion:this.appVersion,env:this.env},u),s)}},{key:"commit",value:(n=hu(dr().mark(function s(o){var a,l;return dr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:try{a=this.mixed(o),l=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(a).map(function(u){var d=xQ(u,2),f=d[0],h=d[1];l.searchParams.set(f,h)}),new Image().src=l.toString()}catch(u){console.log("commit Error",u)}case 1:case"end":return c.stop()}},s,this)})),function(s){return n.apply(this,arguments)})}],[{key:"install",value:function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_h(t,t,$l)||(s.config.errorHandler=function(a,l,c){_h(t,t,$l).ErrorPluginInstance.onVueError(a,l,c),console.error(a)},c5(t,t,$l,new t(o)))}},{key:"sendError",value:function(s){_h(t,t,$l)?_h(t,t,$l).ErrorPluginInstance.onReactError(s):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),$l={writable:!0,value:null};const Qge="",eme="",Tce={components:{InfoFilled:Em,ArrowRight:Cm},mixins:[kr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:GH,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,s,o,a,l,c,u;const e=[];if(this.nodeInfo.length===1){const d=this.nodeInfo[0];d.type!=="aggregation"&&d.type!=="nodeType"&&(e.push(W0),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===d.id)||(e.push(Y0),(o=(s=this.moduleDetail)==null?void 0:s.config)!=null&&o.hideCollectMenu||e.push(d.collect?J0:K0),e.push(d.textProp==="name"?q0:z0),d.label&&e.push(d.textProp==="label"?H0:G0)),this.canGoDetail&&e.push(h4)),e.push(d.fx?V0:$0);const f=this.history.dataNow.links.some(y=>y.source.id===d.id&&y.target.type==="aggregation"),v=this.history.dataNow.links.filter(y=>y.source.id===d.id).map(y=>y.target).some(y=>{let _=0;return this.history.dataNow.links.map(w=>{w.source.id===y.id&&_++}),_===0});f||d.type==="aggregation"?e.push(u4):v&&e.push(c4),v&&e.push(l4),e.push(X0)}else this.nodeInfo.length>1?(e.push(Y0,W0),e.push(this.nodeInfo.some(f=>!f.collect)?K0:J0),this.nodeInfo.some(f=>f.label)&&e.push(this.nodeInfo.some(f=>f.textProp!=="label")?G0:H0),e.push(this.nodeInfo.some(f=>f.textProp!=="name")?z0:q0),e.push(this.nodeInfo.some(f=>!f.fx)?$0:V0),e.push(X0)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(f=>f.label)&&e.push(this.history.dataNow.nodes.some(f=>f.textProp!=="label")?s4:r4),e.push(this.history.dataNow.nodes.some(f=>f.textProp!=="name")?n4:i4),e.push(this.history.dataNow.nodes.some(f=>!f.fx)?e4:t4),this.history.currentIndex>0&&e.push(o4),this.history.currentIndex<this.history.length-1&&e.push(a4));const t=(a=this.nodeInfo[0])==null?void 0:a.type,n=(u=(c=(l=this.nodeInfo[0])==null?void 0:l.detail)==null?void 0:c.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(d=>{d.icon||(d.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,s=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=s?0:"auto",bottom:r<s?0:"auto"}},thirdBorderCheck(e,t,n,r){const s=document.body.offsetWidth,o=document.body.offsetHeight,a=this.secondBorderCheck(e,n).top;let l;const c=(t+r)*this.itemHeight,u=c>180?180:c;return a===0?l=this.axis.top+e*this.itemHeight+u:l=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=s?"-100%":"100%",bottom:o>=l?0:"auto",top:o<l?0:"auto"}},handleClick(e,t){if(!t){if(Bn({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;Ke(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){Bn({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),Ke(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Oce={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},Nce={class:"cm-list"},Ice={class:"cm-ul"},Rce={class:"hd"},Dce=["src"],Lce={class:"bd"},kce={class:"cm-ul cm-ul-level1"},Mce=["title"],Fce=["title","onClick"],Bce=["title","onClick"],jce={key:0,class:"icon","aria-hidden":"true"},Uce=["title","onClick"],$ce=["src"],Vce=["title","onClick"],zce={key:0,class:"fas el-icon-fa-cog"},qce={key:1,class:"fas el-icon-fa-external-link-alt"},Hce={class:"text-wrapper"},Gce=["src"],Wce=["src"],Kce={key:3,class:"shortcut"},Jce={key:2,class:"icon","aria-hidden":"true"},Yce=["title","onClick"],Xce={key:1,class:"icon","aria-hidden":"true"},Zce=["title","onClick"];function Qce(e,t,n,r,s,o){const a=Ge("ArrowRight"),l=Bt,c=Ge("InfoFilled"),u=hi;return n.show?(R(),U("div",{key:0,class:"cm-container",style:Ze(o.axisComputed),onClick:t[1]||(t[1]=pt((...d)=>o.handleCollapse&&o.handleCollapse(...d),["stop"]))},[(R(),U("svg",Oce,t[2]||(t[2]=[K("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[K("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1)]))),K("div",Nce,[K("ul",Ice,[o.checkboxMenu.length>0?(R(),U("li",{key:0,class:"cm-li data-opt-wrapper",style:Ze(o.liStyle)},[K("div",Rce,[K("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,Dce),t[3]||(t[3]=Ye("按关系分类拓线")),ie(l,null,{default:ne(()=>[ie(a)]),_:1})]),K("div",Lce,[K("ul",kce,[(R(!0),U(qe,null,It(o.checkboxMenu,(d,f)=>(R(),U("li",{key:f,class:"cm-li context-one",style:Ze(o.liStyle)},[o.hasChildren(d)?(R(),U("div",{key:0,class:ee(["cm-item",o.firstLeft?"cm-left":""]),title:d.namec},[K("span",null,Ne(d.namec),1),t[4]||(t[4]=K("svg",{class:"icon","aria-hidden":"true"},[K("use",{"xlink:href":"#icon-arrow-right"})],-1))],10,Mce)):(R(),U("div",{key:1,class:ee(["cm-item",o.firstLeft?"cm-left":""]),title:d.namec,onClick:pt(h=>o.handleDataClick(d,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(d.namec),1)],10,Fce)),o.hasChildren(d)?(R(),U("ul",{key:2,class:"cm-ul cm-ul-level2",style:Ze(o.secondBorderCheck(f,d.children.length))},[(R(!0),U(qe,null,It(d.children,(h,g)=>(R(),U("li",{key:g,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",o.secondLeft?"cm-left":""]),title:h.namec,onClick:pt(v=>o.handleDataClick(h,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(h.namec),1),o.hasChildren(h)?(R(),U("svg",jce,t[5]||(t[5]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Bce),o.hasChildren(h)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level3",style:Ze(o.thirdBorderCheck(f,g,d.children.length,h.children.length))},[(R(!0),U(qe,null,It(h.children,(v,y)=>(R(),U("li",{key:y,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:"cm-item",title:v.namec,onClick:pt(_=>o.handleDataClick(v,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(v.namec),1)],8,Uce)],4))),128))],4)):oe("",!0)],4))),128))],4)):oe("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<s.maxMulti?(R(),U("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:Ze(o.liStyle)},[K("div",{class:"hd",onClick:t[0]||(t[0]=pt(d=>o.handleDataClick(null,s.globalMenus.expandNode),["stop"]))},[K("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,$ce),t[6]||(t[6]=Ye("展开全部关系 "))]),t[7]||(t[7]=K("div",{class:"bd"},null,-1))],4)):oe("",!0),(R(!0),U(qe,null,It(o.systemMenu,(d,f)=>(R(),U("li",{key:f,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{"cm-left":o.firstLeft,disabled:d.disabled}]),title:d.namec,onClick:pt(h=>o.handleClick(d,d.disabled),["stop"])},[o.isSystemItem(d)?(R(),U("i",zce)):o.isExternalItem(d)?(R(),U("i",qce)):oe("",!0),K("div",Hce,[d.icon?(R(),U("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+d.icon+".svg"],class:"t-icon"},null,8,Gce)):(R(),U("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+d.name+".svg"],class:"t-icon"},null,8,Wce)),d.tooltip?(R(),ye(u,{key:2,class:"el-icon-info",effect:"dark",content:d.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(d.namec),1),d.shortcut?(R(),U("span",Kce,Ne(d.shortcut),1)):oe("",!0)]),o.hasChildren(d)?(R(),U("svg",Jce,t[8]||(t[8]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Vce),o.hasChildren(d)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level2",style:Ze(o.secondBorderCheck(f,d.children.length))},[(R(!0),U(qe,null,It(d.children,(h,g)=>(R(),U("li",{key:g,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{"cm-left":o.secondLeft,disabled:d.disabled||h.disabled}]),title:h.namec,onClick:pt(v=>o.handleClick(h,d.disabled||h.disabled),["stop"])},[h.tooltip?(R(),ye(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(h.namec),1),o.hasChildren(h)?(R(),U("svg",Xce,t[9]||(t[9]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Yce),o.hasChildren(h)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level3",style:Ze(o.thirdBorderCheck(f,g,d.children.length,h.children.length))},[(R(!0),U(qe,null,It(h.children,(v,y)=>(R(),U("li",{key:y,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{disabled:d.disabled||h.disabled||v.disabled}]),title:v.namec,onClick:pt(_=>o.handleClick(v,d.disabled||h.disabled||v.disabled),["stop"])},[v.tooltip?(R(),ye(u,{key:0,class:"el-icon-info",effect:"dark",content:v.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(v.namec),1)],10,Zce)],4))),128))],4)):oe("",!0)],4))),128))],4)):oe("",!0)],4))),128))])])],4)):oe("",!0)}const eue=fn(Tce,[["render",Qce],["__scopeId","data-v-dfb39ec8"]]),tme="",nme="",ime="",rme="",tue={name:"Popover",components:{ForceGraphSvgIcon:Qo},mixins:[kr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})},customTooltip:{type:Function}},data(){return{isFunction:Bd,showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var l,c,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(l=document.getElementsByClassName("popover-container")[0])==null?void 0:l.offsetHeight,r=(c=document.getElementsByClassName("d3-container")[0])==null?void 0:c.offsetHeight,s=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let o;t?o=Math.max(this.mousePosition.top,n+s)+5:o=Math.min(this.mousePosition.top,Math.max(r-n,s))-5;const a={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:o+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=a},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var s,o,a;const r=n.detail;return Fe(me({},n),{name:((s=r==null?void 0:r.info)==null?void 0:s.name)||n.name,level:((a=(o=r==null?void 0:r.info)==null?void 0:o.basic)==null?void 0:a.level)||""})});e==null||e.sort((n,r)=>{var a,l;const s=(a=this.levelList.find(c=>c.level===n.level))==null?void 0:a.dangerNumber;return((l=this.levelList.find(c=>c.level===r.level))==null?void 0:l.dangerNumber)-s}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return R0(e)},getTypeZh(e){var n,r,s;let t=e;if(e==="nodeType")t="关系节点";else for(const o in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[o].name)){t=(s=this.moduleDetail)==null?void 0:s.nodes[o].namec;break}return t},getLevelClass(e){return If(e,this.levelList)},getColorStyle(e){return ea(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var s;const t=(s=this.data)==null?void 0:s.links,n=[],r=[];return t==null||t.map(o=>{o.source.id===e&&(n.push(o.target.id),o.target.detail&&$q(o.target.detail.info.basic.level,this.levelList)&&r.push(o.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let s="-";return r&&(n?s=t.length?t.join("|"):"-":s=t||"-"),s},formatTags(e){return Mf(Ff(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)Ke(mt,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),Ke(mt,"emitDataLoaded")},0)}}}},nue={key:0},iue=["innerHTML"],rue={key:1,class:"node-info-container"},sue={class:"popover-block popover-header"},oue={key:0,class:"popover-collect"},aue={key:1,class:"row-item"},lue={class:"label"},cue={key:2,class:"row-item"},uue={class:"value"},due={class:"node-type-info"},fue={class:"name"},hue={key:3,class:"row-item"},pue={class:"value"},gue={class:"popover-block popover-fields"},mue={key:0,class:"node-detail top-border"},vue={key:0,class:"row-item"},bue=["title"],yue={key:1,class:"row-item row-item-tag"},_ue={class:"value"},wue={class:"graph-tags-box"},Cue={key:0,class:"row-item"},Sue={class:"label"},Eue=["title"],xue={key:1,class:"node-statistics top-border"},Aue={class:"row-item node-num"},Pue={class:"value"},Tue={key:0},Oue={class:"danger"},Nue={key:2,class:"node-aggregation"},Iue={class:"aggregation-title"},Rue={class:"aggregation-box"},Due={key:2,class:"node-info-container"},Lue={class:"popover-fields"},kue={class:"top"};function Mue(e,t,n,r,s,o){const a=Ge("force-graph-svg-icon"),l=hi,c=Wc,u=$z,d=Jo,f=Uz;return R(),U("div",{class:ee(["popover-container",o.show?"show-popover":"hide-popover"]),style:Ze(s.position),onMouseenter:t[0]||(t[0]=(...h)=>o.handleMouseEnter&&o.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>o.handleMouseLeave&&o.handleMouseLeave(...h))},[K("div",null,[o.show&&n.customTooltip&&s.isFunction(n.customTooltip)?(R(),U("div",nue,[K("div",{innerHTML:n.customTooltip({nodeInfo:n.nodeInfo,data:n.data,moduleDetail:n.moduleDetail})},null,8,iue)])):n.type==="node"?(R(),U("div",rue,[K("div",sue,[n.nodeInfo.collect?(R(),U("div",oue,[ie(l,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:ne(()=>[ie(a,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):oe("",!0),o.isNormalNode?(R(),U("div",aue,[K("div",lue,Ne(o.getTypeZh(n.nodeInfo.type))+":",1),K("div",{class:ee(["value",{"star-next":n.nodeInfo.collect}])},Ne(o.name),3)])):oe("",!0),o.isNodeTypeNode?(R(),U("div",cue,[t[2]||(t[2]=K("div",{class:"label"},"关系节点:",-1)),K("div",uue,[K("div",due,[K("div",fue,Ne(n.nodeInfo.name),1)])])])):oe("",!0),n.nodeInfo.label?(R(),U("div",hue,[t[3]||(t[3]=K("div",{class:"label"},"备注:",-1)),K("div",pue,Ne(n.nodeInfo.label),1)])):oe("",!0)]),K("div",gue,[o.isNormalNode&&n.nodeInfo.detail?(R(),U("div",mue,[o.canGoDetail&&o.hasLevel?(R(),U("div",vue,[t[4]||(t[4]=K("div",{class:"label"},"危险级别:",-1)),K("div",{class:ee(["value level",o.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},Ne(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,bue)])):oe("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(R(),U("div",yue,[t[7]||(t[7]=K("div",{class:"label"},"标签:",-1)),K("div",_ue,[K("div",wue,[(R(!0),U(qe,null,It(o.formatTags(n.nodeInfo.detail.tags),(h,g)=>(R(),ye(l,{key:g,"popper-class":"el-tooltip-gray"},{content:ne(()=>[K("div",null,[Ye(Ne(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(R(),U(qe,{key:0},[t[5]||(t[5]=K("br",null,null,-1)),t[6]||(t[6]=Ye(" 标签状态:失效 "))],64)):oe("",!0)])]),default:ne(()=>[K("span",null,[ie(c,{class:ee(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:ne(()=>[Ye(Ne(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):oe("",!0),(R(!0),U(qe,null,It(o.fieldMapThisType,(h,g)=>(R(),U(qe,null,[o.canShowField(h)?(R(),U("div",Cue,[K("div",Sue,Ne(h.zh)+":",1),K("div",{class:ee(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[g]},Ne(o.getFieldValue(h)),11,Eue)])):oe("",!0)],64))),256))])):oe("",!0),o.isNodeTypeNode?(R(),U("div",xue,[K("div",Aue,[t[9]||(t[9]=K("div",{class:"label"},"拓展节点统计:",-1)),K("div",Pue,[o.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(R(),U("span",Tue,[K("span",Oue,Ne(o.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),t[8]||(t[8]=Ye("/"))])):oe("",!0),Ye(Ne(o.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):oe("",!0),o.isAggregateNode?(R(),U("div",Nue,[K("div",Iue,"聚合节点 ("+Ne(s.aggregationList.length)+"个)",1),K("div",Rue,[ie(f,{data:s.aggregationList,style:{width:"100%"}},{default:ne(()=>[ie(u,{prop:"name","min-width":"200",label:"名称"}),ie(u,{sortable:"",prop:"type",label:"类型"}),ie(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:ne(h=>[K("span",{style:Ze({color:o.getColorStyle(h.row.level)})},Ne(h.row.level||"--"),5)]),_:1}),ie(u,{label:"操作"},{default:ne(h=>[ie(d,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:g=>o.addToGraph(h.row)},{default:ne(()=>t[10]||(t[10]=[Ye(" 添加到图谱 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):oe("",!0)])])):(R(),U("div",Due,[K("div",Lue,[K("div",kue,Ne(n.nodeInfo.apiName),1)])]))])],38)}const Fue=fn(tue,[["render",Mue],["__scopeId","data-v-194a65c9"]]),Bue=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],vy={name:"vue-safe-force-graph",version:"2.0.76",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64","lib:webcomponent":"vite build --mode web_component",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm run lib:webcomponent && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.7","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.8.8",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.5.3","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.4","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-element-plus":"^0.8.0","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},_me="",{toClipboard:jue}=Bf(),Uue="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",qr=1,$ue=["ip","intranet","internet"],by=20,$n={},Vue={name:"ForceGraphRenderByCanvas",components:{Popover:Fue,NodeContextmenu:eue},mixins:[kr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},linkDistance:{type:Number,default:120},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeWidth:{type:Number},startNodeWidth:{type:Number},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function},enableScript:{type:Boolean,default:!1},edgeLabelMaxLength:{type:Number,default:10},customNodeImages:{type:Object,default:()=>{}}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,customIconLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:sl()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:bn(null),layer:bn(null),nodesGroup:bn({}),linksGroup:bn({}),grab:bn(null),simulation:bn(null),nodes:bn(null),links:bn(null),hoveredNode:bn(null),mouseDownNode:bn(null),selectionRect:null,selection:[],scale:qr,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=us(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return ot(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&!this.customIconLoaded&&(yield this.loadCustomIcon(),yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return ot(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update();const n=document.querySelectorAll(`.${this.uniqueClass}.render-container`);n!=null&&n.length&&(this.isThreatPath?n[0].setAttribute("data-theme",t):(n[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t)))},200)})},immediate:!0}},created(){vs.setProject("QH_10542_1724").getTrack(),console.log("组件版本: "+(vy==null?void 0:vy.version)),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return ot(this,null,function*(){new Pce({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),Uq(this.levelList),!this.isThreatPath&&(no(mt,"buttonClick",e=>{gi(e,"buttonClick msg"),this.handleContextMenuClick(e)}),no(mt,"relationClick",e=>{this.handleContextMenuClick(e)}),no(mt,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){io(mt,"buttonClick"),io(mt,"relationClick"),io(mt,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),gi("destroy")},methods:{initForceGraph(){return ot(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(s=>{for(const o of s){if(t=o.contentRect.width,n=o.contentRect.height,gi(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new zt.Stage({container:e,width:t,height:n,scaleX:qr,scaleY:qr}),this.layer=new zt.Layer,this.grab=new zt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab);const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",s=>{if(!this.mousedownNode||!s.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&s.evt.altKey){const o=this.stage.getPointerPosition(),a=(o.x-this.stage.x())/this.scale,l=(o.y-this.stage.y())/this.scale,c=a-this.selectionRect.x(),u=l-this.selectionRect.y();this.selectionRect.width(c),this.selectionRect.height(u),this.stage.batchDraw()}}else{const o=this.stage.getPointerPosition(),a=this.stage.scaleX(),l=(o.x-this.stage.x())/a,c=(o.y-this.stage.y())/a;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,l,c]),this.layer.batchDraw()}}),this.stage.on("wheel",s=>{s.evt.preventDefault();const o=1.1,a=this.scale,l=s.evt.deltaY<0?a*o:a/o;this.scale=l;const c=this.stage.getPointerPosition(),u=this.stage.position(),d=c.x-(c.x-u.x)*(l/a),f=c.y-(c.y-u.y)*(l/a);this.stage.setAttrs({scaleX:l,scaleY:l,x:d,y:f}),this.layer.batchDraw()}),this.stage.on("mousedown",s=>{const o=s.target;if(o&&o.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),s.evt.altKey){this.stage.setDraggable(!1);const a=this.stage.scaleX(),l=this.stage.getPointerPosition(),c=(l.x-this.stage.x())/a,u=(l.y-this.stage.y())/a;this.selectionRect=new zt.Rect({x:c,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",s=>{if(this.stage.setDraggable(!1),this.selectionRect&&s.evt.altKey){const o=this.selectionRect.x(),a=this.selectionRect.y(),l=this.selectionRect.width(),c=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const d={x:u.x,y:u.y},f=Math.min(o,o+l),h=Math.max(o,o+l),g=Math.min(a,a+c),v=Math.max(a,a+c);return d.x>=f&&d.x<=h&&d.y>=g&&d.y<=v}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",s=>{s.target&&s.target.nodeType==="Stage"&&this.handleDeselectNode(s)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*qr),t=this.stage.height()/(2*qr);this.hasSimulation=!0,this.simulation=_Q(this.nodes).force("link",sQ(this.links).id(r=>r.id).distance(this.linkDistance).strength(1)).force("charge",wQ().strength(this.strength)).force("x",CQ()).force("y",SQ()).force("center",z8(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.nodeWidth&&this.simulation.force("collision",iQ().radius(this.nodeWidth/2)),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{gi("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;gi("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)gi("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return ot(this,null,function*(){var t,n,r;!this.iconAllLoaded&&((n=(t=this.moduleDetail)==null?void 0:t.nodes)!=null&&n.length)&&!this.customIconLoaded&&(yield this.loadIcons(),yield this.loadCustomIcon()),!this.destroyed&&(r=this.nodes)!=null&&r.length&&(this.initScript(),gi("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new zt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab)},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>ot(this,null,function*(){var _,w,A,C,S,x,T,N,I,B,D,M,G,H,ae,X,k,z,W,Z,j,we,ge;const s=(w=(_=r.detail)==null?void 0:_.info)==null?void 0:w.icon_img;let o;r.type==="nodeType"?o=this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:o=this.iconSize[r.icon]||this.iconSize[r.type]||24,r.startNode&&this.startNodeWidth&&(o=this.startNodeWidth);const a=((S=(C=(A=r==null?void 0:r.detail)==null?void 0:A.info)==null?void 0:C.basic)==null?void 0:S.level)||"",l=(N=(T=(x=r==null?void 0:r.detail)==null?void 0:x.info)==null?void 0:T.basic)==null?void 0:N.flag;let c;try{c=yield this.getNodeImage(r)}catch(re){console.log(re)}this.nodesGroup[r.id]&&((I=this.nodesGroup[r.id])==null||I.destroy());const u=new zt.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&u.addName("isSelected"),r.startNode&&this.startNodeAnimation){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0}),Se=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0}),_e=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0});u.add(ce),u.add(Se),u.add(_e);const q=(Q,fe)=>new zt.Animation(function(Re){const Le=Re.time;if(Le%fe/fe===0)return!1;const V=.5-.5*(Le%fe)/fe,Y=40*(Le%fe)/fe;Q.radius(Y||0),Q.opacity(V)},this.layer);(B=this.anim1)==null||B.stop(),(D=this.anim2)==null||D.stop(),(M=this.anim3)==null||M.stop(),this.anim1=q(ce,1500),this.anim2=q(Se,1500),this.anim3=q(_e,1500),(G=this.anim1)==null||G.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:this.startNodeAnimation?0:.3});u.add(ce)}if(!s&&(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country")){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:o/2,stroke:re,strokeWidth:2});u.add(ce)}if(c){const re=l||(ae=(H=r==null?void 0:r.detail)==null?void 0:H.info)!=null&&ae.inner_country?20:o,ce=c&&new zt.Image({x:0,y:0,offsetX:re/2,offsetY:re/2,image:c,width:re,height:re,draggable:!1});u.add(ce)}if(!s&&r.detail&&r.type==="md5"){const re=((z=(k=(X=r.detail.info)==null?void 0:X.basic)==null?void 0:k.file_type)==null?void 0:z.toUpperCase())||"MD5",ce=new zt.Text({name:"md5Text",x:0,y:0,text:re,fontSize:4,fontWeight:700,fontFamily:Uue,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});ce.x(ce.x()-ce.width()/2),u.add(ce)}const d=r.textProp||"name",f=d==="name"?((Z=(W=r==null?void 0:r.detail)==null?void 0:W.info)==null?void 0:Z.name)||r.name:r[d];let h=(f==null?void 0:f.length)>14&&!$ue.includes(r.type)?f.slice(0,7)+"..."+f.slice(-7):f;h=Jq(h);const g=new zt.Text({offsetY:o/2,name:"konvaText",x:0,y:o+8,text:h,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});g.x(g.x()-g.width()/2),u.add(g);const v=new zt.Circle({name:"border",x:0,y:0,radius:o/2,fill:"#5c6271",opacity:.4,visible:!1});if(u.add(v),(we=(j=r.detail)==null?void 0:j.tags)!=null&&we.length){const re=new zt.Circle({x:((o/2||14)+5)*Math.sin(60*Math.PI/180),y:-((o/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});u.add(re)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var y=new zt.Circle({name:"collect",x:((o/2||14)+5)*Math.sin(0*Math.PI/180),y:-((o/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});u.add(y)}if(r.label){const re=new zt.Circle({x:((o/2||14)+5)*Math.sin(30*Math.PI/180),y:-((o/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});u.add(re)}if(r.type==="nodeType"&&r.showTotal){const re=(o/2||14)+5,ce=70*Math.PI/180,Se=re*Math.sin(ce),_e=-re*Math.cos(ce),q=new zt.Circle({x:Se,y:_e,radius:10,fill:"#1890ff",stroke:"white",strokeWidth:2,listening:!1});u.add(q);const Q=new zt.Text({x:Se,y:_e,text:`${((ge=r==null?void 0:r.children)==null?void 0:ge.length)||0}`,fontSize:10,fontFamily:"Calibri",fill:"#fff",align:"center",verticalAlign:"middle",listening:!1});Q.offsetX(Q.width()/2),Q.offsetY(Q.height()/2),u.add(Q)}u.on("dragstart",(re,ce)=>{re.evt&&re.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),u.on("dragmove",re=>{if(!(re.evt&&re.evt[this.actKey])){var ce=this.simulation.nodes().find(Se=>Se.id===r.id);ce&&(ce.x=u.x(),ce.fx=u.x(),ce.y=u.y(),ce.fy=u.y(),this.links.forEach(Se=>{const _e=this.linksGroup[`${Se.source.id}-${Se.target.id}`],q=_e==null?void 0:_e.findOne(".konvaLine"),Q=_e==null?void 0:_e.findOne(".linkArrow"),fe=_e==null?void 0:_e.findOne(".edgeLabel");let Re,Le,Je,V;if(Se.source.id===ce.id){if(!this.nodesGroup[Se.target.id])return;Re=ce.x,Le=this.nodesGroup[Se.target.id].x(),Je=ce.y,V=this.nodesGroup[Se.target.id].y(),q.points([Re,Je,Le,V]);const Y=D0(Re,Je,Le,V,by);Q==null||Q.x(Y==null?void 0:Y.x),Q==null||Q.y(Y==null?void 0:Y.y),Q==null||Q.rotation(Math.atan2(V-Je,Le-Re)*(180/Math.PI))}else if(Se.target.id===ce.id){if(!this.nodesGroup[Se.source.id])return;Re=this.nodesGroup[Se.source.id].x()||0,Le=ce.x||0,Je=this.nodesGroup[Se.source.id].y()||0,V=ce.y||0,q.points([Re,Je,Le,V]);const Y=D0(Re,Je,Le,V,by);Q==null||Q.x(Y==null?void 0:Y.x),Q==null||Q.y(Y==null?void 0:Y.y),Q==null||Q.rotation(Math.atan2(V-Je,Le-Re)*(180/Math.PI))}if(fe&&(Se.source.id===ce.id||Se.target.id===ce.id)){fe.x((Re+Le)/2),fe.y((Je+V)/2),fe.offsetX(fe.getWidth()/2||0),fe.offsetY(fe.getHeight()/2+8||0);const Y=Math.atan2(V-Je,Le-Re)*(180/Math.PI);Le<Re?fe.rotation(Y+180):fe.rotation(Y)}}),this.layer.batchDraw())}}),u.on("dragend",re=>{re.evt&&re.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),u.on("click",re=>{re.evt.detail===2?this.expandNodes(re,r):re.evt.detail===1&&re.evt.button===0&&this.handleNodeClick(re,r)}),u.on("contextmenu",re=>{re.cancelBubble=!0,re.evt.preventDefault(),re.evt.stopPropagation(),this.handleNodeContextMenu(re,r,u)}),u.on("mouseup",re=>this.handleNodeMouseUp(re,r)),u.on("mousedown",re=>this.handleNodeMouseDown(re,r)),u.on("mouseenter",re=>this.handleNodeMouseEnter(re,r)),u.on("mouseleave",re=>this.handleNodeMouseLeave(re,r)),this.grab.add(u),this.nodesGroup[r.id]=u})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new zt.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),s=this.darkMode?"#445152":"#999",o=new zt.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:s});r.add(o);const a=n.source.x||0,l=n.source.y||0,c=n.target.x||0,u=n.target.y||0,d=new zt.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[a,l,c,u],stroke:n.target.type==="org"?"#cf1322":s,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.edgeLabelProp){const f=n.edgeLabelProp.length>this.edgeLabelMaxLength?n.edgeLabelProp.substring(0,this.edgeLabelMaxLength)+"...":n.edgeLabelProp,h=new zt.Text({name:"edgeLabel customEdgeLabel",x:(a+c)/2,y:(l+u)/2,text:f,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(h)}if(n.target.type==="nodeType"){const f=n.target.relay_name||n.target.name,h=new zt.Text({name:"edgeLabel",x:(a+c)/2,y:(l+u)/2,text:f,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(h)}r.add(d),r.on("mouseenter",f=>this.handleLinkMouseEnter(f,n)),r.on("mouseleave",f=>this.handleLinkMouseLeave(f,n)),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(gi("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],s=this.linksGroup[`${r.source.id}-${r.target.id}`],o=s==null?void 0:s.findOne(".konvaLine"),a=s==null?void 0:s.findOne(".linkArrow"),l=s==null?void 0:s.findOne(".edgeLabel");let c=r.source.x,u=r.source.y,d=r.target.x,f=r.target.y;const h=d-c||1,g=f-u||1,v=Math.sqrt(h*h+g*g),y=h/v||1,_=g/v||1,w=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,A=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(c=c+w*y,u=u+w*_,d=d-A*y,f=f-A*_,isNaN(c)||isNaN(u)||isNaN(d)||isNaN(f)){e=!1;break}if(o==null||o.points([c,u,d,f]),a){const C=D0(c,u,d,f,by);a==null||a.x((C==null?void 0:C.x)||0),a==null||a.y((C==null?void 0:C.y)||0),a==null||a.rotation(Math.atan2(f-u,d-c)*(180/Math.PI))}if(l){l.x((c+d)/2),l.y((u+f)/2),l.offsetX(l.getWidth()/2||0),l.offsetY(l.getHeight()/2+8||0);const C=Math.atan2(f-u,d-c)*(180/Math.PI);d<c?l.rotation(C+180):l.rotation(C)}}if(!e){gi("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const s=this.linksGroup[`${r.source.id}-${r.target.id}`];s==null||s.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const s=t.find(a=>a.source.id===r.source.id&&a.target.id===r.target.id),o=this.linksGroup[`${r.source.id}-${r.target.id}`];s?o==null||o.addName("keyed"):o==null||o.removeName("keyed")}),this.nodes.forEach(r=>{const s=this.nodesGroup[r.id];n.includes(r.id)?s==null||s.addName("keyed"):s==null||s.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),s=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(s)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),s=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const o=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const a=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(a),s.fill(a),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const a=e.target.type==="org"?"#cf1322":o;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(a),s.fill(a),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!sl()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(sl())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,s,o,a,l,c;if(!this.enableScript||this.scriptInited)return;((o=(s=(r=this.history)==null?void 0:r.dataNow)==null?void 0:s.nodes)==null?void 0:o.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((c=(l=(a=this.history)==null?void 0:a.dataNow)==null?void 0:l.nodes)==null||c.some(u=>{const d=e.indexOf(u.id);return d>=0&&u.startNode===!0&&(t=d),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(A=>e.indexOf(A.id)>=0);r==null||r.forEach(function(A,C){const S=this.nodesGroup[A.id];n.push({bounds:(S==null?void 0:S.getClientRect())||{},fx:A.x||0,fy:A.y||0})});const s=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const o=this.stage.width(),a=this.stage.height()/1.5,l=s.width,c=s.height;if(l===0||c===0)return;let u=t/Math.max(l/o,c/a);u=Math.min(u,qr)||qr,this.scale=u;const d=this.stage.width()/(2*u),f=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],g=h==null?void 0:h.getClientRect(),v=g.x*u,y=g.y*u,_=d-v,w=f-y;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:w||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,s;return e.map(o=>{const a=o.bounds,l=a.x+o.fx,c=a.y+o.fy;t=Math.min(l,t)||l,n=Math.min(c,n)||c,r=Math.max(l+a.width,r)||l+a.width,s=Math.max(c+a.height,s)||c+a.height}),{x:t,y:n,width:r-t,height:s-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadCustomIcon(){if(this.customNodeImages&&!this.customIconLoaded){let e=0;const t=Object.keys(this.customNodeImages).length;Object.keys(this.customNodeImages).forEach(n=>ot(this,null,function*(){e++,$n[n]=yield Lr(this.customNodeImages[n]),e===t&&(this.customIconLoaded=!0)}))}else this.customIconLoaded=!0},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const c in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[c];u==null||u.map(d=>{d.children?r.push(...d.children):r.push(d)})}n.push(...r.map(c=>c.icon)),n.push(...this.moduleDetail.nodes.map(c=>c.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const s=this;let o=0;const a=n.filter(c=>this.imgPath[`${s.prefix}d3svg1/${c}.svg`]);function l(c){return{}.VITE_SVG_TYPE==="base64"?VS(c):US(c)}a.map(c=>{l(this.imgPath[`${s.prefix}d3svg1/${c}.svg`]).then(u=>{s.iconFiles[c]=u;const d=Yq(u).width;this.iconSize[c]=this.nodeWidth?this.nodeWidth:d,o++,o===a.length&&(s.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt&&e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=Bue:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){Ke(this,"handle-select-node",{isSelected:!1,_node:it(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||B4(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),Ke(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){Bn({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(s=>s.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(s=>s.type==="nodeType"))return;n?this.selection=this.selection.filter(s=>s.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(s=>s.id===t.id);Ke(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),s=e.target,o=s.getAbsolutePosition(),l=s.getStage().container().getBoundingClientRect(),c=o.x-n/2+l.left,u=o.y-r/2+l.top,d=c,f=u,h=d,g=d+n,v=f,y=f+r;this.hoverNodePosition={top:v,right:g,bottom:y,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),s=(r.x-this.stage.x())/n,o=(r.y-this.stage.y())/n;this.mousedownPos={x:s,y:o},this.dragLine=new zt.Line({points:[s,o,s,o],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},handleLinkMouseEnter(e,t){if(t.target.type==="nodeType")return;const n=!!t.edgeLabelProp;let r;if(n?r=t.edgeLabelProp:r=t.target.relay_name||t.target.name,r.length<=this.edgeLabelMaxLength)return;const o=this.linksGroup[`${t.source.id}-${t.target.id}`].findOne(".edgeLabel"),a=t.source.x,l=t.source.y,c=t.target.x,u=t.target.y;o&&(o.text(r),o.x((a+c)/2),o.y((l+u)/2),o.offsetX(o.getWidth()/2||0),o.offsetY(o.getHeight()/2+8||0))},handleLinkMouseLeave(e,t){if(t.target.type==="nodeType")return;const n=!!t.edgeLabelProp;let r;if(n?r=t.edgeLabelProp:r=t.target.relay_name||t.target.name,r.length<=this.edgeLabelMaxLength)return;const o=this.linksGroup[`${t.source.id}-${t.target.id}`].findOne(".edgeLabel"),a=t.source.x,l=t.source.y,c=t.target.x,u=t.target.y;o&&(o.text(r.substring(0,this.edgeLabelMaxLength)+"..."),o.x((a+c)/2),o.y((l+u)/2),o.offsetX(o.getWidth()/2||0),o.offsetY(o.getHeight()/2+8||0))},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){var e,t;(e=this.simulation)!=null&&e.stop&&((t=this.simulation)==null||t.stop()),this.nodes.map(n=>{delete n.vx,delete n.vy,delete n.x,delete n.y,delete n.fx,delete n.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,s=0;const o=t[n];this.links.map(a=>{a.source.id===o&&r++,a.target.id===o&&s++}),r>=1&&t.splice(n,1),s>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var d,f,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),s=this.grab.getClientRect(),o=s.width/this.scale,a=s.height/this.scale;if(o===0||a===0)return;let l=e/Math.max(o/n,a/r);if(l=t?l:Math.min(l,qr)||qr,!t&&l>qr)return;this.scale=l;const c=this.stage.width()/(2*l),u=this.stage.height()/(2*l);if((d=this.simulation)!=null&&d.force&&((f=this.simulation)==null||f.force("center",z8(c,u))),this.ticked(),this.stage.setAttrs({scaleX:l,scaleY:l,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const g=this.grab.getClientRect(),v=(n-g.width)/2-g.x,y=(r-g.height)/2-g.y;this.stage.setAttrs({x:v,y}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,s;const o={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(a=>r.includes(a.id));break;case"hold_aggregation":s=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(s,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(a=>{a.textProp=o[t.name]}),this.update();break;case"all_show_label":case"all_show_names":this.nodes.map(a=>{a.textProp=o[t.name]}),this.update();break;case"un_show_names":case"un_show_label":e.map(a=>{a.textProp=null}),this.update();break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(a=>{a.textProp=null}),this.update();break;case"all_show_edges_label":this.links.map(a=>{a.edgeLabelProp=a.edge_label}),this.update();break;case"all_hide_edges_label":this.links.map(a=>{a.edgeLabelProp=null}),this.update();break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(a=>{this.starNode(a)});break;case"un_node_star":e.map(a=>{this.starNode(a,!1)});break;case"fix_nodes":e.map(a=>{this.toggleMove(a,!0)});break;case"un_fix_nodes":e.map(a=>{this.toggleMove(a,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(a=>{this.$parent.expandNodes(a)});break;case"expand_part_node":e.map(a=>{this.$parent.expandNodes(a,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;case"show_nodes":this.toggleShowNodes(e,!0);break;case"hide_nodes":this.toggleShowNodes(e,!1);break;default:Ke(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:it(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else vn({message:"无可操作权限",type:"warning"})},expandNodes(e,t){Bn({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):vn({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,null,n),this.selection.filter(s=>s.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},toggleShowNodes(e,t=!0){e.forEach(n=>{this.history.toggleShowNode(n,null,t)}),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
155
- `}),t&&jue(t).then(()=>{vn({message:"复制成功",type:"success"})},n=>{console.log("copy---e",n)})},toggleMove(e,t){e.fx=t?e.x:null,e.fy=t?e.y:null},autoDisplay(){this.nodes.map(e=>{e.fx=null,e.fy=null})},editLabel(e){var t;LS.prompt("修改备注",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:(t=e[0])==null?void 0:t.label,inputPlaceholder:"请输入备注,最多20字",inputValidator:n=>n.length>20?"已超过20字":!0}).then(({value:n})=>{e.map(r=>{r.label=n,this.showLabel(r,"label")}),this.updateNodeStyle()}).catch(n=>{console.log(n)})},showLabel(e,t){e.textProp=t,this.update()},hideLabel(e,t){e.textProp=null,this.update()},safeGet(e,t){return!e||!t?void 0:t.split(".").reduce((s,o)=>s&&s[o]?s[o]:void 0,e)},fixAllNodes(e=!0){this.nodes.map(t=>{this.toggleMove(t,e)}),!e&&this.isAutoTick&&this.updateSimulation()},highlightByRule(e,t){if(!e.prop&&!t){this.nodes.forEach(l=>{const c=this.nodesGroup[l.id];c==null||c.removeName("lowlight")}),this.links.forEach(l=>{const c=this.linksGroup[`${l.source.id}-${l.target.id}`];c==null||c.removeName("lowlight")});return}const{type:n,prop:r,value:s}=e,o=this,a=[];this.nodes.forEach(l=>{const c=this.nodesGroup[l.id];r?n==="include"?s.includes(o.safeGet(l,r))&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight"):n==="equal"?o.safeGet(l,r)===s&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight"):n==="boolean"&&(R0(o.safeGet(l,r))&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight")):o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight")}),this.links.forEach(l=>{const c=this.linksGroup[`${l.source.id}-${l.target.id}`];a.some(d=>d.id===l.target.id)?c==null||c.removeName("lowlight"):c==null||c.addName("lowlight")})},handleCustomSelect(e){if(this.handleDeselectNode(),!e.prop)return;const{type:t,prop:n,value:r}=e,s=this;this.nodes.forEach(o=>{if(n&&t==="include"){let a;if(o.type==="nodeType"){const l=s.safeGet(o,"parents"),c=s.safeGet(o,"children"),u=l==null?void 0:l.some(f=>r.includes(f)),d=c==null?void 0:c.some(f=>r.includes(f));a=u&&d}(r.includes(s.safeGet(o,n))||a)&&this.selection.push(o)}}),this.updateSelection()},inNodesRange(e,t){return e?e.some(n=>n===t.id):!0},loadFlagFiles(e){return ot(this,null,function*(){return new Promise(t=>{this.flagFiles[e]?t(this.flagFiles[e]):(this.flagFiles[e]=this.imgPath[`${this.prefix}d3svg1/flags/${e}.png`],t(this.flagFiles[e]))})})},getNodeImage(e){return ot(this,null,function*(){var s,o,a,l,c,u,d,f,h,g,v,y;let t=null;const n=(a=(o=(s=e.detail)==null?void 0:s.info)==null?void 0:o.basic)==null?void 0:a.flag,r=(u=(c=(l=e==null?void 0:e.detail)==null?void 0:l.info)==null?void 0:c.basic)==null?void 0:u.level;if(this.customNodeImages&&this.customNodeImages[e.type]){if($n[e.type])return $n[e.type];t=yield Lr(this.customNodeImages[e.type]),$n[e.type]=t}else if(e.detail&&((f=(d=e.detail)==null?void 0:d.info)!=null&&f.icon_img))try{t=yield Lr(e.detail.info.icon_img)}catch(_){console.log("loadCompleted error",_)}else if(e.detail&&((g=(h=e.detail)==null?void 0:h.info)!=null&&g.inner_img))try{t=yield Lr(e.detail.info.inner_img)}catch(_){console.log("loadCompleted error",_)}else if(e.type==="nodeType"||e.type==="aggregation"){if(e!=null&&e.icon_img)try{return t=yield Lr(e.icon_img),t}catch(w){console.log("loadCompleted error",w)}const _=e.icon||"node_type";if($n[_])return t=$n[_],t;t=this.iconFiles[_]?this.iconFiles[_]:this.iconFiles.node_type,t=yield Lr("data:image/svg+xml,"+encodeURIComponent(t)),$n[_]=t}else if(n&&(e.type==="ip"||e.type==="internet")){if($n[n])return t=$n[n],t;yield this.loadFlagFiles(n),t=yield Lr(this.flagFiles[n]),$n[n]=t}else if((y=(v=e.detail)==null?void 0:v.info)!=null&&y.inner_country&&(e.type==="country"||e.type==="target_country")){const _=e.detail.info.inner_country;if($n[_])return t=$n[_],t;yield this.loadFlagFiles(_),t=yield Lr(this.flagFiles[_]),$n[_]=t}else{const _=`${e.type||"node"}${r}${this.darkMode}`;if($n[_])return t=$n[_],t;t=this.iconFiles[e.type]?this.iconFiles[e.type]:this.iconFiles.node;const w=ea(r,this.levelList,this.darkMode),A=this.darkMode?"#182628":"#fff";t=$S(t,w,A);try{t=yield Lr("data:image/svg+xml,"+encodeURIComponent(t))}catch(C){console.log(C)}$n[_]=t}return t})},handleGoDetail(e){e.forEach(t=>{if(t.isCluster)return;const n=t.type,r=this.moduleDetail.config.jumpRule[n];if(r)if(n==="org"){const s=t.id.split("(")[0];s.indexOf("APT")>=0&&window.open(r.split("${id}").join(s),t.id)}else{let s=t.origin&&t.origin[0]||t.id;(n==="url"||n==="virus")&&(s=encodeURIComponent(s)),window.open(r.split("${id}").join(s),t.id)}})},starNode(e,t=!0){e.collect=t,this.update()},handleAddBlack(e){this.showBlackType=!0,this.node=e},changeVisible(e){this.showBlackType=e},zoomIn(){this.adjustZoom(1.1)},zoomOut(){this.adjustZoom(.909)},adjustZoom(e){const n=this.stage.scaleX()*e;this.scale=n;const r={x:this.stage.width()/2,y:this.stage.height()/2},s={x:this.stage.getPointerPosition().x-this.stage.x(),y:this.stage.getPointerPosition().y-this.stage.y()},o={x:-(s.x-r.x)*(e-1),y:-(s.y-r.y)*(e-1)};this.stage.setAttrs({x:this.stage.x()+o.x,y:this.stage.y()+o.y,scaleX:n,scaleY:n}),this.layer.batchDraw()},addNodesDetail(e){return ot(this,null,function*(){const t=e.filter(s=>!s.detail&&s.noDetail!==!0&&s.type!=="aggregation"&&s.type!=="nodeType"),n={};t.map(s=>{n[s.type]?n[s.type].push(s):n[s.type]=[s]});const r=[];for(const s in n){const o=n[s],a={};o.map(l=>{l.origin&&(a[l.id]=l.origin)}),r.push(this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[n[s][0].type],node_id:n[s].map(l=>l.id),origin:a}).then(l=>(l.data.records.map(u=>{const d=e.find(f=>f.id===u.info.id);d.detail=u}),Promise.resolve({}))))}})},addCanvasBg(){this.darkMode&&(this.darkBgRect=new zt.Rect({x:0,y:0,width:this.stage.width()/this.scale,height:this.stage.height()/this.scale,fill:"#021212",stroke:"#021212",listening:!1,draggable:!1}),this.layer.add(this.darkBgRect),this.darkBgRect.moveToBottom(),this.stage.draw())},removeCanvasBg(){this.darkBgRect&&this.darkBgRect.destroy(),this.darkBgRect=null,this.stage.draw()}}},zue={class:"main-svg-box","element-loading-text":"布局中...","element-loading-background":"rgba(122, 122, 122)"},que={ref:"canvasContainer",class:"canvas-container"};function Hue(e,t,n,r,s,o){const a=Ge("popover"),l=Ge("node-contextmenu"),c=IS;return R(),U("div",{class:ee(["render-container",n.darkMode?"dark-theme "+s.uniqueClass:" "+s.uniqueClass])},[Lt((R(),U("div",zue,[K("div",que,null,512)])),[[c,s.ticking]]),ie(a,{"dark-mode":n.darkMode,"show-popover":s.showPopover&&!s.isDragging,"mouse-position":s.hoverNodePosition,"node-info":s.popoverNode,"module-detail":n.moduleDetail,type:s.popoverType,"custom-tooltip":n.customTooltip,history:n.history,data:n.history.dataNow},null,8,["dark-mode","show-popover","mouse-position","node-info","module-detail","type","custom-tooltip","history","data"]),n.isThreatPath?oe("",!0):(R(),ye(l,{key:0,show:o.showContextMenuFlag,axis:s.mousePosition,"node-info":o.contextMenuNodes,history:n.history,"menu-options":s.menuOptions,"module-detail":n.moduleDetail,onContextmenuClick:o.handleContextMenuClick},null,8,["show","axis","node-info","history","menu-options","module-detail","onContextmenuClick"]))],2)}const Gue=fn(Vue,[["render",Hue]]),wme="",Cme="",Sme="",{toClipboard:MA}=Bf(),Wue={name:"SnapShotDialog",components:{},mixins:[],props:{snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,ruleForm:{radio:"0",event:"",group:"",graphDesc:""},rules:{event:[{required:!0,message:"请选择安全事件",trigger:"change"}],group:[{required:!1,message:"请选择团队",trigger:"change"}]},eventOptions:[{value:"",label:""}],groupOptions:[{value:"",label:""}],hostList:["https://sc.360.net","https://sc.b.qihoo.net","http://sec.test.safe.qihoo.net"],isInnerAccount:!1,visibleSuccess:!1,eventUrl:null}},computed:{},watch:{snapshot:{handler:function(e,t){e.name&&(this.ruleForm.graphDesc=e.name)},immediate:!0,deep:!0}},mounted(){this.graphApi.getReportList&&this.graphApi.getReportList().then(e=>{e.data!==null&&(this.eventOptions=[],e.data.map(t=>{this.eventOptions.push({label:t.title,value:t.report_id})}))}),this.graphApi.getGroupList&&this.graphApi.getGroupList().then(e=>{e.data!==null?(this.groupOptions=[],e.data.map(t=>{this.groupOptions.push({label:t.group_name,value:t.group_id})}),this.isInnerAccount=!0):this.isInnerAccount=!1})},updated(){},beforeUnmount(){},methods:{hanleClickCopy(e){MA(e).then(t=>vn({message:"复制成功",type:"success"}),t=>vn.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1,this.resetForm("ruleForm")},submitForm(e){this.$refs[e].validate(t=>{if(t){const n=this.hostList.some(l=>l===this.origin);let r=null;n?this.origin===this.hostList[1]?r=`${this.hostList[0]}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`${this.origin}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`http://test.sec.360.net/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`,this.eventUrl=window.location.origin+"/event/"+this.ruleForm.event;const s=this.snapshot.thumb;let o=null;this.groupOptions.map(l=>{l.value===this.ruleForm.group&&(o=l.label)});const a={report_id:this.ruleForm.event,group_id:this.ruleForm.group,content:s,graph_url:r,group_name:o,acl:parseInt(this.ruleForm.radio),head:this.ruleForm.graphDesc};this.graphApi.addGraph(a).then(l=>{l.code==="0"?(MA(this.eventUrl),vn({message:"分享成功! 分享事件地址已经复制",type:"success",showClose:!0,duration:5e3})):vn({message:"分享失败",type:"error"})}).catch(()=>{vn({message:"分享失败",type:"error"})}),this.resetForm(e),this.dialogVisible=!1}else return!1})},resetForm(e){this.$refs[e].resetFields(),this.snapshot.name=""}}},Kue={class:"sharetoEvents"},Jue={class:"lable-header"},Yue={class:"desc"},Xue={key:0,class:"desc-font"},Zue={key:1,class:"desc-font"},Que={class:"dialog-footer"};function ede(e,t,n,r,s,o){const a=M$,l=xf,c=Ef,u=Gm,d=Js,f=Hm,h=Jo,g=Kc;return R(),U("div",Kue,[ie(g,{title:"分享到安全事件","append-to-body":"","close-on-click-modal":!1,width:"25%",modelValue:s.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=v=>s.dialogVisible=v),class:"el-dialog-graph"},{footer:ne(()=>[K("span",Que,[ie(h,{type:"primary",onClick:t[5]||(t[5]=v=>o.submitForm("ruleForm"))},{default:ne(()=>t[9]||(t[9]=[Ye("确认分享")])),_:1}),ie(h,{onClick:o.hide},{default:ne(()=>t[10]||(t[10]=[Ye("关闭")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(f,{ref:"ruleForm",model:s.ruleForm,rules:s.rules,"label-width":"100px",class:"demo-ruleForm"},{default:ne(()=>[K("div",Jue,[ie(a,{modelValue:s.ruleForm.radio,"onUpdate:modelValue":t[0]||(t[0]=v=>s.ruleForm.radio=v),class:"el-radio",label:"1",border:"",size:"medium"},{default:ne(()=>t[7]||(t[7]=[Ye("付费可见")])),_:1},8,["modelValue"]),ie(a,{modelValue:s.ruleForm.radio,"onUpdate:modelValue":t[1]||(t[1]=v=>s.ruleForm.radio=v),label:"0",border:"",size:"medium"},{default:ne(()=>t[8]||(t[8]=[Ye("开放")])),_:1},8,["modelValue"]),K("div",Yue,[s.ruleForm.radio==="0"?(R(),U("span",Xue,"该Graph内容对所有用户可见。")):(R(),U("span",Zue,"该Graph内容对付费用户可见。"))])]),ie(u,{label:"安全事件",prop:"event"},{default:ne(()=>[ie(c,{modelValue:s.ruleForm.event,"onUpdate:modelValue":t[2]||(t[2]=v=>s.ruleForm.event=v),"popper-append-to-body":!1,filterable:"",placeholder:"请选择",class:"select-item"},{default:ne(()=>[(R(!0),U(qe,null,It(s.eventOptions,v=>(R(),ye(l,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s.isInnerAccount?(R(),ye(u,{key:0,label:"选择团队",prop:"group"},{default:ne(()=>[ie(c,{modelValue:s.ruleForm.group,"onUpdate:modelValue":t[3]||(t[3]=v=>s.ruleForm.group=v),class:"select-item",filterable:"",placeholder:"请选择"},{default:ne(()=>[(R(!0),U(qe,null,It(s.groupOptions,v=>(R(),ye(l,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):oe("",!0),ie(u,{label:"Graph介绍",prop:"graphDesc"},{default:ne(()=>[ie(d,{modelValue:s.ruleForm.graphDesc,"onUpdate:modelValue":t[4]||(t[4]=v=>s.ruleForm.graphDesc=v),type:"textarea",rows:2,placeholder:"请输入内容",maxlength:"50",clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}const tde=fn(Wue,[["render",ede]]),Eme="",{toClipboard:nde}=Bf(),ide={name:"SnapShotDialog",components:{ShareToSecurityEvents:tde},mixins:[],props:{customCopyPathFn:{type:Function},graphUrlPath:{type:String,default:"/graph"},snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,isInnerAccount:!1}},computed:{linkAddress(){return this.customCopyPathFn&&typeof this.customCopyPathFn=="function"?this.customCopyPathFn({snapshot_id:this.snapshot.snapshot_id}):`${this.origin}${this.graphUrlPath}?snapshot_id=${this.snapshot.snapshot_id}`},linkAddressAndCode(){return this.customCopyPathFn&&typeof this.customCopyPathFn=="function"?this.customCopyPathFn({snapshot_id:this.snapshot.snapshot_id,vcode:this.snapshot.vcode}):`${this.linkAddress}&vcode=${this.snapshot.vcode}`}},watch:{},created(){},mounted(){no(mt,"sharePermission",e=>{this.isInnerAccount=e})},updated(){},beforeUnmount(){io(mt,"sharePermission")},methods:{hanleClickCopy(e){nde(e).then(t=>vn({message:"复制成功",type:"success"}),t=>vn.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1},shareToEvents(){this.dialogVisible=!1,this.$refs.sharetoevents.show()}}},rde={class:"snapshotdialog-container"},sde={class:"dialog-footer"};function ode(e,t,n,r,s,o){const a=Js,l=tV,c=Jo,u=Kc,d=Ge("ShareToSecurityEvents");return R(),U("div",rde,[ie(u,{modelValue:s.dialogVisible,"onUpdate:modelValue":t[2]||(t[2]=f=>s.dialogVisible=f),title:"复制链接及提取码","append-to-body":"","close-on-click-modal":!1,class:"el-dialog-graph"},{footer:ne(()=>[K("span",sde,[s.isInnerAccount?(R(),ye(c,{key:0,type:"primary",onClick:t[0]||(t[0]=f=>o.shareToEvents())},{default:ne(()=>t[5]||(t[5]=[Ye("分享到安全事件")])),_:1})):oe("",!0),ie(c,{type:"primary",onClick:t[1]||(t[1]=f=>o.hanleClickCopy(o.linkAddressAndCode))},{default:ne(()=>t[6]||(t[6]=[Ye("复制链接及提取码")])),_:1}),ie(c,{onClick:o.hide},{default:ne(()=>t[7]||(t[7]=[Ye("关闭")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(a,{value:o.linkAddress,readonly:""},{prepend:ne(()=>t[3]||(t[3]=[Ye("链接地址:")])),_:1},8,["value"]),ie(l),ie(a,{value:n.snapshot.vcode,readonly:""},{prepend:ne(()=>t[4]||(t[4]=[Ye("提取码:")])),_:1},8,["value"])]),_:1},8,["modelValue"]),ie(d,{ref:"sharetoevents",snapshot:n.snapshot,"graph-api":n.graphApi},null,8,["snapshot","graph-api"])])}const ade=fn(ide,[["render",ode]]),xme="",lde={name:"ForceGraphByCanvas",components:{Loading:Va,ForceGraphSvgIcon:Qo,RenderByCanvas:Gue,ButtonList:iX,SnapShotDialog:ade,RightMenu:EW,Legend:SJ,NodeVisibleControl:OJ},mixins:[kr],provide:function(){return{history:this.history,hasLevel:this.hasLevel,levelList:this.levelList,levelMap:this.levelMap,getDarkMode:()=>this.darkMode,requestGraphData:this.requestGraphData,moduleDetail:()=>this.moduleDetail}},props:{showPoint:{type:Boolean,default:!0},isRenderStartNode:{type:Boolean,default:!0},isDefaultSelectStartNode:{type:Boolean,default:!0},isShowRightMenu:{type:Boolean,default:!0},hideButtonList:{type:Array,default:()=>[]},showTopSearch:{type:Boolean,default:!1},customContextMenuEvent:{type:Function},handleSelectNodeEvent:{type:Function},handleDataLoaded:{type:Function},graphApi:{type:Object,default:()=>{}},graphUrlPath:{type:String,default:"/graph"},customCopyPathFn:{type:Function},snapshot_id:{type:String,default:""},vcode:{type:String,default:""},module:{type:String,default:""},startNode:{type:Array,default:()=>[]},enterStartNode:{type:Boolean,default:!1},hasLevel:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",iconType:"",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",iconType:"",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",iconType:"",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",iconType:"",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},showLevelCount:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},title:{type:String,default:""},isShowNodeMessage:{type:Boolean,default:!0},nodeWidth:{type:Number},startNodeWidth:{type:Number},linkDistance:{type:Number},strength:{type:Number},nodeTypeScale:{type:Number},singlesNodeMaxNum:{type:Number,default:100},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function},enableScript:{type:Boolean,default:!1},edgeLabelMaxLength:{type:Number,default:10},hasNodeVisibleControl:{type:Boolean,default:!1},hasLegend:{type:Boolean,default:!0},customNodeImages:{type:Object,default:()=>{}},isShowNodeType:{type:Boolean,default:!0}},emits:["sharePermission","custom-contextmenu-click","handle-select-node","handle-data-loaded","outdate"],data(){return{history:new Fq({isShowNodeMessage:this.isShowNodeMessage}),isLoading:!1,bigLoading:!1,loadingInfo:"数据加载中",moduleDetail:{},contextMenuNode:{},contextMenuId:0,isDragging:!1,isCtrlDown:!1,selection:[],snapshot:{},inited:!1,outdateTime:0,fullScreen:!1,generateUniqueIndexNow:this.generateUniqueIndex(),screenHeight:0,margin:"0",requestGraphData:!0,nodeTypeList:[]}},computed:{topFrame(){return window.top.location===window.location},levelMap(){const e={};return this.levelList.forEach(t=>{e[t.level]=t}),e}},watch:{startNode:{handler:function(e,t){this.moduleDetail.module&&this.searchStartNode()},immediate:!0,deep:!0},screenHeight:{deep:!0,handler:function(){this.margin=this.changeMargin()}},graphApi:{handler:function(){this.$nextTick(()=>{this.initializeGraphApi()})},deep:!0,immediate:!0}},unmounted(){window.onresize=null},mounted(){return ot(this,null,function*(){console.log('"2024/11/19 15:04:27"',"2024/11/19 15:04:27"),this.initializeGraphApi(),window.onresize=()=>{this.fullScreen=!!document.fullscreenElement,this.screenHeight=document.body.clientHeight},this.margin=this.changeMargin(),no(mt,"emitDataLoaded",()=>{this.emitDataLoaded()})})},methods:{initializeGraphApi(){if(this.graphApi){if(this.snapshot_id)this.isLoading=!0,this.graphApi.getSnapshotDetail({snapshot_id:this.snapshot_id,vcode:this.vcode}).then(e=>{this.moduleDetail=e.data.config,this.history.initFromSnapshot(JSON.parse(e.data.data)),setTimeout(()=>{this.$refs.render.updateNodeStyle(),this.centerAndZoom(.8,!1)},1e3)}).catch(e=>{console.log(e,"e")}).finally(e=>{this.isLoading=!1});else if(this.module)this.initGraph();else{vn.error("请传入模块名称");return}this.graphApi.userInfo&&this.graphApi.userInfo().then(e=>{e.data!==null&&(Ke(mt,"sharePermission",e.data.access.graph_share),this.requestGraphData=e.data.access.request_graph_data)}).catch(e=>{this.onOutdate(e.res)})}},handleCustomContextMenuClick(e){this.customContextMenuEvent&&typeof this.customContextMenuEvent=="function"?this.customContextMenuEvent(it(e)):Ke(this,"custom-contextmenu-click",it(e))},handleSelectNode(e){this.handleSelectNodeEvent&&typeof this.handleSelectNodeEvent=="function"?this.handleSelectNodeEvent(it(e),it(this.history.dataNow)):Ke(this,"handle-select-node",it(e))},searchStartNode(){this.startNode.length>0&&!this.inited&&this.startNode.map(e=>{const t={type:e.type,id:e.id,startNode:!0};this.inited=!0,this.moduleDetail.nodes.findIndex(n=>e.type===n.name)>=0?this.addNewNodesAndExpand(t):(vn({message:"无相关数据",type:"warning"}),this.emitDataLoaded())})},initGraph(){return ot(this,null,function*(){var e;gi("initGraph"),(e=this.graphApi)==null||e.getGraphConfig({name:this.module}).then(t=>{const n=t.data||{},r=kf(n==null?void 0:n.node_info),s=(n==null?void 0:n.nodes)||[];s.forEach(a=>{a.name=a.name.toLowerCase()});const o=kf(n==null?void 0:n.plugs);n.node_info=r,n.nodes=s,n.plugs=o,this.moduleDetail=n,this.searchStartNode(),!this.inited&&this.enterStartNode&&this.$refs.buttonList.addNode("search")}).catch(t=>{this.onOutdate(t.res),this.emitDataLoaded(),console.log("e",t)})})},addNewNodesAndExpand(e){this.isLoading=!0,this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(t=>{var s,o,a;let n={id:(s=t.data.records[0])==null?void 0:s.info.id,type:(o=t.data.records[0])==null?void 0:o.info.type,startNode:!0,detail:t.data.records[0],group:e.id,name:((a=t.data.records[0])==null?void 0:a.info.name)||e.id};n=bs(n,this.moduleDetail.plugs);const r={addOne:{nodes:[n],links:[]}};this.isRenderStartNode&&(this.history.pushState(r),this.history.updateData(t.data.records,[e.id]),setTimeout(()=>{this.isDefaultSelectStartNode&&(this.handleTableSelect([e.id]),setTimeout(()=>{this.selection.length&&this.handleSelectNode({isSelected:!0,_node:this.selection[0]})},0))},500)),this.expandNodes(n)}).catch(t=>{console.log(t,"e"),this.emitDataLoaded(),this.onOutdate(t.res),vn({message:"无该节点信息",type:"warning"})}).finally(()=>{this.isLoading=!1})},onAction(e){this.history.pushState(e)},onOutdate(e){(e==null?void 0:e.code)==="AC100001"&&this.outdateTime<1&&(this.outdateTime++,Ke(this,"outdate"))},expandNodes(e,t){return ot(this,null,function*(){if(!(e!=null&&e.type))return;const n=this.moduleDetail.plugs[e==null?void 0:e.type];let r=[];t?(r=Array.isArray(t)?[...t]:[t],e.apis===void 0&&(e.apis=[]),e.apis.push(...r)):(e.expand=1,e.apis=[],e.apis.push({namec:"拓线全部",value:0,name:"",flagSelect:!0}),n==null||n.map(u=>{u.children?r.push(...u.children):r.push(u)}));const s=r.map(u=>this.graphApi.getGraphRequest({api:u.name,node_id:e.id,origin:e.origin,nodeType:e.type,moduleDetail:this.moduleDetail}).then(d=>Promise.resolve(Fe(me(me({},d),u),{api:u.name,apiC:u.relay_name,icon:u.icon,note_name:u.note_name,icon_img:u.icon_img,canLoop:u.canloop,showTotal:u.show_total}))).catch(d=>Promise.resolve(d)));this.isLoading=!0;let o;yield Promise.all(s).then(u=>{if(u.some(f=>{var h;return((h=f.res)==null?void 0:h.code)==="AC100001"})){this.onOutdate({code:"AC100001"});return}o=u.filter(f=>f.code==="0"||f.code===0)}).catch(u=>{console.log(u,"e")}).finally(u=>{this.isLoading=!1});const a=[];let l=[];if(o&&o.forEach(u=>{var C;if(e.getData[u.api]=!0,this.history.dataNow.nodes.find(x=>x.id===e.id)&&(this.history.dataNow.nodes.find(x=>x.id===e.id).getData[u.api]=!0),!u.data)return;let d;const f=(C=u.data.nodes||[])==null?void 0:C.map(x=>(x.group=e.id+"-"+u.api,x.groupC=u.apiC,x=bs(x,this.moduleDetail.plugs),x));if(!this.isShowNodeType){d=u.data.links||[],a.push(...u.data.nodes||[]),l.push(...d||[]);return}const h=e.id+"-"+u.api;let g={id:h,name:u.apiC,note_name:u.note_name,type:"nodeType",icon:u.icon,showTotal:u.showTotal,icon_img:u.icon_img};const S=u,{code:v,msg:y,data:_}=S,w=Rs(S,["code","msg","data"]);g=me(me({},w),g);const A={source:e.id,target:h};if(g=bs(g,this.moduleDetail.plugs),this.nodeTypeList.push(u.icon||"node_type"),f.length>0&&this.isRenderStartNode){if(d=(u.data.links||[]).map(x=>{let T;if(x.source===e.id){const N=this.history.dataNow.nodes.filter(I=>I.id===x.target);if(N.length>0&&(T=this.findGrandSonNodeIds(N[0]).indexOf(x.source)>=0),!u.api.canLoop&&T)return;x.source=h}else x.target===e.id&&(x.target=h);return x.edgeLabelProp=x.edge_label,x}).filter(x=>x),d.length===0)return;d.push(A)}else d=u.data.links||[];if(this.isRenderStartNode&&f.length>=this.singlesNodeMaxNum){let x=null,T=null;const N=String(Math.floor(new Date().getTime()));x={id:N,list:f,type:"aggregation",name:"聚合",relationId:g.id},x=bs(x,this.moduleDetail.plugs),T={source:g.id,target:N,uniqueIndex:this.generateUniqueIndexNow()};const I={addOne:{nodes:[g,x],links:[A,T]},type:"aggregation"};this.history.pushState(I),this.getNodeDetail(x.list,x.id)}else d.length&&this.isRenderStartNode&&f.push(g),a.push(...f||[]),l.push(...d||[])}),!this.isRenderStartNode){const u={},d={},f=[];this.nodeTypeList.push("node_type"),l.forEach(h=>{const g=h.source+"-"+h.name;if(!u[g]){let v={id:g,name:h.name,type:"nodeType",icon:h.feature.icon};v=bs(v,this.moduleDetail.plugs),u[g]=v}d[g]?d[g].push(h):d[g]=[h]});for(const h in u)a.push(u[h]);for(const h in d)d[h].forEach(v=>{const y=Fe(me({},v),{source:v.source,target:h}),_=Fe(me({},v),{source:h,target:v.target});f.push(y),f.push(_)});l=f}l.map(u=>{u.uniqueIndex=this.generateUniqueIndexNow()});const c={addOne:{nodes:a,links:l}};(a.length>0||l.length>0)&&this.history.pushState(c),this.history.length===2&&setTimeout(()=>{this.centerAndZoom(.8,!1)},1e3),this.getNodeDetail(a)})},findGrandSonNodeIds(e){return this.history.dataNow.nodes.filter(r=>{var s;return((s=e.children)==null?void 0:s.indexOf(r.id))>=0}).reduce((r,s)=>(r.push(...s.children||[]),r),[])||[]},centerAndZoom(e,t){var n;(n=this.$refs.render)==null||n.centerAndZoom(e,t)},generateUniqueIndex(){let e=0;return function(){return e++}},reset(){this.$refs.render.reset()},getNodeDetail(e,t){const r=this.history.dataNow.nodes.filter(a=>e.findIndex(l=>l.id===a.id)>=0).filter(a=>!a.detail&&a.noDetail!==!0&&a.type!=="aggregation"&&a.type!=="nodeType"),s={};r.map(a=>{s[a.type]?s[a.type].push(a):s[a.type]=[a]});let o=Object.keys(s).length;for(const a in s){const l=s[a],c={};l.map(u=>{u.origin&&(c[u.id]=u.origin)}),this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[s[a][0].type],node_id:s[a].map(u=>u.id),origin:c,nodeType:s[a][0].type,moduleDetail:this.moduleDetail}).then(u=>{const d=u.data.records;t?this.history.updateAggregationDetail(d,s[a].map(f=>f.id),t):this.history.updateData(d,s[a].map(f=>f.id))}).catch(u=>{this.onOutdate(u.res)}).finally(()=>{o=o-1,o===0&&(gi(" 数据加载完"),this.emitDataLoaded())})}Object.keys(s).length||this.emitDataLoaded()},emitDataLoaded(){this.handleDataLoaded&&typeof this.handleDataLoaded=="function"?this.handleDataLoaded({dataNow:it(this.history.dataNow)}):Ke(this,"handle-data-loaded",{dataNow:it(this.history.dataNow)})},addNode({node:e,type:t,connectNode:n}){if(this.history.dataNow.nodes.findIndex(o=>o.id===e.id)>-1){vn({type:"warning",message:"该节点已存在,添加失败"});return}let s;if(t==="diy"&&e.type==="nodeType"){let o=Fe(me({},e),{detail:null,diy:!0,group:e.id});o=bs(o,this.moduleDetail.plugs);const a=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[o],links:a?[a]:[]}},this.history.pushState(s)}else t==="diy"?this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(o=>{var c,u,d;let a={id:(c=o.data.records[0])==null?void 0:c.info.id,type:(u=o.data.records[0])==null?void 0:u.info.type,detail:o.data.records[0],group:e.id,name:((d=o.data.records[0])==null?void 0:d.info.name)||e.id};a=bs(a,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[a],links:l?[l]:[]}},this.history.pushState(s)}).catch(o=>{this.onOutdate(o.res);let a=Fe(me({},e),{detail:null,diy:!0,group:e.id});a=bs(a,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[a],links:l?[l]:[]}},this.history.pushState(s)}).finally(o=>{setTimeout(()=>{},500)}):this.addNewNodesAndExpand(e)},addLink(e,t){if(!([e,t].filter(o=>o.type==="nodeType").length===1))return;const r={source:e.id,target:t.id,uniqueIndex:this.generateUniqueIndexNow(),diy:!0};let s=!1;if(this.history.dataNow.links.map(o=>{o.source.id===e.id&&o.target.id===t.id&&(s=!0)}),!s){const o={addOne:{links:[r]}};this.onAction(o)}},expandSelectedNodes(e){e.map(t=>{this.expandNodes(t)})},handleTableSelect(e=[]){this.$refs.render.handleTableSelect(e)},updateSelection(){this.selection=this.$refs.render.selection,this.$refs.render.selectEdgesByNode(this.selection),this.$refs.render.showKeyWay(this.selection),this.$refs.render.updateNodeStyle()},aggregationNodes(e,t){if(e.length===0)return;const n=[];for(const a in this.history.dataNow.nodes)e.findIndex((c,u,d)=>c===this.history.dataNow.nodes[a].id)>=0&&n.push(JSON.parse(JSON.stringify(this.history.dataNow.nodes[a])));const r=String(Math.floor(new Date().getTime()));let s={id:r,list:n,type:"aggregation",name:"聚合",relationId:t.id};s=bs(s,this.moduleDetail.plugs);const o={addOne:{nodes:[s],links:[{source:t.id,target:r,uniqueIndex:this.generateUniqueIndexNow()}]},deleteOne:{nodes:n,links:n.map(a=>({source:t.id,target:a.id}))},type:"aggregation"};this.history.pushState(o),this.emitDataLoaded()},releaseAggregation(e){let t;if(e.type==="aggregation"&&(t=e),this.history.dataNow.links.map(n=>{n.source.id===e.id&&n.target.type==="aggregation"&&(t=t||n.target,n.source)}),t){const n={deleteOne:{nodes:[t],links:[{source:t.relationId,target:t.id}]},addOne:{nodes:t.list,links:t.list.map(r=>({source:t.relationId,target:r.id}))},type:"aggregation"};for(const r in this.history.dataNow.nodes)t.list.findIndex((o,a,l)=>o===this.history.dataNow.nodes[r].id)>=0&&(this.history.dataNow.nodes[r].aggregation=!1);this.history.pushState(n),this.emitDataLoaded()}},saveSnapshot(){return ot(this,null,function*(){LS.prompt(null,"添加快照",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^.{1,20}$/,inputPlaceholder:"请输入20字以内快照名称",inputErrorMessage:"请输入20字以内快照名称"}).then(t=>ot(this,[t],function*({value:e}){this.bigLoading=!0,setTimeout(()=>ot(this,null,function*(){try{const n=yield this.$refs.buttonList.svgToBlob(),r=new FormData;r.append("data",this.history.toString()),r.append("name",e),r.append("thumb",n),this.graphApi.addSnapshot1(r).then(s=>{this.snapshot=s.data,this.snapshot.name=e,this.$refs.snapshot.show()}).catch(s=>{this.onOutdate(s.res)}).finally(s=>{this.bigLoading=!1})}catch(n){this.bigLoading=!1,console.log(n)}}),100)})).catch(()=>{vn({type:"info",message:"取消输入"})})})},autoDisplay(){this.$refs.render.autoDisplay()},deleteNodes(e=this.selection){const t={deleteOne:{nodes:e}};this.history.pushState(t),this.emitDataLoaded();const n=e.map(r=>r.id);this.$refs.render.selection=this.selection.filter(r=>!n.includes(r.id)),setTimeout(()=>{this.updateSelection()},300)},historyForward(){this.history.forward(),setTimeout(()=>{this.updateSelection()},100)},historyBack(){this.history.back(),setTimeout(()=>{this.updateSelection()},100)},toggleFullScreen(){Bn({cId:"toggleFullScreen",c:"切换全屏"}),document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():this.$refs["force-d3-container"].requestFullscreen()},zoomView(e="in"){e==="in"?(Bn({cId:"zoomIn",c:"zoomIn"}),this.$refs.render.zoomIn()):(Bn({cId:"zoomOut",c:"zoomOut"}),this.$refs.render.zoomOut())},fitScreen(){var e;Bn({cId:"centerAndZoom",c:"centerAndZoom"}),(e=this.$refs.render)==null||e.centerAndZoom()},changeMargin(){let e=0;const t=document.body.clientHeight;return e=Math.floor(((t-50)/20-22)/2),e>8?"8px 0":e+"px 0"},handleHighLight(e,t,n){this.$refs.render.setHighlightRule({type:e,prop:t,value:n})},handleCustomSelect(e,t,n){this.$refs.render.handleCustomSelect({type:e,prop:t,value:n})},fixAllNodes(e){this.$refs.render.fixAllNodes(e)},toggleLayout(e){this.$refs.render.toggleLayout(e)},importCsvData(e){for(const t in e.nodes)delete e.nodes[t].vx,delete e.nodes[t].vy,delete e.nodes[t].x,delete e.nodes[t].y;this.history.dataNow=Object.assign({},e)},getCanvasStage(){var e;return(e=this.$refs.render)==null?void 0:e.stage},addCanvasBg(){var e;(e=this.$refs.render)==null||e.addCanvasBg()},removeCanvasBg(){var e;(e=this.$refs.render)==null||e.removeCanvasBg()},controlOperation(e){var t;(t=this.$refs.render)==null||t.handleContextMenuClick(e)}}},cde={key:0,ref:"force-d3-container",class:"d3-container"},ude=["innerHTML"],dde={class:"top-item"},fde={class:"top-line"},hde={key:1,class:"select-num"},pde={class:"highlight"},gde={class:"loading-container"},mde={class:"corner-button-box"};function vde(e,t,n,r,s,o){const a=Ge("ButtonList"),l=Ge("RenderByCanvas"),c=Ge("Loading"),u=Bt,d=Ge("Legend"),f=Ge("NodeVisibleControl"),h=Ge("force-graph-svg-icon"),g=hi,v=Ge("RightMenu"),y=Ge("SnapShotDialog"),_=IS;return n.graphApi?Lt((R(),U("div",cde,[K("div",{class:ee(["graph-box",{"hide-right-menu":!n.isShowRightMenu}])},[n.title?(R(),U("div",{key:0,class:"safe-force-title",innerHTML:n.title},null,8,ude)):oe("",!0),t[4]||(t[4]=K("div",{class:"top-line-bg"},null,-1)),K("div",dde,[K("div",fde,[ie(a,{ref:"buttonList","hide-button-list":n.hideButtonList,selection:s.selection,history:s.history,"module-detail":s.moduleDetail,"request-graph-data":s.requestGraphData,"show-top-search":n.showTopSearch,onSaveSnapshot:o.saveSnapshot,onAddNodes:o.addNode,onAutoDisplay:o.autoDisplay,onDeleteNodes:o.deleteNodes,onFixNodes:o.fixAllNodes,onToggleLayout:o.toggleLayout,onImportCsvData:o.importCsvData},null,8,["hide-button-list","selection","history","module-detail","request-graph-data","show-top-search","onSaveSnapshot","onAddNodes","onAutoDisplay","onDeleteNodes","onFixNodes","onToggleLayout","onImportCsvData"])])]),ie(l,{ref:"render","enable-script":n.enableScript,"module-detail":s.moduleDetail,history:s.history,"level-list":n.levelList,selection:s.selection,data:s.history.dataNow,"request-graph-data":s.requestGraphData,"dark-mode":n.darkMode,"node-type-scale":n.nodeTypeScale,"node-type-list":s.nodeTypeList,"link-distance":n.linkDistance,strength:n.strength,"node-width":n.nodeWidth,"start-node-width":n.startNodeWidth,"start-node-animation":n.startNodeAnimation,"custom-tooltip":n.customTooltip,"edge-label-max-length":n.edgeLabelMaxLength,"custom-node-images":n.customNodeImages,onUpdateSelection:o.updateSelection,onOnaction:o.onAction,onHandleSelectNode:o.handleSelectNode,onCustomContextmenuClick:o.handleCustomContextMenuClick},null,8,["enable-script","module-detail","history","level-list","selection","data","request-graph-data","dark-mode","node-type-scale","node-type-list","link-distance","strength","node-width","start-node-width","start-node-animation","custom-tooltip","edge-label-max-length","custom-node-images","onUpdateSelection","onOnaction","onHandleSelectNode","onCustomContextmenuClick"]),s.selection.length>0?(R(),U("p",hde,[t[2]||(t[2]=Ye(" 已选择")),K("span",pde,Ne(s.selection.length),1),t[3]||(t[3]=Ye("项 "))])):oe("",!0),Lt(K("div",gde,[K("span",null,Ne(s.loadingInfo),1),ie(u,{class:"is-loading"},{default:ne(()=>[ie(c)]),_:1})],512),[[Cn,s.isLoading]]),n.hasLegend?(R(),ye(d,{key:2,"show-point":n.showPoint,history:s.history,"module-detail":s.moduleDetail,"has-level":n.hasLevel,"show-level-count":n.showLevelCount,margin:s.margin,onHighLight:o.handleHighLight},null,8,["show-point","history","module-detail","has-level","show-level-count","margin","onHighLight"])):oe("",!0),n.hasNodeVisibleControl?(R(),ye(f,{key:3,history:s.history,"module-detail":s.moduleDetail,"start-node":n.startNode,"custom-node-images":n.customNodeImages},null,8,["history","module-detail","start-node","custom-node-images"])):oe("",!0),K("div",mde,[!s.fullScreen&&o.topFrame?(R(),ye(g,{key:0,content:"进入全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/full_button.svg"],alt:"",class:"corner-button",onClick:o.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):oe("",!0),s.fullScreen&&o.topFrame?(R(),ye(g,{key:1,content:"退出全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/un_full_button.svg"],alt:"",class:"corner-button",onClick:o.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):oe("",!0),ie(g,{content:"适应屏幕",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/fit_button.svg"],alt:"",class:"corner-button",onClick:o.fitScreen},null,8,["icon-class","onClick"])]),_:1}),ie(g,{content:"放大",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_in_button.svg"],alt:"",class:"corner-button",onClick:t[0]||(t[0]=w=>o.zoomView("in"))},null,8,["icon-class"])]),_:1}),ie(g,{content:"缩小",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_out_button.svg"],alt:"",class:"corner-button",onClick:t[1]||(t[1]=w=>o.zoomView("out"))},null,8,["icon-class"])]),_:1})])],2),n.isShowRightMenu?(R(),ye(v,{key:0,"graph-data":s.history.dataNow,"selected-nodes":s.selection,"request-graph-data":s.requestGraphData,onChangeBox:o.handleTableSelect},null,8,["graph-data","selected-nodes","request-graph-data","onChangeBox"])):oe("",!0),ie(y,{ref:"snapshot",snapshot:s.snapshot,"graph-api":n.graphApi,"graph-url-path":n.graphUrlPath,"custom-copy-path-fn":n.customCopyPathFn},null,8,["snapshot","graph-api","graph-url-path","custom-copy-path-fn"])])),[[_,s.bigLoading]]):oe("",!0)}const xp=fn(lde,[["render",vde]]),Ame="",Ap={props:xp.props,setup(e){return()=>at(FB,{namespace:"force-graph-el"},{default:()=>at(xp,e)})}};xp.install=function(e){e.component(xp.name,Ap)};const bde=TO(Ap,{shadowRoot:!1});customElements.define("force-graph",bde),yt.Graph=Ap,yt.default=Ap,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
154
+ `).slice(1));try{for(s.s();!(n=s.n()).done;){var o=xce(n.value);o&&r.push(o)}}catch(a){s.e(a)}finally{s.f()}return r.slice(0,10)}var Ul=function(e){return Ece(e).toString()},my=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Cp:wp:$u},Ace=function(){function e(t){vh(this,e),As(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return bh(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=r.type,o=r.event,a=n[s];a&&a(o)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(my(r)===Cp){var s={errorType:Cp,errorMessage:r.message,errorSummary:"CorsError",errorId:Ul("".concat(Cp,"-").concat(r.message))};t.commit(s)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(my(t)===$u){var n=t.target||t.srcElement,r=n.src||n.href,s=JSON.stringify($u+": "+r||"UnKnown Resource"),o={errorType:$u,errorMessage:s,errorSummary:"ResourceError",errorId:Ul("".concat($u,"-").concat(s))};this.commit(o)}}},{key:"onJSError",value:function(t){var n,r;if(my(t)===wp){var s=JSON.stringify(t.message),o=function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!l)return c;try{var u=new URL(l);return u.pathname&&u.pathname.endsWith(".js")?l:c}catch(d){return l}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),a={errorType:wp,errorMessage:s,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Ep(t.error)),errorId:Ul("".concat(wp,"-").concat(s,"-").concat(o))};this.commit(a)}}},{key:"onPromiseError",value:function(t){var n,r,s=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),o=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",a={errorType:OA,errorMessage:s,errorSummary:o,errorStack:JSON.stringify(Ep(t.reason)),errorId:Ul("".concat(OA,"-").concat(s,"-").concat(o))};this.commit(a)}},{key:"onVueError",value:function(t,n,r){var s=JSON.stringify(t.message),o={errorType:NA,errorMessage:s,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ep(t)),errorId:Ul("".concat(NA,"-").concat(s,"-").concat(t.name))};this.commit(o)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),s={errorType:IA,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ep(t)),errorId:Ul("".concat(IA,"-").concat(r,"-").concat(t.name))};this.commit(s)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(fu({type:"error"},t)))}}]),e}(),Pce=function(e){function t(){var s,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return vh(this,t),(s=EQ(this,t,[o])).config=o,s.isReport()?(s.PerformancePluginInstance=new fce(pu(s)),s.WhiteScreenPluginInstance=new yce(pu(s)),s.ErrorPluginInstance=new Ace(pu(s)),s.plugins=[s.PerformancePluginInstance,s.WhiteScreenPluginInstance,s.ErrorPluginInstance],s.init(),c5(t,t,$l,pu(s)),s):o5(s)}var n,r;return function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(o&&o.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),o&&$v(s,o)}(t,dce),bh(t,[{key:"isReport",value:function(){var s=this.isIE(),o=this.calcRatio();return this.config.appKey&&o&&!s}},{key:"init",value:(r=hu(dr().mark(function s(){return dr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(a){try{a.init()}catch(l){console.error("initPlugin Error",l)}});case 2:case"end":return o.stop()}},s,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=this.uid(),a=this.getTime(),l=a.time,c=a.date,u=this.getUA(),d=window.location,f=d.host,h=d.origin,g=d.pathname;return fu(fu({uid:o,sid:this.sid,url:window.location.href,host:f,fullPath:h+g,sdkVersion:this.sdkVersion,createDate:c,appKey:this.config.appKey,createTime:l,appVersion:this.appVersion,env:this.env},u),s)}},{key:"commit",value:(n=hu(dr().mark(function s(o){var a,l;return dr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:try{a=this.mixed(o),l=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(a).map(function(u){var d=xQ(u,2),f=d[0],h=d[1];l.searchParams.set(f,h)}),new Image().src=l.toString()}catch(u){console.log("commit Error",u)}case 1:case"end":return c.stop()}},s,this)})),function(s){return n.apply(this,arguments)})}],[{key:"install",value:function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_h(t,t,$l)||(s.config.errorHandler=function(a,l,c){_h(t,t,$l).ErrorPluginInstance.onVueError(a,l,c),console.error(a)},c5(t,t,$l,new t(o)))}},{key:"sendError",value:function(s){_h(t,t,$l)?_h(t,t,$l).ErrorPluginInstance.onReactError(s):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),$l={writable:!0,value:null};const Qge="",eme="",Tce={components:{InfoFilled:Em,ArrowRight:Cm},mixins:[kr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:GH,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,s,o,a,l,c,u;const e=[];if(this.nodeInfo.length===1){const d=this.nodeInfo[0];d.type!=="aggregation"&&d.type!=="nodeType"&&(e.push(W0),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===d.id)||(e.push(Y0),(o=(s=this.moduleDetail)==null?void 0:s.config)!=null&&o.hideCollectMenu||e.push(d.collect?J0:K0),e.push(d.textProp==="name"?q0:z0),d.label&&e.push(d.textProp==="label"?H0:G0)),this.canGoDetail&&e.push(h4)),e.push(d.fx?V0:$0);const f=this.history.dataNow.links.some(y=>y.source.id===d.id&&y.target.type==="aggregation"),v=this.history.dataNow.links.filter(y=>y.source.id===d.id).map(y=>y.target).some(y=>{let _=0;return this.history.dataNow.links.map(w=>{w.source.id===y.id&&_++}),_===0});f||d.type==="aggregation"?e.push(u4):v&&e.push(c4),v&&e.push(l4),e.push(X0)}else this.nodeInfo.length>1?(e.push(Y0,W0),e.push(this.nodeInfo.some(f=>!f.collect)?K0:J0),this.nodeInfo.some(f=>f.label)&&e.push(this.nodeInfo.some(f=>f.textProp!=="label")?G0:H0),e.push(this.nodeInfo.some(f=>f.textProp!=="name")?z0:q0),e.push(this.nodeInfo.some(f=>!f.fx)?$0:V0),e.push(X0)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(f=>f.label)&&e.push(this.history.dataNow.nodes.some(f=>f.textProp!=="label")?s4:r4),e.push(this.history.dataNow.nodes.some(f=>f.textProp!=="name")?n4:i4),e.push(this.history.dataNow.nodes.some(f=>!f.fx)?e4:t4),this.history.currentIndex>0&&e.push(o4),this.history.currentIndex<this.history.length-1&&e.push(a4));const t=(a=this.nodeInfo[0])==null?void 0:a.type,n=(u=(c=(l=this.nodeInfo[0])==null?void 0:l.detail)==null?void 0:c.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(d=>{d.icon||(d.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,s=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=s?0:"auto",bottom:r<s?0:"auto"}},thirdBorderCheck(e,t,n,r){const s=document.body.offsetWidth,o=document.body.offsetHeight,a=this.secondBorderCheck(e,n).top;let l;const c=(t+r)*this.itemHeight,u=c>180?180:c;return a===0?l=this.axis.top+e*this.itemHeight+u:l=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=s?"-100%":"100%",bottom:o>=l?0:"auto",top:o<l?0:"auto"}},handleClick(e,t){if(!t){if(Bn({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;Ke(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){Bn({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),Ke(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Oce={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},Nce={class:"cm-list"},Ice={class:"cm-ul"},Rce={class:"hd"},Dce=["src"],Lce={class:"bd"},kce={class:"cm-ul cm-ul-level1"},Mce=["title"],Fce=["title","onClick"],Bce=["title","onClick"],jce={key:0,class:"icon","aria-hidden":"true"},Uce=["title","onClick"],$ce=["src"],Vce=["title","onClick"],zce={key:0,class:"fas el-icon-fa-cog"},qce={key:1,class:"fas el-icon-fa-external-link-alt"},Hce={class:"text-wrapper"},Gce=["src"],Wce=["src"],Kce={key:3,class:"shortcut"},Jce={key:2,class:"icon","aria-hidden":"true"},Yce=["title","onClick"],Xce={key:1,class:"icon","aria-hidden":"true"},Zce=["title","onClick"];function Qce(e,t,n,r,s,o){const a=Ge("ArrowRight"),l=Bt,c=Ge("InfoFilled"),u=hi;return n.show?(R(),U("div",{key:0,class:"cm-container",style:Ze(o.axisComputed),onClick:t[1]||(t[1]=pt((...d)=>o.handleCollapse&&o.handleCollapse(...d),["stop"]))},[(R(),U("svg",Oce,t[2]||(t[2]=[K("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[K("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1)]))),K("div",Nce,[K("ul",Ice,[o.checkboxMenu.length>0?(R(),U("li",{key:0,class:"cm-li data-opt-wrapper",style:Ze(o.liStyle)},[K("div",Rce,[K("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,Dce),t[3]||(t[3]=Ye("按关系分类拓线")),ie(l,null,{default:ne(()=>[ie(a)]),_:1})]),K("div",Lce,[K("ul",kce,[(R(!0),U(qe,null,It(o.checkboxMenu,(d,f)=>(R(),U("li",{key:f,class:"cm-li context-one",style:Ze(o.liStyle)},[o.hasChildren(d)?(R(),U("div",{key:0,class:ee(["cm-item",o.firstLeft?"cm-left":""]),title:d.namec},[K("span",null,Ne(d.namec),1),t[4]||(t[4]=K("svg",{class:"icon","aria-hidden":"true"},[K("use",{"xlink:href":"#icon-arrow-right"})],-1))],10,Mce)):(R(),U("div",{key:1,class:ee(["cm-item",o.firstLeft?"cm-left":""]),title:d.namec,onClick:pt(h=>o.handleDataClick(d,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(d.namec),1)],10,Fce)),o.hasChildren(d)?(R(),U("ul",{key:2,class:"cm-ul cm-ul-level2",style:Ze(o.secondBorderCheck(f,d.children.length))},[(R(!0),U(qe,null,It(d.children,(h,g)=>(R(),U("li",{key:g,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",o.secondLeft?"cm-left":""]),title:h.namec,onClick:pt(v=>o.handleDataClick(h,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(h.namec),1),o.hasChildren(h)?(R(),U("svg",jce,t[5]||(t[5]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Bce),o.hasChildren(h)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level3",style:Ze(o.thirdBorderCheck(f,g,d.children.length,h.children.length))},[(R(!0),U(qe,null,It(h.children,(v,y)=>(R(),U("li",{key:y,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:"cm-item",title:v.namec,onClick:pt(_=>o.handleDataClick(v,s.globalMenus.expandPartNode),["stop"])},[K("span",null,Ne(v.namec),1)],8,Uce)],4))),128))],4)):oe("",!0)],4))),128))],4)):oe("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<s.maxMulti?(R(),U("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:Ze(o.liStyle)},[K("div",{class:"hd",onClick:t[0]||(t[0]=pt(d=>o.handleDataClick(null,s.globalMenus.expandNode),["stop"]))},[K("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,$ce),t[6]||(t[6]=Ye("展开全部关系 "))]),t[7]||(t[7]=K("div",{class:"bd"},null,-1))],4)):oe("",!0),(R(!0),U(qe,null,It(o.systemMenu,(d,f)=>(R(),U("li",{key:f,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{"cm-left":o.firstLeft,disabled:d.disabled}]),title:d.namec,onClick:pt(h=>o.handleClick(d,d.disabled),["stop"])},[o.isSystemItem(d)?(R(),U("i",zce)):o.isExternalItem(d)?(R(),U("i",qce)):oe("",!0),K("div",Hce,[d.icon?(R(),U("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+d.icon+".svg"],class:"t-icon"},null,8,Gce)):(R(),U("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+d.name+".svg"],class:"t-icon"},null,8,Wce)),d.tooltip?(R(),ye(u,{key:2,class:"el-icon-info",effect:"dark",content:d.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(d.namec),1),d.shortcut?(R(),U("span",Kce,Ne(d.shortcut),1)):oe("",!0)]),o.hasChildren(d)?(R(),U("svg",Jce,t[8]||(t[8]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Vce),o.hasChildren(d)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level2",style:Ze(o.secondBorderCheck(f,d.children.length))},[(R(!0),U(qe,null,It(d.children,(h,g)=>(R(),U("li",{key:g,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{"cm-left":o.secondLeft,disabled:d.disabled||h.disabled}]),title:h.namec,onClick:pt(v=>o.handleClick(h,d.disabled||h.disabled),["stop"])},[h.tooltip?(R(),ye(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(h.namec),1),o.hasChildren(h)?(R(),U("svg",Xce,t[9]||(t[9]=[K("use",{"xlink:href":"#icon-arrow-right"},null,-1)]))):oe("",!0)],10,Yce),o.hasChildren(h)?(R(),U("ul",{key:0,class:"cm-ul cm-ul-level3",style:Ze(o.thirdBorderCheck(f,g,d.children.length,h.children.length))},[(R(!0),U(qe,null,It(h.children,(v,y)=>(R(),U("li",{key:y,class:"cm-li",style:Ze(o.liStyle)},[K("div",{class:ee(["cm-item",{disabled:d.disabled||h.disabled||v.disabled}]),title:v.namec,onClick:pt(_=>o.handleClick(v,d.disabled||h.disabled||v.disabled),["stop"])},[v.tooltip?(R(),ye(u,{key:0,class:"el-icon-info",effect:"dark",content:v.tooltip,placement:"top-start"},{default:ne(()=>[ie(l,null,{default:ne(()=>[ie(c)]),_:1})]),_:2},1032,["content"])):oe("",!0),K("span",null,Ne(v.namec),1)],10,Zce)],4))),128))],4)):oe("",!0)],4))),128))],4)):oe("",!0)],4))),128))])])],4)):oe("",!0)}const eue=fn(Tce,[["render",Qce],["__scopeId","data-v-dfb39ec8"]]),tme="",nme="",ime="",rme="",tue={name:"Popover",components:{ForceGraphSvgIcon:Qo},mixins:[kr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})},customTooltip:{type:Function}},data(){return{isFunction:Bd,showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var l,c,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(l=document.getElementsByClassName("popover-container")[0])==null?void 0:l.offsetHeight,r=(c=document.getElementsByClassName("d3-container")[0])==null?void 0:c.offsetHeight,s=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let o;t?o=Math.max(this.mousePosition.top,n+s)+5:o=Math.min(this.mousePosition.top,Math.max(r-n,s))-5;const a={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:o+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=a},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var s,o,a;const r=n.detail;return Fe(me({},n),{name:((s=r==null?void 0:r.info)==null?void 0:s.name)||n.name,level:((a=(o=r==null?void 0:r.info)==null?void 0:o.basic)==null?void 0:a.level)||""})});e==null||e.sort((n,r)=>{var a,l;const s=(a=this.levelList.find(c=>c.level===n.level))==null?void 0:a.dangerNumber;return((l=this.levelList.find(c=>c.level===r.level))==null?void 0:l.dangerNumber)-s}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return R0(e)},getTypeZh(e){var n,r,s;let t=e;if(e==="nodeType")t="关系节点";else for(const o in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[o].name)){t=(s=this.moduleDetail)==null?void 0:s.nodes[o].namec;break}return t},getLevelClass(e){return If(e,this.levelList)},getColorStyle(e){return ea(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var s;const t=(s=this.data)==null?void 0:s.links,n=[],r=[];return t==null||t.map(o=>{o.source.id===e&&(n.push(o.target.id),o.target.detail&&$q(o.target.detail.info.basic.level,this.levelList)&&r.push(o.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let s="-";return r&&(n?s=t.length?t.join("|"):"-":s=t||"-"),s},formatTags(e){return Mf(Ff(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)Ke(mt,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),Ke(mt,"emitDataLoaded")},0)}}}},nue={key:0},iue=["innerHTML"],rue={key:1,class:"node-info-container"},sue={class:"popover-block popover-header"},oue={key:0,class:"popover-collect"},aue={key:1,class:"row-item"},lue={class:"label"},cue={key:2,class:"row-item"},uue={class:"value"},due={class:"node-type-info"},fue={class:"name"},hue={key:3,class:"row-item"},pue={class:"value"},gue={class:"popover-block popover-fields"},mue={key:0,class:"node-detail top-border"},vue={key:0,class:"row-item"},bue=["title"],yue={key:1,class:"row-item row-item-tag"},_ue={class:"value"},wue={class:"graph-tags-box"},Cue={key:0,class:"row-item"},Sue={class:"label"},Eue=["title"],xue={key:1,class:"node-statistics top-border"},Aue={class:"row-item node-num"},Pue={class:"value"},Tue={key:0},Oue={class:"danger"},Nue={key:2,class:"node-aggregation"},Iue={class:"aggregation-title"},Rue={class:"aggregation-box"},Due={key:2,class:"node-info-container"},Lue={class:"popover-fields"},kue={class:"top"};function Mue(e,t,n,r,s,o){const a=Ge("force-graph-svg-icon"),l=hi,c=Wc,u=$z,d=Jo,f=Uz;return R(),U("div",{class:ee(["popover-container",o.show?"show-popover":"hide-popover"]),style:Ze(s.position),onMouseenter:t[0]||(t[0]=(...h)=>o.handleMouseEnter&&o.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>o.handleMouseLeave&&o.handleMouseLeave(...h))},[K("div",null,[o.show&&n.customTooltip&&s.isFunction(n.customTooltip)?(R(),U("div",nue,[K("div",{innerHTML:n.customTooltip({nodeInfo:n.nodeInfo,data:n.data,moduleDetail:n.moduleDetail})},null,8,iue)])):n.type==="node"?(R(),U("div",rue,[K("div",sue,[n.nodeInfo.collect?(R(),U("div",oue,[ie(l,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:ne(()=>[ie(a,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):oe("",!0),o.isNormalNode?(R(),U("div",aue,[K("div",lue,Ne(o.getTypeZh(n.nodeInfo.type))+":",1),K("div",{class:ee(["value",{"star-next":n.nodeInfo.collect}])},Ne(o.name),3)])):oe("",!0),o.isNodeTypeNode?(R(),U("div",cue,[t[2]||(t[2]=K("div",{class:"label"},"关系节点:",-1)),K("div",uue,[K("div",due,[K("div",fue,Ne(n.nodeInfo.name),1)])])])):oe("",!0),n.nodeInfo.label?(R(),U("div",hue,[t[3]||(t[3]=K("div",{class:"label"},"备注:",-1)),K("div",pue,Ne(n.nodeInfo.label),1)])):oe("",!0)]),K("div",gue,[o.isNormalNode&&n.nodeInfo.detail?(R(),U("div",mue,[o.canGoDetail&&o.hasLevel?(R(),U("div",vue,[t[4]||(t[4]=K("div",{class:"label"},"危险级别:",-1)),K("div",{class:ee(["value level",o.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},Ne(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,bue)])):oe("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(R(),U("div",yue,[t[7]||(t[7]=K("div",{class:"label"},"标签:",-1)),K("div",_ue,[K("div",wue,[(R(!0),U(qe,null,It(o.formatTags(n.nodeInfo.detail.tags),(h,g)=>(R(),ye(l,{key:g,"popper-class":"el-tooltip-gray"},{content:ne(()=>[K("div",null,[Ye(Ne(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(R(),U(qe,{key:0},[t[5]||(t[5]=K("br",null,null,-1)),t[6]||(t[6]=Ye(" 标签状态:失效 "))],64)):oe("",!0)])]),default:ne(()=>[K("span",null,[ie(c,{class:ee(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:ne(()=>[Ye(Ne(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):oe("",!0),(R(!0),U(qe,null,It(o.fieldMapThisType,(h,g)=>(R(),U(qe,null,[o.canShowField(h)?(R(),U("div",Cue,[K("div",Sue,Ne(h.zh)+":",1),K("div",{class:ee(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[g]},Ne(o.getFieldValue(h)),11,Eue)])):oe("",!0)],64))),256))])):oe("",!0),o.isNodeTypeNode?(R(),U("div",xue,[K("div",Aue,[t[9]||(t[9]=K("div",{class:"label"},"拓展节点统计:",-1)),K("div",Pue,[o.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(R(),U("span",Tue,[K("span",Oue,Ne(o.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),t[8]||(t[8]=Ye("/"))])):oe("",!0),Ye(Ne(o.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):oe("",!0),o.isAggregateNode?(R(),U("div",Nue,[K("div",Iue,"聚合节点 ("+Ne(s.aggregationList.length)+"个)",1),K("div",Rue,[ie(f,{data:s.aggregationList,style:{width:"100%"}},{default:ne(()=>[ie(u,{prop:"name","min-width":"200",label:"名称"}),ie(u,{sortable:"",prop:"type",label:"类型"}),ie(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:ne(h=>[K("span",{style:Ze({color:o.getColorStyle(h.row.level)})},Ne(h.row.level||"--"),5)]),_:1}),ie(u,{label:"操作"},{default:ne(h=>[ie(d,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:g=>o.addToGraph(h.row)},{default:ne(()=>t[10]||(t[10]=[Ye(" 添加到图谱 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):oe("",!0)])])):(R(),U("div",Due,[K("div",Lue,[K("div",kue,Ne(n.nodeInfo.apiName),1)])]))])],38)}const Fue=fn(tue,[["render",Mue],["__scopeId","data-v-194a65c9"]]),Bue=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],vy={name:"vue-safe-force-graph",version:"2.0.77",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64","lib:webcomponent":"vite build --mode web_component",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm run lib:webcomponent && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.7","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.8.8",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.5.3","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.4","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-element-plus":"^0.8.0","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},_me="",{toClipboard:jue}=Bf(),Uue="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",qr=1,$ue=["ip","intranet","internet"],by=20,$n={},Vue={name:"ForceGraphRenderByCanvas",components:{Popover:Fue,NodeContextmenu:eue},mixins:[kr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},linkDistance:{type:Number,default:120},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeWidth:{type:Number},startNodeWidth:{type:Number},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function},enableScript:{type:Boolean,default:!1},edgeLabelMaxLength:{type:Number,default:10},customNodeImages:{type:Object,default:()=>{}},enablePopover:{type:Boolean,default:!0},canvasBg:{type:String,default:"transparent"}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,customIconLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:sl()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:bn(null),layer:bn(null),nodesGroup:bn({}),linksGroup:bn({}),grab:bn(null),simulation:bn(null),nodes:bn(null),links:bn(null),hoveredNode:bn(null),mouseDownNode:bn(null),selectionRect:null,selection:[],scale:qr,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=us(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return ot(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&!this.customIconLoaded&&(yield this.loadCustomIcon(),yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return ot(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update();const n=document.querySelectorAll(`.${this.uniqueClass}.render-container`);n!=null&&n.length&&(this.isThreatPath?n[0].setAttribute("data-theme",t):(n[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t)))},200)})},immediate:!0}},created(){vs.setProject("QH_10542_1724").getTrack(),console.log("组件版本: "+(vy==null?void 0:vy.version)),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return ot(this,null,function*(){new Pce({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),Uq(this.levelList),!this.isThreatPath&&(no(mt,"buttonClick",e=>{gi(e,"buttonClick msg"),this.handleContextMenuClick(e)}),no(mt,"relationClick",e=>{this.handleContextMenuClick(e)}),no(mt,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){io(mt,"buttonClick"),io(mt,"relationClick"),io(mt,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),gi("destroy")},methods:{initForceGraph(){return ot(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(s=>{for(const o of s){if(t=o.contentRect.width,n=o.contentRect.height,gi(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new zt.Stage({container:e,width:t,height:n,scaleX:qr,scaleY:qr}),this.layer=new zt.Layer,this.grab=new zt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab),this.addCanvasBg();const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",s=>{if(!this.mousedownNode||!s.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&s.evt.altKey){const o=this.stage.getPointerPosition(),a=(o.x-this.stage.x())/this.scale,l=(o.y-this.stage.y())/this.scale,c=a-this.selectionRect.x(),u=l-this.selectionRect.y();this.selectionRect.width(c),this.selectionRect.height(u),this.stage.batchDraw()}}else{const o=this.stage.getPointerPosition(),a=this.stage.scaleX(),l=(o.x-this.stage.x())/a,c=(o.y-this.stage.y())/a;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,l,c]),this.layer.batchDraw()}}),this.stage.on("wheel",s=>{s.evt.preventDefault();const o=1.1,a=this.scale,l=s.evt.deltaY<0?a*o:a/o;this.scale=l;const c=this.stage.getPointerPosition(),u=this.stage.position(),d=c.x-(c.x-u.x)*(l/a),f=c.y-(c.y-u.y)*(l/a);this.stage.setAttrs({scaleX:l,scaleY:l,x:d,y:f}),this.layer.batchDraw()}),this.stage.on("mousedown",s=>{const o=s.target;if(o&&o.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),s.evt.altKey){this.stage.setDraggable(!1);const a=this.stage.scaleX(),l=this.stage.getPointerPosition(),c=(l.x-this.stage.x())/a,u=(l.y-this.stage.y())/a;this.selectionRect=new zt.Rect({x:c,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",s=>{if(this.stage.setDraggable(!1),this.selectionRect&&s.evt.altKey){const o=this.selectionRect.x(),a=this.selectionRect.y(),l=this.selectionRect.width(),c=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const d={x:u.x,y:u.y},f=Math.min(o,o+l),h=Math.max(o,o+l),g=Math.min(a,a+c),v=Math.max(a,a+c);return d.x>=f&&d.x<=h&&d.y>=g&&d.y<=v}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",s=>{s.target&&s.target.nodeType==="Stage"&&this.handleDeselectNode(s)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*qr),t=this.stage.height()/(2*qr);this.hasSimulation=!0,this.simulation=_Q(this.nodes).force("link",sQ(this.links).id(r=>r.id).distance(this.linkDistance).strength(1)).force("charge",wQ().strength(this.strength)).force("x",CQ()).force("y",SQ()).force("center",z8(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.nodeWidth&&this.simulation.force("collision",iQ().radius(this.nodeWidth/2)),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{gi("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;gi("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)gi("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return ot(this,null,function*(){var t,n,r;!this.iconAllLoaded&&((n=(t=this.moduleDetail)==null?void 0:t.nodes)!=null&&n.length)&&!this.customIconLoaded&&(yield this.loadIcons(),yield this.loadCustomIcon()),!this.destroyed&&(r=this.nodes)!=null&&r.length&&(this.initScript(),gi("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new zt.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab),this.addCanvasBg()},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>ot(this,null,function*(){var _,w,A,C,S,x,T,N,I,B,D,M,G,H,ae,X,k,z,W,Z,j,we,ge;const s=(w=(_=r.detail)==null?void 0:_.info)==null?void 0:w.icon_img;let o;r.type==="nodeType"?o=this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:o=this.iconSize[r.icon]||this.iconSize[r.type]||24,r.startNode&&this.startNodeWidth&&(o=this.startNodeWidth);const a=((S=(C=(A=r==null?void 0:r.detail)==null?void 0:A.info)==null?void 0:C.basic)==null?void 0:S.level)||"",l=(N=(T=(x=r==null?void 0:r.detail)==null?void 0:x.info)==null?void 0:T.basic)==null?void 0:N.flag;let c;try{c=yield this.getNodeImage(r)}catch(re){console.log(re)}this.nodesGroup[r.id]&&((I=this.nodesGroup[r.id])==null||I.destroy());const u=new zt.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&u.addName("isSelected"),r.startNode&&this.startNodeAnimation){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0}),Se=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0}),_e=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:0});u.add(ce),u.add(Se),u.add(_e);const q=(Q,fe)=>new zt.Animation(function(Re){const Le=Re.time;if(Le%fe/fe===0)return!1;const V=.5-.5*(Le%fe)/fe,Y=40*(Le%fe)/fe;Q.radius(Y||0),Q.opacity(V)},this.layer);(B=this.anim1)==null||B.stop(),(D=this.anim2)==null||D.stop(),(M=this.anim3)==null||M.stop(),this.anim1=q(ce,1500),this.anim2=q(Se,1500),this.anim3=q(_e,1500),(G=this.anim1)==null||G.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,radius:20,fill:re,opacity:this.startNodeAnimation?0:.3});u.add(ce)}if(!s&&(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country")){const re=ea(a,this.levelList,this.darkMode),ce=new zt.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:o/2,stroke:re,strokeWidth:2});u.add(ce)}if(c){const re=l||(ae=(H=r==null?void 0:r.detail)==null?void 0:H.info)!=null&&ae.inner_country?20:o,ce=c&&new zt.Image({x:0,y:0,offsetX:re/2,offsetY:re/2,image:c,width:re,height:re,draggable:!1});u.add(ce)}if(!s&&r.detail&&r.type==="md5"){const re=((z=(k=(X=r.detail.info)==null?void 0:X.basic)==null?void 0:k.file_type)==null?void 0:z.toUpperCase())||"MD5",ce=new zt.Text({name:"md5Text",x:0,y:0,text:re,fontSize:4,fontWeight:700,fontFamily:Uue,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});ce.x(ce.x()-ce.width()/2),u.add(ce)}const d=r.textProp||"name",f=d==="name"?((Z=(W=r==null?void 0:r.detail)==null?void 0:W.info)==null?void 0:Z.name)||r.name:r[d];let h=(f==null?void 0:f.length)>14&&!$ue.includes(r.type)?f.slice(0,7)+"..."+f.slice(-7):f;h=Jq(h);const g=new zt.Text({offsetY:o/2,name:"konvaText",x:0,y:o+8,text:h,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});g.x(g.x()-g.width()/2),u.add(g);const v=new zt.Circle({name:"border",x:0,y:0,radius:o/2,fill:"#5c6271",opacity:.4,visible:!1});if(u.add(v),(we=(j=r.detail)==null?void 0:j.tags)!=null&&we.length){const re=new zt.Circle({x:((o/2||14)+5)*Math.sin(60*Math.PI/180),y:-((o/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});u.add(re)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var y=new zt.Circle({name:"collect",x:((o/2||14)+5)*Math.sin(0*Math.PI/180),y:-((o/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});u.add(y)}if(r.label){const re=new zt.Circle({x:((o/2||14)+5)*Math.sin(30*Math.PI/180),y:-((o/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});u.add(re)}if(r.type==="nodeType"&&r.showTotal){const re=(o/2||14)+5,ce=70*Math.PI/180,Se=re*Math.sin(ce),_e=-re*Math.cos(ce),q=new zt.Circle({x:Se,y:_e,radius:10,fill:"#1890ff",stroke:"white",strokeWidth:2,listening:!1});u.add(q);const Q=new zt.Text({x:Se,y:_e,text:`${((ge=r==null?void 0:r.children)==null?void 0:ge.length)||0}`,fontSize:10,fontFamily:"Calibri",fill:"#fff",align:"center",verticalAlign:"middle",listening:!1});Q.offsetX(Q.width()/2),Q.offsetY(Q.height()/2),u.add(Q)}u.on("dragstart",(re,ce)=>{re.evt&&re.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),u.on("dragmove",re=>{if(!(re.evt&&re.evt[this.actKey])){var ce=this.simulation.nodes().find(Se=>Se.id===r.id);ce&&(ce.x=u.x(),ce.fx=u.x(),ce.y=u.y(),ce.fy=u.y(),this.links.forEach(Se=>{const _e=this.linksGroup[`${Se.source.id}-${Se.target.id}`],q=_e==null?void 0:_e.findOne(".konvaLine"),Q=_e==null?void 0:_e.findOne(".linkArrow"),fe=_e==null?void 0:_e.findOne(".edgeLabel");let Re,Le,Je,V;if(Se.source.id===ce.id){if(!this.nodesGroup[Se.target.id])return;Re=ce.x,Le=this.nodesGroup[Se.target.id].x(),Je=ce.y,V=this.nodesGroup[Se.target.id].y(),q.points([Re,Je,Le,V]);const Y=D0(Re,Je,Le,V,by);Q==null||Q.x(Y==null?void 0:Y.x),Q==null||Q.y(Y==null?void 0:Y.y),Q==null||Q.rotation(Math.atan2(V-Je,Le-Re)*(180/Math.PI))}else if(Se.target.id===ce.id){if(!this.nodesGroup[Se.source.id])return;Re=this.nodesGroup[Se.source.id].x()||0,Le=ce.x||0,Je=this.nodesGroup[Se.source.id].y()||0,V=ce.y||0,q.points([Re,Je,Le,V]);const Y=D0(Re,Je,Le,V,by);Q==null||Q.x(Y==null?void 0:Y.x),Q==null||Q.y(Y==null?void 0:Y.y),Q==null||Q.rotation(Math.atan2(V-Je,Le-Re)*(180/Math.PI))}if(fe&&(Se.source.id===ce.id||Se.target.id===ce.id)){fe.x((Re+Le)/2),fe.y((Je+V)/2),fe.offsetX(fe.getWidth()/2||0),fe.offsetY(fe.getHeight()/2+8||0);const Y=Math.atan2(V-Je,Le-Re)*(180/Math.PI);Le<Re?fe.rotation(Y+180):fe.rotation(Y)}}),this.layer.batchDraw())}}),u.on("dragend",re=>{re.evt&&re.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),u.on("click",re=>{re.evt.detail===2?this.expandNodes(re,r):re.evt.detail===1&&re.evt.button===0&&this.handleNodeClick(re,r)}),u.on("contextmenu",re=>{re.cancelBubble=!0,re.evt.preventDefault(),re.evt.stopPropagation(),this.handleNodeContextMenu(re,r,u)}),u.on("mouseup",re=>this.handleNodeMouseUp(re,r)),u.on("mousedown",re=>this.handleNodeMouseDown(re,r)),u.on("mouseenter",re=>this.handleNodeMouseEnter(re,r)),u.on("mouseleave",re=>this.handleNodeMouseLeave(re,r)),this.grab.add(u),this.nodesGroup[r.id]=u})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new zt.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),s=this.darkMode?"#445152":"#999",o=new zt.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:s});r.add(o);const a=n.source.x||0,l=n.source.y||0,c=n.target.x||0,u=n.target.y||0,d=new zt.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[a,l,c,u],stroke:n.target.type==="org"?"#cf1322":s,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.edgeLabelProp){const f=n.edgeLabelProp.length>this.edgeLabelMaxLength?n.edgeLabelProp.substring(0,this.edgeLabelMaxLength)+"...":n.edgeLabelProp,h=new zt.Text({name:"edgeLabel customEdgeLabel",x:(a+c)/2,y:(l+u)/2,text:f,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(h)}if(n.target.type==="nodeType"){const f=n.target.relay_name||n.target.name,h=new zt.Text({name:"edgeLabel",x:(a+c)/2,y:(l+u)/2,text:f,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(h)}r.add(d),r.on("mouseenter",f=>this.handleLinkMouseEnter(f,n)),r.on("mouseleave",f=>this.handleLinkMouseLeave(f,n)),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(gi("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],s=this.linksGroup[`${r.source.id}-${r.target.id}`],o=s==null?void 0:s.findOne(".konvaLine"),a=s==null?void 0:s.findOne(".linkArrow"),l=s==null?void 0:s.findOne(".edgeLabel");let c=r.source.x,u=r.source.y,d=r.target.x,f=r.target.y;const h=d-c||1,g=f-u||1,v=Math.sqrt(h*h+g*g),y=h/v||1,_=g/v||1,w=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,A=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(c=c+w*y,u=u+w*_,d=d-A*y,f=f-A*_,isNaN(c)||isNaN(u)||isNaN(d)||isNaN(f)){e=!1;break}if(o==null||o.points([c,u,d,f]),a){const C=D0(c,u,d,f,by);a==null||a.x((C==null?void 0:C.x)||0),a==null||a.y((C==null?void 0:C.y)||0),a==null||a.rotation(Math.atan2(f-u,d-c)*(180/Math.PI))}if(l){l.x((c+d)/2),l.y((u+f)/2),l.offsetX(l.getWidth()/2||0),l.offsetY(l.getHeight()/2+8||0);const C=Math.atan2(f-u,d-c)*(180/Math.PI);d<c?l.rotation(C+180):l.rotation(C)}}if(!e){gi("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const s=this.linksGroup[`${r.source.id}-${r.target.id}`];s==null||s.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const s=t.find(a=>a.source.id===r.source.id&&a.target.id===r.target.id),o=this.linksGroup[`${r.source.id}-${r.target.id}`];s?o==null||o.addName("keyed"):o==null||o.removeName("keyed")}),this.nodes.forEach(r=>{const s=this.nodesGroup[r.id];n.includes(r.id)?s==null||s.addName("keyed"):s==null||s.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),s=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(s)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),s=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const o=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const a=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(a),s.fill(a),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const a=e.target.type==="org"?"#cf1322":o;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(a),s.fill(a),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!sl()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(sl())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,s,o,a,l,c;if(!this.enableScript||this.scriptInited)return;((o=(s=(r=this.history)==null?void 0:r.dataNow)==null?void 0:s.nodes)==null?void 0:o.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((c=(l=(a=this.history)==null?void 0:a.dataNow)==null?void 0:l.nodes)==null||c.some(u=>{const d=e.indexOf(u.id);return d>=0&&u.startNode===!0&&(t=d),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(A=>e.indexOf(A.id)>=0);r==null||r.forEach(function(A,C){const S=this.nodesGroup[A.id];n.push({bounds:(S==null?void 0:S.getClientRect())||{},fx:A.x||0,fy:A.y||0})});const s=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const o=this.stage.width(),a=this.stage.height()/1.5,l=s.width,c=s.height;if(l===0||c===0)return;let u=t/Math.max(l/o,c/a);u=Math.min(u,qr)||qr,this.scale=u;const d=this.stage.width()/(2*u),f=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],g=h==null?void 0:h.getClientRect(),v=g.x*u,y=g.y*u,_=d-v,w=f-y;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:w||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,s;return e.map(o=>{const a=o.bounds,l=a.x+o.fx,c=a.y+o.fy;t=Math.min(l,t)||l,n=Math.min(c,n)||c,r=Math.max(l+a.width,r)||l+a.width,s=Math.max(c+a.height,s)||c+a.height}),{x:t,y:n,width:r-t,height:s-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadCustomIcon(){if(this.customNodeImages&&!this.customIconLoaded){let e=0;const t=Object.keys(this.customNodeImages).length;Object.keys(this.customNodeImages).forEach(n=>ot(this,null,function*(){e++,$n[n]=yield Lr(this.customNodeImages[n]),e===t&&(this.customIconLoaded=!0)}))}else this.customIconLoaded=!0},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const c in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[c];u==null||u.map(d=>{d.children?r.push(...d.children):r.push(d)})}n.push(...r.map(c=>c.icon)),n.push(...this.moduleDetail.nodes.map(c=>c.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const s=this;let o=0;const a=n.filter(c=>this.imgPath[`${s.prefix}d3svg1/${c}.svg`]);function l(c){return{}.VITE_SVG_TYPE==="base64"?VS(c):US(c)}a.map(c=>{l(this.imgPath[`${s.prefix}d3svg1/${c}.svg`]).then(u=>{s.iconFiles[c]=u;const d=Yq(u).width;this.iconSize[c]=this.nodeWidth?this.nodeWidth:d,o++,o===a.length&&(s.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt&&e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=Bue:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){Ke(this,"handle-select-node",{isSelected:!1,_node:it(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||B4(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),Ke(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){Bn({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(s=>s.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(s=>s.type==="nodeType"))return;n?this.selection=this.selection.filter(s=>s.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(s=>s.id===t.id);Ke(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),s=e.target,o=s.getAbsolutePosition(),l=s.getStage().container().getBoundingClientRect(),c=o.x-n/2+l.left,u=o.y-r/2+l.top,d=c,f=u,h=d,g=d+n,v=f,y=f+r;this.hoverNodePosition={top:v,right:g,bottom:y,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),s=(r.x-this.stage.x())/n,o=(r.y-this.stage.y())/n;this.mousedownPos={x:s,y:o},this.dragLine=new zt.Line({points:[s,o,s,o],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},handleLinkMouseEnter(e,t){if(t.target.type==="nodeType")return;const n=!!t.edgeLabelProp;let r;if(n?r=t.edgeLabelProp:r=t.target.relay_name||t.target.name,r.length<=this.edgeLabelMaxLength)return;const o=this.linksGroup[`${t.source.id}-${t.target.id}`].findOne(".edgeLabel"),a=t.source.x,l=t.source.y,c=t.target.x,u=t.target.y;o&&(o.text(r),o.x((a+c)/2),o.y((l+u)/2),o.offsetX(o.getWidth()/2||0),o.offsetY(o.getHeight()/2+8||0))},handleLinkMouseLeave(e,t){if(t.target.type==="nodeType")return;const n=!!t.edgeLabelProp;let r;if(n?r=t.edgeLabelProp:r=t.target.relay_name||t.target.name,r.length<=this.edgeLabelMaxLength)return;const o=this.linksGroup[`${t.source.id}-${t.target.id}`].findOne(".edgeLabel"),a=t.source.x,l=t.source.y,c=t.target.x,u=t.target.y;o&&(o.text(r.substring(0,this.edgeLabelMaxLength)+"..."),o.x((a+c)/2),o.y((l+u)/2),o.offsetX(o.getWidth()/2||0),o.offsetY(o.getHeight()/2+8||0))},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){var e,t;(e=this.simulation)!=null&&e.stop&&((t=this.simulation)==null||t.stop()),this.nodes.map(n=>{delete n.vx,delete n.vy,delete n.x,delete n.y,delete n.fx,delete n.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,s=0;const o=t[n];this.links.map(a=>{a.source.id===o&&r++,a.target.id===o&&s++}),r>=1&&t.splice(n,1),s>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var d,f,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),s=this.grab.getClientRect(),o=s.width/this.scale,a=s.height/this.scale;if(o===0||a===0)return;let l=e/Math.max(o/n,a/r);if(l=t?l:Math.min(l,qr)||qr,!t&&l>qr)return;this.scale=l;const c=this.stage.width()/(2*l),u=this.stage.height()/(2*l);if((d=this.simulation)!=null&&d.force&&((f=this.simulation)==null||f.force("center",z8(c,u))),this.ticked(),this.stage.setAttrs({scaleX:l,scaleY:l,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const g=this.grab.getClientRect(),v=(n-g.width)/2-g.x,y=(r-g.height)/2-g.y;this.stage.setAttrs({x:v,y}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,s;const o={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(a=>r.includes(a.id));break;case"hold_aggregation":s=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(s,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(a=>{a.textProp=o[t.name]}),this.update();break;case"all_show_label":case"all_show_names":this.nodes.map(a=>{a.textProp=o[t.name]}),this.update();break;case"un_show_names":case"un_show_label":e.map(a=>{a.textProp=null}),this.update();break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(a=>{a.textProp=null}),this.update();break;case"all_show_edges_label":this.links.map(a=>{a.edgeLabelProp=a.edge_label}),this.update();break;case"all_hide_edges_label":this.links.map(a=>{a.edgeLabelProp=null}),this.update();break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(a=>{this.starNode(a)});break;case"un_node_star":e.map(a=>{this.starNode(a,!1)});break;case"fix_nodes":e.map(a=>{this.toggleMove(a,!0)});break;case"un_fix_nodes":e.map(a=>{this.toggleMove(a,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(a=>{this.$parent.expandNodes(a)});break;case"expand_part_node":e.map(a=>{this.$parent.expandNodes(a,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;case"show_nodes":this.toggleShowNodes(e,!0);break;case"hide_nodes":this.toggleShowNodes(e,!1);break;default:Ke(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:it(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else vn({message:"无可操作权限",type:"warning"})},expandNodes(e,t){Bn({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):vn({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,null,n),this.selection.filter(s=>s.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},toggleShowNodes(e,t=!0){e.forEach(n=>{this.history.toggleShowNode(n,null,t)}),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
155
+ `}),t&&jue(t).then(()=>{vn({message:"复制成功",type:"success"})},n=>{console.log("copy---e",n)})},toggleMove(e,t){e.fx=t?e.x:null,e.fy=t?e.y:null},autoDisplay(){this.nodes.map(e=>{e.fx=null,e.fy=null})},editLabel(e){var t;LS.prompt("修改备注",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:(t=e[0])==null?void 0:t.label,inputPlaceholder:"请输入备注,最多20字",inputValidator:n=>n.length>20?"已超过20字":!0}).then(({value:n})=>{e.map(r=>{r.label=n,this.showLabel(r,"label")}),this.updateNodeStyle()}).catch(n=>{console.log(n)})},showLabel(e,t){e.textProp=t,this.update()},hideLabel(e,t){e.textProp=null,this.update()},safeGet(e,t){return!e||!t?void 0:t.split(".").reduce((s,o)=>s&&s[o]?s[o]:void 0,e)},fixAllNodes(e=!0){this.nodes.map(t=>{this.toggleMove(t,e)}),!e&&this.isAutoTick&&this.updateSimulation()},highlightByRule(e,t){if(!e.prop&&!t){this.nodes.forEach(l=>{const c=this.nodesGroup[l.id];c==null||c.removeName("lowlight")}),this.links.forEach(l=>{const c=this.linksGroup[`${l.source.id}-${l.target.id}`];c==null||c.removeName("lowlight")});return}const{type:n,prop:r,value:s}=e,o=this,a=[];this.nodes.forEach(l=>{const c=this.nodesGroup[l.id];r?n==="include"?s.includes(o.safeGet(l,r))&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight"):n==="equal"?o.safeGet(l,r)===s&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight"):n==="boolean"&&(R0(o.safeGet(l,r))&&o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight")):o.inNodesRange(t,l)?(c==null||c.removeName("lowlight"),a.push(l)):c==null||c.addName("lowlight")}),this.links.forEach(l=>{const c=this.linksGroup[`${l.source.id}-${l.target.id}`];a.some(d=>d.id===l.target.id)?c==null||c.removeName("lowlight"):c==null||c.addName("lowlight")})},handleCustomSelect(e){if(this.handleDeselectNode(),!e.prop)return;const{type:t,prop:n,value:r}=e,s=this;this.nodes.forEach(o=>{if(n&&t==="include"){let a;if(o.type==="nodeType"){const l=s.safeGet(o,"parents"),c=s.safeGet(o,"children"),u=l==null?void 0:l.some(f=>r.includes(f)),d=c==null?void 0:c.some(f=>r.includes(f));a=u&&d}(r.includes(s.safeGet(o,n))||a)&&this.selection.push(o)}}),this.updateSelection()},inNodesRange(e,t){return e?e.some(n=>n===t.id):!0},loadFlagFiles(e){return ot(this,null,function*(){return new Promise(t=>{this.flagFiles[e]?t(this.flagFiles[e]):(this.flagFiles[e]=this.imgPath[`${this.prefix}d3svg1/flags/${e}.png`],t(this.flagFiles[e]))})})},getNodeImage(e){return ot(this,null,function*(){var s,o,a,l,c,u,d,f,h,g,v,y;let t=null;const n=(a=(o=(s=e.detail)==null?void 0:s.info)==null?void 0:o.basic)==null?void 0:a.flag,r=(u=(c=(l=e==null?void 0:e.detail)==null?void 0:l.info)==null?void 0:c.basic)==null?void 0:u.level;if(this.customNodeImages&&this.customNodeImages[e.type]){if($n[e.type])return $n[e.type];t=yield Lr(this.customNodeImages[e.type]),$n[e.type]=t}else if(e.detail&&((f=(d=e.detail)==null?void 0:d.info)!=null&&f.icon_img))try{t=yield Lr(e.detail.info.icon_img)}catch(_){console.log("loadCompleted error",_)}else if(e.detail&&((g=(h=e.detail)==null?void 0:h.info)!=null&&g.inner_img))try{t=yield Lr(e.detail.info.inner_img)}catch(_){console.log("loadCompleted error",_)}else if(e.type==="nodeType"||e.type==="aggregation"){if(e!=null&&e.icon_img)try{return t=yield Lr(e.icon_img),t}catch(w){console.log("loadCompleted error",w)}const _=e.icon||"node_type";if($n[_])return t=$n[_],t;t=this.iconFiles[_]?this.iconFiles[_]:this.iconFiles.node_type,t=yield Lr("data:image/svg+xml,"+encodeURIComponent(t)),$n[_]=t}else if(n&&(e.type==="ip"||e.type==="internet")){if($n[n])return t=$n[n],t;yield this.loadFlagFiles(n),t=yield Lr(this.flagFiles[n]),$n[n]=t}else if((y=(v=e.detail)==null?void 0:v.info)!=null&&y.inner_country&&(e.type==="country"||e.type==="target_country")){const _=e.detail.info.inner_country;if($n[_])return t=$n[_],t;yield this.loadFlagFiles(_),t=yield Lr(this.flagFiles[_]),$n[_]=t}else{const _=`${e.type||"node"}${r}${this.darkMode}`;if($n[_])return t=$n[_],t;t=this.iconFiles[e.type]?this.iconFiles[e.type]:this.iconFiles.node;const w=ea(r,this.levelList,this.darkMode),A=this.darkMode?"#182628":"#fff";t=$S(t,w,A);try{t=yield Lr("data:image/svg+xml,"+encodeURIComponent(t))}catch(C){console.log(C)}$n[_]=t}return t})},handleGoDetail(e){e.forEach(t=>{if(t.isCluster)return;const n=t.type,r=this.moduleDetail.config.jumpRule[n];if(r)if(n==="org"){const s=t.id.split("(")[0];s.indexOf("APT")>=0&&window.open(r.split("${id}").join(s),t.id)}else{let s=t.origin&&t.origin[0]||t.id;(n==="url"||n==="virus")&&(s=encodeURIComponent(s)),window.open(r.split("${id}").join(s),t.id)}})},starNode(e,t=!0){e.collect=t,this.update()},handleAddBlack(e){this.showBlackType=!0,this.node=e},changeVisible(e){this.showBlackType=e},zoomIn(){this.adjustZoom(1.1)},zoomOut(){this.adjustZoom(.909)},adjustZoom(e){const n=this.stage.scaleX()*e;this.scale=n;const r={x:this.stage.width()/2,y:this.stage.height()/2},s={x:this.stage.getPointerPosition().x-this.stage.x(),y:this.stage.getPointerPosition().y-this.stage.y()},o={x:-(s.x-r.x)*(e-1),y:-(s.y-r.y)*(e-1)};this.stage.setAttrs({x:this.stage.x()+o.x,y:this.stage.y()+o.y,scaleX:n,scaleY:n}),this.layer.batchDraw()},addNodesDetail(e){return ot(this,null,function*(){const t=e.filter(s=>!s.detail&&s.noDetail!==!0&&s.type!=="aggregation"&&s.type!=="nodeType"),n={};t.map(s=>{n[s.type]?n[s.type].push(s):n[s.type]=[s]});const r=[];for(const s in n){const o=n[s],a={};o.map(l=>{l.origin&&(a[l.id]=l.origin)}),r.push(this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[n[s][0].type],node_id:n[s].map(l=>l.id),origin:a}).then(l=>(l.data.records.map(u=>{const d=e.find(f=>f.id===u.info.id);d.detail=u}),Promise.resolve({}))))}})},addCanvasBg(){this.darkBgRect=new zt.Rect({x:0,y:0,width:this.stage.width()/this.scale,height:this.stage.height()/this.scale,fill:this.canvasBg,listening:!1,draggable:!1}),this.layer.add(this.darkBgRect),this.darkBgRect.moveToBottom(),this.stage.draw()},removeCanvasBg(){this.darkBgRect&&this.darkBgRect.destroy(),this.darkBgRect=null,this.stage.draw()}}},zue={class:"main-svg-box","element-loading-text":"布局中...","element-loading-background":"rgba(122, 122, 122)"},que={ref:"canvasContainer",class:"canvas-container"};function Hue(e,t,n,r,s,o){const a=Ge("popover"),l=Ge("node-contextmenu"),c=IS;return R(),U("div",{class:ee(["render-container",n.darkMode?"dark-theme "+s.uniqueClass:" "+s.uniqueClass])},[Lt((R(),U("div",zue,[K("div",que,null,512)])),[[c,s.ticking]]),n.enablePopover?(R(),ye(a,{key:0,"dark-mode":n.darkMode,"show-popover":s.showPopover&&!s.isDragging,"mouse-position":s.hoverNodePosition,"node-info":s.popoverNode,"module-detail":n.moduleDetail,type:s.popoverType,"custom-tooltip":n.customTooltip,history:n.history,data:n.history.dataNow},null,8,["dark-mode","show-popover","mouse-position","node-info","module-detail","type","custom-tooltip","history","data"])):oe("",!0),n.isThreatPath?oe("",!0):(R(),ye(l,{key:1,show:o.showContextMenuFlag,axis:s.mousePosition,"node-info":o.contextMenuNodes,history:n.history,"menu-options":s.menuOptions,"module-detail":n.moduleDetail,onContextmenuClick:o.handleContextMenuClick},null,8,["show","axis","node-info","history","menu-options","module-detail","onContextmenuClick"]))],2)}const Gue=fn(Vue,[["render",Hue]]),wme="",Cme="",Sme="",{toClipboard:MA}=Bf(),Wue={name:"SnapShotDialog",components:{},mixins:[],props:{snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,ruleForm:{radio:"0",event:"",group:"",graphDesc:""},rules:{event:[{required:!0,message:"请选择安全事件",trigger:"change"}],group:[{required:!1,message:"请选择团队",trigger:"change"}]},eventOptions:[{value:"",label:""}],groupOptions:[{value:"",label:""}],hostList:["https://sc.360.net","https://sc.b.qihoo.net","http://sec.test.safe.qihoo.net"],isInnerAccount:!1,visibleSuccess:!1,eventUrl:null}},computed:{},watch:{snapshot:{handler:function(e,t){e.name&&(this.ruleForm.graphDesc=e.name)},immediate:!0,deep:!0}},mounted(){this.graphApi.getReportList&&this.graphApi.getReportList().then(e=>{e.data!==null&&(this.eventOptions=[],e.data.map(t=>{this.eventOptions.push({label:t.title,value:t.report_id})}))}),this.graphApi.getGroupList&&this.graphApi.getGroupList().then(e=>{e.data!==null?(this.groupOptions=[],e.data.map(t=>{this.groupOptions.push({label:t.group_name,value:t.group_id})}),this.isInnerAccount=!0):this.isInnerAccount=!1})},updated(){},beforeUnmount(){},methods:{hanleClickCopy(e){MA(e).then(t=>vn({message:"复制成功",type:"success"}),t=>vn.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1,this.resetForm("ruleForm")},submitForm(e){this.$refs[e].validate(t=>{if(t){const n=this.hostList.some(l=>l===this.origin);let r=null;n?this.origin===this.hostList[1]?r=`${this.hostList[0]}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`${this.origin}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`http://test.sec.360.net/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`,this.eventUrl=window.location.origin+"/event/"+this.ruleForm.event;const s=this.snapshot.thumb;let o=null;this.groupOptions.map(l=>{l.value===this.ruleForm.group&&(o=l.label)});const a={report_id:this.ruleForm.event,group_id:this.ruleForm.group,content:s,graph_url:r,group_name:o,acl:parseInt(this.ruleForm.radio),head:this.ruleForm.graphDesc};this.graphApi.addGraph(a).then(l=>{l.code==="0"?(MA(this.eventUrl),vn({message:"分享成功! 分享事件地址已经复制",type:"success",showClose:!0,duration:5e3})):vn({message:"分享失败",type:"error"})}).catch(()=>{vn({message:"分享失败",type:"error"})}),this.resetForm(e),this.dialogVisible=!1}else return!1})},resetForm(e){this.$refs[e].resetFields(),this.snapshot.name=""}}},Kue={class:"sharetoEvents"},Jue={class:"lable-header"},Yue={class:"desc"},Xue={key:0,class:"desc-font"},Zue={key:1,class:"desc-font"},Que={class:"dialog-footer"};function ede(e,t,n,r,s,o){const a=M$,l=xf,c=Ef,u=Gm,d=Js,f=Hm,h=Jo,g=Kc;return R(),U("div",Kue,[ie(g,{title:"分享到安全事件","append-to-body":"","close-on-click-modal":!1,width:"25%",modelValue:s.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=v=>s.dialogVisible=v),class:"el-dialog-graph"},{footer:ne(()=>[K("span",Que,[ie(h,{type:"primary",onClick:t[5]||(t[5]=v=>o.submitForm("ruleForm"))},{default:ne(()=>t[9]||(t[9]=[Ye("确认分享")])),_:1}),ie(h,{onClick:o.hide},{default:ne(()=>t[10]||(t[10]=[Ye("关闭")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(f,{ref:"ruleForm",model:s.ruleForm,rules:s.rules,"label-width":"100px",class:"demo-ruleForm"},{default:ne(()=>[K("div",Jue,[ie(a,{modelValue:s.ruleForm.radio,"onUpdate:modelValue":t[0]||(t[0]=v=>s.ruleForm.radio=v),class:"el-radio",label:"1",border:"",size:"medium"},{default:ne(()=>t[7]||(t[7]=[Ye("付费可见")])),_:1},8,["modelValue"]),ie(a,{modelValue:s.ruleForm.radio,"onUpdate:modelValue":t[1]||(t[1]=v=>s.ruleForm.radio=v),label:"0",border:"",size:"medium"},{default:ne(()=>t[8]||(t[8]=[Ye("开放")])),_:1},8,["modelValue"]),K("div",Yue,[s.ruleForm.radio==="0"?(R(),U("span",Xue,"该Graph内容对所有用户可见。")):(R(),U("span",Zue,"该Graph内容对付费用户可见。"))])]),ie(u,{label:"安全事件",prop:"event"},{default:ne(()=>[ie(c,{modelValue:s.ruleForm.event,"onUpdate:modelValue":t[2]||(t[2]=v=>s.ruleForm.event=v),"popper-append-to-body":!1,filterable:"",placeholder:"请选择",class:"select-item"},{default:ne(()=>[(R(!0),U(qe,null,It(s.eventOptions,v=>(R(),ye(l,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s.isInnerAccount?(R(),ye(u,{key:0,label:"选择团队",prop:"group"},{default:ne(()=>[ie(c,{modelValue:s.ruleForm.group,"onUpdate:modelValue":t[3]||(t[3]=v=>s.ruleForm.group=v),class:"select-item",filterable:"",placeholder:"请选择"},{default:ne(()=>[(R(!0),U(qe,null,It(s.groupOptions,v=>(R(),ye(l,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):oe("",!0),ie(u,{label:"Graph介绍",prop:"graphDesc"},{default:ne(()=>[ie(d,{modelValue:s.ruleForm.graphDesc,"onUpdate:modelValue":t[4]||(t[4]=v=>s.ruleForm.graphDesc=v),type:"textarea",rows:2,placeholder:"请输入内容",maxlength:"50",clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}const tde=fn(Wue,[["render",ede]]),Eme="",{toClipboard:nde}=Bf(),ide={name:"SnapShotDialog",components:{ShareToSecurityEvents:tde},mixins:[],props:{customCopyPathFn:{type:Function},graphUrlPath:{type:String,default:"/graph"},snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,isInnerAccount:!1}},computed:{linkAddress(){return this.customCopyPathFn&&typeof this.customCopyPathFn=="function"?this.customCopyPathFn({snapshot_id:this.snapshot.snapshot_id}):`${this.origin}${this.graphUrlPath}?snapshot_id=${this.snapshot.snapshot_id}`},linkAddressAndCode(){return this.customCopyPathFn&&typeof this.customCopyPathFn=="function"?this.customCopyPathFn({snapshot_id:this.snapshot.snapshot_id,vcode:this.snapshot.vcode}):`${this.linkAddress}&vcode=${this.snapshot.vcode}`}},watch:{},created(){},mounted(){no(mt,"sharePermission",e=>{this.isInnerAccount=e})},updated(){},beforeUnmount(){io(mt,"sharePermission")},methods:{hanleClickCopy(e){nde(e).then(t=>vn({message:"复制成功",type:"success"}),t=>vn.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1},shareToEvents(){this.dialogVisible=!1,this.$refs.sharetoevents.show()}}},rde={class:"snapshotdialog-container"},sde={class:"dialog-footer"};function ode(e,t,n,r,s,o){const a=Js,l=tV,c=Jo,u=Kc,d=Ge("ShareToSecurityEvents");return R(),U("div",rde,[ie(u,{modelValue:s.dialogVisible,"onUpdate:modelValue":t[2]||(t[2]=f=>s.dialogVisible=f),title:"复制链接及提取码","append-to-body":"","close-on-click-modal":!1,class:"el-dialog-graph"},{footer:ne(()=>[K("span",sde,[s.isInnerAccount?(R(),ye(c,{key:0,type:"primary",onClick:t[0]||(t[0]=f=>o.shareToEvents())},{default:ne(()=>t[5]||(t[5]=[Ye("分享到安全事件")])),_:1})):oe("",!0),ie(c,{type:"primary",onClick:t[1]||(t[1]=f=>o.hanleClickCopy(o.linkAddressAndCode))},{default:ne(()=>t[6]||(t[6]=[Ye("复制链接及提取码")])),_:1}),ie(c,{onClick:o.hide},{default:ne(()=>t[7]||(t[7]=[Ye("关闭")])),_:1},8,["onClick"])])]),default:ne(()=>[ie(a,{value:o.linkAddress,readonly:""},{prepend:ne(()=>t[3]||(t[3]=[Ye("链接地址:")])),_:1},8,["value"]),ie(l),ie(a,{value:n.snapshot.vcode,readonly:""},{prepend:ne(()=>t[4]||(t[4]=[Ye("提取码:")])),_:1},8,["value"])]),_:1},8,["modelValue"]),ie(d,{ref:"sharetoevents",snapshot:n.snapshot,"graph-api":n.graphApi},null,8,["snapshot","graph-api"])])}const ade=fn(ide,[["render",ode]]),xme="",lde={name:"ForceGraphByCanvas",components:{Loading:Va,ForceGraphSvgIcon:Qo,RenderByCanvas:Gue,ButtonList:iX,SnapShotDialog:ade,RightMenu:EW,Legend:SJ,NodeVisibleControl:OJ},mixins:[kr],provide:function(){return{history:this.history,hasLevel:this.hasLevel,levelList:this.levelList,levelMap:this.levelMap,getDarkMode:()=>this.darkMode,requestGraphData:this.requestGraphData,moduleDetail:()=>this.moduleDetail}},props:{showPoint:{type:Boolean,default:!0},isRenderStartNode:{type:Boolean,default:!0},isDefaultSelectStartNode:{type:Boolean,default:!0},isShowRightMenu:{type:Boolean,default:!0},enablePopover:{type:Boolean,default:!0},canvasBg:{type:String,default:"transparent"},hideButtonList:{type:Array,default:()=>[]},showTopSearch:{type:Boolean,default:!1},customContextMenuEvent:{type:Function},handleSelectNodeEvent:{type:Function},handleDataLoaded:{type:Function},graphApi:{type:Object,default:()=>{}},graphUrlPath:{type:String,default:"/graph"},customCopyPathFn:{type:Function},snapshot_id:{type:String,default:""},vcode:{type:String,default:""},module:{type:String,default:""},startNode:{type:Array,default:()=>[]},enterStartNode:{type:Boolean,default:!1},hasLevel:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",iconType:"",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",iconType:"",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",iconType:"",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",iconType:"",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},showLevelCount:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},title:{type:String,default:""},isShowNodeMessage:{type:Boolean,default:!0},nodeWidth:{type:Number},startNodeWidth:{type:Number},linkDistance:{type:Number},strength:{type:Number},nodeTypeScale:{type:Number},singlesNodeMaxNum:{type:Number,default:100},startNodeAnimation:{type:Boolean,default:!0},customTooltip:{type:Function},enableScript:{type:Boolean,default:!1},edgeLabelMaxLength:{type:Number,default:10},hasNodeVisibleControl:{type:Boolean,default:!1},hasLegend:{type:Boolean,default:!0},customNodeImages:{type:Object,default:()=>{}},isShowNodeType:{type:Boolean,default:!0}},emits:["sharePermission","custom-contextmenu-click","handle-select-node","handle-data-loaded","outdate"],data(){return{history:new Fq({isShowNodeMessage:this.isShowNodeMessage}),isLoading:!1,bigLoading:!1,loadingInfo:"数据加载中",moduleDetail:{},contextMenuNode:{},contextMenuId:0,isDragging:!1,isCtrlDown:!1,selection:[],snapshot:{},inited:!1,outdateTime:0,fullScreen:!1,generateUniqueIndexNow:this.generateUniqueIndex(),screenHeight:0,margin:"0",requestGraphData:!0,nodeTypeList:[]}},computed:{topFrame(){return window.top.location===window.location},levelMap(){const e={};return this.levelList.forEach(t=>{e[t.level]=t}),e}},watch:{startNode:{handler:function(e,t){this.moduleDetail.module&&this.searchStartNode()},immediate:!0,deep:!0},screenHeight:{deep:!0,handler:function(){this.margin=this.changeMargin()}},graphApi:{handler:function(){this.$nextTick(()=>{this.initializeGraphApi()})},deep:!0,immediate:!0}},unmounted(){window.onresize=null},mounted(){return ot(this,null,function*(){console.log('"2024/11/19 19:22:24"',"2024/11/19 19:22:24"),this.initializeGraphApi(),window.onresize=()=>{this.fullScreen=!!document.fullscreenElement,this.screenHeight=document.body.clientHeight},this.margin=this.changeMargin(),no(mt,"emitDataLoaded",()=>{this.emitDataLoaded()})})},methods:{initializeGraphApi(){if(this.graphApi){if(this.snapshot_id)this.isLoading=!0,this.graphApi.getSnapshotDetail({snapshot_id:this.snapshot_id,vcode:this.vcode}).then(e=>{this.moduleDetail=e.data.config,this.history.initFromSnapshot(JSON.parse(e.data.data)),setTimeout(()=>{this.$refs.render.updateNodeStyle(),this.centerAndZoom(.8,!1)},1e3)}).catch(e=>{console.log(e,"e")}).finally(e=>{this.isLoading=!1});else if(this.module)this.initGraph();else{vn.error("请传入模块名称");return}this.graphApi.userInfo&&this.graphApi.userInfo().then(e=>{e.data!==null&&(Ke(mt,"sharePermission",e.data.access.graph_share),this.requestGraphData=e.data.access.request_graph_data)}).catch(e=>{this.onOutdate(e.res)})}},handleCustomContextMenuClick(e){this.customContextMenuEvent&&typeof this.customContextMenuEvent=="function"?this.customContextMenuEvent(it(e)):Ke(this,"custom-contextmenu-click",it(e))},handleSelectNode(e){this.handleSelectNodeEvent&&typeof this.handleSelectNodeEvent=="function"?this.handleSelectNodeEvent(it(e),it(this.history.dataNow)):Ke(this,"handle-select-node",it(e))},searchStartNode(){this.startNode.length>0&&!this.inited&&this.startNode.map(e=>{const t={type:e.type,id:e.id,startNode:!0};this.inited=!0,this.moduleDetail.nodes.findIndex(n=>e.type===n.name)>=0?this.addNewNodesAndExpand(t):(vn({message:"无相关数据",type:"warning"}),this.emitDataLoaded())})},initGraph(){return ot(this,null,function*(){var e;gi("initGraph"),(e=this.graphApi)==null||e.getGraphConfig({name:this.module}).then(t=>{const n=t.data||{},r=kf(n==null?void 0:n.node_info),s=(n==null?void 0:n.nodes)||[];s.forEach(a=>{a.name=a.name.toLowerCase()});const o=kf(n==null?void 0:n.plugs);n.node_info=r,n.nodes=s,n.plugs=o,this.moduleDetail=n,this.searchStartNode(),!this.inited&&this.enterStartNode&&this.$refs.buttonList.addNode("search")}).catch(t=>{this.onOutdate(t.res),this.emitDataLoaded(),console.log("e",t)})})},addNewNodesAndExpand(e){this.isLoading=!0,this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(t=>{var s,o,a;let n={id:(s=t.data.records[0])==null?void 0:s.info.id,type:(o=t.data.records[0])==null?void 0:o.info.type,startNode:!0,detail:t.data.records[0],group:e.id,name:((a=t.data.records[0])==null?void 0:a.info.name)||e.id};n=bs(n,this.moduleDetail.plugs);const r={addOne:{nodes:[n],links:[]}};this.isRenderStartNode&&(this.history.pushState(r),this.history.updateData(t.data.records,[e.id]),setTimeout(()=>{this.isDefaultSelectStartNode&&(this.handleTableSelect([e.id]),setTimeout(()=>{this.selection.length&&this.handleSelectNode({isSelected:!0,_node:this.selection[0]})},0))},500)),this.expandNodes(n)}).catch(t=>{console.log(t,"e"),this.emitDataLoaded(),this.onOutdate(t.res),vn({message:"无该节点信息",type:"warning"})}).finally(()=>{this.isLoading=!1})},onAction(e){this.history.pushState(e)},onOutdate(e){(e==null?void 0:e.code)==="AC100001"&&this.outdateTime<1&&(this.outdateTime++,Ke(this,"outdate"))},expandNodes(e,t){return ot(this,null,function*(){if(!(e!=null&&e.type))return;const n=this.moduleDetail.plugs[e==null?void 0:e.type];let r=[];t?(r=Array.isArray(t)?[...t]:[t],e.apis===void 0&&(e.apis=[]),e.apis.push(...r)):(e.expand=1,e.apis=[],e.apis.push({namec:"拓线全部",value:0,name:"",flagSelect:!0}),n==null||n.map(u=>{u.children?r.push(...u.children):r.push(u)}));const s=r.map(u=>this.graphApi.getGraphRequest({api:u.name,node_id:e.id,origin:e.origin,nodeType:e.type,moduleDetail:this.moduleDetail}).then(d=>Promise.resolve(Fe(me(me({},d),u),{api:u.name,apiC:u.relay_name,icon:u.icon,note_name:u.note_name,icon_img:u.icon_img,canLoop:u.canloop,showTotal:u.show_total}))).catch(d=>Promise.resolve(d)));this.isLoading=!0;let o;yield Promise.all(s).then(u=>{if(u.some(f=>{var h;return((h=f.res)==null?void 0:h.code)==="AC100001"})){this.onOutdate({code:"AC100001"});return}o=u.filter(f=>f.code==="0"||f.code===0)}).catch(u=>{console.log(u,"e")}).finally(u=>{this.isLoading=!1});const a=[];let l=[];if(o&&o.forEach(u=>{var C;if(e.getData[u.api]=!0,this.history.dataNow.nodes.find(x=>x.id===e.id)&&(this.history.dataNow.nodes.find(x=>x.id===e.id).getData[u.api]=!0),!u.data)return;let d;const f=(C=u.data.nodes||[])==null?void 0:C.map(x=>(x.group=e.id+"-"+u.api,x.groupC=u.apiC,x=bs(x,this.moduleDetail.plugs),x));if(!this.isShowNodeType){d=u.data.links||[],a.push(...u.data.nodes||[]),l.push(...d||[]);return}const h=e.id+"-"+u.api;let g={id:h,name:u.apiC,note_name:u.note_name,type:"nodeType",icon:u.icon,showTotal:u.showTotal,icon_img:u.icon_img};const S=u,{code:v,msg:y,data:_}=S,w=Rs(S,["code","msg","data"]);g=me(me({},w),g);const A={source:e.id,target:h};if(g=bs(g,this.moduleDetail.plugs),this.nodeTypeList.push(u.icon||"node_type"),f.length>0&&this.isRenderStartNode){if(d=(u.data.links||[]).map(x=>{let T;if(x.source===e.id){const N=this.history.dataNow.nodes.filter(I=>I.id===x.target);if(N.length>0&&(T=this.findGrandSonNodeIds(N[0]).indexOf(x.source)>=0),!u.api.canLoop&&T)return;x.source=h}else x.target===e.id&&(x.target=h);return x.edgeLabelProp=x.edge_label,x}).filter(x=>x),d.length===0)return;d.push(A)}else d=u.data.links||[];if(this.isRenderStartNode&&f.length>=this.singlesNodeMaxNum){let x=null,T=null;const N=String(Math.floor(new Date().getTime()));x={id:N,list:f,type:"aggregation",name:"聚合",relationId:g.id},x=bs(x,this.moduleDetail.plugs),T={source:g.id,target:N,uniqueIndex:this.generateUniqueIndexNow()};const I={addOne:{nodes:[g,x],links:[A,T]},type:"aggregation"};this.history.pushState(I),this.getNodeDetail(x.list,x.id)}else d.length&&this.isRenderStartNode&&f.push(g),a.push(...f||[]),l.push(...d||[])}),!this.isRenderStartNode){const u={},d={},f=[];this.nodeTypeList.push("node_type"),l.forEach(h=>{const g=h.source+"-"+h.name;if(!u[g]){let v={id:g,name:h.name,type:"nodeType",icon:h.feature.icon};v=bs(v,this.moduleDetail.plugs),u[g]=v}d[g]?d[g].push(h):d[g]=[h]});for(const h in u)a.push(u[h]);for(const h in d)d[h].forEach(v=>{const y=Fe(me({},v),{source:v.source,target:h}),_=Fe(me({},v),{source:h,target:v.target});f.push(y),f.push(_)});l=f}l.map(u=>{u.uniqueIndex=this.generateUniqueIndexNow()});const c={addOne:{nodes:a,links:l}};(a.length>0||l.length>0)&&this.history.pushState(c),this.history.length===2&&setTimeout(()=>{this.centerAndZoom(.8,!1)},1e3),this.getNodeDetail(a)})},findGrandSonNodeIds(e){return this.history.dataNow.nodes.filter(r=>{var s;return((s=e.children)==null?void 0:s.indexOf(r.id))>=0}).reduce((r,s)=>(r.push(...s.children||[]),r),[])||[]},centerAndZoom(e,t){var n;(n=this.$refs.render)==null||n.centerAndZoom(e,t)},generateUniqueIndex(){let e=0;return function(){return e++}},reset(){this.$refs.render.reset()},getNodeDetail(e,t){const r=this.history.dataNow.nodes.filter(a=>e.findIndex(l=>l.id===a.id)>=0).filter(a=>!a.detail&&a.noDetail!==!0&&a.type!=="aggregation"&&a.type!=="nodeType"),s={};r.map(a=>{s[a.type]?s[a.type].push(a):s[a.type]=[a]});let o=Object.keys(s).length;for(const a in s){const l=s[a],c={};l.map(u=>{u.origin&&(c[u.id]=u.origin)}),this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[s[a][0].type],node_id:s[a].map(u=>u.id),origin:c,nodeType:s[a][0].type,moduleDetail:this.moduleDetail}).then(u=>{const d=u.data.records;t?this.history.updateAggregationDetail(d,s[a].map(f=>f.id),t):this.history.updateData(d,s[a].map(f=>f.id))}).catch(u=>{this.onOutdate(u.res)}).finally(()=>{o=o-1,o===0&&(gi(" 数据加载完"),this.emitDataLoaded())})}Object.keys(s).length||this.emitDataLoaded()},emitDataLoaded(){this.handleDataLoaded&&typeof this.handleDataLoaded=="function"?this.handleDataLoaded({dataNow:it(this.history.dataNow)}):Ke(this,"handle-data-loaded",{dataNow:it(this.history.dataNow)})},addNode({node:e,type:t,connectNode:n}){if(this.history.dataNow.nodes.findIndex(o=>o.id===e.id)>-1){vn({type:"warning",message:"该节点已存在,添加失败"});return}let s;if(t==="diy"&&e.type==="nodeType"){let o=Fe(me({},e),{detail:null,diy:!0,group:e.id});o=bs(o,this.moduleDetail.plugs);const a=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[o],links:a?[a]:[]}},this.history.pushState(s)}else t==="diy"?this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(o=>{var c,u,d;let a={id:(c=o.data.records[0])==null?void 0:c.info.id,type:(u=o.data.records[0])==null?void 0:u.info.type,detail:o.data.records[0],group:e.id,name:((d=o.data.records[0])==null?void 0:d.info.name)||e.id};a=bs(a,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[a],links:l?[l]:[]}},this.history.pushState(s)}).catch(o=>{this.onOutdate(o.res);let a=Fe(me({},e),{detail:null,diy:!0,group:e.id});a=bs(a,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;s={addOne:{nodes:[a],links:l?[l]:[]}},this.history.pushState(s)}).finally(o=>{setTimeout(()=>{},500)}):this.addNewNodesAndExpand(e)},addLink(e,t){if(!([e,t].filter(o=>o.type==="nodeType").length===1))return;const r={source:e.id,target:t.id,uniqueIndex:this.generateUniqueIndexNow(),diy:!0};let s=!1;if(this.history.dataNow.links.map(o=>{o.source.id===e.id&&o.target.id===t.id&&(s=!0)}),!s){const o={addOne:{links:[r]}};this.onAction(o)}},expandSelectedNodes(e){e.map(t=>{this.expandNodes(t)})},handleTableSelect(e=[]){this.$refs.render.handleTableSelect(e)},updateSelection(){this.selection=this.$refs.render.selection,this.$refs.render.selectEdgesByNode(this.selection),this.$refs.render.showKeyWay(this.selection),this.$refs.render.updateNodeStyle()},aggregationNodes(e,t){if(e.length===0)return;const n=[];for(const a in this.history.dataNow.nodes)e.findIndex((c,u,d)=>c===this.history.dataNow.nodes[a].id)>=0&&n.push(JSON.parse(JSON.stringify(this.history.dataNow.nodes[a])));const r=String(Math.floor(new Date().getTime()));let s={id:r,list:n,type:"aggregation",name:"聚合",relationId:t.id};s=bs(s,this.moduleDetail.plugs);const o={addOne:{nodes:[s],links:[{source:t.id,target:r,uniqueIndex:this.generateUniqueIndexNow()}]},deleteOne:{nodes:n,links:n.map(a=>({source:t.id,target:a.id}))},type:"aggregation"};this.history.pushState(o),this.emitDataLoaded()},releaseAggregation(e){let t;if(e.type==="aggregation"&&(t=e),this.history.dataNow.links.map(n=>{n.source.id===e.id&&n.target.type==="aggregation"&&(t=t||n.target,n.source)}),t){const n={deleteOne:{nodes:[t],links:[{source:t.relationId,target:t.id}]},addOne:{nodes:t.list,links:t.list.map(r=>({source:t.relationId,target:r.id}))},type:"aggregation"};for(const r in this.history.dataNow.nodes)t.list.findIndex((o,a,l)=>o===this.history.dataNow.nodes[r].id)>=0&&(this.history.dataNow.nodes[r].aggregation=!1);this.history.pushState(n),this.emitDataLoaded()}},saveSnapshot(){return ot(this,null,function*(){LS.prompt(null,"添加快照",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^.{1,20}$/,inputPlaceholder:"请输入20字以内快照名称",inputErrorMessage:"请输入20字以内快照名称"}).then(t=>ot(this,[t],function*({value:e}){this.bigLoading=!0,setTimeout(()=>ot(this,null,function*(){try{const n=yield this.$refs.buttonList.svgToBlob(),r=new FormData;r.append("data",this.history.toString()),r.append("name",e),r.append("thumb",n),this.graphApi.addSnapshot1(r).then(s=>{this.snapshot=s.data,this.snapshot.name=e,this.$refs.snapshot.show()}).catch(s=>{this.onOutdate(s.res)}).finally(s=>{this.bigLoading=!1})}catch(n){this.bigLoading=!1,console.log(n)}}),100)})).catch(()=>{vn({type:"info",message:"取消输入"})})})},autoDisplay(){this.$refs.render.autoDisplay()},deleteNodes(e=this.selection){const t={deleteOne:{nodes:e}};this.history.pushState(t),this.emitDataLoaded();const n=e.map(r=>r.id);this.$refs.render.selection=this.selection.filter(r=>!n.includes(r.id)),setTimeout(()=>{this.updateSelection()},300)},historyForward(){this.history.forward(),setTimeout(()=>{this.updateSelection()},100)},historyBack(){this.history.back(),setTimeout(()=>{this.updateSelection()},100)},toggleFullScreen(){Bn({cId:"toggleFullScreen",c:"切换全屏"}),document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():this.$refs["force-d3-container"].requestFullscreen()},zoomView(e="in"){e==="in"?(Bn({cId:"zoomIn",c:"zoomIn"}),this.$refs.render.zoomIn()):(Bn({cId:"zoomOut",c:"zoomOut"}),this.$refs.render.zoomOut())},fitScreen(){var e;Bn({cId:"centerAndZoom",c:"centerAndZoom"}),(e=this.$refs.render)==null||e.centerAndZoom()},changeMargin(){let e=0;const t=document.body.clientHeight;return e=Math.floor(((t-50)/20-22)/2),e>8?"8px 0":e+"px 0"},handleHighLight(e,t,n){this.$refs.render.setHighlightRule({type:e,prop:t,value:n})},handleCustomSelect(e,t,n){this.$refs.render.handleCustomSelect({type:e,prop:t,value:n})},fixAllNodes(e){this.$refs.render.fixAllNodes(e)},toggleLayout(e){this.$refs.render.toggleLayout(e)},importCsvData(e){for(const t in e.nodes)delete e.nodes[t].vx,delete e.nodes[t].vy,delete e.nodes[t].x,delete e.nodes[t].y;this.history.dataNow=Object.assign({},e)},getCanvasStage(){var e;return(e=this.$refs.render)==null?void 0:e.stage},addCanvasBg(){var e;(e=this.$refs.render)==null||e.addCanvasBg()},removeCanvasBg(){var e;(e=this.$refs.render)==null||e.removeCanvasBg()},controlOperation(e){var t;(t=this.$refs.render)==null||t.handleContextMenuClick(e)}}},cde={key:0,ref:"force-d3-container",class:"d3-container"},ude=["innerHTML"],dde={class:"top-item"},fde={class:"top-line"},hde={key:1,class:"select-num"},pde={class:"highlight"},gde={class:"loading-container"},mde={class:"corner-button-box"};function vde(e,t,n,r,s,o){const a=Ge("ButtonList"),l=Ge("RenderByCanvas"),c=Ge("Loading"),u=Bt,d=Ge("Legend"),f=Ge("NodeVisibleControl"),h=Ge("force-graph-svg-icon"),g=hi,v=Ge("RightMenu"),y=Ge("SnapShotDialog"),_=IS;return n.graphApi?Lt((R(),U("div",cde,[K("div",{class:ee(["graph-box",{"hide-right-menu":!n.isShowRightMenu}])},[n.title?(R(),U("div",{key:0,class:"safe-force-title",innerHTML:n.title},null,8,ude)):oe("",!0),t[4]||(t[4]=K("div",{class:"top-line-bg"},null,-1)),K("div",dde,[K("div",fde,[ie(a,{ref:"buttonList","hide-button-list":n.hideButtonList,selection:s.selection,history:s.history,"module-detail":s.moduleDetail,"request-graph-data":s.requestGraphData,"show-top-search":n.showTopSearch,onSaveSnapshot:o.saveSnapshot,onAddNodes:o.addNode,onAutoDisplay:o.autoDisplay,onDeleteNodes:o.deleteNodes,onFixNodes:o.fixAllNodes,onToggleLayout:o.toggleLayout,onImportCsvData:o.importCsvData},null,8,["hide-button-list","selection","history","module-detail","request-graph-data","show-top-search","onSaveSnapshot","onAddNodes","onAutoDisplay","onDeleteNodes","onFixNodes","onToggleLayout","onImportCsvData"])])]),ie(l,{ref:"render","enable-script":n.enableScript,"module-detail":s.moduleDetail,history:s.history,"level-list":n.levelList,selection:s.selection,data:s.history.dataNow,"request-graph-data":s.requestGraphData,"dark-mode":n.darkMode,"node-type-scale":n.nodeTypeScale,"node-type-list":s.nodeTypeList,"link-distance":n.linkDistance,strength:n.strength,"node-width":n.nodeWidth,"start-node-width":n.startNodeWidth,"start-node-animation":n.startNodeAnimation,"custom-tooltip":n.customTooltip,"edge-label-max-length":n.edgeLabelMaxLength,"custom-node-images":n.customNodeImages,"enable-popover":n.enablePopover,"canvas-bg":n.canvasBg,onUpdateSelection:o.updateSelection,onOnaction:o.onAction,onHandleSelectNode:o.handleSelectNode,onCustomContextmenuClick:o.handleCustomContextMenuClick},null,8,["enable-script","module-detail","history","level-list","selection","data","request-graph-data","dark-mode","node-type-scale","node-type-list","link-distance","strength","node-width","start-node-width","start-node-animation","custom-tooltip","edge-label-max-length","custom-node-images","enable-popover","canvas-bg","onUpdateSelection","onOnaction","onHandleSelectNode","onCustomContextmenuClick"]),s.selection.length>0?(R(),U("p",hde,[t[2]||(t[2]=Ye(" 已选择")),K("span",pde,Ne(s.selection.length),1),t[3]||(t[3]=Ye("项 "))])):oe("",!0),Lt(K("div",gde,[K("span",null,Ne(s.loadingInfo),1),ie(u,{class:"is-loading"},{default:ne(()=>[ie(c)]),_:1})],512),[[Cn,s.isLoading]]),n.hasLegend?(R(),ye(d,{key:2,"show-point":n.showPoint,history:s.history,"module-detail":s.moduleDetail,"has-level":n.hasLevel,"show-level-count":n.showLevelCount,margin:s.margin,onHighLight:o.handleHighLight},null,8,["show-point","history","module-detail","has-level","show-level-count","margin","onHighLight"])):oe("",!0),n.hasNodeVisibleControl?(R(),ye(f,{key:3,history:s.history,"module-detail":s.moduleDetail,"start-node":n.startNode,"custom-node-images":n.customNodeImages},null,8,["history","module-detail","start-node","custom-node-images"])):oe("",!0),K("div",mde,[!s.fullScreen&&o.topFrame?(R(),ye(g,{key:0,content:"进入全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/full_button.svg"],alt:"",class:"corner-button",onClick:o.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):oe("",!0),s.fullScreen&&o.topFrame?(R(),ye(g,{key:1,content:"退出全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/un_full_button.svg"],alt:"",class:"corner-button",onClick:o.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):oe("",!0),ie(g,{content:"适应屏幕",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/fit_button.svg"],alt:"",class:"corner-button",onClick:o.fitScreen},null,8,["icon-class","onClick"])]),_:1}),ie(g,{content:"放大",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_in_button.svg"],alt:"",class:"corner-button",onClick:t[0]||(t[0]=w=>o.zoomView("in"))},null,8,["icon-class"])]),_:1}),ie(g,{content:"缩小",placement:"left","popper-class":"el-tooltip-gray"},{default:ne(()=>[ie(h,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_out_button.svg"],alt:"",class:"corner-button",onClick:t[1]||(t[1]=w=>o.zoomView("out"))},null,8,["icon-class"])]),_:1})])],2),n.isShowRightMenu?(R(),ye(v,{key:0,"graph-data":s.history.dataNow,"selected-nodes":s.selection,"request-graph-data":s.requestGraphData,onChangeBox:o.handleTableSelect},null,8,["graph-data","selected-nodes","request-graph-data","onChangeBox"])):oe("",!0),ie(y,{ref:"snapshot",snapshot:s.snapshot,"graph-api":n.graphApi,"graph-url-path":n.graphUrlPath,"custom-copy-path-fn":n.customCopyPathFn},null,8,["snapshot","graph-api","graph-url-path","custom-copy-path-fn"])])),[[_,s.bigLoading]]):oe("",!0)}const xp=fn(lde,[["render",vde]]),Ame="",Ap={props:xp.props,setup(e){return()=>at(FB,{namespace:"force-graph-el"},{default:()=>at(xp,e)})}};xp.install=function(e){e.component(xp.name,Ap)};const bde=TO(Ap,{shadowRoot:!1});customElements.define("force-graph",bde),yt.Graph=Ap,yt.default=Ap,Object.defineProperties(yt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});