@a2simcode/dui 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dui.css +2 -1
- package/dist/dui.es.js +10080 -13286
- package/dist/dui.umd.js +5 -5
- package/package.json +6 -6
- package/LICENSE +0 -53
package/dist/dui.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function($e,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):($e=typeof globalThis<"u"?globalThis:$e||self,s($e.DuiUI={},$e.Vue))})(this,(function($e,s){"use strict";const $t=(t,e)=>(t.install=n=>{n.component(t.name,t),e&&e.forEach(o=>{n.component(o.name,o)})},t),Wt=(t="")=>{const e=Date.now(),n=Math.floor(Math.random()*1e9);return t===""?String(n)+String(e):t+"_"+n+String(e)},mi=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(mi);const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=mi(t[n]));return e},Sc=t=>{if(Array.isArray(t))t.length=0;else if(t&&typeof t=="object")for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&delete t[e]},yi={},Nc=(t,e,n)=>{n[t]=n[t]||{};const o=Wt();return n[t][o]=e,o},kc=(t,e,n)=>{const o=[],i=n[t]||{};return Object.keys(i).forEach(r=>{const a=i[r];try{a&&o.push(a(e))}catch(l){console.error(l)}}),o},Dc=(t,e,n)=>{if(e){const o=n[t];o&&delete o[e]}else delete n[t]},Lr=(t,e)=>Nc(t,e,yi),Se=(t,e)=>kc(t,e,yi),Tc=(t,e)=>{Dc(t,e,yi)},Fr=(t,e,n,o,i,r)=>{const a=e.id,l=e.level,{getDesignLocals:u,selectComponent:c,getComponent:d,isMyChildComponent:f,addComponent:h,deleteComponent:p,getParentComponents:y,removeComponentFromContainer:m,addComponentToContainer:b,copyComponent:N,activedComponent:_,top:g}=s.inject("d-drag-design-provide",{}),x=[],z=s.ref(!1),$=s.ref(!1),F=s.ref(!1),Y=s.ref(!1),G=s.ref(!1),S={id:"",type:""},I=s.ref(!1),E=s.ref(!1);let H="",w=null;const D=q=>{if(H===q)return w;H=q;const{top:ee,left:re,width:oe,height:ce}=t.value.getBoundingClientRect();return w=[{x:re,y:ee},{x:re+oe,y:ee},{x:re+oe,y:ee+ce},{x:re,y:ee+ce}],w},v=(q,ee,re)=>{let oe=ee-re[0].y;oe<0&&(oe=-oe);let ce=ee-re[3].y;ce<0&&(ce=-ce);let ie=q-re[0].x;ie<0&&(ie=-ie);let se=q-re[1].x;return se<0&&(se=-se),{ly:oe>ce?ce:oe,typey:oe>ce?"bottom":"top",lx:ie>se?se:ie,lallx:ie+se}},C=(q,ee,re)=>q>=re[0].x&&q<=re[1].x&&ee>=re[0].y&&ee<=re[3].y,k=()=>{if(i){Se("dragClick",{id:a});return}if(!$.value){if(c(a),l!==0){const q=t.value.getBoundingClientRect(),ee=u();q.top-ee.top<22?Y.value=!0:Y.value=!1}$.value=!0,Se("dragClick",{id:a})}},O=q=>{const ee=p(q);ee&&s.nextTick(()=>{Se("dragClick",{id:ee})})},R=()=>{S.id="",S.type="",l===0&&(G.value=!1)},B=()=>{Se("mouseEnterOrLeave",{id:a,type:"enter"})},P=()=>{Se("mouseEnterOrLeave",{id:a,type:"leave"})},L=q=>{Se("dragClick",{id:q})},j={mouseEnterOrLeave:({id:q,type:ee})=>{ee==="enter"?x.push(q):x.length>0&&x.splice(x.length-1,1);const re=x.length;re>0&&a===x[re-1]?z.value=!0:z.value=!1},dragAciveChild:({type:q,id:ee})=>{ee===a?q==="top"?(I.value=!0,E.value=!1):(E.value=!0,I.value=!1):(E.value=!1,I.value=!1)},dragClick({id:q,isAgain:ee}){console.log("dragClick",q,a),q!==a?$.value=!1:(ee&&($.value=!1),k())}};j[`dragGetChildDistance_${a}`]=({dragX:q,dragY:ee,moveId:re})=>{const oe=D(re);return v(q,ee,oe)};const K={isInContainer({x:q,y:ee,id:re,moveId:oe}){if(a===re||f(re,a))return F.value=!1,{isIn:!1,level:l,id:a,groupId:r};const ce=D(oe);if(C(q,ee,ce))return l===0&&(G.value=!0),{isIn:!0,level:l,id:a,groupId:r};if(l===0){const{ly:ie,lx:se}=v(q,ee,ce);if(ie<20&&se<20)return G.value=!0,{isIn:!0,level:l,id:a,groupId:r};G.value=!1}return F.value=!1,{isIn:!1,level:l,id:a,groupId:r}},dragActiveContainer:({containerId:q,containerGroupId:ee,dragX:re,dragY:oe,moveId:ce})=>{if(q===a&&ee===r)if(F.value=!0,o&&o.value.length>0){let ie={ly:9999999,lx:0,lallx:0,id:"",typey:""};o?.value.forEach(se=>{if(r&&se.groupId!==r)return;const A=Se(`dragGetChildDistance_${se.id}`,{dragX:re,dragY:oe,moveId:ce})[0];A&&(ie.ly>A.ly||ie.ly===A.ly&&(ie.lx>A.lx||ie.lx===A.lx&&ie.lallx>A.lallx))&&(ie=A,ie.id=se.id)}),S.id=ie.id,S.type=ie.typey,Se("dragAciveChild",{id:ie.id,type:ie.typey})}else Se("dragAciveChild",{id:""});else F.value=!1},dragAdd:q=>{if(F.value){let ee=o?.value.length||0;S.id!==""&&S.id!==void 0&&(ee=o?.value.findIndex(re=>re.id===S.id)||0,S.type==="bottom"&&(ee+=1)),h(q,a,ee,r),F.value=!1}R()},dragAddByClick:q=>{if(!_.value&&a===g.id||_.value?.id===a||_.value?.containerId===a&&_.value?.dragType!=="container"){const ee=o?.value.length||0,re=h(q,a,ee,r,!0);re&&q.config&&Object.keys(q.config).forEach(oe=>{re.config[oe]=q.config[oe]})}},dragUpdate(q){if(F.value){const ee=d(q);if(ee.level=l+1,S.id!==ee.id){m(ee.containerId,q);let re=o?.value.findIndex(oe=>oe.id===S.id)||0;S.type==="bottom"&&(re+=1),b(ee,a,re,r)}F.value=!1,s.nextTick(()=>{Se("dragClick",{id:ee.id,isAgain:!0})})}R()}},Q={};return s.onMounted(()=>{(!i||n!=="container")&&Object.keys(j).forEach(q=>{Q[q]=Lr(q,j[q])}),n==="container"&&Object.keys(K).forEach(q=>{Q[q]=Lr(q,K[q])}),e.isNewAdd&&s.nextTick(()=>{k(),delete e.isNewAdd})}),s.onUnmounted(()=>{Object.keys(Q).forEach(q=>{Tc(q,Q[q])})}),{onMouseenter:B,onMouseleave:P,activeComponent:k,handleComponentClick:L,deleteComponentByClick:O,copyComponent:N,getParentComponents:y,isBottomToolBar:Y,isHover:z,isSelect:$,isToContainer:F,isMoveingInTopLevel:G,isTopActive:I,isBottomActive:E}},jr=(t,e)=>{const n={x:0,y:0,clientX:0,clientY:0,dragElement:null,dragElementId:"jcode-darg-move-id",toContainerLevel:-1,toContainerId:"",groupId:"",id:""};let o=!1;const i=(p,y)=>{o!==!0&&(o=!0,setTimeout(()=>{p(),o=!1},y))},r=s.ref(!1),a=(p,y,m)=>{const b=document.createElement("div");return b.id=n.dragElementId,b.innerText=p,b.className="d-drag-move",b.style.top=`${y}px`,b.style.left=`${m}px`,document.body.appendChild(b),b},l=()=>{document.onmousemove=null,document.onmouseup=null,r.value=!1,Se("dragAciveChild",{id:""})},u=()=>{l(),n.dragElement&&(n.dragElement.remove(),n.dragElement=null,e?Se("dragAdd",t):Se("dragUpdate",t.id))},c=p=>{const{clientY:y,clientX:m}=p;if(!n.dragElement){const b=Math.abs(n.x-m),N=Math.abs(n.y-y);if(b<=1&&N<=1)return;r.value=!0,n.dragElement=a(t.name,y-11,m-32)}n.dragElement.style.top=`${y-11}px`,n.dragElement.style.left=`${m-32}px`,n.clientX=m,n.clientY=y,i(()=>{if(!r.value)return;const b=Se("isInContainer",{x:m,y,id:t.id,moveId:n.id});n.toContainerLevel=-1,n.toContainerId="",n.groupId="",b.forEach(({level:N,id:_,isIn:g,groupId:x})=>{g&&n.toContainerLevel<N&&(n.toContainerLevel=N,n.toContainerId=_,n.groupId=x)}),n.toContainerId!==""?Se("dragActiveContainer",{containerId:n.toContainerId,containerGroupId:n.groupId,dragX:m,dragY:y,moveId:n.id}):Se("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{l()},onMousedown:p=>{n.x=p.clientX,n.y=p.clientY,n.id=Wt(),document.onmouseup=u,document.onmousemove=c},onClick:()=>{Se("dragAddByClick",t)},moveActive:r}},Ic=t=>(t.install=e=>{e.component(t.name,t)},t),Xn=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),Gr=/^[a-z0-9]+(-[a-z0-9]+)*$/,qn=(t,e,n,o="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;o=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),u=i.pop(),c={provider:i.length>0?i[0]:o,prefix:u,name:l};return e&&!Kn(c)?null:c}const r=i[0],a=r.split("-");if(a.length>1){const l={provider:o,prefix:a.shift(),name:a.join("-")};return e&&!Kn(l)?null:l}if(n&&o===""){const l={provider:o,prefix:"",name:r};return e&&!Kn(l,n)?null:l}return null},Kn=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,Wr=Object.freeze({left:0,top:0,width:16,height:16}),Zn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),un=Object.freeze({...Wr,...Zn}),vi=Object.freeze({...un,body:"",hidden:!1});function Mc(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const o=((t.rotate||0)+(e.rotate||0))%4;return o&&(n.rotate=o),n}function Yr(t,e){const n=Mc(t,e);for(const o in vi)o in Zn?o in t&&!(o in n)&&(n[o]=Zn[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function Bc(t,e){const n=t.icons,o=t.aliases||Object.create(null),i=Object.create(null);function r(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const l=o[a]&&o[a].parent,u=l&&r(l);u&&(i[a]=[l].concat(u))}return i[a]}return Object.keys(n).concat(Object.keys(o)).forEach(r),i}function $c(t,e,n){const o=t.icons,i=t.aliases||Object.create(null);let r={};function a(l){r=Yr(o[l]||i[l],r)}return a(e),n.forEach(a),Yr(t,r)}function Ur(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(i=>{e(i,null),n.push(i)});const o=Bc(t);for(const i in o){const r=o[i];r&&(e(i,$c(t,i,r)),n.push(i))}return n}const zc={provider:"",aliases:{},not_found:{},...Wr};function bi(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Xr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!bi(t,zc))return null;const n=e.icons;for(const i in n){const r=n[i];if(!i||typeof r.body!="string"||!bi(r,vi))return null}const o=e.aliases||Object.create(null);for(const i in o){const r=o[i],a=r.parent;if(!i||typeof a!="string"||!n[a]&&!o[a]||!bi(r,vi))return null}return e}const qr=Object.create(null);function Ac(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Yt(t,e){const n=qr[t]||(qr[t]=Object.create(null));return n[e]||(n[e]=Ac(t,e))}function Kr(t,e){return Xr(e)?Ur(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}function Pc(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}let fn=!1;function Zr(t){return typeof t=="boolean"&&(fn=t),fn}function Jr(t){const e=typeof t=="string"?qn(t,!0,fn):t;if(e){const n=Yt(e.provider,e.prefix),o=e.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function Oc(t,e){const n=qn(t,!0,fn);if(!n)return!1;const o=Yt(n.provider,n.prefix);return e?Pc(o,n.name,e):(o.missing.add(n.name),!0)}function Rc(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),fn&&!e&&!t.prefix){let i=!1;return Xr(t)&&(t.prefix="",Ur(t,(r,a)=>{Oc(r,a)&&(i=!0)})),i}const n=t.prefix;if(!Kn({prefix:n,name:"a"}))return!1;const o=Yt(e,n);return!!Kr(o,t)}function Qr(t){const e=Jr(t);return e&&{...un,...e}}const es=Object.freeze({width:null,height:null}),ts=Object.freeze({...es,...Zn}),Hc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Vc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ns(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(Hc);if(o===null||!o.length)return t;const i=[];let r=o.shift(),a=Vc.test(r);for(;;){if(a){const l=parseFloat(r);isNaN(l)?i.push(r):i.push(Math.ceil(l*e*n)/n)}else i.push(r);if(r=o.shift(),r===void 0)return i.join("");a=!a}}function Lc(t,e="defs"){let n="";const o=t.indexOf("<"+e);for(;o>=0;){const i=t.indexOf(">",o),r=t.indexOf("</"+e);if(i===-1||r===-1)break;const a=t.indexOf(">",r);if(a===-1)break;n+=t.slice(i+1,r).trim(),t=t.slice(0,o).trim()+t.slice(a+1)}return{defs:n,content:t}}function Fc(t,e){return t?"<defs>"+t+"</defs>"+e:e}function jc(t,e,n){const o=Lc(t);return Fc(o.defs,e+o.content+n)}const Gc=t=>t==="unset"||t==="undefined"||t==="none";function Wc(t,e){const n={...un,...t},o={...ts,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,o].forEach(m=>{const b=[],N=m.hFlip,_=m.vFlip;let g=m.rotate;N?_?g+=2:(b.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),b.push("scale(-1 1)"),i.top=i.left=0):_&&(b.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),b.push("scale(1 -1)"),i.top=i.left=0);let x;switch(g<0&&(g-=Math.floor(g/4)*4),g=g%4,g){case 1:x=i.height/2+i.top,b.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:b.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:x=i.width/2+i.left,b.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}g%2===1&&(i.left!==i.top&&(x=i.left,i.left=i.top,i.top=x),i.width!==i.height&&(x=i.width,i.width=i.height,i.height=x)),b.length&&(r=jc(r,'<g transform="'+b.join(" ")+'">',"</g>"))});const a=o.width,l=o.height,u=i.width,c=i.height;let d,f;a===null?(f=l===null?"1em":l==="auto"?c:l,d=ns(f,u/c)):(d=a==="auto"?u:a,f=l===null?ns(d,c/u):l==="auto"?c:l);const h={},p=(m,b)=>{Gc(b)||(h[m]=b.toString())};p("width",d),p("height",f);const y=[i.left,i.top,u,c];return h.viewBox=y.join(" "),{attributes:h,viewBox:y,body:r}}const Yc=/\sid="(\S+)"/g,Uc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Xc=0;function qc(t,e=Uc){const n=[];let o;for(;o=Yc.exec(t);)n.push(o[1]);if(!n.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(r=>{const a=typeof e=="function"?e(r):e+(Xc++).toString(),l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}const wi=Object.create(null);function Kc(t,e){wi[t]=e}function _i(t){return wi[t]||wi[""]}function xi(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const Ci=Object.create(null),hn=["https://api.simplesvg.com","https://api.unisvg.com"],Jn=[];for(;hn.length>0;)hn.length===1||Math.random()>.5?Jn.push(hn.shift()):Jn.push(hn.pop());Ci[""]=xi({resources:["https://api.iconify.design"].concat(Jn)});function Zc(t,e){const n=xi(e);return n===null?!1:(Ci[t]=n,!0)}function Ei(t){return Ci[t]}let os=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();function Jc(t,e){const n=Ei(t);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const r=e+".json?icons=";o=n.maxURL-i-n.path.length-r.length}return o}function Qc(t){return t===404}const ed=(t,e,n)=>{const o=[],i=Jc(t,e),r="icons";let a={type:r,provider:t,prefix:e,icons:[]},l=0;return n.forEach((u,c)=>{l+=u.length+1,l>=i&&c>0&&(o.push(a),a={type:r,provider:t,prefix:e,icons:[]},l=u.length),a.icons.push(u)}),o.push(a),o};function td(t){if(typeof t=="string"){const e=Ei(t);if(e)return e.path}return"/"}const nd={prepare:ed,send:(t,e,n)=>{if(!os){n("abort",424);return}let o=td(e.provider);switch(e.type){case"icons":{const r=e.prefix,l=e.icons.join(","),u=new URLSearchParams({icons:l});o+=r+".json?"+u.toString();break}case"custom":{const r=e.uri;o+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let i=503;os(t+o).then(r=>{const a=r.status;if(a!==200){setTimeout(()=>{n(Qc(a)?"abort":"next",a)});return}return i=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",i)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",i)})}};function od(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((i,r)=>i.provider!==r.provider?i.provider.localeCompare(r.provider):i.prefix!==r.prefix?i.prefix.localeCompare(r.prefix):i.name.localeCompare(r.name));let o={provider:"",prefix:"",name:""};return t.forEach(i=>{if(o.name===i.name&&o.prefix===i.prefix&&o.provider===i.provider)return;o=i;const r=i.provider,a=i.prefix,l=i.name,u=n[r]||(n[r]=Object.create(null)),c=u[a]||(u[a]=Yt(r,a));let d;l in c.icons?d=e.loaded:a===""||c.missing.has(l)?d=e.missing:d=e.pending;const f={provider:r,prefix:a,name:l};d.push(f)}),e}function is(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(i=>i.id!==e))})}function id(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const o=t.provider,i=t.prefix;e.forEach(r=>{const a=r.icons,l=a.pending.length;a.pending=a.pending.filter(u=>{if(u.prefix!==i)return!0;const c=u.name;if(t.icons[c])a.loaded.push({provider:o,prefix:i,name:c});else if(t.missing.has(c))a.missing.push({provider:o,prefix:i,name:c});else return n=!0,!0;return!1}),a.pending.length!==l&&(n||is([t],r.id),r.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),r.abort))})}))}let rd=0;function sd(t,e,n){const o=rd++,i=is.bind(null,n,o);if(!e.pending.length)return i;const r={id:o,icons:e,callback:t,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(r)}),i}function ad(t,e=!0,n=!1){const o=[];return t.forEach(i=>{const r=typeof i=="string"?qn(i,e,n):i;r&&o.push(r)}),o}var ld={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function cd(t,e,n,o){const i=t.resources.length,r=t.random?Math.floor(Math.random()*i):t.index;let a;if(t.random){let $=t.resources.slice(0);for(a=[];$.length>1;){const F=Math.floor(Math.random()*$.length);a.push($[F]),$=$.slice(0,F).concat($.slice(F+1))}a=a.concat($)}else a=t.resources.slice(r).concat(t.resources.slice(0,r));const l=Date.now();let u="pending",c=0,d,f=null,h=[],p=[];typeof o=="function"&&p.push(o);function y(){f&&(clearTimeout(f),f=null)}function m(){u==="pending"&&(u="aborted"),y(),h.forEach($=>{$.status==="pending"&&($.status="aborted")}),h=[]}function b($,F){F&&(p=[]),typeof $=="function"&&p.push($)}function N(){return{startTime:l,payload:e,status:u,queriesSent:c,queriesPending:h.length,subscribe:b,abort:m}}function _(){u="failed",p.forEach($=>{$(void 0,d)})}function g(){h.forEach($=>{$.status==="pending"&&($.status="aborted")}),h=[]}function x($,F,Y){const G=F!=="success";switch(h=h.filter(S=>S!==$),u){case"pending":break;case"failed":if(G||!t.dataAfterTimeout)return;break;default:return}if(F==="abort"){d=Y,_();return}if(G){d=Y,h.length||(a.length?z():_());return}if(y(),g(),!t.random){const S=t.resources.indexOf($.resource);S!==-1&&S!==t.index&&(t.index=S)}u="completed",p.forEach(S=>{S(Y)})}function z(){if(u!=="pending")return;y();const $=a.shift();if($===void 0){if(h.length){f=setTimeout(()=>{y(),u==="pending"&&(g(),_())},t.timeout);return}_();return}const F={status:"pending",resource:$,callback:(Y,G)=>{x(F,Y,G)}};h.push(F),c++,f=setTimeout(z,t.rotate),n($,e,F.callback)}return setTimeout(z),N}function rs(t){const e={...ld,...t};let n=[];function o(){n=n.filter(l=>l().status==="pending")}function i(l,u,c){const d=cd(e,l,u,(f,h)=>{o(),c&&c(f,h)});return n.push(d),d}function r(l){return n.find(u=>l(u))||null}return{query:i,find:r,setIndex:l=>{e.index=l},getIndex:()=>e.index,cleanup:o}}function ss(){}const Si=Object.create(null);function dd(t){if(!Si[t]){const e=Ei(t);if(!e)return;const n=rs(e),o={config:e,redundancy:n};Si[t]=o}return Si[t]}function ud(t,e,n){let o,i;if(typeof t=="string"){const r=_i(t);if(!r)return n(void 0,424),ss;i=r.send;const a=dd(t);a&&(o=a.redundancy)}else{const r=xi(t);if(r){o=rs(r);const a=t.resources?t.resources[0]:"",l=_i(a);l&&(i=l.send)}}return!o||!i?(n(void 0,424),ss):o.query(e,i,n)().abort}function as(){}function fd(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,id(t)}))}function hd(t){const e=[],n=[];return t.forEach(o=>{(o.match(Gr)?e:n).push(o)}),{valid:e,invalid:n}}function pn(t,e,n){function o(){const i=t.pendingIcons;e.forEach(r=>{i&&i.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!Kr(t,n).length){o();return}}catch(i){console.error(i)}o(),fd(t)}function ls(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function pd(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:o}=t,i=t.iconsToLoad;if(delete t.iconsToLoad,!i||!i.length)return;const r=t.loadIcon;if(t.loadIcons&&(i.length>1||!r)){ls(t.loadIcons(i,o,n),d=>{pn(t,i,d)});return}if(r){i.forEach(d=>{const f=r(d,o,n);ls(f,h=>{const p=h?{prefix:o,icons:{[d]:h}}:null;pn(t,[d],p)})});return}const{valid:a,invalid:l}=hd(i);if(l.length&&pn(t,l,null),!a.length)return;const u=o.match(Gr)?_i(n):null;if(!u){pn(t,a,null);return}u.prepare(n,o,a).forEach(d=>{ud(n,d,f=>{pn(t,d.icons,f)})})}))}const gd=(t,e)=>{const n=ad(t,!0,Zr()),o=od(n);if(!o.pending.length){let u=!0;return e&&setTimeout(()=>{u&&e(o.loaded,o.missing,o.pending,as)}),()=>{u=!1}}const i=Object.create(null),r=[];let a,l;return o.pending.forEach(u=>{const{provider:c,prefix:d}=u;if(d===l&&c===a)return;a=c,l=d,r.push(Yt(c,d));const f=i[c]||(i[c]=Object.create(null));f[d]||(f[d]=[])}),o.pending.forEach(u=>{const{provider:c,prefix:d,name:f}=u,h=Yt(c,d),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(f)||(p.add(f),i[c][d].push(f))}),r.forEach(u=>{const c=i[u.provider][u.prefix];c.length&&pd(u,c)}),e?sd(e,o,r):as};function md(t,e){const n={...t};for(const o in e){const i=e[o],r=typeof i;o in es?(i===null||i&&(r==="string"||r==="number"))&&(n[o]=i):r===typeof n[o]&&(n[o]=o==="rotate"?i%4:i)}return n}const yd=/[\s,]+/;function vd(t,e){e.split(yd).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function bd(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(t);return isNaN(i)?0:o(i)}else if(n!==t){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/i,r%1===0?o(r):0)}}return e}function wd(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in e)n+=" "+o+'="'+e[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function _d(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function xd(t){return"data:image/svg+xml,"+_d(t)}function Cd(t){return'url("'+xd(t)+'")'}const cs={...ts,inline:!1},Ed={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sd={display:"inline-block"},Ni={backgroundColor:"currentColor"},ds={backgroundColor:"transparent"},us={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},fs={webkitMask:Ni,mask:Ni,background:ds};for(const t in fs){const e=fs[t];for(const n in us)e[t+n]=us[n]}const Qn={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Qn[t+"-flip"]=e,Qn[t.slice(0,1)+"-flip"]=e,Qn[t+"Flip"]=e});function hs(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}const ps=(t,e)=>{const n=md(cs,e),o={...Ed},i=e.mode||"svg",r={},a=e.style,l=typeof a=="object"&&!(a instanceof Array)?a:{};for(let m in e){const b=e[m];if(b!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[m]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&vd(n,b);break;case"color":r.color=b;break;case"rotate":typeof b=="string"?n[m]=bd(b):typeof b=="number"&&(n[m]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete o["aria-hidden"];break;default:{const N=Qn[m];N?(b===!0||b==="true"||b===1)&&(n[N]=!0):cs[m]===void 0&&(o[m]=b)}}}const u=Wc(t,n),c=u.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),i==="svg"){o.style={...r,...l},Object.assign(o,c);let m=0,b=e.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),o.innerHTML=qc(u.body,b?()=>b+"ID"+m++:"iconifyVue"),s.h("svg",o)}const{body:d,width:f,height:h}=t,p=i==="mask"||(i==="bg"?!1:d.indexOf("currentColor")!==-1),y=wd(d,{...c,width:f+"",height:h+""});return o.style={...r,"--svg":Cd(y),width:hs(c.width),height:hs(c.height),...Sd,...p?Ni:ds,...l},s.h("span",o)};if(Zr(!0),Kc("",nd),typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!Rc(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const i=e[n];if(typeof i!="object"||!i||i.resources===void 0)continue;Zc(n,i)||console.error(o)}catch{console.error(o)}}}}const Nd={...un,body:""},gs=s.defineComponent((t,{emit:e})=>{const n=s.ref(null);function o(){n.value&&(n.value.abort?.(),n.value=null)}const i=s.ref(!!t.ssr),r=s.ref(""),a=s.shallowRef(null);function l(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let d;if(typeof c!="string"||(d=qn(c,!1,!0))===null)return null;let f=Jr(d);if(!f){const y=n.value;return(!y||y.name!==c)&&(f===null?n.value={name:c}:n.value={name:c,abort:gd([d],u)}),null}o(),r.value!==c&&(r.value=c,s.nextTick(()=>{e("load",c)}));const h=t.customise;if(h){f=Object.assign({},f);const y=h(f.body,d.name,d.prefix,d.provider);typeof y=="string"&&(f.body=y)}const p=["iconify"];return d.prefix!==""&&p.push("iconify--"+d.prefix),d.provider!==""&&p.push("iconify--"+d.provider),{data:f,classes:p}}function u(){const c=l();c?c.data!==a.value?.data&&(a.value=c):a.value=null}return i.value?u():s.onMounted(()=>{i.value=!0,u()}),s.watch(()=>t.icon,u),s.onUnmounted(o),()=>{const c=a.value;if(!c)return ps(Nd,t);let d=t;return c.classes&&(d={...t,class:c.classes.join(" ")}),ps({...un,...c.data},d)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),gn=s.defineComponent({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const e=t,n=s.computed(()=>{const i=e.icon;if(i.indexOf(":")===-1)return Qr(`jcode:${e.icon}`)==null,`jcode:${e.icon}`;const a=`jcode:${i.split(":")[1]}`;return Qr(a)!=null?a:i}),o=s.computed(()=>({size:e.size,color:e.color,icon:n.value}));return(i,r)=>t.isDiv?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0},i.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[s.createVNode(s.unref(gs),s.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16)):(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:1},i.$attrs,{class:"jicon"}),[s.createVNode(s.unref(gs),s.mergeProps(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),kd=["disabled"],Dd={key:2},Ut=Ic(s.defineComponent({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=h=>{!d.value&&!o.disabled&&(i("click",h),o.href&&window.open(o.href,o.target?o.target:"_self"))},a=s.shallowRef(null),l=()=>{a.value?.focus()},u=()=>{a.value?.blur()},c=s.computed(()=>o.notLabel||!o.label),d=s.ref(!1);s.watch(()=>o.loading,h=>{if(typeof h=="boolean")d.value=h;else if(Xn(h?.delay))d.value=!1;else{const p=setTimeout(()=>{d.value=!0},h.delay);return()=>clearTimeout(p)}},{immediate:!0});const f=s.computed(()=>o.label||"");return e({focus:l,blur:u}),(h,p)=>(s.openBlock(),s.createElementBlock("button",{ref_key:"buttonNodeRef",ref:a,type:"button",class:s.normalizeClass(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":d.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:s.withModifiers(r,["stop"])},[d.value?(s.openBlock(),s.createBlock(gn,{key:0,icon:"mdi:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):s.createCommentVNode("",!0),t.icon?(s.openBlock(),s.createBlock(gn,{key:1,icon:t.icon},null,8,["icon"])):s.createCommentVNode("",!0),t.notLabel?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Dd,s.toDisplayString(f.value),1)),s.renderSlot(h.$slots,"iconAfter")],10,kd))}})),Td={class:"d-drag-btns-pname"},Id={key:0,class:"d-drag-mask"},ki=s.defineComponent({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(t){const e=t,n=s.ref(),{onMouseenter:o,onMouseleave:i,activeComponent:r,handleComponentClick:a,deleteComponentByClick:l,copyComponent:u,getParentComponents:c,isHover:d,isSelect:f,isTopActive:h,isBottomActive:p,isBottomToolBar:y}=Fr(n,e.componentData,"component"),{onContextmenu:m,onMousedown:b,moveActive:N}=jr(e.componentData,!1);return(_,g)=>{const x=s.resolveComponent("el-space");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["d-drag-component",{selected:s.unref(f),hovered:s.unref(d),isBottomToolBar:s.unref(y),active:s.unref(N),isTopActive:s.unref(h),isBottomActive:s.unref(p)}])},[g[11]||(g[11]=s.createElementVNode("div",{class:"d-drag-line"},null,-1)),s.createElementVNode("div",{class:"d-drag-btns",onMouseenter:g[4]||(g[4]=(...z)=>s.unref(o)&&s.unref(o)(...z)),onMouseleave:g[5]||(g[5]=(...z)=>s.unref(i)&&s.unref(i)(...z))},[s.createVNode(x,{size:4},{default:s.withCtx(()=>[s.createElementVNode("div",{class:"d-drag-btns-names",onClick:s.withModifiers(()=>{},["stop"])},[s.createVNode(s.unref(Ut),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"]),s.createElementVNode("div",Td,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(c)(t.componentData.containerId),z=>(s.openBlock(),s.createElementBlock("div",{key:z.id},[s.createVNode(s.unref(Ut),{class:"d-drag-btn",type:"primary",size:"small",label:z.name,onClick:$=>s.unref(a)(z.id)},null,8,["label","onClick"])]))),128))])]),s.createVNode(s.unref(Ut),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:g[0]||(g[0]=s.withModifiers(z=>s.unref(u)(t.componentData.id),["stop"]))}),s.createElementVNode("div",{onContextmenu:g[1]||(g[1]=s.withModifiers((...z)=>s.unref(m)&&s.unref(m)(...z),["stop"])),onMousedown:g[2]||(g[2]=s.withModifiers((...z)=>s.unref(b)&&s.unref(b)(...z),["stop"])),style:{display:"flex"}},[s.createVNode(s.unref(Ut),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),s.createVNode(s.unref(Ut),{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:g[3]||(g[3]=s.withModifiers(z=>s.unref(l)(t.componentData.id),["stop"]))})]),_:1})],32),s.createElementVNode("div",{ref_key:"refDrag",ref:n,class:"d-drag-body",onClick:g[6]||(g[6]=s.withModifiers((...z)=>s.unref(r)&&s.unref(r)(...z),["stop"])),onContextmenu:g[7]||(g[7]=s.withModifiers((...z)=>s.unref(m)&&s.unref(m)(...z),["stop"])),onMousedown:g[8]||(g[8]=s.withModifiers((...z)=>s.unref(b)&&s.unref(b)(...z),["stop"])),onMouseenter:g[9]||(g[9]=(...z)=>s.unref(o)&&s.unref(o)(...z)),onMouseleave:g[10]||(g[10]=(...z)=>s.unref(i)&&s.unref(i)(...z))},[s.renderSlot(_.$slots,"default"),t.isContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Id))],544)],2)}}}),Di=s.defineComponent({name:"DDragTool",__name:"tool",props:{config:{}},setup(t){const e=t,{onContextmenu:n,onMousedown:o,onClick:i}=jr(e.config??{name:"",id:""},!0);return(r,a)=>(s.openBlock(),s.createElementBlock("div",{class:"d-drag-tool",onClick:a[0]||(a[0]=s.withModifiers((...l)=>s.unref(i)&&s.unref(i)(...l),["stop"])),onContextmenu:a[1]||(a[1]=s.withModifiers((...l)=>s.unref(n)&&s.unref(n)(...l),["stop"])),onMousedown:a[2]||(a[2]=s.withModifiers((...l)=>s.unref(o)&&s.unref(o)(...l),["stop"]))},[s.renderSlot(r.$slots,"default")],32))}}),Md={key:0,class:"d-drag-line"},Bd={key:1,class:"d-drag-btns"},Ti=s.defineComponent({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(t){const e=t,n=s.ref(),o=s.computed(()=>e.componentData?.children||[]),{onMouseenter:i,onMouseleave:r,activeComponent:a,isHover:l,isSelect:u,isToContainer:c,isMoveingInTopLevel:d,isTopActive:f,isBottomActive:h}=Fr(n,e.componentData,"container",o,e.isComponentContainer,e.groupId),p=s.computed(()=>!!(o.value.findIndex(y=>y.groupId===e.groupId)===-1&&c.value));return(y,m)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"refDrag",ref:n,class:s.normalizeClass(["d-drag-container",{selected:s.unref(u)&&!t.isComponentContainer,hovered:s.unref(l)&&!t.isComponentContainer,isTopLevel:t.componentData.level===0,active:p.value,isMoveingInTopLevel:s.unref(d),isTopActive:s.unref(f),isBottomActive:s.unref(h)}])},[t.isComponentContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Md)),t.isComponentContainer?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",Bd,[s.createElementVNode("div",{class:"d-drag-btns-names",onClick:s.withModifiers(()=>{},["stop"])},[s.createVNode(s.unref(Ut),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"])])])),s.createElementVNode("div",{class:"d-drag-body",onClick:m[0]||(m[0]=s.withModifiers((...b)=>s.unref(a)&&s.unref(a)(...b),["stop"])),onMouseenter:m[1]||(m[1]=(...b)=>s.unref(i)&&s.unref(i)(...b)),onMouseleave:m[2]||(m[2]=(...b)=>s.unref(r)&&s.unref(r)(...b))},[s.renderSlot(y.$slots,"default")],32)],2))}}),Ii=s.defineComponent({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=s.inject("dui-design-provide",{});return(n,o)=>{const i=s.resolveComponent("el-col");return s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.componentList,r=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:r.id},[r.type!="pkey"?(s.openBlock(),s.createBlock(i,{key:0,span:r.config.span||24},{default:s.withCtx(()=>[s.createVNode(ki,{"is-container":r.dragType!=="component","component-data":r},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):s.createCommentVNode("",!0)],64))),128)}}}),Mi=s.defineComponent({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=s.inject("dui-design-provide",{}),n=o=>{if(o.flexWidth)return{width:o.flexWidth+"%"}};return(o,i)=>(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.componentList,r=>(s.openBlock(),s.createBlock(ki,{key:r.id,style:s.normalizeStyle(n(r.config)),"is-container":r.dragType!=="component","component-data":r},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),ms=$t(ki,[Di,Ti,Ii,Mi]);function mn(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}function ut(t){return typeof t=="function"?t():s.unref(t)}const $d=typeof window<"u"&&typeof document<"u",zd=t=>typeof t<"u",Ad=Object.prototype.toString,Pd=t=>Ad.call(t)==="[object Object]",Od=()=>{};function Rd(t,e){function n(...o){return new Promise((i,r)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(r)})}return n}const ys=t=>t();function Hd(t=ys){const e=s.ref(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...r)=>{e.value&&t(...r)};return{isActive:s.readonly(e),pause:n,resume:o,eventFilter:i}}function vs(t,e=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(e?()=>i(n):o,t)})}function Vd(t,e,n={}){const{eventFilter:o=ys,...i}=n;return s.watch(t,Rd(o,e),i)}function Xt(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:l,isActive:u}=Hd(o);return{stop:Vd(t,e,{...i,eventFilter:r}),pause:a,resume:l,isActive:u}}function Ld(t,e={}){if(!s.isRef(t))return s.toRefs(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=s.customRef(()=>({get(){return t.value[o]},set(i){var r;if((r=ut(e.replaceRef))!=null?r:!0)if(Array.isArray(t.value)){const l=[...t.value];l[o]=i,t.value=l}else{const l={...t.value,[o]:i};Object.setPrototypeOf(l,Object.getPrototypeOf(t.value)),t.value=l}else t.value[o]=i}}));return n}function Bi(t,e=!1){function n(f,{flush:h="sync",deep:p=!1,timeout:y,throwOnTimeout:m}={}){let b=null;const _=[new Promise(g=>{b=s.watch(t,x=>{f(x)!==e&&(b?.(),g(x))},{flush:h,deep:p,immediate:!0})})];return y!=null&&_.push(vs(y,m).then(()=>ut(t)).finally(()=>b?.())),Promise.race(_)}function o(f,h){if(!s.isRef(f))return n(x=>x===f,h);const{flush:p="sync",deep:y=!1,timeout:m,throwOnTimeout:b}=h??{};let N=null;const g=[new Promise(x=>{N=s.watch([t,f],([z,$])=>{e!==(z===$)&&(N?.(),x(z))},{flush:p,deep:y,immediate:!0})})];return m!=null&&g.push(vs(m,b).then(()=>ut(t)).finally(()=>(N?.(),ut(t)))),Promise.race(g)}function i(f){return n(h=>!!h,f)}function r(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function u(f,h){return n(p=>{const y=Array.from(p);return y.includes(f)||y.includes(ut(f))},h)}function c(f){return d(1,f)}function d(f=1,h){let p=-1;return n(()=>(p+=1,p>=f),h)}return Array.isArray(ut(t))?{toMatch:n,toContains:u,changed:c,changedTimes:d,get not(){return Bi(t,!e)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:l,toBeUndefined:a,changed:c,changedTimes:d,get not(){return Bi(t,!e)}}}function $i(t){return Bi(t)}function Fd(t){var e;const n=ut(t);return(e=n?.$el)!=null?e:n}const bs=$d?window:void 0;function ws(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=bs):[e,n,o,i]=t,!e)return Od;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(d=>d()),r.length=0},l=(d,f,h,p)=>(d.addEventListener(f,h,p),()=>d.removeEventListener(f,h,p)),u=s.watch(()=>[Fd(e),ut(i)],([d,f])=>{if(a(),!d)return;const h=Pd(f)?{...f}:f;r.push(...n.flatMap(p=>o.map(y=>l(d,p,y,h))))},{immediate:!0,flush:"post"}),c=()=>{u(),a()};return mn(c),c}function jd(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function _s(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=bs,eventName:r="keydown",passive:a=!1,dedupe:l=!1}=o,u=jd(e);return ws(i,r,d=>{d.repeat&&ut(l)||u(d)&&n(d)},a)}function Gd(t){return JSON.parse(JSON.stringify(t))}function zi(t,e,n,o={}){var i,r,a;const{clone:l=!1,passive:u=!1,eventName:c,deep:d=!1,defaultValue:f,shouldEmit:h}=o,p=s.getCurrentInstance(),y=n||p?.emit||((i=p?.$emit)==null?void 0:i.bind(p))||((a=(r=p?.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p?.proxy));let m=c;e||(e="modelValue"),m=m||`update:${e.toString()}`;const b=g=>l?typeof l=="function"?l(g):Gd(g):g,N=()=>zd(t[e])?b(t[e]):f,_=g=>{h?h(g)&&y(m,g):y(m,g)};if(u){const g=N(),x=s.ref(g);let z=!1;return s.watch(()=>t[e],$=>{z||(z=!0,x.value=b($),s.nextTick(()=>z=!1))}),s.watch(x,$=>{!z&&($!==t[e]||d)&&_($)},{deep:d}),x}else return s.computed({get(){return N()},set(g){_(g)}})}var Wd={value:()=>{}};function eo(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new to(n)}function to(t){this._=t}function Yd(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}to.prototype=eo.prototype={constructor:to,on:function(t,e){var n=this._,o=Yd(t+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(t=o[r]).type)&&(i=Ud(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++r<a;)if(i=(t=o[r]).type)n[i]=xs(n[i],t.name,e);else if(e==null)for(i in n)n[i]=xs(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new to(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)}};function Ud(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}function xs(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=Wd,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ai="http://www.w3.org/1999/xhtml";const Cs={svg:"http://www.w3.org/2000/svg",xhtml:Ai,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function no(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Cs.hasOwnProperty(e)?{space:Cs[e],local:t}:t}function Xd(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ai&&e.documentElement.namespaceURI===Ai?e.createElement(t):e.createElementNS(n,t)}}function qd(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Es(t){var e=no(t);return(e.local?qd:Xd)(e)}function Kd(){}function Pi(t){return t==null?Kd:function(){return this.querySelector(t)}}function Zd(t){typeof t!="function"&&(t=Pi(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=new Array(a),u,c,d=0;d<a;++d)(u=r[d])&&(c=t.call(u,u.__data__,d,r))&&("__data__"in u&&(c.__data__=u.__data__),l[d]=c);return new je(o,this._parents)}function Jd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Qd(){return[]}function Ss(t){return t==null?Qd:function(){return this.querySelectorAll(t)}}function eu(t){return function(){return Jd(t.apply(this,arguments))}}function tu(t){typeof t=="function"?t=eu(t):t=Ss(t);for(var e=this._groups,n=e.length,o=[],i=[],r=0;r<n;++r)for(var a=e[r],l=a.length,u,c=0;c<l;++c)(u=a[c])&&(o.push(t.call(u,u.__data__,c,a)),i.push(u));return new je(o,i)}function Ns(t){return function(){return this.matches(t)}}function ks(t){return function(e){return e.matches(t)}}var nu=Array.prototype.find;function ou(t){return function(){return nu.call(this.children,t)}}function iu(){return this.firstElementChild}function ru(t){return this.select(t==null?iu:ou(typeof t=="function"?t:ks(t)))}var su=Array.prototype.filter;function au(){return Array.from(this.children)}function lu(t){return function(){return su.call(this.children,t)}}function cu(t){return this.selectAll(t==null?au:lu(typeof t=="function"?t:ks(t)))}function du(t){typeof t!="function"&&(t=Ns(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],u,c=0;c<a;++c)(u=r[c])&&t.call(u,u.__data__,c,r)&&l.push(u);return new je(o,this._parents)}function Ds(t){return new Array(t.length)}function uu(){return new je(this._enter||this._groups.map(Ds),this._parents)}function oo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}oo.prototype={constructor:oo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function fu(t){return function(){return t}}function hu(t,e,n,o,i,r){for(var a=0,l,u=e.length,c=r.length;a<c;++a)(l=e[a])?(l.__data__=r[a],o[a]=l):n[a]=new oo(t,r[a]);for(;a<u;++a)(l=e[a])&&(i[a]=l)}function pu(t,e,n,o,i,r,a){var l,u,c=new Map,d=e.length,f=r.length,h=new Array(d),p;for(l=0;l<d;++l)(u=e[l])&&(h[l]=p=a.call(u,u.__data__,l,e)+"",c.has(p)?i[l]=u:c.set(p,u));for(l=0;l<f;++l)p=a.call(t,r[l],l,r)+"",(u=c.get(p))?(o[l]=u,u.__data__=r[l],c.delete(p)):n[l]=new oo(t,r[l]);for(l=0;l<d;++l)(u=e[l])&&c.get(h[l])===u&&(i[l]=u)}function gu(t){return t.__data__}function mu(t,e){if(!arguments.length)return Array.from(this,gu);var n=e?pu:hu,o=this._parents,i=this._groups;typeof t!="function"&&(t=fu(t));for(var r=i.length,a=new Array(r),l=new Array(r),u=new Array(r),c=0;c<r;++c){var d=o[c],f=i[c],h=f.length,p=yu(t.call(d,d&&d.__data__,c,o)),y=p.length,m=l[c]=new Array(y),b=a[c]=new Array(y),N=u[c]=new Array(h);n(d,f,m,b,N,p,e);for(var _=0,g=0,x,z;_<y;++_)if(x=m[_]){for(_>=g&&(g=_+1);!(z=b[g])&&++g<y;);x._next=z||null}}return a=new je(a,o),a._enter=l,a._exit=u,a}function yu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function vu(){return new je(this._exit||this._groups.map(Ds),this._parents)}function bu(t,e,n){var o=this.enter(),i=this,r=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function wu(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,r=o.length,a=Math.min(i,r),l=new Array(i),u=0;u<a;++u)for(var c=n[u],d=o[u],f=c.length,h=l[u]=new Array(f),p,y=0;y<f;++y)(p=c[y]||d[y])&&(h[y]=p);for(;u<i;++u)l[u]=n[u];return new je(l,this._parents)}function _u(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function xu(t){t||(t=Cu);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],l=a.length,u=i[r]=new Array(l),c,d=0;d<l;++d)(c=a[d])&&(u[d]=c);u.sort(e)}return new je(i,this._parents).order()}function Cu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Eu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Su(){return Array.from(this)}function Nu(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function ku(){let t=0;for(const e of this)++t;return t}function Du(){return!this.node()}function Tu(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],r=0,a=i.length,l;r<a;++r)(l=i[r])&&t.call(l,l.__data__,r,i);return this}function Iu(t){return function(){this.removeAttribute(t)}}function Mu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bu(t,e){return function(){this.setAttribute(t,e)}}function $u(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function zu(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Au(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Pu(t,e){var n=no(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?Mu:Iu:typeof e=="function"?n.local?Au:zu:n.local?$u:Bu)(n,e))}function Ts(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ou(t){return function(){this.style.removeProperty(t)}}function Ru(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Hu(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Vu(t,e,n){return arguments.length>1?this.each((e==null?Ou:typeof e=="function"?Hu:Ru)(t,e,n??"")):qt(this.node(),t)}function qt(t,e){return t.style.getPropertyValue(e)||Ts(t).getComputedStyle(t,null).getPropertyValue(e)}function Lu(t){return function(){delete this[t]}}function Fu(t,e){return function(){this[t]=e}}function ju(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Gu(t,e){return arguments.length>1?this.each((e==null?Lu:typeof e=="function"?ju:Fu)(t,e)):this.node()[t]}function Is(t){return t.trim().split(/^|\s+/)}function Oi(t){return t.classList||new Ms(t)}function Ms(t){this._node=t,this._names=Is(t.getAttribute("class")||"")}Ms.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Bs(t,e){for(var n=Oi(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function $s(t,e){for(var n=Oi(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function Wu(t){return function(){Bs(this,t)}}function Yu(t){return function(){$s(this,t)}}function Uu(t,e){return function(){(e.apply(this,arguments)?Bs:$s)(this,t)}}function Xu(t,e){var n=Is(t+"");if(arguments.length<2){for(var o=Oi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Uu:e?Wu:Yu)(n,e))}function qu(){this.textContent=""}function Ku(t){return function(){this.textContent=t}}function Zu(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ju(t){return arguments.length?this.each(t==null?qu:(typeof t=="function"?Zu:Ku)(t)):this.node().textContent}function Qu(){this.innerHTML=""}function ef(t){return function(){this.innerHTML=t}}function tf(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function nf(t){return arguments.length?this.each(t==null?Qu:(typeof t=="function"?tf:ef)(t)):this.node().innerHTML}function of(){this.nextSibling&&this.parentNode.appendChild(this)}function rf(){return this.each(of)}function sf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function af(){return this.each(sf)}function lf(t){var e=typeof t=="function"?t:Es(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function cf(){return null}function df(t,e){var n=typeof t=="function"?t:Es(t),o=e==null?cf:typeof e=="function"?e:Pi(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function uf(){var t=this.parentNode;t&&t.removeChild(this)}function ff(){return this.each(uf)}function hf(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function pf(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function gf(t){return this.select(t?pf:hf)}function mf(t){return arguments.length?this.property("__data__",t):this.node().__data__}function yf(t){return function(e){t.call(this,e,this.__data__)}}function vf(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function bf(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,r;n<i;++n)r=e[n],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):e[++o]=r;++o?e.length=o:delete this.__on}}}function wf(t,e,n){return function(){var o=this.__on,i,r=yf(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=e;return}}this.addEventListener(t.type,r,n),i={type:t.type,name:t.name,value:e,listener:r,options:n},o?o.push(i):this.__on=[i]}}function _f(t,e,n){var o=vf(t+""),i,r=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,d;u<c;++u)for(i=0,d=l[u];i<r;++i)if((a=o[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=e?wf:bf,i=0;i<r;++i)this.each(l(o[i],e,n));return this}function zs(t,e,n){var o=Ts(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function xf(t,e){return function(){return zs(this,t,e)}}function Cf(t,e){return function(){return zs(this,t,e.apply(this,arguments))}}function Ef(t,e){return this.each((typeof e=="function"?Cf:xf)(t,e))}function*Sf(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var As=[null];function je(t,e){this._groups=t,this._parents=e}function yn(){return new je([[document.documentElement]],As)}function Nf(){return this}je.prototype=yn.prototype={constructor:je,select:Zd,selectAll:tu,selectChild:ru,selectChildren:cu,filter:du,data:mu,enter:uu,exit:vu,join:bu,merge:wu,selection:Nf,order:_u,sort:xu,call:Eu,nodes:Su,node:Nu,size:ku,empty:Du,each:Tu,attr:Pu,style:Vu,property:Gu,classed:Xu,text:Ju,html:nf,raise:rf,lower:af,append:lf,insert:df,remove:ff,clone:gf,datum:mf,on:_f,dispatch:Ef,[Symbol.iterator]:Sf};function Je(t){return typeof t=="string"?new je([[document.querySelector(t)]],[document.documentElement]):new je([[t]],As)}function kf(t){let e;for(;e=t.sourceEvent;)t=e;return t}function it(t,e){if(t=kf(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Df={passive:!1},vn={capture:!0,passive:!1};function Ri(t){t.stopImmediatePropagation()}function Kt(t){t.preventDefault(),t.stopImmediatePropagation()}function Ps(t){var e=t.document.documentElement,n=Je(t).on("dragstart.drag",Kt,vn);"onselectstart"in e?n.on("selectstart.drag",Kt,vn):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Os(t,e){var n=t.document.documentElement,o=Je(t).on("dragstart.drag",null);e&&(o.on("click.drag",Kt,vn),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const io=t=>()=>t;function Hi(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:r,x:a,y:l,dx:u,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Hi.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Tf(t){return!t.ctrlKey&&!t.button}function If(){return this.parentNode}function Mf(t,e){return e??{x:t.x,y:t.y}}function Bf(){return navigator.maxTouchPoints||"ontouchstart"in this}function $f(){var t=Tf,e=If,n=Mf,o=Bf,i={},r=eo("start","drag","end"),a=0,l,u,c,d,f=0;function h(x){x.on("mousedown.drag",p).filter(o).on("touchstart.drag",b).on("touchmove.drag",N,Df).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(x,z){if(!(d||!t.call(this,x,z))){var $=g(this,e.call(this,x,z),x,z,"mouse");$&&(Je(x.view).on("mousemove.drag",y,vn).on("mouseup.drag",m,vn),Ps(x.view),Ri(x),c=!1,l=x.clientX,u=x.clientY,$("start",x))}}function y(x){if(Kt(x),!c){var z=x.clientX-l,$=x.clientY-u;c=z*z+$*$>f}i.mouse("drag",x)}function m(x){Je(x.view).on("mousemove.drag mouseup.drag",null),Os(x.view,c),Kt(x),i.mouse("end",x)}function b(x,z){if(t.call(this,x,z)){var $=x.changedTouches,F=e.call(this,x,z),Y=$.length,G,S;for(G=0;G<Y;++G)(S=g(this,F,x,z,$[G].identifier,$[G]))&&(Ri(x),S("start",x,$[G]))}}function N(x){var z=x.changedTouches,$=z.length,F,Y;for(F=0;F<$;++F)(Y=i[z[F].identifier])&&(Kt(x),Y("drag",x,z[F]))}function _(x){var z=x.changedTouches,$=z.length,F,Y;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),F=0;F<$;++F)(Y=i[z[F].identifier])&&(Ri(x),Y("end",x,z[F]))}function g(x,z,$,F,Y,G){var S=r.copy(),I=it(G||$,z),E,H,w;if((w=n.call(x,new Hi("beforestart",{sourceEvent:$,target:h,identifier:Y,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:S}),F))!=null)return E=w.x-I[0]||0,H=w.y-I[1]||0,function D(v,C,k){var O=I,R;switch(v){case"start":i[Y]=D,R=a++;break;case"end":delete i[Y],--a;case"drag":I=it(k||C,z),R=a;break}S.call(v,x,new Hi(v,{sourceEvent:C,subject:w,target:h,identifier:Y,active:R,x:I[0]+E,y:I[1]+H,dx:I[0]-O[0],dy:I[1]-O[1],dispatch:S}),F)}}return h.filter=function(x){return arguments.length?(t=typeof x=="function"?x:io(!!x),h):t},h.container=function(x){return arguments.length?(e=typeof x=="function"?x:io(x),h):e},h.subject=function(x){return arguments.length?(n=typeof x=="function"?x:io(x),h):n},h.touchable=function(x){return arguments.length?(o=typeof x=="function"?x:io(!!x),h):o},h.on=function(){var x=r.on.apply(r,arguments);return x===r?h:x},h.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,h):Math.sqrt(f)},h}function Vi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Rs(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function bn(){}var wn=.7,ro=1/wn,Zt="\\s*([+-]?\\d+)\\s*",_n="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zf=/^#([0-9a-f]{3,8})$/,Af=new RegExp(`^rgb\\(${Zt},${Zt},${Zt}\\)$`),Pf=new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`),Of=new RegExp(`^rgba\\(${Zt},${Zt},${Zt},${_n}\\)$`),Rf=new RegExp(`^rgba\\(${rt},${rt},${rt},${_n}\\)$`),Hf=new RegExp(`^hsl\\(${_n},${rt},${rt}\\)$`),Vf=new RegExp(`^hsla\\(${_n},${rt},${rt},${_n}\\)$`),Hs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Vi(bn,zt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Vs,formatHex:Vs,formatHex8:Lf,formatHsl:Ff,formatRgb:Ls,toString:Ls});function Vs(){return this.rgb().formatHex()}function Lf(){return this.rgb().formatHex8()}function Ff(){return Ys(this).formatHsl()}function Ls(){return this.rgb().formatRgb()}function zt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=zf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fs(e):n===3?new He(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?so(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?so(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Af.exec(t))?new He(e[1],e[2],e[3],1):(e=Pf.exec(t))?new He(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Of.exec(t))?so(e[1],e[2],e[3],e[4]):(e=Rf.exec(t))?so(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Hf.exec(t))?Ws(e[1],e[2]/100,e[3]/100,1):(e=Vf.exec(t))?Ws(e[1],e[2]/100,e[3]/100,e[4]):Hs.hasOwnProperty(t)?Fs(Hs[t]):t==="transparent"?new He(NaN,NaN,NaN,0):null}function Fs(t){return new He(t>>16&255,t>>8&255,t&255,1)}function so(t,e,n,o){return o<=0&&(t=e=n=NaN),new He(t,e,n,o)}function jf(t){return t instanceof bn||(t=zt(t)),t?(t=t.rgb(),new He(t.r,t.g,t.b,t.opacity)):new He}function Li(t,e,n,o){return arguments.length===1?jf(t):new He(t,e,n,o??1)}function He(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Vi(He,Li,Rs(bn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new He(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?wn:Math.pow(wn,t),new He(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new He(At(this.r),At(this.g),At(this.b),ao(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:js,formatHex:js,formatHex8:Gf,formatRgb:Gs,toString:Gs}));function js(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}`}function Gf(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}${Pt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gs(){const t=ao(this.opacity);return`${t===1?"rgb(":"rgba("}${At(this.r)}, ${At(this.g)}, ${At(this.b)}${t===1?")":`, ${t})`}`}function ao(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function At(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Pt(t){return t=At(t),(t<16?"0":"")+t.toString(16)}function Ws(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Qe(t,e,n,o)}function Ys(t){if(t instanceof Qe)return new Qe(t.h,t.s,t.l,t.opacity);if(t instanceof bn||(t=zt(t)),!t)return new Qe;if(t instanceof Qe)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),r=Math.max(e,n,o),a=NaN,l=r-i,u=(r+i)/2;return l?(e===r?a=(n-o)/l+(n<o)*6:n===r?a=(o-e)/l+2:a=(e-n)/l+4,l/=u<.5?r+i:2-r-i,a*=60):l=u>0&&u<1?0:a,new Qe(a,l,u,t.opacity)}function Wf(t,e,n,o){return arguments.length===1?Ys(t):new Qe(t,e,n,o??1)}function Qe(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Vi(Qe,Wf,Rs(bn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new Qe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?wn:Math.pow(wn,t),new Qe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,i=2*n-o;return new He(Fi(t>=240?t-240:t+120,i,o),Fi(t,i,o),Fi(t<120?t+240:t-120,i,o),this.opacity)},clamp(){return new Qe(Us(this.h),lo(this.s),lo(this.l),ao(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ao(this.opacity);return`${t===1?"hsl(":"hsla("}${Us(this.h)}, ${lo(this.s)*100}%, ${lo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Us(t){return t=(t||0)%360,t<0?t+360:t}function lo(t){return Math.max(0,Math.min(1,t||0))}function Fi(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const ji=t=>()=>t;function Yf(t,e){return function(n){return t+n*e}}function Uf(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Xf(t){return(t=+t)==1?Xs:function(e,n){return n-e?Uf(e,n,t):ji(isNaN(e)?n:e)}}function Xs(t,e){var n=e-t;return n?Yf(t,n):ji(isNaN(t)?e:t)}const co=(function t(e){var n=Xf(e);function o(i,r){var a=n((i=Li(i)).r,(r=Li(r)).r),l=n(i.g,r.g),u=n(i.b,r.b),c=Xs(i.opacity,r.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=u(d),i.opacity=c(d),i+""}}return o.gamma=t,o})(1);function qf(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=t[i]*(1-r)+e[i]*r;return o}}function Kf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Zf(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,i=new Array(o),r=new Array(n),a;for(a=0;a<o;++a)i[a]=xn(t[a],e[a]);for(;a<n;++a)r[a]=e[a];return function(l){for(a=0;a<o;++a)r[a]=i[a](l);return r}}function Jf(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function st(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Qf(t,e){var n={},o={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=xn(t[i],e[i]):o[i]=e[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Gi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wi=new RegExp(Gi.source,"g");function eh(t){return function(){return t}}function th(t){return function(e){return t(e)+""}}function qs(t,e){var n=Gi.lastIndex=Wi.lastIndex=0,o,i,r,a=-1,l=[],u=[];for(t=t+"",e=e+"";(o=Gi.exec(t))&&(i=Wi.exec(e));)(r=i.index)>n&&(r=e.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,u.push({i:a,x:st(o,i)})),n=Wi.lastIndex;return n<e.length&&(r=e.slice(n),l[a]?l[a]+=r:l[++a]=r),l.length<2?u[0]?th(u[0].x):eh(e):(e=u.length,function(c){for(var d=0,f;d<e;++d)l[(f=u[d]).i]=f.x(c);return l.join("")})}function xn(t,e){var n=typeof e,o;return e==null||n==="boolean"?ji(e):(n==="number"?st:n==="string"?(o=zt(e))?(e=o,co):qs:e instanceof zt?co:e instanceof Date?Jf:Kf(e)?qf:Array.isArray(e)?Zf:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Qf:st)(t,e)}var Ks=180/Math.PI,Yi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zs(t,e,n,o,i,r){var a,l,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*o)&&(n-=t*u,o-=e*u),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,u/=l),t*o<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(e,t)*Ks,skewX:Math.atan(u)*Ks,scaleX:a,scaleY:l}}var uo;function nh(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Yi:Zs(e.a,e.b,e.c,e.d,e.e,e.f)}function oh(t){return t==null||(uo||(uo=document.createElementNS("http://www.w3.org/2000/svg","g")),uo.setAttribute("transform",t),!(t=uo.transform.baseVal.consolidate()))?Yi:(t=t.matrix,Zs(t.a,t.b,t.c,t.d,t.e,t.f))}function Js(t,e,n,o){function i(c){return c.length?c.pop()+" ":""}function r(c,d,f,h,p,y){if(c!==f||d!==h){var m=p.push("translate(",null,e,null,n);y.push({i:m-4,x:st(c,f)},{i:m-2,x:st(d,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(c,d,f,h){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:st(c,d)})):d&&f.push(i(f)+"rotate("+d+o)}function l(c,d,f,h){c!==d?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:st(c,d)}):d&&f.push(i(f)+"skewX("+d+o)}function u(c,d,f,h,p,y){if(c!==f||d!==h){var m=p.push(i(p)+"scale(",null,",",null,")");y.push({i:m-4,x:st(c,f)},{i:m-2,x:st(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=t(c),d=t(d),r(c.translateX,c.translateY,d.translateX,d.translateY,f,h),a(c.rotate,d.rotate,f,h),l(c.skewX,d.skewX,f,h),u(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var y=-1,m=h.length,b;++y<m;)f[(b=h[y]).i]=b.x(p);return f.join("")}}}var ih=Js(nh,"px, ","px)","deg)"),rh=Js(oh,", ",")",")"),sh=1e-12;function Qs(t){return((t=Math.exp(t))+1/t)/2}function ah(t){return((t=Math.exp(t))-1/t)/2}function lh(t){return((t=Math.exp(2*t))-1)/(t+1)}const fo=(function t(e,n,o){function i(r,a){var l=r[0],u=r[1],c=r[2],d=a[0],f=a[1],h=a[2],p=d-l,y=f-u,m=p*p+y*y,b,N;if(m<sh)N=Math.log(h/c)/e,b=function(F){return[l+F*p,u+F*y,c*Math.exp(e*F*N)]};else{var _=Math.sqrt(m),g=(h*h-c*c+o*m)/(2*c*n*_),x=(h*h-c*c-o*m)/(2*h*n*_),z=Math.log(Math.sqrt(g*g+1)-g),$=Math.log(Math.sqrt(x*x+1)-x);N=($-z)/e,b=function(F){var Y=F*N,G=Qs(z),S=c/(n*_)*(G*lh(e*Y+z)-ah(z));return[l+S*p,u+S*y,c*G/Qs(e*Y+z)]}}return b.duration=N*1e3*e/Math.SQRT2,b}return i.rho=function(r){var a=Math.max(.001,+r),l=a*a,u=l*l;return t(a,l,u)},i})(Math.SQRT2,2,4);var Jt=0,Cn=0,En=0,ea=1e3,ho,Sn,po=0,Ot=0,go=0,Nn=typeof performance=="object"&&performance.now?performance:Date,ta=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ui(){return Ot||(ta(ch),Ot=Nn.now()+go)}function ch(){Ot=0}function mo(){this._call=this._time=this._next=null}mo.prototype=na.prototype={constructor:mo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ui():+n)+(e==null?0:+e),!this._next&&Sn!==this&&(Sn?Sn._next=this:ho=this,Sn=this),this._call=t,this._time=n,Xi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xi())}};function na(t,e,n){var o=new mo;return o.restart(t,e,n),o}function dh(){Ui(),++Jt;for(var t=ho,e;t;)(e=Ot-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Jt}function oa(){Ot=(po=Nn.now())+go,Jt=Cn=0;try{dh()}finally{Jt=0,fh(),Ot=0}}function uh(){var t=Nn.now(),e=t-po;e>ea&&(go-=e,po=t)}function fh(){for(var t,e=ho,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ho=n);Sn=t,Xi(o)}function Xi(t){if(!Jt){Cn&&(Cn=clearTimeout(Cn));var e=t-Ot;e>24?(t<1/0&&(Cn=setTimeout(oa,t-Nn.now()-go)),En&&(En=clearInterval(En))):(En||(po=Nn.now(),En=setInterval(uh,ea)),Jt=1,ta(oa))}}function ia(t,e,n){var o=new mo;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}var hh=eo("start","end","cancel","interrupt"),ph=[],ra=0,sa=1,qi=2,yo=3,aa=4,Ki=5,vo=6;function bo(t,e,n,o,i,r){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;gh(t,n,{name:e,index:o,group:i,on:hh,tween:ph,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ra})}function Zi(t,e){var n=et(t,e);if(n.state>ra)throw new Error("too late; already scheduled");return n}function at(t,e){var n=et(t,e);if(n.state>yo)throw new Error("too late; already running");return n}function et(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function gh(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=na(r,0,n.time);function r(c){n.state=sa,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,f,h,p;if(n.state!==sa)return u();for(d in o)if(p=o[d],p.name===n.name){if(p.state===yo)return ia(a);p.state===aa?(p.state=vo,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete o[d]):+d<e&&(p.state=vo,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete o[d])}if(ia(function(){n.state===yo&&(n.state=aa,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=qi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===qi){for(n.state=yo,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function l(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Ki,1),f=-1,h=i.length;++f<h;)i[f].call(t,d);n.state===Ki&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=vo,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function wo(t,e){var n=t.__transition,o,i,r=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){r=!1;continue}i=o.state>qi&&o.state<Ki,o.state=vo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}r&&delete t.__transition}}function mh(t){return this.each(function(){wo(this,t)})}function yh(t,e){var n,o;return function(){var i=at(this,t),r=i.tween;if(r!==n){o=n=r;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function vh(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=at(this,t),a=r.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===e){i[u]=l;break}u===c&&i.push(l)}r.tween=i}}function bh(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=et(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?yh:vh)(n,t,e))}function Ji(t,e,n){var o=t._id;return t.each(function(){var i=at(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return et(i,o).value[e]}}function la(t,e){var n;return(typeof e=="number"?st:e instanceof zt?co:(n=zt(e))?(e=n,co):qs)(t,e)}function wh(t){return function(){this.removeAttribute(t)}}function _h(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xh(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function Ch(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function Eh(t,e,n){var o,i,r;return function(){var a,l=n(this),u;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=l+"",a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l)))}}function Sh(t,e,n){var o,i,r;return function(){var a,l=n(this),u;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=l+"",a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l)))}}function Nh(t,e){var n=no(t),o=n==="transform"?rh:la;return this.attrTween(t,typeof e=="function"?(n.local?Sh:Eh)(n,o,Ji(this,"attr."+t,e)):e==null?(n.local?_h:wh)(n):(n.local?Ch:xh)(n,o,e))}function kh(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Dh(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Th(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&Dh(t,r)),n}return i._value=e,i}function Ih(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&kh(t,r)),n}return i._value=e,i}function Mh(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=no(t);return this.tween(n,(o.local?Th:Ih)(o,e))}function Bh(t,e){return function(){Zi(this,t).delay=+e.apply(this,arguments)}}function $h(t,e){return e=+e,function(){Zi(this,t).delay=e}}function zh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Bh:$h)(e,t)):et(this.node(),e).delay}function Ah(t,e){return function(){at(this,t).duration=+e.apply(this,arguments)}}function Ph(t,e){return e=+e,function(){at(this,t).duration=e}}function Oh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ah:Ph)(e,t)):et(this.node(),e).duration}function Rh(t,e){if(typeof e!="function")throw new Error;return function(){at(this,t).ease=e}}function Hh(t){var e=this._id;return arguments.length?this.each(Rh(e,t)):et(this.node(),e).ease}function Vh(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;at(this,t).ease=n}}function Lh(t){if(typeof t!="function")throw new Error;return this.each(Vh(this._id,t))}function Fh(t){typeof t!="function"&&(t=Ns(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],u,c=0;c<a;++c)(u=r[c])&&t.call(u,u.__data__,c,r)&&l.push(u);return new ft(o,this._parents,this._name,this._id)}function jh(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),a=new Array(o),l=0;l<r;++l)for(var u=e[l],c=n[l],d=u.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<o;++l)a[l]=e[l];return new ft(a,this._parents,this._name,this._id)}function Gh(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Wh(t,e,n){var o,i,r=Gh(e)?Zi:at;return function(){var a=r(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}function Yh(t,e){var n=this._id;return arguments.length<2?et(this.node(),n).on.on(t):this.each(Wh(n,t,e))}function Uh(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Xh(){return this.on("end.remove",Uh(this._id))}function qh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Pi(t));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var l=o[a],u=l.length,c=r[a]=new Array(u),d,f,h=0;h<u;++h)(d=l[h])&&(f=t.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),c[h]=f,bo(c[h],e,n,h,c,et(d,n)));return new ft(r,this._parents,e,n)}function Kh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ss(t));for(var o=this._groups,i=o.length,r=[],a=[],l=0;l<i;++l)for(var u=o[l],c=u.length,d,f=0;f<c;++f)if(d=u[f]){for(var h=t.call(d,d.__data__,f,u),p,y=et(d,n),m=0,b=h.length;m<b;++m)(p=h[m])&&bo(p,e,n,m,h,y);r.push(h),a.push(d)}return new ft(r,a,e,n)}var Zh=yn.prototype.constructor;function Jh(){return new Zh(this._groups,this._parents)}function Qh(t,e){var n,o,i;return function(){var r=qt(this,t),a=(this.style.removeProperty(t),qt(this,t));return r===a?null:r===n&&a===o?i:i=e(n=r,o=a)}}function ca(t){return function(){this.style.removeProperty(t)}}function ep(t,e,n){var o,i=n+"",r;return function(){var a=qt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}function tp(t,e,n){var o,i,r;return function(){var a=qt(this,t),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(t),qt(this,t))),a===u?null:a===o&&u===i?r:(i=u,r=e(o=a,l))}}function np(t,e){var n,o,i,r="style."+e,a="end."+r,l;return function(){var u=at(this,t),c=u.on,d=u.value[r]==null?l||(l=ca(e)):void 0;(c!==n||i!==d)&&(o=(n=c).copy()).on(a,i=d),u.on=o}}function op(t,e,n){var o=(t+="")=="transform"?ih:la;return e==null?this.styleTween(t,Qh(t,o)).on("end.style."+t,ca(t)):typeof e=="function"?this.styleTween(t,tp(t,o,Ji(this,"style."+t,e))).each(np(this._id,t)):this.styleTween(t,ep(t,o,e),n).on("end.style."+t,null)}function ip(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function rp(t,e,n){var o,i;function r(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&ip(t,a,n)),o}return r._value=e,r}function sp(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,rp(t,e,n??""))}function ap(t){return function(){this.textContent=t}}function lp(t){return function(){var e=t(this);this.textContent=e??""}}function cp(t){return this.tween("text",typeof t=="function"?lp(Ji(this,"text",t)):ap(t==null?"":t+""))}function dp(t){return function(e){this.textContent=t.call(this,e)}}function up(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&dp(i)),e}return o._value=t,o}function fp(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,up(t))}function hp(){for(var t=this._name,e=this._id,n=da(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,u,c=0;c<l;++c)if(u=a[c]){var d=et(u,e);bo(u,t,n,c,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ft(o,this._parents,t,n)}function pp(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var l={value:a},u={value:function(){--i===0&&r()}};n.each(function(){var c=at(this,o),d=c.on;d!==t&&(e=(t=d).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(u)),c.on=e}),i===0&&r()})}var gp=0;function ft(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function da(){return++gp}var ht=yn.prototype;ft.prototype={constructor:ft,select:qh,selectAll:Kh,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:Fh,merge:jh,selection:Jh,transition:hp,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:Yh,attr:Nh,attrTween:Mh,style:op,styleTween:sp,text:cp,textTween:fp,remove:Xh,tween:bh,delay:zh,duration:Oh,ease:Hh,easeVarying:Lh,end:pp,[Symbol.iterator]:ht[Symbol.iterator]};function mp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yp={time:null,delay:0,duration:250,ease:mp};function vp(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function bp(t){var e,n;t instanceof ft?(e=t._id,t=t._name):(e=da(),(n=yp).time=Ui(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,u,c=0;c<l;++c)(u=a[c])&&bo(u,t,e,c,a,n||vp(u,e));return new ft(o,this._parents,t,e)}yn.prototype.interrupt=mh,yn.prototype.transition=bp;const _o=t=>()=>t;function wp(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function pt(t,e,n){this.k=t,this.x=e,this.y=n}pt.prototype={constructor:pt,scale:function(t){return t===1?this:new pt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new pt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qt=new pt(1,0,0);pt.prototype;function Qi(t){t.stopImmediatePropagation()}function kn(t){t.preventDefault(),t.stopImmediatePropagation()}function _p(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function xp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function ua(){return this.__zoom||Qt}function Cp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ep(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sp(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function Np(){var t=_p,e=xp,n=Sp,o=Cp,i=Ep,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,u=fo,c=eo("start","zoom","end"),d,f,h,p=500,y=150,m=0,b=10;function N(w){w.property("__zoom",ua).on("wheel.zoom",Y,{passive:!1}).on("mousedown.zoom",G).on("dblclick.zoom",S).filter(i).on("touchstart.zoom",I).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(w,D,v,C){var k=w.selection?w.selection():w;k.property("__zoom",ua),w!==k?z(w,D,v,C):k.interrupt().each(function(){$(this,arguments).event(C).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},N.scaleBy=function(w,D,v,C){N.scaleTo(w,function(){var k=this.__zoom.k,O=typeof D=="function"?D.apply(this,arguments):D;return k*O},v,C)},N.scaleTo=function(w,D,v,C){N.transform(w,function(){var k=e.apply(this,arguments),O=this.__zoom,R=v==null?x(k):typeof v=="function"?v.apply(this,arguments):v,B=O.invert(R),P=typeof D=="function"?D.apply(this,arguments):D;return n(g(_(O,P),R,B),k,a)},v,C)},N.translateBy=function(w,D,v,C){N.transform(w,function(){return n(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof v=="function"?v.apply(this,arguments):v),e.apply(this,arguments),a)},null,C)},N.translateTo=function(w,D,v,C,k){N.transform(w,function(){var O=e.apply(this,arguments),R=this.__zoom,B=C==null?x(O):typeof C=="function"?C.apply(this,arguments):C;return n(Qt.translate(B[0],B[1]).scale(R.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof v=="function"?-v.apply(this,arguments):-v),O,a)},C,k)};function _(w,D){return D=Math.max(r[0],Math.min(r[1],D)),D===w.k?w:new pt(D,w.x,w.y)}function g(w,D,v){var C=D[0]-v[0]*w.k,k=D[1]-v[1]*w.k;return C===w.x&&k===w.y?w:new pt(w.k,C,k)}function x(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function z(w,D,v,C){w.on("start.zoom",function(){$(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(C).end()}).tween("zoom",function(){var k=this,O=arguments,R=$(k,O).event(C),B=e.apply(k,O),P=v==null?x(B):typeof v=="function"?v.apply(k,O):v,L=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),j=k.__zoom,K=typeof D=="function"?D.apply(k,O):D,Q=u(j.invert(P).concat(L/j.k),K.invert(P).concat(L/K.k));return function(q){if(q===1)q=K;else{var ee=Q(q),re=L/ee[2];q=new pt(re,P[0]-ee[0]*re,P[1]-ee[1]*re)}R.zoom(null,q)}})}function $(w,D,v){return!v&&w.__zooming||new F(w,D)}function F(w,D){this.that=w,this.args=D,this.active=0,this.sourceEvent=null,this.extent=e.apply(w,D),this.taps=0}F.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,D){return this.mouse&&w!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var D=Je(this.that).datum();c.call(w,this.that,new wp(w,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:c}),D)}};function Y(w,...D){if(!t.apply(this,arguments))return;var v=$(this,D).event(w),C=this.__zoom,k=Math.max(r[0],Math.min(r[1],C.k*Math.pow(2,o.apply(this,arguments)))),O=it(w);if(v.wheel)(v.mouse[0][0]!==O[0]||v.mouse[0][1]!==O[1])&&(v.mouse[1]=C.invert(v.mouse[0]=O)),clearTimeout(v.wheel);else{if(C.k===k)return;v.mouse=[O,C.invert(O)],wo(this),v.start()}kn(w),v.wheel=setTimeout(R,y),v.zoom("mouse",n(g(_(C,k),v.mouse[0],v.mouse[1]),v.extent,a));function R(){v.wheel=null,v.end()}}function G(w,...D){if(h||!t.apply(this,arguments))return;var v=w.currentTarget,C=$(this,D,!0).event(w),k=Je(w.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",L,!0),O=it(w,v),R=w.clientX,B=w.clientY;Ps(w.view),Qi(w),C.mouse=[O,this.__zoom.invert(O)],wo(this),C.start();function P(j){if(kn(j),!C.moved){var K=j.clientX-R,Q=j.clientY-B;C.moved=K*K+Q*Q>m}C.event(j).zoom("mouse",n(g(C.that.__zoom,C.mouse[0]=it(j,v),C.mouse[1]),C.extent,a))}function L(j){k.on("mousemove.zoom mouseup.zoom",null),Os(j.view,C.moved),kn(j),C.event(j).end()}}function S(w,...D){if(t.apply(this,arguments)){var v=this.__zoom,C=it(w.changedTouches?w.changedTouches[0]:w,this),k=v.invert(C),O=v.k*(w.shiftKey?.5:2),R=n(g(_(v,O),C,k),e.apply(this,D),a);kn(w),l>0?Je(this).transition().duration(l).call(z,R,C,w):Je(this).call(N.transform,R,C,w)}}function I(w,...D){if(t.apply(this,arguments)){var v=w.touches,C=v.length,k=$(this,D,w.changedTouches.length===C).event(w),O,R,B,P;for(Qi(w),R=0;R<C;++R)B=v[R],P=it(B,this),P=[P,this.__zoom.invert(P),B.identifier],k.touch0?!k.touch1&&k.touch0[2]!==P[2]&&(k.touch1=P,k.taps=0):(k.touch0=P,O=!0,k.taps=1+!!d);d&&(d=clearTimeout(d)),O&&(k.taps<2&&(f=P[0],d=setTimeout(function(){d=null},p)),wo(this),k.start())}}function E(w,...D){if(this.__zooming){var v=$(this,D).event(w),C=w.changedTouches,k=C.length,O,R,B,P;for(kn(w),O=0;O<k;++O)R=C[O],B=it(R,this),v.touch0&&v.touch0[2]===R.identifier?v.touch0[0]=B:v.touch1&&v.touch1[2]===R.identifier&&(v.touch1[0]=B);if(R=v.that.__zoom,v.touch1){var L=v.touch0[0],j=v.touch0[1],K=v.touch1[0],Q=v.touch1[1],q=(q=K[0]-L[0])*q+(q=K[1]-L[1])*q,ee=(ee=Q[0]-j[0])*ee+(ee=Q[1]-j[1])*ee;R=_(R,Math.sqrt(q/ee)),B=[(L[0]+K[0])/2,(L[1]+K[1])/2],P=[(j[0]+Q[0])/2,(j[1]+Q[1])/2]}else if(v.touch0)B=v.touch0[0],P=v.touch0[1];else return;v.zoom("touch",n(g(R,B,P),v.extent,a))}}function H(w,...D){if(this.__zooming){var v=$(this,D).event(w),C=w.changedTouches,k=C.length,O,R;for(Qi(w),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),O=0;O<k;++O)R=C[O],v.touch0&&v.touch0[2]===R.identifier?delete v.touch0:v.touch1&&v.touch1[2]===R.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(R=it(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<b)){var B=Je(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return N.wheelDelta=function(w){return arguments.length?(o=typeof w=="function"?w:_o(+w),N):o},N.filter=function(w){return arguments.length?(t=typeof w=="function"?w:_o(!!w),N):t},N.touchable=function(w){return arguments.length?(i=typeof w=="function"?w:_o(!!w),N):i},N.extent=function(w){return arguments.length?(e=typeof w=="function"?w:_o([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),N):e},N.scaleExtent=function(w){return arguments.length?(r[0]=+w[0],r[1]=+w[1],N):[r[0],r[1]]},N.translateExtent=function(w){return arguments.length?(a[0][0]=+w[0][0],a[1][0]=+w[1][0],a[0][1]=+w[0][1],a[1][1]=+w[1][1],N):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},N.constrain=function(w){return arguments.length?(n=w,N):n},N.duration=function(w){return arguments.length?(l=+w,N):l},N.interpolate=function(w){return arguments.length?(u=w,N):u},N.on=function(){var w=c.on.apply(c,arguments);return w===c?N:w},N.clickDistance=function(w){return arguments.length?(m=(w=+w)*w,N):Math.sqrt(m)},N.tapDistance=function(w){return arguments.length?(b=+w,N):b},N}var de=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(de||{}),er=(t=>(t.Partial="partial",t.Full="full",t))(er||{}),Rt=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))(Rt||{}),gt=(t=>(t.Strict="strict",t.Loose="loose",t))(gt||{}),mt=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(mt||{}),Dn=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(Dn||{}),fa=(t=>(t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right",t))(fa||{});const kp=["INPUT","SELECT","TEXTAREA"],Dp=typeof document<"u"?document:null;function tr(t){var e,n;const o=((n=(e=t.composedPath)==null?void 0:e.call(t))==null?void 0:n[0])||t.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,r=typeof o?.closest=="function"?o.closest(".nokey"):null;return kp.includes(o?.nodeName)||i||!!r}function Tp(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function ha(t,e,n,o){const i=e.replace("+",`
|
|
1
|
+
(function(Me,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(Me=typeof globalThis<"u"?globalThis:Me||self,s(Me.DuiUI={},Me.Vue))})(this,function(Me,s){Object.defineProperties(Me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var tc=Object.create,kr=Object.defineProperty,nc=Object.getOwnPropertyDescriptor,oc=Object.getOwnPropertyNames,ic=Object.getPrototypeOf,rc=Object.prototype.hasOwnProperty,Pe=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),sc=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=oc(e),r=0,a=i.length,l;r<a;r++)l=i[r],!rc.call(t,l)&&l!==n&&kr(t,l,{get:(d=>e[d]).bind(null,l),enumerable:!(o=nc(e,l))||o.enumerable});return t},bt=(t,e,n)=>(n=t!=null?tc(ic(t)):{},sc(e||!t||!t.__esModule?kr(n,"default",{value:t,enumerable:!0}):n,t)),Mt=(t,e)=>(t.install=n=>{n.component(t.name,t),e&&e.forEach(o=>{n.component(o.name,o)})},t),Ft=(t="")=>{const e=Date.now(),n=Math.floor(Math.random()*1e9);return t===""?String(n)+String(e):t+"_"+n+String(e)},ni=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(ni);const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=ni(t[n]));return e},ac=t=>{if(Array.isArray(t))t.length=0;else if(t&&typeof t=="object")for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&delete t[e]},oi={},lc=(t,e,n)=>{n[t]=n[t]||{};const o=Ft();return n[t][o]=e,o},cc=(t,e,n)=>{const o=[],i=n[t]||{};return Object.keys(i).forEach(r=>{const a=i[r];try{a&&o.push(a(e))}catch(l){console.error(l)}}),o},dc=(t,e,n)=>{if(e){const o=n[t];o&&delete o[e]}else delete n[t]},Nr=(t,e)=>lc(t,e,oi),Se=(t,e)=>cc(t,e,oi),uc=(t,e)=>{dc(t,e,oi)},Dr=(t,e,n,o,i,r)=>{const a=e.id,l=e.level,{getDesignLocals:d,selectComponent:c,getComponent:u,isMyChildComponent:f,addComponent:h,deleteComponent:p,getParentComponents:g,removeComponentFromContainer:m,addComponentToContainer:w,copyComponent:I,activedComponent:y,top:v}=(0,s.inject)("d-drag-design-provide",{}),C=[],$=(0,s.ref)(!1),z=(0,s.ref)(!1),W=(0,s.ref)(!1),j=(0,s.ref)(!1),D=(0,s.ref)(!1),O={id:"",type:""},H=(0,s.ref)(!1),S=(0,s.ref)(!1);let Y="",b=null;const B=U=>{if(Y===U)return b;Y=U;const{top:Z,left:te,width:oe,height:ae}=t.value.getBoundingClientRect();return b=[{x:te,y:Z},{x:te+oe,y:Z},{x:te+oe,y:Z+ae},{x:te,y:Z+ae}],b},_=(U,Z,te)=>{let oe=Z-te[0].y;oe<0&&(oe=-oe);let ae=Z-te[3].y;ae<0&&(ae=-ae);let ee=U-te[0].x;ee<0&&(ee=-ee);let ie=U-te[1].x;return ie<0&&(ie=-ie),{ly:oe>ae?ae:oe,typey:oe>ae?"bottom":"top",lx:ee>ie?ie:ee,lallx:ee+ie}},x=(U,Z,te)=>U>=te[0].x&&U<=te[1].x&&Z>=te[0].y&&Z<=te[3].y,T=()=>{if(i){Se("dragClick",{id:a});return}if(!z.value){if(c(a),l!==0){const U=t.value.getBoundingClientRect(),Z=d();U.top-Z.top<22?j.value=!0:j.value=!1}z.value=!0,Se("dragClick",{id:a})}},P=U=>{const Z=p(U);Z&&(0,s.nextTick)(()=>{Se("dragClick",{id:Z})})},L=()=>{O.id="",O.type="",l===0&&(D.value=!1)},M=()=>{Se("mouseEnterOrLeave",{id:a,type:"enter"})},V=()=>{Se("mouseEnterOrLeave",{id:a,type:"leave"})},F=U=>{Se("dragClick",{id:U})},G={mouseEnterOrLeave:({id:U,type:Z})=>{Z==="enter"?C.push(U):C.length>0&&C.splice(C.length-1,1);const te=C.length;te>0&&a===C[te-1]?$.value=!0:$.value=!1},dragAciveChild:({type:U,id:Z})=>{Z===a?U==="top"?(H.value=!0,S.value=!1):(S.value=!0,H.value=!1):(S.value=!1,H.value=!1)},dragClick({id:U,isAgain:Z}){console.log("dragClick",U,a),U!==a?z.value=!1:(Z&&(z.value=!1),T())}};G[`dragGetChildDistance_${a}`]=({dragX:U,dragY:Z,moveId:te})=>_(U,Z,B(te));const X={isInContainer({x:U,y:Z,id:te,moveId:oe}){if(a===te||f(te,a))return W.value=!1,{isIn:!1,level:l,id:a,groupId:r};const ae=B(oe);if(x(U,Z,ae))return l===0&&(D.value=!0),{isIn:!0,level:l,id:a,groupId:r};if(l===0){const{ly:ee,lx:ie}=_(U,Z,ae);if(ee<20&&ie<20)return D.value=!0,{isIn:!0,level:l,id:a,groupId:r};D.value=!1}return W.value=!1,{isIn:!1,level:l,id:a,groupId:r}},dragActiveContainer:({containerId:U,containerGroupId:Z,dragX:te,dragY:oe,moveId:ae})=>{if(U===a&&Z===r)if(W.value=!0,o&&o.value.length>0){let ee={ly:9999999,lx:0,lallx:0,id:"",typey:""};o?.value.forEach(ie=>{if(r&&ie.groupId!==r)return;const R=Se(`dragGetChildDistance_${ie.id}`,{dragX:te,dragY:oe,moveId:ae})[0];R&&(ee.ly>R.ly||ee.ly===R.ly&&(ee.lx>R.lx||ee.lx===R.lx&&ee.lallx>R.lallx))&&(ee=R,ee.id=ie.id)}),O.id=ee.id,O.type=ee.typey,Se("dragAciveChild",{id:ee.id,type:ee.typey})}else Se("dragAciveChild",{id:""});else W.value=!1},dragAdd:U=>{if(W.value){let Z=o?.value.length||0;O.id!==""&&O.id!==void 0&&(Z=o?.value.findIndex(te=>te.id===O.id)||0,O.type==="bottom"&&(Z+=1)),h(U,a,Z,r),W.value=!1}L()},dragAddByClick:U=>{if(!y.value&&a===v.id||y.value?.id===a||y.value?.containerId===a&&y.value?.dragType!=="container"){const Z=h(U,a,o?.value.length||0,r,!0);Z&&U.config&&Object.keys(U.config).forEach(te=>{Z.config[te]=U.config[te]})}},dragUpdate(U){if(W.value){const Z=u(U);if(Z.level=l+1,O.id!==Z.id){m(Z.containerId,U);let te=o?.value.findIndex(oe=>oe.id===O.id)||0;O.type==="bottom"&&(te+=1),w(Z,a,te,r)}W.value=!1,(0,s.nextTick)(()=>{Se("dragClick",{id:Z.id,isAgain:!0})})}L()}},J={};return(0,s.onMounted)(()=>{(!i||n!=="container")&&Object.keys(G).forEach(U=>{J[U]=Nr(U,G[U])}),n==="container"&&Object.keys(X).forEach(U=>{J[U]=Nr(U,X[U])}),e.isNewAdd&&(0,s.nextTick)(()=>{T(),delete e.isNewAdd})}),(0,s.onUnmounted)(()=>{Object.keys(J).forEach(U=>{uc(U,J[U])})}),{onMouseenter:M,onMouseleave:V,activeComponent:T,handleComponentClick:F,deleteComponentByClick:P,copyComponent:I,getParentComponents:g,isBottomToolBar:j,isHover:$,isSelect:z,isToContainer:W,isMoveingInTopLevel:D,isTopActive:H,isBottomActive:S}},Tr=(t,e)=>{const n={x:0,y:0,clientX:0,clientY:0,dragElement:null,dragElementId:"jcode-darg-move-id",toContainerLevel:-1,toContainerId:"",groupId:"",id:""};let o=!1;const i=(p,g)=>{o!==!0&&(o=!0,setTimeout(()=>{p(),o=!1},g))},r=(0,s.ref)(!1),a=(p,g,m)=>{const w=document.createElement("div");return w.id=n.dragElementId,w.innerText=p,w.className="d-drag-move",w.style.top=`${g}px`,w.style.left=`${m}px`,document.body.appendChild(w),w},l=()=>{document.onmousemove=null,document.onmouseup=null,r.value=!1,Se("dragAciveChild",{id:""})},d=()=>{l(),n.dragElement&&(n.dragElement.remove(),n.dragElement=null,e?Se("dragAdd",t):Se("dragUpdate",t.id))},c=p=>{const{clientY:g,clientX:m}=p;if(!n.dragElement){const w=Math.abs(n.x-m),I=Math.abs(n.y-g);if(w<=1&&I<=1)return;r.value=!0,n.dragElement=a(t.name,g-11,m-32)}n.dragElement.style.top=`${g-11}px`,n.dragElement.style.left=`${m-32}px`,n.clientX=m,n.clientY=g,i(()=>{if(!r.value)return;const w=Se("isInContainer",{x:m,y:g,id:t.id,moveId:n.id});n.toContainerLevel=-1,n.toContainerId="",n.groupId="",w.forEach(({level:I,id:y,isIn:v,groupId:C})=>{v&&n.toContainerLevel<I&&(n.toContainerLevel=I,n.toContainerId=y,n.groupId=C)}),n.toContainerId!==""?Se("dragActiveContainer",{containerId:n.toContainerId,containerGroupId:n.groupId,dragX:m,dragY:g,moveId:n.id}):Se("dragAciveChild",{id:""})},100)};return{onContextmenu:()=>{l()},onMousedown:p=>{n.x=p.clientX,n.y=p.clientY,n.id=Ft(),document.onmouseup=d,document.onmousemove=c},onClick:()=>{Se("dragAddByClick",t)},moveActive:r}},fc=t=>(t.install=e=>{e.component(t.name,t)},t),Xn=t=>!!(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0||typeof t=="object"&&Object.keys(t).length===0),Ir=/^[a-z0-9]+(-[a-z0-9]+)*$/,qn=(t,e,n,o="")=>{const i=t.split(":");if(t.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;o=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const l=i.pop(),d=i.pop(),c={provider:i.length>0?i[0]:o,prefix:d,name:l};return e&&!Kn(c)?null:c}const r=i[0],a=r.split("-");if(a.length>1){const l={provider:o,prefix:a.shift(),name:a.join("-")};return e&&!Kn(l)?null:l}if(n&&o===""){const l={provider:o,prefix:"",name:r};return e&&!Kn(l,n)?null:l}return null},Kn=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1,Mr=Object.freeze({left:0,top:0,width:16,height:16}),Zn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),fn=Object.freeze({...Mr,...Zn}),ii=Object.freeze({...fn,body:"",hidden:!1});function hc(t,e){const n={};!t.hFlip!=!e.hFlip&&(n.hFlip=!0),!t.vFlip!=!e.vFlip&&(n.vFlip=!0);const o=((t.rotate||0)+(e.rotate||0))%4;return o&&(n.rotate=o),n}function Br(t,e){const n=hc(t,e);for(const o in ii)o in Zn?o in t&&!(o in n)&&(n[o]=Zn[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function pc(t,e){const n=t.icons,o=t.aliases||Object.create(null),i=Object.create(null);function r(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const l=o[a]&&o[a].parent,d=l&&r(l);d&&(i[a]=[l].concat(d))}return i[a]}return Object.keys(n).concat(Object.keys(o)).forEach(r),i}function gc(t,e,n){const o=t.icons,i=t.aliases||Object.create(null);let r={};function a(l){r=Br(o[l]||i[l],r)}return a(e),n.forEach(a),Br(t,r)}function zr(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(i=>{e(i,null),n.push(i)});const o=pc(t);for(const i in o){const r=o[i];r&&(e(i,gc(t,i,r)),n.push(i))}return n}var mc={provider:"",aliases:{},not_found:{},...Mr};function ri(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Ar(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!ri(t,mc))return null;const n=e.icons;for(const i in n){const r=n[i];if(!i||typeof r.body!="string"||!ri(r,ii))return null}const o=e.aliases||Object.create(null);for(const i in o){const r=o[i],a=r.parent;if(!i||typeof a!="string"||!n[a]&&!o[a]||!ri(r,ii))return null}return e}var Pr=Object.create(null);function vc(t,e){return{provider:t,prefix:e,icons:Object.create(null),missing:new Set}}function Gt(t,e){const n=Pr[t]||(Pr[t]=Object.create(null));return n[e]||(n[e]=vc(t,e))}function Or(t,e){return Ar(e)?zr(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}function yc(t,e,n){try{if(typeof n.body=="string")return t.icons[e]={...n},!0}catch{}return!1}var hn=!1;function $r(t){return typeof t=="boolean"&&(hn=t),hn}function Rr(t){const e=typeof t=="string"?qn(t,!0,hn):t;if(e){const n=Gt(e.provider,e.prefix),o=e.name;return n.icons[o]||(n.missing.has(o)?null:void 0)}}function _c(t,e){const n=qn(t,!0,hn);if(!n)return!1;const o=Gt(n.provider,n.prefix);return e?yc(o,n.name,e):(o.missing.add(n.name),!0)}function wc(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),hn&&!e&&!t.prefix){let o=!1;return Ar(t)&&(t.prefix="",zr(t,(i,r)=>{_c(i,r)&&(o=!0)})),o}const n=t.prefix;return Kn({prefix:n,name:"a"})?!!Or(Gt(e,n),t):!1}function Hr(t){const e=Rr(t);return e&&{...fn,...e}}var Vr=Object.freeze({width:null,height:null}),Lr=Object.freeze({...Vr,...Zn}),bc=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Cc=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Fr(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(bc);if(o===null||!o.length)return t;const i=[];let r=o.shift(),a=Cc.test(r);for(;;){if(a){const l=parseFloat(r);isNaN(l)?i.push(r):i.push(Math.ceil(l*e*n)/n)}else i.push(r);if(r=o.shift(),r===void 0)return i.join("");a=!a}}function Ec(t,e="defs"){let n="";const o=t.indexOf("<"+e);for(;o>=0;){const i=t.indexOf(">",o),r=t.indexOf("</"+e);if(i===-1||r===-1)break;const a=t.indexOf(">",r);if(a===-1)break;n+=t.slice(i+1,r).trim(),t=t.slice(0,o).trim()+t.slice(a+1)}return{defs:n,content:t}}function xc(t,e){return t?"<defs>"+t+"</defs>"+e:e}function Sc(t,e,n){const o=Ec(t);return xc(o.defs,e+o.content+n)}var kc=t=>t==="unset"||t==="undefined"||t==="none";function Nc(t,e){const n={...fn,...t},o={...Lr,...e},i={left:n.left,top:n.top,width:n.width,height:n.height};let r=n.body;[n,o].forEach(m=>{const w=[],I=m.hFlip,y=m.vFlip;let v=m.rotate;I?y?v+=2:(w.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),w.push("scale(-1 1)"),i.top=i.left=0):y&&(w.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),w.push("scale(1 -1)"),i.top=i.left=0);let C;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:C=i.height/2+i.top,w.unshift("rotate(90 "+C.toString()+" "+C.toString()+")");break;case 2:w.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:C=i.width/2+i.left,w.unshift("rotate(-90 "+C.toString()+" "+C.toString()+")");break}v%2===1&&(i.left!==i.top&&(C=i.left,i.left=i.top,i.top=C),i.width!==i.height&&(C=i.width,i.width=i.height,i.height=C)),w.length&&(r=Sc(r,'<g transform="'+w.join(" ")+'">',"</g>"))});const a=o.width,l=o.height,d=i.width,c=i.height;let u,f;a===null?(f=l===null?"1em":l==="auto"?c:l,u=Fr(f,d/c)):(u=a==="auto"?d:a,f=l===null?Fr(u,c/d):l==="auto"?c:l);const h={},p=(m,w)=>{kc(w)||(h[m]=w.toString())};p("width",u),p("height",f);const g=[i.left,i.top,d,c];return h.viewBox=g.join(" "),{attributes:h,viewBox:g,body:r}}var Dc=/\sid="(\S+)"/g,Tc="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ic=0;function Mc(t,e=Tc){const n=[];let o;for(;o=Dc.exec(t);)n.push(o[1]);if(!n.length)return t;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(r=>{const a=typeof e=="function"?e(r):e+(Ic++).toString(),l=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+l+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),t=t.replace(new RegExp(i,"g"),""),t}var si=Object.create(null);function Bc(t,e){si[t]=e}function ai(t){return si[t]||si[""]}function li(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array)||!e.length)return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}for(var ci=Object.create(null),pn=["https://api.simplesvg.com","https://api.unisvg.com"],Jn=[];pn.length>0;)pn.length===1||Math.random()>.5?Jn.push(pn.shift()):Jn.push(pn.pop());ci[""]=li({resources:["https://api.iconify.design"].concat(Jn)});function zc(t,e){const n=li(e);return n===null?!1:(ci[t]=n,!0)}function di(t){return ci[t]}var Ac=()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}},Gr=Ac();function Pc(t,e){const n=di(t);if(!n)return 0;let o;if(!n.maxURL)o=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const r=e+".json?icons=";o=n.maxURL-i-n.path.length-r.length}return o}function Oc(t){return t===404}var $c=(t,e,n)=>{const o=[],i=Pc(t,e),r="icons";let a={type:r,provider:t,prefix:e,icons:[]},l=0;return n.forEach((d,c)=>{l+=d.length+1,l>=i&&c>0&&(o.push(a),a={type:r,provider:t,prefix:e,icons:[]},l=d.length),a.icons.push(d)}),o.push(a),o};function Rc(t){if(typeof t=="string"){const e=di(t);if(e)return e.path}return"/"}var Hc=(t,e,n)=>{if(!Gr){n("abort",424);return}let o=Rc(e.provider);switch(e.type){case"icons":{const r=e.prefix,a=e.icons.join(","),l=new URLSearchParams({icons:a});o+=r+".json?"+l.toString();break}case"custom":{const r=e.uri;o+=r.slice(0,1)==="/"?r.slice(1):r;break}default:n("abort",400);return}let i=503;Gr(t+o).then(r=>{const a=r.status;if(a!==200){setTimeout(()=>{n(Oc(a)?"abort":"next",a)});return}return i=501,r.json()}).then(r=>{if(typeof r!="object"||r===null){setTimeout(()=>{r===404?n("abort",r):n("next",i)});return}setTimeout(()=>{n("success",r)})}).catch(()=>{n("next",i)})},Vc={prepare:$c,send:Hc};function Lc(t){const e={loaded:[],missing:[],pending:[]},n=Object.create(null);t.sort((i,r)=>i.provider!==r.provider?i.provider.localeCompare(r.provider):i.prefix!==r.prefix?i.prefix.localeCompare(r.prefix):i.name.localeCompare(r.name));let o={provider:"",prefix:"",name:""};return t.forEach(i=>{if(o.name===i.name&&o.prefix===i.prefix&&o.provider===i.provider)return;o=i;const r=i.provider,a=i.prefix,l=i.name,d=n[r]||(n[r]=Object.create(null)),c=d[a]||(d[a]=Gt(r,a));let u;l in c.icons?u=e.loaded:a===""||c.missing.has(l)?u=e.missing:u=e.pending;const f={provider:r,prefix:a,name:l};u.push(f)}),e}function jr(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(i=>i.id!==e))})}function Fc(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const e=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!e.length)return;let n=!1;const o=t.provider,i=t.prefix;e.forEach(r=>{const a=r.icons,l=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const c=d.name;if(t.icons[c])a.loaded.push({provider:o,prefix:i,name:c});else if(t.missing.has(c))a.missing.push({provider:o,prefix:i,name:c});else return n=!0,!0;return!1}),a.pending.length!==l&&(n||jr([t],r.id),r.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),r.abort))})}))}var Gc=0;function jc(t,e,n){const o=Gc++,i=jr.bind(null,n,o);if(!e.pending.length)return i;const r={id:o,icons:e,callback:t,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(r)}),i}function Wc(t,e=!0,n=!1){const o=[];return t.forEach(i=>{const r=typeof i=="string"?qn(i,e,n):i;r&&o.push(r)}),o}var Yc={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Uc(t,e,n,o){const i=t.resources.length,r=t.random?Math.floor(Math.random()*i):t.index;let a;if(t.random){let z=t.resources.slice(0);for(a=[];z.length>1;){const W=Math.floor(Math.random()*z.length);a.push(z[W]),z=z.slice(0,W).concat(z.slice(W+1))}a=a.concat(z)}else a=t.resources.slice(r).concat(t.resources.slice(0,r));const l=Date.now();let d="pending",c=0,u,f=null,h=[],p=[];typeof o=="function"&&p.push(o);function g(){f&&(clearTimeout(f),f=null)}function m(){d==="pending"&&(d="aborted"),g(),h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function w(z,W){W&&(p=[]),typeof z=="function"&&p.push(z)}function I(){return{startTime:l,payload:e,status:d,queriesSent:c,queriesPending:h.length,subscribe:w,abort:m}}function y(){d="failed",p.forEach(z=>{z(void 0,u)})}function v(){h.forEach(z=>{z.status==="pending"&&(z.status="aborted")}),h=[]}function C(z,W,j){const D=W!=="success";switch(h=h.filter(O=>O!==z),d){case"pending":break;case"failed":if(D||!t.dataAfterTimeout)return;break;default:return}if(W==="abort"){u=j,y();return}if(D){u=j,h.length||(a.length?$():y());return}if(g(),v(),!t.random){const O=t.resources.indexOf(z.resource);O!==-1&&O!==t.index&&(t.index=O)}d="completed",p.forEach(O=>{O(j)})}function $(){if(d!=="pending")return;g();const z=a.shift();if(z===void 0){if(h.length){f=setTimeout(()=>{g(),d==="pending"&&(v(),y())},t.timeout);return}y();return}const W={status:"pending",resource:z,callback:(j,D)=>{C(W,j,D)}};h.push(W),c++,f=setTimeout($,t.rotate),n(z,e,W.callback)}return setTimeout($),I}function Wr(t){const e={...Yc,...t};let n=[];function o(){n=n.filter(a=>a().status==="pending")}function i(a,l,d){const c=Uc(e,a,l,(u,f)=>{o(),d&&d(u,f)});return n.push(c),c}function r(a){return n.find(l=>a(l))||null}return{query:i,find:r,setIndex:a=>{e.index=a},getIndex:()=>e.index,cleanup:o}}function Yr(){}var ui=Object.create(null);function Xc(t){if(!ui[t]){const e=di(t);if(!e)return;ui[t]={config:e,redundancy:Wr(e)}}return ui[t]}function qc(t,e,n){let o,i;if(typeof t=="string"){const r=ai(t);if(!r)return n(void 0,424),Yr;i=r.send;const a=Xc(t);a&&(o=a.redundancy)}else{const r=li(t);if(r){o=Wr(r);const a=ai(t.resources?t.resources[0]:"");a&&(i=a.send)}}return!o||!i?(n(void 0,424),Yr):o.query(e,i,n)().abort}function Ur(){}function Kc(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,Fc(t)}))}function Zc(t){const e=[],n=[];return t.forEach(o=>{(o.match(Ir)?e:n).push(o)}),{valid:e,invalid:n}}function gn(t,e,n){function o(){const i=t.pendingIcons;e.forEach(r=>{i&&i.delete(r),t.icons[r]||t.missing.add(r)})}if(n&&typeof n=="object")try{if(!Or(t,n).length){o();return}}catch(i){console.error(i)}o(),Kc(t)}function Xr(t,e){t instanceof Promise?t.then(n=>{e(n)}).catch(()=>{e(null)}):e(t)}function Jc(t,e){t.iconsToLoad?t.iconsToLoad=t.iconsToLoad.concat(e).sort():t.iconsToLoad=e,t.iconsQueueFlag||(t.iconsQueueFlag=!0,setTimeout(()=>{t.iconsQueueFlag=!1;const{provider:n,prefix:o}=t,i=t.iconsToLoad;if(delete t.iconsToLoad,!i||!i.length)return;const r=t.loadIcon;if(t.loadIcons&&(i.length>1||!r)){Xr(t.loadIcons(i,o,n),c=>{gn(t,i,c)});return}if(r){i.forEach(c=>{Xr(r(c,o,n),u=>{gn(t,[c],u?{prefix:o,icons:{[c]:u}}:null)})});return}const{valid:a,invalid:l}=Zc(i);if(l.length&&gn(t,l,null),!a.length)return;const d=o.match(Ir)?ai(n):null;if(!d){gn(t,a,null);return}d.prepare(n,o,a).forEach(c=>{qc(n,c,u=>{gn(t,c.icons,u)})})}))}var Qc=(t,e)=>{const n=Lc(Wc(t,!0,$r()));if(!n.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(n.loaded,n.missing,n.pending,Ur)}),()=>{l=!1}}const o=Object.create(null),i=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:c}=l;if(c===a&&d===r)return;r=d,a=c,i.push(Gt(d,c));const u=o[d]||(o[d]=Object.create(null));u[c]||(u[c]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:c,name:u}=l,f=Gt(d,c),h=f.pendingIcons||(f.pendingIcons=new Set);h.has(u)||(h.add(u),o[d][c].push(u))}),i.forEach(l=>{const d=o[l.provider][l.prefix];d.length&&Jc(l,d)}),e?jc(e,n,i):Ur};function ed(t,e){const n={...t};for(const o in e){const i=e[o],r=typeof i;o in Vr?(i===null||i&&(r==="string"||r==="number"))&&(n[o]=i):r===typeof n[o]&&(n[o]=o==="rotate"?i%4:i)}return n}var td=/[\s,]+/;function nd(t,e){e.split(td).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0;break}})}function od(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(t);return isNaN(i)?0:o(i)}else if(n!==t){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let r=parseFloat(t.slice(0,t.length-n.length));return isNaN(r)?0:(r=r/i,r%1===0?o(r):0)}}return e}function id(t,e){let n=t.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in e)n+=" "+o+'="'+e[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+t+"</svg>"}function rd(t){return t.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function sd(t){return"data:image/svg+xml,"+rd(t)}function ad(t){return'url("'+sd(t)+'")'}var qr={...Lr,inline:!1},ld={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},cd={display:"inline-block"},fi={backgroundColor:"currentColor"},Kr={backgroundColor:"transparent"},Zr={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Jr={webkitMask:fi,mask:fi,background:Kr};for(const t in Jr){const e=Jr[t];for(const n in Zr)e[t+n]=Zr[n]}var Qn={};["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";Qn[t+"-flip"]=e,Qn[t.slice(0,1)+"-flip"]=e,Qn[t+"Flip"]=e});function Qr(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}var es=(t,e)=>{const n=ed(qr,e),o={...ld},i=e.mode||"svg",r={},a=e.style,l=typeof a=="object"&&!(a instanceof Array)?a:{};for(let m in e){const w=e[m];if(w!==void 0)switch(m){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[m]=w===!0||w==="true"||w===1;break;case"flip":typeof w=="string"&&nd(n,w);break;case"color":r.color=w;break;case"rotate":typeof w=="string"?n[m]=od(w):typeof w=="number"&&(n[m]=w);break;case"ariaHidden":case"aria-hidden":w!==!0&&w!=="true"&&delete o["aria-hidden"];break;default:{const I=Qn[m];I?(w===!0||w==="true"||w===1)&&(n[I]=!0):qr[m]===void 0&&(o[m]=w)}}}const d=Nc(t,n),c=d.attributes;if(n.inline&&(r.verticalAlign="-0.125em"),i==="svg"){o.style={...r,...l},Object.assign(o,c);let m=0,w=e.id;return typeof w=="string"&&(w=w.replace(/-/g,"_")),o.innerHTML=Mc(d.body,w?()=>w+"ID"+m++:"iconifyVue"),(0,s.h)("svg",o)}const{body:u,width:f,height:h}=t,p=i==="mask"||(i==="bg"?!1:u.indexOf("currentColor")!==-1),g=id(u,{...c,width:f+"",height:h+""});return o.style={...r,"--svg":ad(g),width:Qr(c.width),height:Qr(c.height),...cd,...p?fi:Kr,...l},(0,s.h)("span",o)};if($r(!0),Bc("",Vc),typeof document<"u"&&typeof window<"u"){const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!wc(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const i=e[n];if(typeof i!="object"||!i||i.resources===void 0)continue;zc(n,i)||console.error(o)}catch{console.error(o)}}}}var dd={...fn,body:""},ts=(0,s.defineComponent)((t,{emit:e})=>{const n=(0,s.ref)(null);function o(){n.value&&(n.value.abort?.(),n.value=null)}const i=(0,s.ref)(!!t.ssr),r=(0,s.ref)(""),a=(0,s.shallowRef)(null);function l(){const c=t.icon;if(typeof c=="object"&&c!==null&&typeof c.body=="string")return r.value="",{data:c};let u;if(typeof c!="string"||(u=qn(c,!1,!0))===null)return null;let f=Rr(u);if(!f){const g=n.value;return(!g||g.name!==c)&&(f===null?n.value={name:c}:n.value={name:c,abort:Qc([u],d)}),null}o(),r.value!==c&&(r.value=c,(0,s.nextTick)(()=>{e("load",c)}));const h=t.customise;if(h){f=Object.assign({},f);const g=h(f.body,u.name,u.prefix,u.provider);typeof g=="string"&&(f.body=g)}const p=["iconify"];return u.prefix!==""&&p.push("iconify--"+u.prefix),u.provider!==""&&p.push("iconify--"+u.provider),{data:f,classes:p}}function d(){const c=l();c?c.data!==a.value?.data&&(a.value=c):a.value=null}return i.value?d():(0,s.onMounted)(()=>{i.value=!0,d()}),(0,s.watch)(()=>t.icon,d),(0,s.onUnmounted)(o),()=>{const c=a.value;if(!c)return es(dd,t);let u=t;return c.classes&&(u={...t,class:c.classes.join(" ")}),es({...fn,...c.data},u)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]}),ud=(0,s.defineComponent)({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(t){const e=t,n=(0,s.computed)(()=>{const i=e.icon;if(i.indexOf(":")===-1)return Hr(`jcode:${e.icon}`)==null,`jcode:${e.icon}`;const r=`jcode:${i.split(":")[1]}`;return Hr(r)!=null?r:i}),o=(0,s.computed)(()=>({size:e.size,color:e.color,icon:n.value}));return(i,r)=>t.isDiv?((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({key:0},i.$attrs,{class:"j-icon jicon",style:{height:`${t.size}px`}}),[(0,s.createVNode)((0,s.unref)(ts),(0,s.mergeProps)(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16)):((0,s.openBlock)(),(0,s.createElementBlock)("span",(0,s.mergeProps)({key:1},i.$attrs,{class:"jicon"}),[(0,s.createVNode)((0,s.unref)(ts),(0,s.mergeProps)(o.value,{height:`${t.size}px`,width:`${t.size}px`,mode:"svg",style:`transform:rotate(${t.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),mn=ud,fd=["disabled"],hd={key:2},pd=(0,s.defineComponent)({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=h=>{!u.value&&!o.disabled&&(i("click",h),o.href&&window.open(o.href,o.target?o.target:"_self"))},a=(0,s.shallowRef)(null),l=()=>{a.value?.focus()},d=()=>{a.value?.blur()},c=(0,s.computed)(()=>o.notLabel||!o.label),u=(0,s.ref)(!1);(0,s.watch)(()=>o.loading,h=>{if(typeof h=="boolean")u.value=h;else if(Xn(h?.delay))u.value=!1;else{const p=setTimeout(()=>{u.value=!0},h.delay);return()=>clearTimeout(p)}},{immediate:!0});const f=(0,s.computed)(()=>o.label||"");return e({focus:l,blur:d}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("button",{ref_key:"buttonNodeRef",ref:a,type:"button",class:(0,s.normalizeClass)(["j-button",{"j-button-primary":t.type=="primary","j-button-default":t.type=="default","j-button-dashed":t.type=="dashed","j-button-link":t.type=="link","j-button-text":t.type=="text","j-button-ghost":t.ghost==!0,"j-button-danger":t.danger==!0,"j-button-lg":t.size=="large","j-button-sm":t.size=="small","j-button-circle":t.shape=="circle","j-button-round":t.shape=="round","j-button-block":t.block==!0,"j-button-loading":u.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":t.compact==!0,"j-button-last-compact-item":t.lastCompactItem==!0,"j-button-first-compact-item":t.firstCompactItem==!0}]),disabled:t.disabled,onClick:(0,s.withModifiers)(r,["stop"])},[u.value?((0,s.openBlock)(),(0,s.createBlock)(mn,{key:0,icon:"mdi:loading",size:t.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):(0,s.createCommentVNode)("",!0),t.icon?((0,s.openBlock)(),(0,s.createBlock)(mn,{key:1,icon:t.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),t.notLabel?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",hd,(0,s.toDisplayString)(f.value),1)),(0,s.renderSlot)(h.$slots,"iconAfter")],10,fd))}}),gd=pd,jt=fc(gd),md={class:"d-drag-btns-pname"},vd={key:0,class:"d-drag-mask"},yd=(0,s.defineComponent)({name:"DDrag",__name:"drag",props:{componentData:{default:()=>({})},isContainer:{type:Boolean,default:!1}},setup(t){const e=t,n=(0,s.ref)(),{onMouseenter:o,onMouseleave:i,activeComponent:r,handleComponentClick:a,deleteComponentByClick:l,copyComponent:d,getParentComponents:c,isHover:u,isSelect:f,isTopActive:h,isBottomActive:p,isBottomToolBar:g}=Dr(n,e.componentData,"component"),{onContextmenu:m,onMousedown:w,moveActive:I}=Tr(e.componentData,!1);return(y,v)=>{const C=(0,s.resolveComponent)("el-space");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["d-drag-component",{selected:(0,s.unref)(f),hovered:(0,s.unref)(u),isBottomToolBar:(0,s.unref)(g),active:(0,s.unref)(I),isTopActive:(0,s.unref)(h),isBottomActive:(0,s.unref)(p)}])},[v[11]||(v[11]=(0,s.createElementVNode)("div",{class:"d-drag-line"},null,-1)),(0,s.createElementVNode)("div",{class:"d-drag-btns",onMouseenter:v[4]||(v[4]=(...$)=>(0,s.unref)(o)&&(0,s.unref)(o)(...$)),onMouseleave:v[5]||(v[5]=(...$)=>(0,s.unref)(i)&&(0,s.unref)(i)(...$))},[(0,s.createVNode)(C,{size:4},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,s.withModifiers)(()=>{},["stop"])},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"]),(0,s.createElementVNode)("div",md,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(c)(t.componentData.containerId),$=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:$.id},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:$.name,onClick:z=>(0,s.unref)(a)($.id)},null,8,["label","onClick"])]))),128))])]),(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:content-copy",onClick:v[0]||(v[0]=(0,s.withModifiers)($=>(0,s.unref)(d)(t.componentData.id),["stop"]))}),(0,s.createElementVNode)("div",{onContextmenu:v[1]||(v[1]=(0,s.withModifiers)((...$)=>(0,s.unref)(m)&&(0,s.unref)(m)(...$),["stop"])),onMousedown:v[2]||(v[2]=(0,s.withModifiers)((...$)=>(0,s.unref)(w)&&(0,s.unref)(w)(...$),["stop"])),style:{display:"flex"}},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",icon:"mdi:drag"})],32),(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",danger:"",type:"primary",size:"small",icon:"mdi:delete",onClick:v[3]||(v[3]=(0,s.withModifiers)($=>(0,s.unref)(l)(t.componentData.id),["stop"]))})]),_:1})],32),(0,s.createElementVNode)("div",{ref_key:"refDrag",ref:n,class:"d-drag-body",onClick:v[6]||(v[6]=(0,s.withModifiers)((...$)=>(0,s.unref)(r)&&(0,s.unref)(r)(...$),["stop"])),onContextmenu:v[7]||(v[7]=(0,s.withModifiers)((...$)=>(0,s.unref)(m)&&(0,s.unref)(m)(...$),["stop"])),onMousedown:v[8]||(v[8]=(0,s.withModifiers)((...$)=>(0,s.unref)(w)&&(0,s.unref)(w)(...$),["stop"])),onMouseenter:v[9]||(v[9]=(...$)=>(0,s.unref)(o)&&(0,s.unref)(o)(...$)),onMouseleave:v[10]||(v[10]=(...$)=>(0,s.unref)(i)&&(0,s.unref)(i)(...$))},[(0,s.renderSlot)(y.$slots,"default"),t.isContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",vd))],544)],2)}}}),hi=yd,_d=(0,s.defineComponent)({name:"DDragTool",__name:"tool",props:{config:{}},setup(t){const{onContextmenu:e,onMousedown:n,onClick:o}=Tr(t.config??{name:"",id:""},!0);return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-drag-tool",onClick:r[0]||(r[0]=(0,s.withModifiers)((...a)=>(0,s.unref)(o)&&(0,s.unref)(o)(...a),["stop"])),onContextmenu:r[1]||(r[1]=(0,s.withModifiers)((...a)=>(0,s.unref)(e)&&(0,s.unref)(e)(...a),["stop"])),onMousedown:r[2]||(r[2]=(0,s.withModifiers)((...a)=>(0,s.unref)(n)&&(0,s.unref)(n)(...a),["stop"]))},[(0,s.renderSlot)(i.$slots,"default")],32))}}),pi=_d,wd={key:0,class:"d-drag-line"},bd={key:1,class:"d-drag-btns"},Cd=(0,s.defineComponent)({name:"DDragContainer",__name:"container",props:{componentData:{default:()=>({})},isComponentContainer:{type:Boolean,default:!0},groupId:{default:void 0}},setup(t){const e=t,n=(0,s.ref)(),o=(0,s.computed)(()=>e.componentData?.children||[]),{onMouseenter:i,onMouseleave:r,activeComponent:a,isHover:l,isSelect:d,isToContainer:c,isMoveingInTopLevel:u,isTopActive:f,isBottomActive:h}=Dr(n,e.componentData,"container",o,e.isComponentContainer,e.groupId),p=(0,s.computed)(()=>!!(o.value.findIndex(g=>g.groupId===e.groupId)===-1&&c.value));return(g,m)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"refDrag",ref:n,class:(0,s.normalizeClass)(["d-drag-container",{selected:(0,s.unref)(d)&&!t.isComponentContainer,hovered:(0,s.unref)(l)&&!t.isComponentContainer,isTopLevel:t.componentData.level===0,active:p.value,isMoveingInTopLevel:(0,s.unref)(u),isTopActive:(0,s.unref)(f),isBottomActive:(0,s.unref)(h)}])},[t.isComponentContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",wd)),t.isComponentContainer?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",bd,[(0,s.createElementVNode)("div",{class:"d-drag-btns-names",onClick:(0,s.withModifiers)(()=>{},["stop"])},[(0,s.createVNode)((0,s.unref)(jt),{class:"d-drag-btn",type:"primary",size:"small",label:t.componentData.name},null,8,["label"])])])),(0,s.createElementVNode)("div",{class:"d-drag-body",onClick:m[0]||(m[0]=(0,s.withModifiers)((...w)=>(0,s.unref)(a)&&(0,s.unref)(a)(...w),["stop"])),onMouseenter:m[1]||(m[1]=(...w)=>(0,s.unref)(i)&&(0,s.unref)(i)(...w)),onMouseleave:m[2]||(m[2]=(...w)=>(0,s.unref)(r)&&(0,s.unref)(r)(...w))},[(0,s.renderSlot)(g.$slots,"default")],32)],2))}}),gi=Cd,Ed=(0,s.defineComponent)({name:"DDragFormList",__name:"dragFormList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,s.inject)("dui-design-provide",{});return(n,o)=>{const i=(0,s.resolveComponent)("el-col");return(0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.componentList,r=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:r.id},[r.type!="pkey"?((0,s.openBlock)(),(0,s.createBlock)(i,{key:0,span:r.config.span||24},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(hi,{"is-container":r.dragType!=="component","component-data":r},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["is-container","component-data"])]),_:2},1032,["span"])):(0,s.createCommentVNode)("",!0)],64))),128)}}}),mi=Ed,xd=(0,s.defineComponent)({name:"DDragIndexList",__name:"dragIndexList",props:{componentList:{default:()=>[]},globalConfig:{default:()=>({})}},setup(t){const{designItemName:e}=(0,s.inject)("dui-design-provide",{}),n=o=>{if(o.flexWidth)return{width:o.flexWidth+"%"}};return(o,i)=>((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.componentList,r=>((0,s.openBlock)(),(0,s.createBlock)(hi,{key:r.id,style:(0,s.normalizeStyle)(n(r.config)),"is-container":r.dragType!=="component","component-data":r},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(e)),{"component-data":r,"global-config":t.globalConfig},null,8,["component-data","global-config"]))]),_:2},1032,["style","is-container","component-data"]))),128))}}),vi=xd,ns=Mt(hi,[pi,gi,mi,vi]);function vn(t){return(0,s.getCurrentScope)()?((0,s.onScopeDispose)(t),!0):!1}function ut(t){return typeof t=="function"?t():(0,s.unref)(t)}var Sd=typeof window<"u"&&typeof document<"u",kd=t=>typeof t<"u",Nd=Object.prototype.toString,Dd=t=>Nd.call(t)==="[object Object]",Td=()=>{};function Id(t,e){function n(...o){return new Promise((i,r)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(i).catch(r)})}return n}var os=t=>t();function Md(t=os){const e=(0,s.ref)(!0);function n(){e.value=!1}function o(){e.value=!0}const i=(...r)=>{e.value&&t(...r)};return{isActive:(0,s.readonly)(e),pause:n,resume:o,eventFilter:i}}function is(t,e=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(e?()=>i(n):o,t)})}function Bd(t,e,n={}){const{eventFilter:o=os,...i}=n;return(0,s.watch)(t,Id(o,e),i)}function Wt(t,e,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:a,resume:l,isActive:d}=Md(o);return{stop:Bd(t,e,{...i,eventFilter:r}),pause:a,resume:l,isActive:d}}function zd(t,e={}){if(!(0,s.isRef)(t))return(0,s.toRefs)(t);const n=Array.isArray(t.value)?Array.from({length:t.value.length}):{};for(const o in t.value)n[o]=(0,s.customRef)(()=>({get(){return t.value[o]},set(i){var r;if((r=ut(e.replaceRef))==null||r)if(Array.isArray(t.value)){const a=[...t.value];a[o]=i,t.value=a}else{const a={...t.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(t.value)),t.value=a}else t.value[o]=i}}));return n}function yi(t,e=!1){function n(f,{flush:h="sync",deep:p=!1,timeout:g,throwOnTimeout:m}={}){let w=null;const I=[new Promise(y=>{w=(0,s.watch)(t,v=>{f(v)!==e&&(w?.(),y(v))},{flush:h,deep:p,immediate:!0})})];return g!=null&&I.push(is(g,m).then(()=>ut(t)).finally(()=>w?.())),Promise.race(I)}function o(f,h){if(!(0,s.isRef)(f))return n(v=>v===f,h);const{flush:p="sync",deep:g=!1,timeout:m,throwOnTimeout:w}=h??{};let I=null;const y=[new Promise(v=>{I=(0,s.watch)([t,f],([C,$])=>{e!==(C===$)&&(I?.(),v(C))},{flush:p,deep:g,immediate:!0})})];return m!=null&&y.push(is(m,w).then(()=>ut(t)).finally(()=>(I?.(),ut(t)))),Promise.race(y)}function i(f){return n(h=>!!h,f)}function r(f){return o(null,f)}function a(f){return o(void 0,f)}function l(f){return n(Number.isNaN,f)}function d(f,h){return n(p=>{const g=Array.from(p);return g.includes(f)||g.includes(ut(f))},h)}function c(f){return u(1,f)}function u(f=1,h){let p=-1;return n(()=>(p+=1,p>=f),h)}return Array.isArray(ut(t))?{toMatch:n,toContains:d,changed:c,changedTimes:u,get not(){return yi(t,!e)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:l,toBeUndefined:a,changed:c,changedTimes:u,get not(){return yi(t,!e)}}}function _i(t){return yi(t)}function Ad(t){var e;const n=ut(t);return(e=n?.$el)!=null?e:n}var rs=Sd?window:void 0;function ss(...t){let e,n,o,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,i]=t,e=rs):[e,n,o,i]=t,!e)return Td;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(u=>u()),r.length=0},l=(u,f,h,p)=>(u.addEventListener(f,h,p),()=>u.removeEventListener(f,h,p)),d=(0,s.watch)(()=>[Ad(e),ut(i)],([u,f])=>{if(a(),!u)return;const h=Dd(f)?{...f}:f;r.push(...n.flatMap(p=>o.map(g=>l(u,p,g,h))))},{immediate:!0,flush:"post"}),c=()=>{d(),a()};return vn(c),c}function Pd(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function as(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=rs,eventName:r="keydown",passive:a=!1,dedupe:l=!1}=o,d=Pd(e);return ss(i,r,u=>{u.repeat&&ut(l)||d(u)&&n(u)},a)}function Od(t){return JSON.parse(JSON.stringify(t))}function wi(t,e,n,o={}){var i,r,a;const{clone:l=!1,passive:d=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:h}=o,p=(0,s.getCurrentInstance)(),g=n||p?.emit||((i=p?.$emit)==null?void 0:i.bind(p))||((a=(r=p?.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p?.proxy));let m=c;e||(e="modelValue"),m=m||`update:${e.toString()}`;const w=v=>l?typeof l=="function"?l(v):Od(v):v,I=()=>kd(t[e])?w(t[e]):f,y=v=>{h?h(v)&&g(m,v):g(m,v)};if(d){const v=(0,s.ref)(I());let C=!1;return(0,s.watch)(()=>t[e],$=>{C||(C=!0,v.value=w($),(0,s.nextTick)(()=>C=!1))}),(0,s.watch)(v,$=>{!C&&($!==t[e]||u)&&y($)},{deep:u}),v}else return(0,s.computed)({get(){return I()},set(v){y(v)}})}var $d={value:()=>{}};function eo(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new to(n)}function to(t){this._=t}function Rd(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}to.prototype=eo.prototype={constructor:to,on:function(t,e){var n=this._,o=Rd(t+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(t=o[r]).type)&&(i=Hd(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++r<a;)if(i=(t=o[r]).type)n[i]=ls(n[i],t.name,e);else if(e==null)for(i in n)n[i]=ls(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new to(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)}};function Hd(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}function ls(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=$d,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var bi="http://www.w3.org/1999/xhtml",cs={svg:"http://www.w3.org/2000/svg",xhtml:bi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function no(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),cs.hasOwnProperty(e)?{space:cs[e],local:t}:t}function Vd(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===bi&&e.documentElement.namespaceURI===bi?e.createElement(t):e.createElementNS(n,t)}}function Ld(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ds(t){var e=no(t);return(e.local?Ld:Vd)(e)}function Fd(){}function Ci(t){return t==null?Fd:function(){return this.querySelector(t)}}function Gd(t){typeof t!="function"&&(t=Ci(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=new Array(a),d,c,u=0;u<a;++u)(d=r[u])&&(c=t.call(d,d.__data__,u,r))&&("__data__"in d&&(c.__data__=d.__data__),l[u]=c);return new Fe(o,this._parents)}function jd(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Wd(){return[]}function us(t){return t==null?Wd:function(){return this.querySelectorAll(t)}}function Yd(t){return function(){return jd(t.apply(this,arguments))}}function Ud(t){typeof t=="function"?t=Yd(t):t=us(t);for(var e=this._groups,n=e.length,o=[],i=[],r=0;r<n;++r)for(var a=e[r],l=a.length,d,c=0;c<l;++c)(d=a[c])&&(o.push(t.call(d,d.__data__,c,a)),i.push(d));return new Fe(o,i)}function fs(t){return function(){return this.matches(t)}}function hs(t){return function(e){return e.matches(t)}}var Xd=Array.prototype.find;function qd(t){return function(){return Xd.call(this.children,t)}}function Kd(){return this.firstElementChild}function Zd(t){return this.select(t==null?Kd:qd(typeof t=="function"?t:hs(t)))}var Jd=Array.prototype.filter;function Qd(){return Array.from(this.children)}function eu(t){return function(){return Jd.call(this.children,t)}}function tu(t){return this.selectAll(t==null?Qd:eu(typeof t=="function"?t:hs(t)))}function nu(t){typeof t!="function"&&(t=fs(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],d,c=0;c<a;++c)(d=r[c])&&t.call(d,d.__data__,c,r)&&l.push(d);return new Fe(o,this._parents)}function ps(t){return new Array(t.length)}function ou(){return new Fe(this._enter||this._groups.map(ps),this._parents)}function oo(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}oo.prototype={constructor:oo,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function iu(t){return function(){return t}}function ru(t,e,n,o,i,r){for(var a=0,l,d=e.length,c=r.length;a<c;++a)(l=e[a])?(l.__data__=r[a],o[a]=l):n[a]=new oo(t,r[a]);for(;a<d;++a)(l=e[a])&&(i[a]=l)}function su(t,e,n,o,i,r,a){var l,d,c=new Map,u=e.length,f=r.length,h=new Array(u),p;for(l=0;l<u;++l)(d=e[l])&&(h[l]=p=a.call(d,d.__data__,l,e)+"",c.has(p)?i[l]=d:c.set(p,d));for(l=0;l<f;++l)p=a.call(t,r[l],l,r)+"",(d=c.get(p))?(o[l]=d,d.__data__=r[l],c.delete(p)):n[l]=new oo(t,r[l]);for(l=0;l<u;++l)(d=e[l])&&c.get(h[l])===d&&(i[l]=d)}function au(t){return t.__data__}function lu(t,e){if(!arguments.length)return Array.from(this,au);var n=e?su:ru,o=this._parents,i=this._groups;typeof t!="function"&&(t=iu(t));for(var r=i.length,a=new Array(r),l=new Array(r),d=new Array(r),c=0;c<r;++c){var u=o[c],f=i[c],h=f.length,p=cu(t.call(u,u&&u.__data__,c,o)),g=p.length,m=l[c]=new Array(g),w=a[c]=new Array(g);n(u,f,m,w,d[c]=new Array(h),p,e);for(var I=0,y=0,v,C;I<g;++I)if(v=m[I]){for(I>=y&&(y=I+1);!(C=w[y])&&++y<g;);v._next=C||null}}return a=new Fe(a,o),a._enter=l,a._exit=d,a}function cu(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function du(){return new Fe(this._exit||this._groups.map(ps),this._parents)}function uu(t,e,n){var o=this.enter(),i=this,r=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function fu(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,r=o.length,a=Math.min(i,r),l=new Array(i),d=0;d<a;++d)for(var c=n[d],u=o[d],f=c.length,h=l[d]=new Array(f),p,g=0;g<f;++g)(p=c[g]||u[g])&&(h[g]=p);for(;d<i;++d)l[d]=n[d];return new Fe(l,this._parents)}function hu(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function pu(t){t||(t=gu);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],l=a.length,d=i[r]=new Array(l),c,u=0;u<l;++u)(c=a[u])&&(d[u]=c);d.sort(e)}return new Fe(i,this._parents).order()}function gu(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function mu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vu(){return Array.from(this)}function yu(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function _u(){let t=0;for(const e of this)++t;return t}function wu(){return!this.node()}function bu(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],r=0,a=i.length,l;r<a;++r)(l=i[r])&&t.call(l,l.__data__,r,i);return this}function Cu(t){return function(){this.removeAttribute(t)}}function Eu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xu(t,e){return function(){this.setAttribute(t,e)}}function Su(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ku(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Nu(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Du(t,e){var n=no(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?Eu:Cu:typeof e=="function"?n.local?Nu:ku:n.local?Su:xu)(n,e))}function gs(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Tu(t){return function(){this.style.removeProperty(t)}}function Iu(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Mu(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function Bu(t,e,n){return arguments.length>1?this.each((e==null?Tu:typeof e=="function"?Mu:Iu)(t,e,n??"")):Yt(this.node(),t)}function Yt(t,e){return t.style.getPropertyValue(e)||gs(t).getComputedStyle(t,null).getPropertyValue(e)}function zu(t){return function(){delete this[t]}}function Au(t,e){return function(){this[t]=e}}function Pu(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ou(t,e){return arguments.length>1?this.each((e==null?zu:typeof e=="function"?Pu:Au)(t,e)):this.node()[t]}function ms(t){return t.trim().split(/^|\s+/)}function Ei(t){return t.classList||new vs(t)}function vs(t){this._node=t,this._names=ms(t.getAttribute("class")||"")}vs.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ys(t,e){for(var n=Ei(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function _s(t,e){for(var n=Ei(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function $u(t){return function(){ys(this,t)}}function Ru(t){return function(){_s(this,t)}}function Hu(t,e){return function(){(e.apply(this,arguments)?ys:_s)(this,t)}}function Vu(t,e){var n=ms(t+"");if(arguments.length<2){for(var o=Ei(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Hu:e?$u:Ru)(n,e))}function Lu(){this.textContent=""}function Fu(t){return function(){this.textContent=t}}function Gu(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ju(t){return arguments.length?this.each(t==null?Lu:(typeof t=="function"?Gu:Fu)(t)):this.node().textContent}function Wu(){this.innerHTML=""}function Yu(t){return function(){this.innerHTML=t}}function Uu(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Xu(t){return arguments.length?this.each(t==null?Wu:(typeof t=="function"?Uu:Yu)(t)):this.node().innerHTML}function qu(){this.nextSibling&&this.parentNode.appendChild(this)}function Ku(){return this.each(qu)}function Zu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ju(){return this.each(Zu)}function Qu(t){var e=typeof t=="function"?t:ds(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function ef(){return null}function tf(t,e){var n=typeof t=="function"?t:ds(t),o=e==null?ef:typeof e=="function"?e:Ci(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function nf(){var t=this.parentNode;t&&t.removeChild(this)}function of(){return this.each(nf)}function rf(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function sf(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function af(t){return this.select(t?sf:rf)}function lf(t){return arguments.length?this.property("__data__",t):this.node().__data__}function cf(t){return function(e){t.call(this,e,this.__data__)}}function df(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function uf(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,r;n<i;++n)r=e[n],(!t.type||r.type===t.type)&&r.name===t.name?this.removeEventListener(r.type,r.listener,r.options):e[++o]=r;++o?e.length=o:delete this.__on}}}function ff(t,e,n){return function(){var o=this.__on,i,r=cf(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=e;return}}this.addEventListener(t.type,r,n),i={type:t.type,name:t.name,value:e,listener:r,options:n},o?o.push(i):this.__on=[i]}}function hf(t,e,n){var o=df(t+""),i,r=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var d=0,c=l.length,u;d<c;++d)for(i=0,u=l[d];i<r;++i)if((a=o[i]).type===u.type&&a.name===u.name)return u.value}return}for(l=e?ff:uf,i=0;i<r;++i)this.each(l(o[i],e,n));return this}function ws(t,e,n){var o=gs(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function pf(t,e){return function(){return ws(this,t,e)}}function gf(t,e){return function(){return ws(this,t,e.apply(this,arguments))}}function mf(t,e){return this.each((typeof e=="function"?gf:pf)(t,e))}function*vf(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var bs=[null];function Fe(t,e){this._groups=t,this._parents=e}function yn(){return new Fe([[document.documentElement]],bs)}function yf(){return this}Fe.prototype=yn.prototype={constructor:Fe,select:Gd,selectAll:Ud,selectChild:Zd,selectChildren:tu,filter:nu,data:lu,enter:ou,exit:du,join:uu,merge:fu,selection:yf,order:hu,sort:pu,call:mu,nodes:vu,node:yu,size:_u,empty:wu,each:bu,attr:Du,style:Bu,property:Ou,classed:Vu,text:ju,html:Xu,raise:Ku,lower:Ju,append:Qu,insert:tf,remove:of,clone:af,datum:lf,on:hf,dispatch:mf,[Symbol.iterator]:vf};function Ze(t){return typeof t=="string"?new Fe([[document.querySelector(t)]],[document.documentElement]):new Fe([[t]],bs)}function _f(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ot(t,e){if(t=_f(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var wf={passive:!1},_n={capture:!0,passive:!1};function xi(t){t.stopImmediatePropagation()}function Ut(t){t.preventDefault(),t.stopImmediatePropagation()}function Cs(t){var e=t.document.documentElement,n=Ze(t).on("dragstart.drag",Ut,_n);"onselectstart"in e?n.on("selectstart.drag",Ut,_n):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Es(t,e){var n=t.document.documentElement,o=Ze(t).on("dragstart.drag",null);e&&(o.on("click.drag",Ut,_n),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var io=t=>()=>t;function Si(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:r,x:a,y:l,dx:d,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Si.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function bf(t){return!t.ctrlKey&&!t.button}function Cf(){return this.parentNode}function Ef(t,e){return e??{x:t.x,y:t.y}}function xf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sf(){var t=bf,e=Cf,n=Ef,o=xf,i={},r=eo("start","drag","end"),a=0,l,d,c,u,f=0;function h(C){C.on("mousedown.drag",p).filter(o).on("touchstart.drag",w).on("touchmove.drag",I,wf).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(C,$){if(!(u||!t.call(this,C,$))){var z=v(this,e.call(this,C,$),C,$,"mouse");z&&(Ze(C.view).on("mousemove.drag",g,_n).on("mouseup.drag",m,_n),Cs(C.view),xi(C),c=!1,l=C.clientX,d=C.clientY,z("start",C))}}function g(C){if(Ut(C),!c){var $=C.clientX-l,z=C.clientY-d;c=$*$+z*z>f}i.mouse("drag",C)}function m(C){Ze(C.view).on("mousemove.drag mouseup.drag",null),Es(C.view,c),Ut(C),i.mouse("end",C)}function w(C,$){if(t.call(this,C,$)){var z=C.changedTouches,W=e.call(this,C,$),j=z.length,D,O;for(D=0;D<j;++D)(O=v(this,W,C,$,z[D].identifier,z[D]))&&(xi(C),O("start",C,z[D]))}}function I(C){var $=C.changedTouches,z=$.length,W,j;for(W=0;W<z;++W)(j=i[$[W].identifier])&&(Ut(C),j("drag",C,$[W]))}function y(C){var $=C.changedTouches,z=$.length,W,j;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),W=0;W<z;++W)(j=i[$[W].identifier])&&(xi(C),j("end",C,$[W]))}function v(C,$,z,W,j,D){var O=r.copy(),H=ot(D||z,$),S,Y,b;if((b=n.call(C,new Si("beforestart",{sourceEvent:z,target:h,identifier:j,active:a,x:H[0],y:H[1],dx:0,dy:0,dispatch:O}),W))!=null)return S=b.x-H[0]||0,Y=b.y-H[1]||0,function B(_,x,T){var P=H,L;switch(_){case"start":i[j]=B,L=a++;break;case"end":delete i[j],--a;case"drag":H=ot(T||x,$),L=a;break}O.call(_,C,new Si(_,{sourceEvent:x,subject:b,target:h,identifier:j,active:L,x:H[0]+S,y:H[1]+Y,dx:H[0]-P[0],dy:H[1]-P[1],dispatch:O}),W)}}return h.filter=function(C){return arguments.length?(t=typeof C=="function"?C:io(!!C),h):t},h.container=function(C){return arguments.length?(e=typeof C=="function"?C:io(C),h):e},h.subject=function(C){return arguments.length?(n=typeof C=="function"?C:io(C),h):n},h.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:io(!!C),h):o},h.on=function(){var C=r.on.apply(r,arguments);return C===r?h:C},h.clickDistance=function(C){return arguments.length?(f=(C=+C)*C,h):Math.sqrt(f)},h}function ki(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function xs(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function wn(){}var bn=.7,ro=1/bn,Xt="\\s*([+-]?\\d+)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",it="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kf=/^#([0-9a-f]{3,8})$/,Nf=new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`),Df=new RegExp(`^rgb\\(${it},${it},${it}\\)$`),Tf=new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${Cn}\\)$`),If=new RegExp(`^rgba\\(${it},${it},${it},${Cn}\\)$`),Mf=new RegExp(`^hsl\\(${Cn},${it},${it}\\)$`),Bf=new RegExp(`^hsla\\(${Cn},${it},${it},${Cn}\\)$`),Ss={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ki(wn,Bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ks,formatHex:ks,formatHex8:zf,formatHsl:Af,formatRgb:Ns,toString:Ns});function ks(){return this.rgb().formatHex()}function zf(){return this.rgb().formatHex8()}function Af(){return Bs(this).formatHsl()}function Ns(){return this.rgb().formatRgb()}function Bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=kf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ds(e):n===3?new Re(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?so(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?so(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Nf.exec(t))?new Re(e[1],e[2],e[3],1):(e=Df.exec(t))?new Re(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Tf.exec(t))?so(e[1],e[2],e[3],e[4]):(e=If.exec(t))?so(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Mf.exec(t))?Ms(e[1],e[2]/100,e[3]/100,1):(e=Bf.exec(t))?Ms(e[1],e[2]/100,e[3]/100,e[4]):Ss.hasOwnProperty(t)?Ds(Ss[t]):t==="transparent"?new Re(NaN,NaN,NaN,0):null}function Ds(t){return new Re(t>>16&255,t>>8&255,t&255,1)}function so(t,e,n,o){return o<=0&&(t=e=n=NaN),new Re(t,e,n,o)}function Pf(t){return t instanceof wn||(t=Bt(t)),t?(t=t.rgb(),new Re(t.r,t.g,t.b,t.opacity)):new Re}function Ni(t,e,n,o){return arguments.length===1?Pf(t):new Re(t,e,n,o??1)}function Re(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}ki(Re,Ni,xs(wn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bn:Math.pow(bn,t),new Re(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Re(zt(this.r),zt(this.g),zt(this.b),ao(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ts,formatHex:Ts,formatHex8:Of,formatRgb:Is,toString:Is}));function Ts(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function Of(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function Is(){const t=ao(this.opacity);return`${t===1?"rgb(":"rgba("}${zt(this.r)}, ${zt(this.g)}, ${zt(this.b)}${t===1?")":`, ${t})`}`}function ao(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function At(t){return t=zt(t),(t<16?"0":"")+t.toString(16)}function Ms(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Je(t,e,n,o)}function Bs(t){if(t instanceof Je)return new Je(t.h,t.s,t.l,t.opacity);if(t instanceof wn||(t=Bt(t)),!t)return new Je;if(t instanceof Je)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),r=Math.max(e,n,o),a=NaN,l=r-i,d=(r+i)/2;return l?(e===r?a=(n-o)/l+(n<o)*6:n===r?a=(o-e)/l+2:a=(e-n)/l+4,l/=d<.5?r+i:2-r-i,a*=60):l=d>0&&d<1?0:a,new Je(a,l,d,t.opacity)}function $f(t,e,n,o){return arguments.length===1?Bs(t):new Je(t,e,n,o??1)}function Je(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}ki(Je,$f,xs(wn,{brighter(t){return t=t==null?ro:Math.pow(ro,t),new Je(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bn:Math.pow(bn,t),new Je(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,i=2*n-o;return new Re(Di(t>=240?t-240:t+120,i,o),Di(t,i,o),Di(t<120?t+240:t-120,i,o),this.opacity)},clamp(){return new Je(zs(this.h),lo(this.s),lo(this.l),ao(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ao(this.opacity);return`${t===1?"hsl(":"hsla("}${zs(this.h)}, ${lo(this.s)*100}%, ${lo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zs(t){return t=(t||0)%360,t<0?t+360:t}function lo(t){return Math.max(0,Math.min(1,t||0))}function Di(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Ti=t=>()=>t;function Rf(t,e){return function(n){return t+n*e}}function Hf(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Vf(t){return(t=+t)==1?As:function(e,n){return n-e?Hf(e,n,t):Ti(isNaN(e)?n:e)}}function As(t,e){var n=e-t;return n?Rf(t,n):Ti(isNaN(t)?e:t)}var co=(function t(e){var n=Vf(e);function o(i,r){var a=n((i=Ni(i)).r,(r=Ni(r)).r),l=n(i.g,r.g),d=n(i.b,r.b),c=As(i.opacity,r.opacity);return function(u){return i.r=a(u),i.g=l(u),i.b=d(u),i.opacity=c(u),i+""}}return o.gamma=t,o})(1);function Lf(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=t[i]*(1-r)+e[i]*r;return o}}function Ff(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gf(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,i=new Array(o),r=new Array(n),a;for(a=0;a<o;++a)i[a]=En(t[a],e[a]);for(;a<n;++a)r[a]=e[a];return function(l){for(a=0;a<o;++a)r[a]=i[a](l);return r}}function jf(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function rt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Wf(t,e){var n={},o={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=En(t[i],e[i]):o[i]=e[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(Ii.source,"g");function Yf(t){return function(){return t}}function Uf(t){return function(e){return t(e)+""}}function Ps(t,e){var n=Ii.lastIndex=Mi.lastIndex=0,o,i,r,a=-1,l=[],d=[];for(t=t+"",e=e+"";(o=Ii.exec(t))&&(i=Mi.exec(e));)(r=i.index)>n&&(r=e.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(o=o[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,d.push({i:a,x:rt(o,i)})),n=Mi.lastIndex;return n<e.length&&(r=e.slice(n),l[a]?l[a]+=r:l[++a]=r),l.length<2?d[0]?Uf(d[0].x):Yf(e):(e=d.length,function(c){for(var u=0,f;u<e;++u)l[(f=d[u]).i]=f.x(c);return l.join("")})}function En(t,e){var n=typeof e,o;return e==null||n==="boolean"?Ti(e):(n==="number"?rt:n==="string"?(o=Bt(e))?(e=o,co):Ps:e instanceof Bt?co:e instanceof Date?jf:Ff(e)?Lf:Array.isArray(e)?Gf:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Wf:rt)(t,e)}var Os=180/Math.PI,Bi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $s(t,e,n,o,i,r){var a,l,d;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(d=t*n+e*o)&&(n-=t*d,o-=e*d),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,d/=l),t*o<e*n&&(t=-t,e=-e,d=-d,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(e,t)*Os,skewX:Math.atan(d)*Os,scaleX:a,scaleY:l}}var uo;function Xf(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Bi:$s(e.a,e.b,e.c,e.d,e.e,e.f)}function qf(t){return t==null||(uo||(uo=document.createElementNS("http://www.w3.org/2000/svg","g")),uo.setAttribute("transform",t),!(t=uo.transform.baseVal.consolidate()))?Bi:(t=t.matrix,$s(t.a,t.b,t.c,t.d,t.e,t.f))}function Rs(t,e,n,o){function i(c){return c.length?c.pop()+" ":""}function r(c,u,f,h,p,g){if(c!==f||u!==h){var m=p.push("translate(",null,e,null,n);g.push({i:m-4,x:rt(c,f)},{i:m-2,x:rt(u,h)})}else(f||h)&&p.push("translate("+f+e+h+n)}function a(c,u,f,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:rt(c,u)})):u&&f.push(i(f)+"rotate("+u+o)}function l(c,u,f,h){c!==u?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:rt(c,u)}):u&&f.push(i(f)+"skewX("+u+o)}function d(c,u,f,h,p,g){if(c!==f||u!==h){var m=p.push(i(p)+"scale(",null,",",null,")");g.push({i:m-4,x:rt(c,f)},{i:m-2,x:rt(u,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,u){var f=[],h=[];return c=t(c),u=t(u),r(c.translateX,c.translateY,u.translateX,u.translateY,f,h),a(c.rotate,u.rotate,f,h),l(c.skewX,u.skewX,f,h),d(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,h),c=u=null,function(p){for(var g=-1,m=h.length,w;++g<m;)f[(w=h[g]).i]=w.x(p);return f.join("")}}}var Kf=Rs(Xf,"px, ","px)","deg)"),Zf=Rs(qf,", ",")",")"),Jf=1e-12;function Hs(t){return((t=Math.exp(t))+1/t)/2}function Qf(t){return((t=Math.exp(t))-1/t)/2}function eh(t){return((t=Math.exp(2*t))-1)/(t+1)}var fo=(function t(e,n,o){function i(r,a){var l=r[0],d=r[1],c=r[2],u=a[0],f=a[1],h=a[2],p=u-l,g=f-d,m=p*p+g*g,w,I;if(m<Jf)I=Math.log(h/c)/e,w=function(z){return[l+z*p,d+z*g,c*Math.exp(e*z*I)]};else{var y=Math.sqrt(m),v=(h*h-c*c+o*m)/(2*c*n*y),C=(h*h-c*c-o*m)/(2*h*n*y),$=Math.log(Math.sqrt(v*v+1)-v);I=(Math.log(Math.sqrt(C*C+1)-C)-$)/e,w=function(z){var W=z*I,j=Hs($),D=c/(n*y)*(j*eh(e*W+$)-Qf($));return[l+D*p,d+D*g,c*j/Hs(e*W+$)]}}return w.duration=I*1e3*e/Math.SQRT2,w}return i.rho=function(r){var a=Math.max(.001,+r),l=a*a;return t(a,l,l*l)},i})(Math.SQRT2,2,4),qt=0,xn=0,Sn=0,Vs=1e3,ho,kn,po=0,Pt=0,go=0,Nn=typeof performance=="object"&&performance.now?performance:Date,Ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zi(){return Pt||(Ls(th),Pt=Nn.now()+go)}function th(){Pt=0}function mo(){this._call=this._time=this._next=null}mo.prototype=Fs.prototype={constructor:mo,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?zi():+n)+(e==null?0:+e),!this._next&&kn!==this&&(kn?kn._next=this:ho=this,kn=this),this._call=t,this._time=n,Ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ai())}};function Fs(t,e,n){var o=new mo;return o.restart(t,e,n),o}function nh(){zi(),++qt;for(var t=ho,e;t;)(e=Pt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--qt}function Gs(){Pt=(po=Nn.now())+go,qt=xn=0;try{nh()}finally{qt=0,ih(),Pt=0}}function oh(){var t=Nn.now(),e=t-po;e>Vs&&(go-=e,po=t)}function ih(){for(var t,e=ho,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ho=n);kn=t,Ai(o)}function Ai(t){qt||(xn&&(xn=clearTimeout(xn)),t-Pt>24?(t<1/0&&(xn=setTimeout(Gs,t-Nn.now()-go)),Sn&&(Sn=clearInterval(Sn))):(Sn||(po=Nn.now(),Sn=setInterval(oh,Vs)),qt=1,Ls(Gs)))}function js(t,e,n){var o=new mo;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}var rh=eo("start","end","cancel","interrupt"),sh=[],Ws=0,Ys=1,Pi=2,vo=3,Us=4,Oi=5,yo=6;function _o(t,e,n,o,i,r){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;ah(t,n,{name:e,index:o,group:i,on:rh,tween:sh,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ws})}function $i(t,e){var n=Qe(t,e);if(n.state>Ws)throw new Error("too late; already scheduled");return n}function st(t,e){var n=Qe(t,e);if(n.state>vo)throw new Error("too late; already running");return n}function Qe(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ah(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=Fs(r,0,n.time);function r(c){n.state=Ys,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,f,h,p;if(n.state!==Ys)return d();for(u in o)if(p=o[u],p.name===n.name){if(p.state===vo)return js(a);p.state===Us?(p.state=yo,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete o[u]):+u<e&&(p.state=yo,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete o[u])}if(js(function(){n.state===vo&&(n.state=Us,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Pi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Pi){for(n.state=vo,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(p=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(d),n.state=Oi,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===Oi&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=yo,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function wo(t,e){var n=t.__transition,o,i,r=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){r=!1;continue}i=o.state>Pi&&o.state<Oi,o.state=yo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}r&&delete t.__transition}}function lh(t){return this.each(function(){wo(this,t)})}function ch(t,e){var n,o;return function(){var i=st(this,t),r=i.tween;if(r!==n){o=n=r;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function dh(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=st(this,t),a=r.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},d=0,c=i.length;d<c;++d)if(i[d].name===e){i[d]=l;break}d===c&&i.push(l)}r.tween=i}}function uh(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Qe(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?ch:dh)(n,t,e))}function Ri(t,e,n){var o=t._id;return t.each(function(){var i=st(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Qe(i,o).value[e]}}function Xs(t,e){var n;return(typeof e=="number"?rt:e instanceof Bt?co:(n=Bt(e))?(e=n,co):Ps)(t,e)}function fh(t){return function(){this.removeAttribute(t)}}function hh(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ph(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttribute(t);return a===i?null:a===o?r:r=e(o=a,n)}}function gh(t,e,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?r:r=e(o=a,n)}}function mh(t,e,n){var o,i,r;return function(){var a,l=n(this),d;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),d=l+"",a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l)))}}function vh(t,e,n){var o,i,r;return function(){var a,l=n(this),d;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),d=l+"",a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l)))}}function yh(t,e){var n=no(t),o=n==="transform"?Zf:Xs;return this.attrTween(t,typeof e=="function"?(n.local?vh:mh)(n,o,Ri(this,"attr."+t,e)):e==null?(n.local?hh:fh)(n):(n.local?gh:ph)(n,o,e))}function _h(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function wh(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function bh(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&wh(t,r)),n}return i._value=e,i}function Ch(t,e){var n,o;function i(){var r=e.apply(this,arguments);return r!==o&&(n=(o=r)&&_h(t,r)),n}return i._value=e,i}function Eh(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=no(t);return this.tween(n,(o.local?bh:Ch)(o,e))}function xh(t,e){return function(){$i(this,t).delay=+e.apply(this,arguments)}}function Sh(t,e){return e=+e,function(){$i(this,t).delay=e}}function kh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xh:Sh)(e,t)):Qe(this.node(),e).delay}function Nh(t,e){return function(){st(this,t).duration=+e.apply(this,arguments)}}function Dh(t,e){return e=+e,function(){st(this,t).duration=e}}function Th(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Nh:Dh)(e,t)):Qe(this.node(),e).duration}function Ih(t,e){if(typeof e!="function")throw new Error;return function(){st(this,t).ease=e}}function Mh(t){var e=this._id;return arguments.length?this.each(Ih(e,t)):Qe(this.node(),e).ease}function Bh(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,t).ease=n}}function zh(t){if(typeof t!="function")throw new Error;return this.each(Bh(this._id,t))}function Ah(t){typeof t!="function"&&(t=fs(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r=e[i],a=r.length,l=o[i]=[],d,c=0;c<a;++c)(d=r[c])&&t.call(d,d.__data__,c,r)&&l.push(d);return new ft(o,this._parents,this._name,this._id)}function Ph(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),a=new Array(o),l=0;l<r;++l)for(var d=e[l],c=n[l],u=d.length,f=a[l]=new Array(u),h,p=0;p<u;++p)(h=d[p]||c[p])&&(f[p]=h);for(;l<o;++l)a[l]=e[l];return new ft(a,this._parents,this._name,this._id)}function Oh(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function $h(t,e,n){var o,i,r=Oh(e)?$i:st;return function(){var a=r(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}function Rh(t,e){var n=this._id;return arguments.length<2?Qe(this.node(),n).on.on(t):this.each($h(n,t,e))}function Hh(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Vh(){return this.on("end.remove",Hh(this._id))}function Lh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ci(t));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var l=o[a],d=l.length,c=r[a]=new Array(d),u,f,h=0;h<d;++h)(u=l[h])&&(f=t.call(u,u.__data__,h,l))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f,_o(c[h],e,n,h,c,Qe(u,n)));return new ft(r,this._parents,e,n)}function Fh(t){var e=this._name,n=this._id;typeof t!="function"&&(t=us(t));for(var o=this._groups,i=o.length,r=[],a=[],l=0;l<i;++l)for(var d=o[l],c=d.length,u,f=0;f<c;++f)if(u=d[f]){for(var h=t.call(u,u.__data__,f,d),p,g=Qe(u,n),m=0,w=h.length;m<w;++m)(p=h[m])&&_o(p,e,n,m,h,g);r.push(h),a.push(u)}return new ft(r,a,e,n)}var Gh=yn.prototype.constructor;function jh(){return new Gh(this._groups,this._parents)}function Wh(t,e){var n,o,i;return function(){var r=Yt(this,t),a=(this.style.removeProperty(t),Yt(this,t));return r===a?null:r===n&&a===o?i:i=e(n=r,o=a)}}function qs(t){return function(){this.style.removeProperty(t)}}function Yh(t,e,n){var o,i=n+"",r;return function(){var a=Yt(this,t);return a===i?null:a===o?r:r=e(o=a,n)}}function Uh(t,e,n){var o,i,r;return function(){var a=Yt(this,t),l=n(this),d=l+"";return l==null&&(d=l=(this.style.removeProperty(t),Yt(this,t))),a===d?null:a===o&&d===i?r:(i=d,r=e(o=a,l))}}function Xh(t,e){var n,o,i,r="style."+e,a="end."+r,l;return function(){var d=st(this,t),c=d.on,u=d.value[r]==null?l||(l=qs(e)):void 0;(c!==n||i!==u)&&(o=(n=c).copy()).on(a,i=u),d.on=o}}function qh(t,e,n){var o=(t+="")=="transform"?Kf:Xs;return e==null?this.styleTween(t,Wh(t,o)).on("end.style."+t,qs(t)):typeof e=="function"?this.styleTween(t,Uh(t,o,Ri(this,"style."+t,e))).each(Xh(this._id,t)):this.styleTween(t,Yh(t,o,e),n).on("end.style."+t,null)}function Kh(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function Zh(t,e,n){var o,i;function r(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&Kh(t,a,n)),o}return r._value=e,r}function Jh(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,Zh(t,e,n??""))}function Qh(t){return function(){this.textContent=t}}function ep(t){return function(){var e=t(this);this.textContent=e??""}}function tp(t){return this.tween("text",typeof t=="function"?ep(Ri(this,"text",t)):Qh(t==null?"":t+""))}function np(t){return function(e){this.textContent=t.call(this,e)}}function op(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&np(i)),e}return o._value=t,o}function ip(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,op(t))}function rp(){for(var t=this._name,e=this._id,n=Ks(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,d,c=0;c<l;++c)if(d=a[c]){var u=Qe(d,e);_o(d,t,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ft(o,this._parents,t,n)}function sp(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var l={value:a},d={value:function(){--i===0&&r()}};n.each(function(){var c=st(this,o),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(d)),c.on=e}),i===0&&r()})}var ap=0;function ft(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function Ks(){return++ap}var ht=yn.prototype;ft.prototype={constructor:ft,select:Lh,selectAll:Fh,selectChild:ht.selectChild,selectChildren:ht.selectChildren,filter:Ah,merge:Ph,selection:jh,transition:rp,call:ht.call,nodes:ht.nodes,node:ht.node,size:ht.size,empty:ht.empty,each:ht.each,on:Rh,attr:yh,attrTween:Eh,style:qh,styleTween:Jh,text:tp,textTween:ip,remove:Vh,tween:uh,delay:kh,duration:Th,ease:Mh,easeVarying:zh,end:sp,[Symbol.iterator]:ht[Symbol.iterator]};function lp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var cp={time:null,delay:0,duration:250,ease:lp};function dp(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function up(t){var e,n;t instanceof ft?(e=t._id,t=t._name):(e=Ks(),(n=cp).time=zi(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],l=a.length,d,c=0;c<l;++c)(d=a[c])&&_o(d,t,e,c,a,n||dp(d,e));return new ft(o,this._parents,t,e)}yn.prototype.interrupt=lh,yn.prototype.transition=up;var bo=t=>()=>t;function fp(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function pt(t,e,n){this.k=t,this.x=e,this.y=n}pt.prototype={constructor:pt,scale:function(t){return t===1?this:new pt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new pt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Kt=new pt(1,0,0);pt.prototype;function Hi(t){t.stopImmediatePropagation()}function Dn(t){t.preventDefault(),t.stopImmediatePropagation()}function hp(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function pp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Zs(){return this.__zoom||Kt}function gp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function mp(){return navigator.maxTouchPoints||"ontouchstart"in this}function vp(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function yp(){var t=hp,e=pp,n=vp,o=gp,i=mp,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,d=fo,c=eo("start","zoom","end"),u,f,h,p=500,g=150,m=0,w=10;function I(b){b.property("__zoom",Zs).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",H).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}I.transform=function(b,B,_,x){var T=b.selection?b.selection():b;T.property("__zoom",Zs),b!==T?$(b,B,_,x):T.interrupt().each(function(){z(this,arguments).event(x).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},I.scaleBy=function(b,B,_,x){I.scaleTo(b,function(){return this.__zoom.k*(typeof B=="function"?B.apply(this,arguments):B)},_,x)},I.scaleTo=function(b,B,_,x){I.transform(b,function(){var T=e.apply(this,arguments),P=this.__zoom,L=_==null?C(T):typeof _=="function"?_.apply(this,arguments):_,M=P.invert(L),V=typeof B=="function"?B.apply(this,arguments):B;return n(v(y(P,V),L,M),T,a)},_,x)},I.translateBy=function(b,B,_,x){I.transform(b,function(){return n(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof _=="function"?_.apply(this,arguments):_),e.apply(this,arguments),a)},null,x)},I.translateTo=function(b,B,_,x,T){I.transform(b,function(){var P=e.apply(this,arguments),L=this.__zoom,M=x==null?C(P):typeof x=="function"?x.apply(this,arguments):x;return n(Kt.translate(M[0],M[1]).scale(L.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof _=="function"?-_.apply(this,arguments):-_),P,a)},x,T)};function y(b,B){return B=Math.max(r[0],Math.min(r[1],B)),B===b.k?b:new pt(B,b.x,b.y)}function v(b,B,_){var x=B[0]-_[0]*b.k,T=B[1]-_[1]*b.k;return x===b.x&&T===b.y?b:new pt(b.k,x,T)}function C(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function $(b,B,_,x){b.on("start.zoom",function(){z(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(x).end()}).tween("zoom",function(){var T=this,P=arguments,L=z(T,P).event(x),M=e.apply(T,P),V=_==null?C(M):typeof _=="function"?_.apply(T,P):_,F=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),G=T.__zoom,X=typeof B=="function"?B.apply(T,P):B,J=d(G.invert(V).concat(F/G.k),X.invert(V).concat(F/X.k));return function(U){if(U===1)U=X;else{var Z=J(U),te=F/Z[2];U=new pt(te,V[0]-Z[0]*te,V[1]-Z[1]*te)}L.zoom(null,U)}})}function z(b,B,_){return!_&&b.__zooming||new W(b,B)}function W(b,B){this.that=b,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(b,B),this.taps=0}W.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,B){return this.mouse&&b!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var B=Ze(this.that).datum();c.call(b,this.that,new fp(b,{sourceEvent:this.sourceEvent,target:I,type:b,transform:this.that.__zoom,dispatch:c}),B)}};function j(b,...B){if(!t.apply(this,arguments))return;var _=z(this,B).event(b),x=this.__zoom,T=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,o.apply(this,arguments)))),P=ot(b);if(_.wheel)(_.mouse[0][0]!==P[0]||_.mouse[0][1]!==P[1])&&(_.mouse[1]=x.invert(_.mouse[0]=P)),clearTimeout(_.wheel);else{if(x.k===T)return;_.mouse=[P,x.invert(P)],wo(this),_.start()}Dn(b),_.wheel=setTimeout(L,g),_.zoom("mouse",n(v(y(x,T),_.mouse[0],_.mouse[1]),_.extent,a));function L(){_.wheel=null,_.end()}}function D(b,...B){if(h||!t.apply(this,arguments))return;var _=b.currentTarget,x=z(this,B,!0).event(b),T=Ze(b.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",F,!0),P=ot(b,_),L=b.clientX,M=b.clientY;Cs(b.view),Hi(b),x.mouse=[P,this.__zoom.invert(P)],wo(this),x.start();function V(G){if(Dn(G),!x.moved){var X=G.clientX-L,J=G.clientY-M;x.moved=X*X+J*J>m}x.event(G).zoom("mouse",n(v(x.that.__zoom,x.mouse[0]=ot(G,_),x.mouse[1]),x.extent,a))}function F(G){T.on("mousemove.zoom mouseup.zoom",null),Es(G.view,x.moved),Dn(G),x.event(G).end()}}function O(b,...B){if(t.apply(this,arguments)){var _=this.__zoom,x=ot(b.changedTouches?b.changedTouches[0]:b,this),T=_.invert(x),P=_.k*(b.shiftKey?.5:2),L=n(v(y(_,P),x,T),e.apply(this,B),a);Dn(b),l>0?Ze(this).transition().duration(l).call($,L,x,b):Ze(this).call(I.transform,L,x,b)}}function H(b,...B){if(t.apply(this,arguments)){var _=b.touches,x=_.length,T=z(this,B,b.changedTouches.length===x).event(b),P,L,M,V;for(Hi(b),L=0;L<x;++L)M=_[L],V=ot(M,this),V=[V,this.__zoom.invert(V),M.identifier],T.touch0?!T.touch1&&T.touch0[2]!==V[2]&&(T.touch1=V,T.taps=0):(T.touch0=V,P=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),P&&(T.taps<2&&(f=V[0],u=setTimeout(function(){u=null},p)),wo(this),T.start())}}function S(b,...B){if(this.__zooming){var _=z(this,B).event(b),x=b.changedTouches,T=x.length,P,L,M,V;for(Dn(b),P=0;P<T;++P)L=x[P],M=ot(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=M:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=M);if(L=_.that.__zoom,_.touch1){var F=_.touch0[0],G=_.touch0[1],X=_.touch1[0],J=_.touch1[1],U=(U=X[0]-F[0])*U+(U=X[1]-F[1])*U,Z=(Z=J[0]-G[0])*Z+(Z=J[1]-G[1])*Z;L=y(L,Math.sqrt(U/Z)),M=[(F[0]+X[0])/2,(F[1]+X[1])/2],V=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(_.touch0)M=_.touch0[0],V=_.touch0[1];else return;_.zoom("touch",n(v(L,M,V),_.extent,a))}}function Y(b,...B){if(this.__zooming){var _=z(this,B).event(b),x=b.changedTouches,T=x.length,P,L;for(Hi(b),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),P=0;P<T;++P)L=x[P],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=ot(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<w)){var M=Ze(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return I.wheelDelta=function(b){return arguments.length?(o=typeof b=="function"?b:bo(+b),I):o},I.filter=function(b){return arguments.length?(t=typeof b=="function"?b:bo(!!b),I):t},I.touchable=function(b){return arguments.length?(i=typeof b=="function"?b:bo(!!b),I):i},I.extent=function(b){return arguments.length?(e=typeof b=="function"?b:bo([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),I):e},I.scaleExtent=function(b){return arguments.length?(r[0]=+b[0],r[1]=+b[1],I):[r[0],r[1]]},I.translateExtent=function(b){return arguments.length?(a[0][0]=+b[0][0],a[1][0]=+b[1][0],a[0][1]=+b[0][1],a[1][1]=+b[1][1],I):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},I.constrain=function(b){return arguments.length?(n=b,I):n},I.duration=function(b){return arguments.length?(l=+b,I):l},I.interpolate=function(b){return arguments.length?(d=b,I):d},I.on=function(){var b=c.on.apply(c,arguments);return b===c?I:b},I.clickDistance=function(b){return arguments.length?(m=(b=+b)*b,I):Math.sqrt(m)},I.tapDistance=function(b){return arguments.length?(w=+b,I):w},I}var ce=(t=>(t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t))(ce||{}),Vi=(t=>(t.Partial="partial",t.Full="full",t))(Vi||{}),Ot=(t=>(t.Bezier="default",t.SimpleBezier="simple-bezier",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t))(Ot||{}),gt=(t=>(t.Strict="strict",t.Loose="loose",t))(gt||{}),mt=(t=>(t.Arrow="arrow",t.ArrowClosed="arrowclosed",t))(mt||{}),Tn=(t=>(t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t))(Tn||{}),Js=(t=>(t.TopLeft="top-left",t.TopCenter="top-center",t.TopRight="top-right",t.BottomLeft="bottom-left",t.BottomCenter="bottom-center",t.BottomRight="bottom-right",t))(Js||{}),_p=["INPUT","SELECT","TEXTAREA"],wp=typeof document<"u"?document:null;function Li(t){var e,n;const o=((n=(e=t.composedPath)==null?void 0:e.call(t))==null?void 0:n[0])||t.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,r=typeof o?.closest=="function"?o.closest(".nokey"):null;return _p.includes(o?.nodeName)||i||!!r}function bp(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey}function Qs(t,e,n,o){const i=e.replace("+",`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|
|
5
5
|
+`).split(`
|
|
6
|
-
`).map(a=>a.trim().toLowerCase());if(i.length===1)return t.toLowerCase()===e.toLowerCase();o||n.add(t.toLowerCase());const r=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(t.toLowerCase()),r}function Ip(t,e){return n=>{if(!n.code&&!n.key)return!1;const o=Mp(n.code,t);return Array.isArray(t)?t.some(i=>ha(n[o],i,e,n.type==="keyup")):ha(n[o],t,e,n.type==="keyup")}}function Mp(t,e){return e.includes(t)?"code":"key"}function Tn(t,e){const n=s.computed(()=>s.toValue(e?.target)??Dp),o=s.shallowRef(s.toValue(t)===!0);let i=!1;const r=new Set;let a=u(s.toValue(t));s.watch(()=>s.toValue(t),(c,d)=>{typeof d=="boolean"&&typeof c!="boolean"&&l(),a=u(c)},{immediate:!0}),ws(["blur","contextmenu"],l),_s((...c)=>a(...c),c=>{var d,f;const h=s.toValue(e?.actInsideInputWithModifier)??!0,p=s.toValue(e?.preventDefault)??!1;if(i=Tp(c),(!i||i&&!h)&&tr(c))return;const m=((f=(d=c.composedPath)==null?void 0:d.call(c))==null?void 0:f[0])||c.target,b=m?.nodeName==="BUTTON"||m?.nodeName==="A";!p&&(i||!b)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),_s((...c)=>a(...c),c=>{const d=s.toValue(e?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!d)&&tr(c))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,r.clear(),o.value=s.toValue(t)===!0}function u(c){return c===null?(l(),()=>!1):typeof c=="boolean"?(l(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Ip(c,r):c}return o}const pa="vue-flow__node-desc",ga="vue-flow__edge-desc",Bp="vue-flow__aria-live",ma=["Enter"," ","Escape"],en={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function xo(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function Co(t,e){const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)}function Eo(t){return{width:t.offsetWidth,height:t.offsetHeight}}function Ht(t,e=0,n=1){return Math.min(Math.max(t,e),n)}function ya(t,e){return{x:Ht(t.x,e[0][0],e[1][0]),y:Ht(t.y,e[0][1],e[1][1])}}function va(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function St(t){return t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t}function Vt(t){return t&&typeof t=="object"&&"id"in t&&"position"in t&&!St(t)}function In(t){return Vt(t)&&"computedPosition"in t}function So(t){return!Number.isNaN(t)&&Number.isFinite(t)}function $p(t){return So(t.width)&&So(t.height)&&So(t.x)&&So(t.y)}function zp(t,e,n){const o={id:t.id.toString(),type:t.type??"default",dimensions:s.markRaw({width:0,height:0}),computedPosition:s.markRaw({z:0,...t.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:ke(t.data)?t.data:{},events:s.markRaw(ke(t.events)?t.events:{})};return Object.assign(e??o,t,{id:t.id.toString(),parentNode:n})}function ba(t,e,n){var o,i;const r={id:t.id.toString(),type:t.type??e?.type??"default",source:t.source.toString(),target:t.target.toString(),sourceHandle:(o=t.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=t.targetHandle)==null?void 0:i.toString(),updatable:t.updatable??n?.updatable,selectable:t.selectable??n?.selectable,focusable:t.focusable??n?.focusable,data:ke(t.data)?t.data:{},events:s.markRaw(ke(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(e??r,t,{id:t.id.toString()})}function wa(t,e,n,o){const i=typeof t=="string"?t:t.id,r=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&r.add(l[o]);return e.filter(l=>r.has(l.id))}function Ap(...t){if(t.length===3){const[r,a,l]=t;return wa(r,a,l,"target")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(r=>St(r)&&r.source===o).map(r=>n.find(a=>Vt(a)&&a.id===r.target))}function Pp(...t){if(t.length===3){const[r,a,l]=t;return wa(r,a,l,"source")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(r=>St(r)&&r.target===o).map(r=>n.find(a=>Vt(a)&&a.id===r.source))}function _a({source:t,sourceHandle:e,target:n,targetHandle:o}){return`vueflow__edge-${t}${e??""}-${n}${o??""}`}function Op(t,e){return e.some(n=>St(n)&&n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle))}function Mn({x:t,y:e},{x:n,y:o,zoom:i}){return{x:t*i+n,y:e*i+o}}function Bn({x:t,y:e},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const l={x:(t-n)/i,y:(e-o)/i};return r?ko(l,a):l}function Rp(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}}function xa({x:t,y:e,width:n,height:o}){return{x:t,y:e,x2:t+n,y2:e+o}}function Hp({x:t,y:e,x2:n,y2:o}){return{x:t,y:e,width:n-t,height:o-e}}function Ca(t){let e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<t.length;n++){const o=t[n];e=Rp(e,xa({...o.computedPosition,...o.dimensions}))}return Hp(e)}function Ea(t,e,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...Bn(e,n),width:e.width/n.zoom,height:e.height/n.zoom},a=[];for(const l of t){const{dimensions:u,selectable:c=!0,hidden:d=!1}=l,f=u.width??l.width??null,h=u.height??l.height??null;if(i&&!c||d)continue;const p=Co(r,xo(l)),y=f===null||h===null,m=o&&p>0,b=(f??0)*(h??0);(y||m||p>=b||l.dragging)&&a.push(l)}return a}function Sa(t,e){const n=new Set;if(typeof t=="string")n.add(t);else if(t.length>=1)for(const o of t)n.add(o.id);return e.filter(o=>n.has(o.source)||n.has(o.target))}function tn(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return zn(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Vp(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=tn(t,n),i=tn(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){const o=tn(t.top??t.y??0,n),i=tn(t.bottom??t.y??0,n),r=tn(t.left??t.x??0,e),a=tn(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:r,x:r+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Lp(t,e,n,o,i,r){const{x:a,y:l}=Mn(t,{x:e,y:n,zoom:o}),{x:u,y:c}=Mn({x:t.x+t.width,y:t.y+t.height},{x:e,y:n,zoom:o}),d=i-u,f=r-c;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}function Na(t,e,n,o,i,r=.1){const a=Vp(r,e,n),l=(e-a.x)/t.width,u=(n-a.y)/t.height,c=Math.min(l,u),d=Ht(c,o,i),f=t.x+t.width/2,h=t.y+t.height/2,p=e/2-f*d,y=n/2-h*d,m=Lp(t,p,y,d,e,n),b={left:Math.min(m.left-a.left,0),top:Math.min(m.top-a.top,0),right:Math.min(m.right-a.right,0),bottom:Math.min(m.bottom-a.bottom,0)};return{x:p-b.left+b.right,y:y-b.top+b.bottom,zoom:d}}function Fp(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function ka(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return n?n.selected?!0:ka(n,e):!1}function $n(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`}function Da(t){const e=t.ctrlKey&&No()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function Ta(t,e,n){return t<e?Ht(Math.abs(t-e),1,e)/e:t>n?-Ht(Math.abs(t-n),1,e)/e:0}function Ia(t,e,n=15,o=40){const i=Ta(t.x,o,e.width-o)*n,r=Ta(t.y,o,e.height-o)*n;return[i,r]}function nr(t,e){if(e){const n=t.position.x+t.dimensions.width-e.dimensions.width,o=t.position.y+t.dimensions.height-e.dimensions.height;if(n>0||o>0||t.position.x<0||t.position.y<0){let i={};if(typeof e.style=="function"?i={...e.style(e)}:e.style&&(i={...e.style}),i.width=i.width??`${e.dimensions.width}px`,i.height=i.height??`${e.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(t.position.x<0){const r=Math.abs(t.position.x);if(e.position.x=e.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;t.position.x=0}if(t.position.y<0){const r=Math.abs(t.position.y);if(e.position.y=e.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;t.position.y=0}e.dimensions.width=Number(i.width.toString().replace("px","")),e.dimensions.height=Number(i.height.toString().replace("px","")),typeof e.style=="function"?e.style=r=>{const a=e.style;return{...a(r),...i}}:e.style={...e.style,...i}}}}function Ma(t,e){var n,o;const i=t.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")e.findIndex(u=>u.id===a.item.id)===-1&&e.push(a.item);else if(a.type==="remove"){const l=e.findIndex(u=>u.id===a.id);l!==-1&&e.splice(l,1)}const r=e.map(a=>a.id);for(const a of e)for(const l of t)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(In(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const u=e[r.indexOf(a.parentNode)];u&&In(u)&&nr(a,u)}break;case"dimensions":if(In(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const u=e[r.indexOf(a.parentNode)];u&&In(u)&&(!!u.dimensions.width&&!!u.dimensions.height?nr(a,u):s.nextTick(()=>{nr(a,u)}))}break}return e}function Nt(t,e){return{id:t,type:"select",selected:e}}function Ba(t){return{item:t,type:"add"}}function $a(t){return{id:t,type:"remove"}}function za(t,e,n,o,i){return{id:t,source:e,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function kt(t,e=new Set,n=!1){const o=[];for(const[i,r]of t){const a=e.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(Nt(r.id,a)))}return o}const Aa=()=>{};function le(t){const e=new Set;let n=Aa,o=()=>!1;const i=()=>e.size>0||o(),r=h=>{n=h},a=()=>{n=Aa},l=h=>{o=h},u=()=>{o=()=>!1},c=h=>{e.delete(h)};return{on:h=>{e.add(h);const p=()=>c(h);return mn(p),{off:p}},off:c,trigger:h=>{const p=[n];return i()?p.push(...e):t&&p.push(t),Promise.allSettled(p.map(y=>y(h)))},hasListeners:i,listeners:e,setEmitter:r,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:u}}function Pa(t,e,n){let o=t;do{if(o&&o.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function jp(t,e,n,o){var i,r;const a=new Map;for(const[l,u]of t)(u.selected||u.id===o)&&(!u.parentNode||!ka(u,t))&&(u.draggable||e&&typeof u.draggable>"u")&&t.get(l)&&a.set(l,{id:u.id,position:u.position||{x:0,y:0},distance:{x:n.x-((i=u.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=u.computedPosition)==null?void 0:r.y)||0},from:{x:u.computedPosition.x,y:u.computedPosition.y},extent:u.extent,parentNode:u.parentNode,dimensions:{...u.dimensions},expandParent:u.expandParent});return Array.from(a.values())}function or({id:t,dragItems:e,findNode:n}){const o=[];for(const i of e){const r=n(i.id);r&&o.push(r)}return[t?o.find(i=>i.id===t):o[0],o]}function Oa(t){if(Array.isArray(t))switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return[0,0,0,0]}return[t,t,t,t]}function Gp(t,e,n){const[o,i,r,a]=typeof t!="string"?Oa(t.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function Wp(t,e,n,o){let i=t.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!t.expandParent)if(t.parentNode&&o&&t.dimensions.width&&t.dimensions.height){const r=Gp(i,t,o);r&&(i=r)}else e(new Be(Ne.NODE_EXTENT_INVALID,t.id)),i=n;else if(Array.isArray(i)){const r=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[r,a,l,u]=Oa(i.padding),c=o?.computedPosition.x||0,d=o?.computedPosition.y||0;i=[[i.range[0][0]+c+u,i.range[0][1]+d+r],[i.range[1][0]+c-a,i.range[1][1]+d-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Yp({width:t,height:e},n){return[n[0],[n[1][0]-(t||0),n[1][1]-(e||0)]]}function ir(t,e,n,o,i){const r=Yp(t.dimensions,Wp(t,n,o,i)),a=ya(e,r);return{position:{x:a.x-(i?.computedPosition.x||0),y:a.y-(i?.computedPosition.y||0)},computedPosition:a}}function nn(t,e,n=de.Left,o=!1){const i=(e?.x??0)+t.computedPosition.x,r=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??Kp(t);if(o)return{x:i+a/2,y:r+l/2};switch(e?.position??n){case de.Top:return{x:i+a/2,y:r};case de.Right:return{x:i+a,y:r+l/2};case de.Bottom:return{x:i+a/2,y:r+l};case de.Left:return{x:i,y:r+l/2}}}function Ra(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Up({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:l,viewport:u}){const c={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+i),y2:Math.max(t.y+o,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=xa({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:a/u.zoom,height:l/u.zoom}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),h=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*h)>0}function Xp(t,e,n=!1){const o=typeof t.zIndex=="number";let i=o?t.zIndex:0;const r=e(t.source),a=e(t.target);return!r||!a?0:(n&&(i=o?t.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var Ne=(t=>(t.MISSING_STYLES="MISSING_STYLES",t.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",t.NODE_INVALID="NODE_INVALID",t.NODE_NOT_FOUND="NODE_NOT_FOUND",t.NODE_MISSING_PARENT="NODE_MISSING_PARENT",t.NODE_TYPE_MISSING="NODE_TYPE_MISSING",t.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",t.EDGE_INVALID="EDGE_INVALID",t.EDGE_NOT_FOUND="EDGE_NOT_FOUND",t.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",t.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",t.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",t.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",t.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",t.EDGE_ORPHANED="EDGE_ORPHANED",t.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",t))(Ne||{});const Ha={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:t=>`Node is invalid
|
|
6
|
+
`).map(a=>a.trim().toLowerCase());if(i.length===1)return t.toLowerCase()===e.toLowerCase();o||n.add(t.toLowerCase());const r=i.every((a,l)=>n.has(a)&&Array.from(n.values())[l]===i[l]);return o&&n.delete(t.toLowerCase()),r}function Cp(t,e){return n=>{if(!n.code&&!n.key)return!1;const o=Ep(n.code,t);return Array.isArray(t)?t.some(i=>Qs(n[o],i,e,n.type==="keyup")):Qs(n[o],t,e,n.type==="keyup")}}function Ep(t,e){return e.includes(t)?"code":"key"}function In(t,e){const n=(0,s.computed)(()=>(0,s.toValue)(e?.target)??wp),o=(0,s.shallowRef)((0,s.toValue)(t)===!0);let i=!1;const r=new Set;let a=d((0,s.toValue)(t));(0,s.watch)(()=>(0,s.toValue)(t),(c,u)=>{typeof u=="boolean"&&typeof c!="boolean"&&l(),a=d(c)},{immediate:!0}),ss(["blur","contextmenu"],l),as((...c)=>a(...c),c=>{var u,f;const h=(0,s.toValue)(e?.actInsideInputWithModifier)??!0,p=(0,s.toValue)(e?.preventDefault)??!1;if(i=bp(c),(!i||i&&!h)&&Li(c))return;const g=((f=(u=c.composedPath)==null?void 0:u.call(c))==null?void 0:f[0])||c.target,m=g?.nodeName==="BUTTON"||g?.nodeName==="A";!p&&(i||!m)&&c.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),as((...c)=>a(...c),c=>{const u=(0,s.toValue)(e?.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!u)&&Li(c))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function l(){i=!1,r.clear(),o.value=(0,s.toValue)(t)===!0}function d(c){return c===null?(l(),()=>!1):typeof c=="boolean"?(l(),o.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?Cp(c,r):c}return o}var ea="vue-flow__node-desc",ta="vue-flow__edge-desc",xp="vue-flow__aria-live",na=["Enter"," ","Escape"],Zt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Co(t){return{...t.computedPosition||{x:0,y:0},width:t.dimensions.width||0,height:t.dimensions.height||0}}function Eo(t,e){const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)}function xo(t){return{width:t.offsetWidth,height:t.offsetHeight}}function $t(t,e=0,n=1){return Math.min(Math.max(t,e),n)}function oa(t,e){return{x:$t(t.x,e[0][0],e[1][0]),y:$t(t.y,e[0][1],e[1][1])}}function ia(t){const e=t.getRootNode();return"elementFromPoint"in e?e:window.document}function Ct(t){return t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t}function Rt(t){return t&&typeof t=="object"&&"id"in t&&"position"in t&&!Ct(t)}function Mn(t){return Rt(t)&&"computedPosition"in t}function So(t){return!Number.isNaN(t)&&Number.isFinite(t)}function Sp(t){return So(t.width)&&So(t.height)&&So(t.x)&&So(t.y)}function kp(t,e,n){const o={id:t.id.toString(),type:t.type??"default",dimensions:(0,s.markRaw)({width:0,height:0}),computedPosition:(0,s.markRaw)({z:0,...t.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Ne(t.data)?t.data:{},events:(0,s.markRaw)(Ne(t.events)?t.events:{})};return Object.assign(e??o,t,{id:t.id.toString(),parentNode:n})}function ra(t,e,n){var o,i;const r={id:t.id.toString(),type:t.type??e?.type??"default",source:t.source.toString(),target:t.target.toString(),sourceHandle:(o=t.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=t.targetHandle)==null?void 0:i.toString(),updatable:t.updatable??n?.updatable,selectable:t.selectable??n?.selectable,focusable:t.focusable??n?.focusable,data:Ne(t.data)?t.data:{},events:(0,s.markRaw)(Ne(t.events)?t.events:{}),label:t.label??"",interactionWidth:t.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(e??r,t,{id:t.id.toString()})}function sa(t,e,n,o){const i=typeof t=="string"?t:t.id,r=new Set,a=o==="source"?"target":"source";for(const l of n)l[a]===i&&r.add(l[o]);return e.filter(l=>r.has(l.id))}function Np(...t){if(t.length===3){const[i,r,a]=t;return sa(i,r,a,"target")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Ct(i)&&i.source===o).map(i=>n.find(r=>Rt(r)&&r.id===i.target))}function Dp(...t){if(t.length===3){const[i,r,a]=t;return sa(i,r,a,"source")}const[e,n]=t,o=typeof e=="string"?e:e.id;return n.filter(i=>Ct(i)&&i.target===o).map(i=>n.find(r=>Rt(r)&&r.id===i.source))}function aa({source:t,sourceHandle:e,target:n,targetHandle:o}){return`vueflow__edge-${t}${e??""}-${n}${o??""}`}function Tp(t,e){return e.some(n=>Ct(n)&&n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle))}function Bn({x:t,y:e},{x:n,y:o,zoom:i}){return{x:t*i+n,y:e*i+o}}function zn({x:t,y:e},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const l={x:(t-n)/i,y:(e-o)/i};return r?No(l,a):l}function Ip(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}}function la({x:t,y:e,width:n,height:o}){return{x:t,y:e,x2:t+n,y2:e+o}}function Mp({x:t,y:e,x2:n,y2:o}){return{x:t,y:e,width:n-t,height:o-e}}function ca(t){let e={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<t.length;n++){const o=t[n];e=Ip(e,la({...o.computedPosition,...o.dimensions}))}return Mp(e)}function da(t,e,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...zn(e,n),width:e.width/n.zoom,height:e.height/n.zoom},a=[];for(const l of t){const{dimensions:d,selectable:c=!0,hidden:u=!1}=l,f=d.width??l.width??null,h=d.height??l.height??null;if(i&&!c||u)continue;const p=Eo(r,Co(l)),g=f===null||h===null,m=o&&p>0,w=(f??0)*(h??0);(g||m||p>=w||l.dragging)&&a.push(l)}return a}function ua(t,e){const n=new Set;if(typeof t=="string")n.add(t);else if(t.length>=1)for(const o of t)n.add(o.id);return e.filter(o=>n.has(o.source)||n.has(o.target))}function Jt(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=Number.parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return Pn(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Bp(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Jt(t,n),i=Jt(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){const o=Jt(t.top??t.y??0,n),i=Jt(t.bottom??t.y??0,n),r=Jt(t.left??t.x??0,e),a=Jt(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:r,x:r+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zp(t,e,n,o,i,r){const{x:a,y:l}=Bn(t,{x:e,y:n,zoom:o}),{x:d,y:c}=Bn({x:t.x+t.width,y:t.y+t.height},{x:e,y:n,zoom:o}),u=i-d,f=r-c;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(f)}}function fa(t,e,n,o,i,r=.1){const a=Bp(r,e,n),l=(e-a.x)/t.width,d=(n-a.y)/t.height,c=$t(Math.min(l,d),o,i),u=t.x+t.width/2,f=t.y+t.height/2,h=e/2-u*c,p=n/2-f*c,g=zp(t,h,p,c,e,n),m={left:Math.min(g.left-a.left,0),top:Math.min(g.top-a.top,0),right:Math.min(g.right-a.right,0),bottom:Math.min(g.bottom-a.bottom,0)};return{x:h-m.left+m.right,y:p-m.top+m.bottom,zoom:c}}function Ap(t,e){return{x:e.x+t.x,y:e.y+t.y,z:(t.z>e.z?t.z:e.z)+1}}function ha(t,e){if(!t.parentNode)return!1;const n=e.get(t.parentNode);return n?n.selected?!0:ha(n,e):!1}function An(t,e){return typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`}function pa(t){const e=t.ctrlKey&&ko()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e}function ga(t,e,n){return t<e?$t(Math.abs(t-e),1,e)/e:t>n?-$t(Math.abs(t-n),1,e)/e:0}function ma(t,e,n=15,o=40){return[ga(t.x,o,e.width-o)*n,ga(t.y,o,e.height-o)*n]}function Fi(t,e){if(e){const n=t.position.x+t.dimensions.width-e.dimensions.width,o=t.position.y+t.dimensions.height-e.dimensions.height;if(n>0||o>0||t.position.x<0||t.position.y<0){let i={};if(typeof e.style=="function"?i={...e.style(e)}:e.style&&(i={...e.style}),i.width=i.width??`${e.dimensions.width}px`,i.height=i.height??`${e.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(t.position.x<0){const r=Math.abs(t.position.x);if(e.position.x=e.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;t.position.x=0}if(t.position.y<0){const r=Math.abs(t.position.y);if(e.position.y=e.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;t.position.y=0}e.dimensions.width=Number(i.width.toString().replace("px","")),e.dimensions.height=Number(i.height.toString().replace("px","")),typeof e.style=="function"?e.style=r=>{const a=e.style;return{...a(r),...i}}:e.style={...e.style,...i}}}}function va(t,e){var n,o;const i=t.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")e.findIndex(l=>l.id===a.item.id)===-1&&e.push(a.item);else if(a.type==="remove"){const l=e.findIndex(d=>d.id===a.id);l!==-1&&e.splice(l,1)}const r=e.map(a=>a.id);for(const a of e)for(const l of t)if(l.id===a.id)switch(l.type){case"select":a.selected=l.selected;break;case"position":if(Mn(a)&&(typeof l.position<"u"&&(a.position=l.position),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&a.parentNode)){const d=e[r.indexOf(a.parentNode)];d&&Mn(d)&&Fi(a,d)}break;case"dimensions":if(Mn(a)&&(typeof l.dimensions<"u"&&(a.dimensions=l.dimensions),typeof l.updateStyle<"u"&&l.updateStyle&&(a.style={...a.style||{},width:`${(n=l.dimensions)==null?void 0:n.width}px`,height:`${(o=l.dimensions)==null?void 0:o.height}px`}),typeof l.resizing<"u"&&(a.resizing=l.resizing),a.expandParent&&a.parentNode)){const d=e[r.indexOf(a.parentNode)];d&&Mn(d)&&(d.dimensions.width&&d.dimensions.height?Fi(a,d):(0,s.nextTick)(()=>{Fi(a,d)}))}break}return e}function Et(t,e){return{id:t,type:"select",selected:e}}function ya(t){return{item:t,type:"add"}}function _a(t){return{id:t,type:"remove"}}function wa(t,e,n,o,i){return{id:t,source:e,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function xt(t,e=new Set,n=!1){const o=[];for(const[i,r]of t){const a=e.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(Et(r.id,a)))}return o}var ba=()=>{};function le(t){const e=new Set;let n=ba,o=()=>!1;const i=()=>e.size>0||o(),r=h=>{n=h},a=()=>{n=ba},l=h=>{o=h},d=()=>{o=()=>!1},c=h=>{e.delete(h)};return{on:h=>{e.add(h);const p=()=>c(h);return vn(p),{off:p}},off:c,trigger:h=>{const p=[n];return i()?p.push(...e):t&&p.push(t),Promise.allSettled(p.map(g=>g(h)))},hasListeners:i,listeners:e,setEmitter:r,removeEmitter:a,setHasEmitListeners:l,removeHasEmitListeners:d}}function Ca(t,e,n){let o=t;do{if(o&&o.matches(e))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Pp(t,e,n,o){var i,r;const a=new Map;for(const[l,d]of t)(d.selected||d.id===o)&&(!d.parentNode||!ha(d,t))&&(d.draggable||e&&typeof d.draggable>"u")&&t.get(l)&&a.set(l,{id:d.id,position:d.position||{x:0,y:0},distance:{x:n.x-((i=d.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=d.computedPosition)==null?void 0:r.y)||0},from:{x:d.computedPosition.x,y:d.computedPosition.y},extent:d.extent,parentNode:d.parentNode,dimensions:{...d.dimensions},expandParent:d.expandParent});return Array.from(a.values())}function Gi({id:t,dragItems:e,findNode:n}){const o=[];for(const i of e){const r=n(i.id);r&&o.push(r)}return[t?o.find(i=>i.id===t):o[0],o]}function Ea(t){if(Array.isArray(t))switch(t.length){case 1:return[t[0],t[0],t[0],t[0]];case 2:return[t[0],t[1],t[0],t[1]];case 3:return[t[0],t[1],t[2],t[1]];case 4:return t;default:return[0,0,0,0]}return[t,t,t,t]}function Op(t,e,n){const[o,i,r,a]=typeof t!="string"?Ea(t.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function $p(t,e,n,o){let i=t.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!t.expandParent)if(t.parentNode&&o&&t.dimensions.width&&t.dimensions.height){const r=Op(i,t,o);r&&(i=r)}else e(new Ie(ke.NODE_EXTENT_INVALID,t.id)),i=n;else if(Array.isArray(i)){const r=o?.computedPosition.x||0,a=o?.computedPosition.y||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[r,a,l,d]=Ea(i.padding),c=o?.computedPosition.x||0,u=o?.computedPosition.y||0;i=[[i.range[0][0]+c+d,i.range[0][1]+u+r],[i.range[1][0]+c-a,i.range[1][1]+u-l]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Rp({width:t,height:e},n){return[n[0],[n[1][0]-(t||0),n[1][1]-(e||0)]]}function ji(t,e,n,o,i){const r=oa(e,Rp(t.dimensions,$p(t,n,o,i)));return{position:{x:r.x-(i?.computedPosition.x||0),y:r.y-(i?.computedPosition.y||0)},computedPosition:r}}function Qt(t,e,n=ce.Left,o=!1){const i=(e?.x??0)+t.computedPosition.x,r=(e?.y??0)+t.computedPosition.y,{width:a,height:l}=e??Fp(t);if(o)return{x:i+a/2,y:r+l/2};switch(e?.position??n){case ce.Top:return{x:i+a/2,y:r};case ce.Right:return{x:i+a,y:r+l/2};case ce.Bottom:return{x:i+a/2,y:r+l};case ce.Left:return{x:i,y:r+l/2}}}function xa(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Hp({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:l,viewport:d}){const c={x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x+n,e.x+i),y2:Math.max(t.y+o,e.y+r)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=la({x:(0-d.x)/d.zoom,y:(0-d.y)/d.zoom,width:a/d.zoom,height:l/d.zoom}),f=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),h=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(f*h)>0}function Vp(t,e,n=!1){const o=typeof t.zIndex=="number";let i=o?t.zIndex:0;const r=e(t.source),a=e(t.target);return!r||!a?0:(n&&(i=o?t.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var ke=(t=>(t.MISSING_STYLES="MISSING_STYLES",t.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",t.NODE_INVALID="NODE_INVALID",t.NODE_NOT_FOUND="NODE_NOT_FOUND",t.NODE_MISSING_PARENT="NODE_MISSING_PARENT",t.NODE_TYPE_MISSING="NODE_TYPE_MISSING",t.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",t.EDGE_INVALID="EDGE_INVALID",t.EDGE_NOT_FOUND="EDGE_NOT_FOUND",t.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",t.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",t.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",t.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",t.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",t.EDGE_ORPHANED="EDGE_ORPHANED",t.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",t))(ke||{}),Sa={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:t=>`Node is invalid
|
|
7
7
|
Node: ${t}`,NODE_NOT_FOUND:t=>`Node not found
|
|
8
8
|
Node: ${t}`,NODE_MISSING_PARENT:(t,e)=>`Node is missing a parent
|
|
9
9
|
Node: ${t}
|
|
@@ -23,6 +23,6 @@ Edge: ${t}
|
|
|
23
23
|
Source: ${e}
|
|
24
24
|
Target: ${n}`,EDGE_ORPHANED:t=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
25
25
|
Edge: ${t}`,EDGE_NOT_FOUND:t=>`Edge not found
|
|
26
|
-
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Be extends Error{constructor(e,...n){var o;super((o=Ha[e])==null?void 0:o.call(Ha,...n)),this.name="VueFlowError",this.code=e,this.args=n}}function rr(t){return"clientX"in t}function qp(t){return"sourceEvent"in t}function lt(t,e){const n=rr(t);let o,i;return n?(o=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(o=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(o=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(o=0,i=0),{x:o-(e?.left??0),y:i-(e?.top??0)}}const No=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Kp(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function ko(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}const Zp=()=>!0;function sr(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Jp(t,e,n){const o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const r of e.values())Co(i,xo(r))>0&&o.push(r);return o}const Qp=250;function eg(t,e,n,o){var i,r;let a=[],l=Number.POSITIVE_INFINITY;const u=Jp(t,n,e+Qp);for(const c of u){const d=[...((i=c.handleBounds)==null?void 0:i.source)??[],...((r=c.handleBounds)==null?void 0:r.target)??[]];for(const f of d){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:h,y:p}=nn(c,f,f.position,!0),y=Math.sqrt((h-t.x)**2+(p-t.y)**2);y>e||(y<l?(a=[{...f,x:h,y:p}],l=y):y===l&&a.push({...f,x:h,y:p}))}}if(!a.length)return null;if(a.length>1){const c=o.type==="source"?"target":"source";return a.find(d=>d.type===c)??a[0]}return a[0]}function Va(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:u,isValidConnection:c=Zp},d,f,h,p){const y=r==="target",m=e?a.querySelector(`.${l}-flow__handle[data-id="${u}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:b,y:N}=lt(t),_=a.elementFromPoint(b,N),g=_?.classList.contains(`${l}-flow__handle`)?_:m,x={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const z=La(void 0,g),$=g.getAttribute("data-nodeid"),F=g.getAttribute("data-handleid"),Y=g.classList.contains("connectable"),G=g.classList.contains("connectableend");if(!$||!z)return x;const S={source:y?$:o,sourceHandle:y?F:i,target:y?o:$,targetHandle:y?i:F};x.connection=S;const E=Y&&G&&(n===gt.Strict?y&&z==="source"||!y&&z==="target":$!==o||F!==i);x.isValid=E&&c(S,{nodes:f,edges:d,sourceNode:h(S.source),targetNode:h(S.target)}),x.toHandle=Fa($,z,F,p,n,!0)}return x}function La(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function tg(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function ng(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function Fa(t,e,n,o,i,r=!1){var a,l,u;const c=o.get(t);if(!c)return null;const d=i===gt.Strict?(a=c.handleBounds)==null?void 0:a[e]:[...((l=c.handleBounds)==null?void 0:l.source)??[],...((u=c.handleBounds)==null?void 0:u.target)??[]],f=(n?d?.find(h=>h.id===n):d?.[0])??null;return f&&r?{...f,...nn(c,f,f.position,!0)}:f}const ar={[de.Left]:de.Right,[de.Right]:de.Left,[de.Top]:de.Bottom,[de.Bottom]:de.Top},og=["production","prod"];function zn(t,...e){ja()&&console.warn(`[Vue Flow]: ${t}`,...e)}function ja(){return!og.includes(process.env.NODE_ENV||"")}function Ga(t,e,n,o,i){const r=e.querySelectorAll(`.vue-flow__handle.${t}`);return r?.length?Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Eo(a)}}):null}function lr(t,e,n,o,i,r=!1,a){i.value=!1,t.selected?(r||t.selected&&e)&&(o([t]),s.nextTick(()=>{a.blur()})):n([t])}function ke(t){return typeof s.unref(t)<"u"}function ig(t,e,n,o){if(!t||!t.source||!t.target)return n(new Be(Ne.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let i;return St(t)?i=t:i={...t,id:_a(t)},i=ba(i,void 0,o),Op(i,e)?!1:i}function rg(t,e,n,o,i){if(!e.source||!e.target)return i(new Be(Ne.EDGE_INVALID,t.id)),!1;if(!n)return i(new Be(Ne.EDGE_NOT_FOUND,t.id)),!1;const{id:r,...a}=t;return{...a,id:o?_a(e):r,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function Wa(t,e,n){const o={},i=[];for(let r=0;r<t.length;++r){const a=t[r];if(!Vt(a)){n(new Be(Ne.NODE_INVALID,a?.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const l=zp(a,e(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=l}for(const r of i){const a=e(r.parentNode)||i.find(l=>l.id===r.parentNode);r.parentNode&&!a&&n(new Be(Ne.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Ya(t,e,n,o,i,r){let a=i;const l=o.get(a)||new Map;o.set(a,l.set(n,e)),a=`${i}-${t}`;const u=o.get(a)||new Map;if(o.set(a,u.set(n,e)),r){a=`${i}-${t}-${r}`;const c=o.get(a)||new Map;o.set(a,c.set(n,e))}}function cr(t,e,n){t.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=o,u={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:l},c=`${i}-${a}--${r}-${l}`,d=`${r}-${l}--${i}-${a}`;Ya("source",u,d,t,i,a),Ya("target",u,c,t,r,l)}}function Ua(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function dr(t,e,n,o,i,r,a,l){const u=[];for(const c of t){const d=St(c)?c:ig(c,l,i,r);if(!d)continue;const f=n(d.source),h=n(d.target);if(!f||!h){i(new Be(Ne.EDGE_SOURCE_TARGET_MISSING,d.id,d.source,d.target));continue}if(!f){i(new Be(Ne.EDGE_SOURCE_MISSING,d.id,d.source));continue}if(!h){i(new Be(Ne.EDGE_TARGET_MISSING,d.id,d.target));continue}if(e&&!e(d,{edges:l,nodes:a,sourceNode:f,targetNode:h})){i(new Be(Ne.EDGE_INVALID,d.id));continue}const p=o(d.id);u.push({...ba(d,p,r),sourceNode:f,targetNode:h})}return u}const Xa=Symbol("vueFlow"),qa=Symbol("nodeId"),Ka=Symbol("nodeRef"),sg=Symbol("edgeId"),ag=Symbol("edgeRef"),Do=Symbol("slots");function Za(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:a,nodeDragThreshold:l,viewport:u,autoPanOnNodeDrag:c,autoPanSpeed:d,nodesDraggable:f,panBy:h,findNode:p,multiSelectionActive:y,nodesSelectionActive:m,selectNodesOnDrag:b,removeSelectedElements:N,addSelectedNodes:_,updateNodePositions:g,emits:x}=we(),{onStart:z,onDrag:$,onStop:F,onClick:Y,el:G,disabled:S,id:I,selectable:E,dragHandle:H}=t,w=s.shallowRef(!1);let D=[],v,C=null,k={x:void 0,y:void 0},O={x:0,y:0},R=null,B=!1,P=!1,L=0,j=!1;const K=dg(),Q=({x:ie,y:se})=>{k={x:ie,y:se};let A=!1;if(D=D.map(M=>{const V={x:ie-M.distance.x,y:se-M.distance.y},{computedPosition:X}=ir(M,n.value?ko(V,o.value):V,x.error,a.value,M.parentNode?p(M.parentNode):void 0);return A=A||M.position.x!==X.x||M.position.y!==X.y,M.position=X,M}),P=P||A,!!A&&(g(D,!0,!0),w.value=!0,R)){const[M,V]=or({id:I,dragItems:D,findNode:p});$({event:R,node:M,nodes:V})}},q=()=>{if(!C)return;const[ie,se]=Ia(O,C,d.value);if(ie!==0||se!==0){const A={x:(k.x??0)-ie/u.value.zoom,y:(k.y??0)-se/u.value.zoom};h({x:ie,y:se})&&Q(A)}L=requestAnimationFrame(q)},ee=(ie,se)=>{B=!0;const A=p(I);!b.value&&!y.value&&A&&(A.selected||N()),A&&s.toValue(E)&&b.value&&lr(A,y.value,_,N,m,!1,se);const M=K(ie.sourceEvent);if(k=M,D=jp(r.value,f.value,M,I),D.length){const[V,X]=or({id:I,dragItems:D,findNode:p});z({event:ie.sourceEvent,node:V,nodes:X})}},re=(ie,se)=>{var A;ie.sourceEvent.type==="touchmove"&&ie.sourceEvent.touches.length>1||(P=!1,l.value===0&&ee(ie,se),k=K(ie.sourceEvent),C=((A=e.value)==null?void 0:A.getBoundingClientRect())||null,O=lt(ie.sourceEvent,C))},oe=(ie,se)=>{const A=K(ie.sourceEvent);if(!j&&B&&c.value&&(j=!0,q()),!B){const M=A.xSnapped-(k.x??0),V=A.ySnapped-(k.y??0);Math.sqrt(M*M+V*V)>l.value&&ee(ie,se)}(k.x!==A.xSnapped||k.y!==A.ySnapped)&&D.length&&B&&(R=ie.sourceEvent,O=lt(ie.sourceEvent,C),Q(A))},ce=ie=>{let se=!1;if(!B&&!w.value&&!y.value){const A=ie.sourceEvent,M=K(A),V=M.xSnapped-(k.x??0),X=M.ySnapped-(k.y??0),T=Math.sqrt(V*V+X*X);T!==0&&T<=l.value&&(Y?.(A),se=!0)}if(D.length&&!se){P&&(g(D,!1,!1),P=!1);const[A,M]=or({id:I,dragItems:D,findNode:p});F({event:ie.sourceEvent,node:A,nodes:M})}D=[],w.value=!1,j=!1,B=!1,k={x:void 0,y:void 0},cancelAnimationFrame(L)};return s.watch([()=>s.toValue(S),G],([ie,se],A,M)=>{if(se){const V=Je(se);ie||(v=$f().on("start",X=>re(X,se)).on("drag",X=>oe(X,se)).on("end",X=>ce(X)).filter(X=>{const T=X.target,U=s.toValue(H);return!X.button&&(!i.value||!Pa(T,`.${i.value}`,se)&&(!U||Pa(T,U,se)))}),V.call(v)),M(()=>{V.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),w}function lg(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),updateStart:le(),update:le(),updateEnd:le()}}function cg(t,e){const n=lg();return n.doubleClick.on(o=>{var i,r;e.edgeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.edgeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.edgeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.edgeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.edgeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.edgeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;e.edgeUpdateStart(o),(r=(i=t.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;e.edgeUpdate(o),(r=(i=t.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;e.edgeUpdateEnd(o),(r=(i=t.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function dg(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:o}=we();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},l=qp(i)?i.sourceEvent:i,{x:u,y:c}=lt(l,a),d=Bn({x:u,y:c},t.value),{x:f,y:h}=n.value?ko(d,e.value):d;return{xSnapped:f,ySnapped:h,...d}}}function To(){return!0}function Ja({handleId:t,nodeId:e,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:u,connectionMode:c,connectionRadius:d,connectOnClick:f,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:y,autoPanSpeed:m,findNode:b,panBy:N,startConnection:_,updateConnection:g,endConnection:x,emits:z,viewport:$,edges:F,nodes:Y,isValidConnection:G,nodeLookup:S}=we();let I=null,E=!1,H=null;function w(v){var C;const k=s.toValue(n)==="target",O=rr(v),R=va(v.target),B=v.currentTarget;if(B&&(O&&v.button===0||!O)){let P=function(ne){A=lt(ne,ce),Q=eg(Bn(A,$.value,!1,[1,1]),d.value,S.value,X),M||(V(),M=!0);const te=Va(ne,{handle:Q,connectionMode:c.value,fromNodeId:s.toValue(e),fromHandleId:s.toValue(t),fromType:k?"target":"source",isValidConnection:K,doc:R,lib:"vue",flowId:l,nodeLookup:S.value},F.value,Y.value,b,S.value);H=te.handleDomNode,I=te.connection,E=ng(!!Q,te.isValid);const fe={...Z,isValid:E,to:te.toHandle&&E?Mn({x:te.toHandle.x,y:te.toHandle.y},$.value):A,toHandle:te.toHandle,toPosition:E&&te.toHandle?te.toHandle.position:ar[X.position],toNode:te.toHandle?S.value.get(te.toHandle.nodeId):null};if(E&&Q&&Z?.toHandle&&fe.toHandle&&Z.toHandle.type===fe.toHandle.type&&Z.toHandle.nodeId===fe.toHandle.nodeId&&Z.toHandle.id===fe.toHandle.id&&Z.to.x===fe.to.x&&Z.to.y===fe.to.y)return;const ge=Q??te.toHandle;if(g(ge&&E?Mn({x:ge.x,y:ge.y},$.value):A,ge,tg(!!ge,E)),Z=fe,!Q&&!E&&!H)return sr(se);I&&I.source!==I.target&&H&&(sr(se),se=H,H.classList.add("connecting","vue-flow__handle-connecting"),H.classList.toggle("valid",!!E),H.classList.toggle("vue-flow__handle-valid",!!E))},L=function(ne){"touches"in ne&&ne.touches.length>0||((Q||H)&&I&&E&&(r?r(ne,I):z.connect(I)),z.connectEnd(ne),i&&a?.(ne),sr(se),cancelAnimationFrame(q),x(ne),M=!1,E=!1,I=null,H=null,R.removeEventListener("mousemove",P),R.removeEventListener("mouseup",L),R.removeEventListener("touchmove",P),R.removeEventListener("touchend",L))};const j=b(s.toValue(e));let K=s.toValue(o)||G.value||To;!K&&j&&(K=(k?j.isValidSourcePos:j.isValidTargetPos)||To);let Q,q=0;const{x:ee,y:re}=lt(v),oe=La(s.toValue(i),B),ce=(C=u.value)==null?void 0:C.getBoundingClientRect();if(!ce||!oe)return;const ie=Fa(s.toValue(e),oe,s.toValue(t),S.value,c.value);if(!ie)return;let se,A=lt(v,ce),M=!1;const V=()=>{if(!y.value)return;const[ne,te]=Ia(A,ce,m.value);N({x:ne,y:te}),q=requestAnimationFrame(V)},X={...ie,nodeId:s.toValue(e),type:oe,position:ie.position},T=S.value.get(s.toValue(e)),W={inProgress:!0,isValid:null,from:nn(T,X,de.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:T,to:A,toHandle:null,toPosition:ar[X.position],toNode:null};_({nodeId:s.toValue(e),id:s.toValue(t),type:oe,position:B?.getAttribute("data-handlepos")||de.Top,...A},{x:ee-ce.left,y:re-ce.top}),z.connectStart({event:v,nodeId:s.toValue(e),handleId:s.toValue(t),handleType:oe});let Z=W;R.addEventListener("mousemove",P),R.addEventListener("mouseup",L),R.addEventListener("touchmove",P),R.addEventListener("touchend",L)}}function D(v){var C,k;if(!f.value)return;const O=s.toValue(n)==="target";if(!h.value){z.clickConnectStart({event:v,nodeId:s.toValue(e),handleId:s.toValue(t)}),_({nodeId:s.toValue(e),type:s.toValue(n),id:s.toValue(t),position:de.Top,...lt(v)},void 0,!0);return}let R=s.toValue(o)||G.value||To;const B=b(s.toValue(e));if(!R&&B&&(R=(O?B.isValidSourcePos:B.isValidTargetPos)||To),B&&(typeof B.connectable>"u"?p.value:B.connectable)===!1)return;const P=va(v.target),L=Va(v,{handle:{nodeId:s.toValue(e),id:s.toValue(t),type:s.toValue(n),position:de.Top,...lt(v)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:R,doc:P,lib:"vue",flowId:l,nodeLookup:S.value},F.value,Y.value,b,S.value),j=((C=L.connection)==null?void 0:C.source)===((k=L.connection)==null?void 0:k.target);L.isValid&&L.connection&&!j&&z.connect(L.connection),z.clickConnectEnd(v),x(v,!0)}return{handlePointerDown:w,handleClick:D}}function ug(){return s.inject(qa,"")}function Qa(t){const e=t??ug()??"",n=s.inject(Ka,s.ref(null)),{findNode:o,edges:i,emits:r}=we(),a=o(e);return a||r.error(new Be(Ne.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:a,parentNode:s.computed(()=>o(a.parentNode)),connectedEdges:s.computed(()=>Sa([a],i.value))}}function fg(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),dragStart:le(),drag:le(),dragStop:le()}}function hg(t,e){const n=fg();return n.doubleClick.on(o=>{var i,r;e.nodeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.nodeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.nodeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.nodeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.nodeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.nodeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;e.nodeDragStart(o),(r=(i=t.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;e.nodeDrag(o),(r=(i=t.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;e.nodeDragStop(o),(r=(i=t.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function el(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:l}=we();return(u,c=!1)=>{const d=r.value?i.value[0]:5,f=r.value?i.value[1]:5,h=c?4:1,p=u.x*d*h,y=u.y*f*h,m=[];for(const b of t.value)if(b.draggable||a&&typeof b.draggable>"u"){const N={x:b.computedPosition.x+p,y:b.computedPosition.y+y},{position:_}=ir(b,N,l.error,e.value,b.parentNode?o(b.parentNode):void 0);m.push({id:b.id,position:_,from:b.position,distance:{x:u.x,y:u.y},dimensions:b.dimensions})}n(m,!0,!1)}}const Io=.1,pg=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function Dt(){return zn("Viewport not initialized yet."),Promise.resolve(!1)}const gg={zoomIn:Dt,zoomOut:Dt,zoomTo:Dt,fitView:Dt,setCenter:Dt,fitBounds:Dt,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:Dt,setTransform:Dt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function mg(t){function e(o,i){return new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?xn:fo).scaleBy(ur(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(l=>{var u;const{x:c,y:d}=ya({x:-o,y:-i},t.translateExtent),f=Qt.translate(-c,-d).scale(r);t.d3Selection&&t.d3Zoom?(u=t.d3Zoom)==null||u.interpolate(a?.interpolate==="linear"?xn:fo).transform(ur(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),f):l(!1)})}return s.computed(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:i=>e(1.2,i),zoomOut:i=>e(1/1.2,i),zoomTo:(i,r)=>new Promise(a=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(r?.interpolate==="linear"?xn:fo).scaleTo(ur(t.d3Selection,r?.duration,r?.ease,()=>{a(!0)}),i):a(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(i={padding:Io,includeHiddenNodes:!1,duration:0})=>{var r,a;const l=[];for(const h of t.nodes)h.dimensions.width&&h.dimensions.height&&(i?.includeHiddenNodes||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(h.id))&&l.push(h);if(!l.length)return Promise.resolve(!1);const u=Ca(l),{x:c,y:d,zoom:f}=Na(u,t.dimensions.width,t.dimensions.height,i.minZoom??t.minZoom,i.maxZoom??t.maxZoom,i.padding??Io);return n(c,d,f,i)},setCenter:(i,r,a)=>{const l=typeof a?.zoom<"u"?a.zoom:t.maxZoom,u=t.dimensions.width/2-i*l,c=t.dimensions.height/2-r*l;return n(u,c,l,a)},fitBounds:(i,r={padding:Io})=>{const{x:a,y:l,zoom:u}=Na(i,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,r.padding??Io);return n(a,l,u,r)},project:i=>Bn(i,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:i=>{if(t.vueFlowRef){const{x:r,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:i.x-r,y:i.y-a};return Bn(l,t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(t.vueFlowRef){const{x:r,y:a}=t.vueFlowRef.getBoundingClientRect(),l={x:i.x+r,y:i.y+a};return Mn(l,t.viewport)}return{x:0,y:0}}}:gg)}function ur(t,e=0,n=pg,o=()=>{}){const i=typeof e=="number"&&e>0;return i||o(),i?t.transition().duration(e).ease(n).on("end",o):t}function yg(t,e,n){const o=s.effectScope(!0);return o.run(()=>{const i=()=>{o.run(()=>{let m,b,N=!!(n.nodes.value.length||n.edges.value.length);m=Xt([t.modelValue,()=>{var _,g;return(g=(_=t.modelValue)==null?void 0:_.value)==null?void 0:g.length}],([_])=>{_&&Array.isArray(_)&&(b?.pause(),n.setElements(_),!b&&!N&&_.length?N=!0:b?.resume())}),b=Xt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([_,g])=>{var x;(x=t.modelValue)!=null&&x.value&&Array.isArray(t.modelValue.value)&&(m?.pause(),t.modelValue.value=[..._,...g],s.nextTick(()=>{m?.resume()}))},{immediate:N}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},r=()=>{o.run(()=>{let m,b,N=!!n.nodes.value.length;m=Xt([t.nodes,()=>{var _,g;return(g=(_=t.nodes)==null?void 0:_.value)==null?void 0:g.length}],([_])=>{_&&Array.isArray(_)&&(b?.pause(),n.setNodes(_),!b&&!N&&_.length?N=!0:b?.resume())}),b=Xt([n.nodes,()=>n.nodes.value.length],([_])=>{var g;(g=t.nodes)!=null&&g.value&&Array.isArray(t.nodes.value)&&(m?.pause(),t.nodes.value=[..._],s.nextTick(()=>{m?.resume()}))},{immediate:N}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},a=()=>{o.run(()=>{let m,b,N=!!n.edges.value.length;m=Xt([t.edges,()=>{var _,g;return(g=(_=t.edges)==null?void 0:_.value)==null?void 0:g.length}],([_])=>{_&&Array.isArray(_)&&(b?.pause(),n.setEdges(_),!b&&!N&&_.length?N=!0:b?.resume())}),b=Xt([n.edges,()=>n.edges.value.length],([_])=>{var g;(g=t.edges)!=null&&g.value&&Array.isArray(t.edges.value)&&(m?.pause(),t.edges.value=[..._],s.nextTick(()=>{m?.resume()}))},{immediate:N}),s.onScopeDispose(()=>{m?.stop(),b?.stop()})})},l=()=>{o.run(()=>{s.watch(()=>e.maxZoom,()=>{e.maxZoom&&ke(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},u=()=>{o.run(()=>{s.watch(()=>e.minZoom,()=>{e.minZoom&&ke(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{s.watch(()=>e.translateExtent,()=>{e.translateExtent&&ke(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},d=()=>{o.run(()=>{s.watch(()=>e.nodeExtent,()=>{e.nodeExtent&&ke(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{s.watch(()=>e.applyDefault,()=>{ke(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const m=async b=>{let N=b;typeof e.autoConnect=="function"&&(N=await e.autoConnect(b)),N!==!1&&n.addEdges([N])};s.watch(()=>e.autoConnect,()=>{ke(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),s.watch(n.autoConnect,(b,N,_)=>{b?n.onConnect(m):n.hooks.value.connect.off(m),_(()=>{n.hooks.value.connect.off(m)})},{immediate:!0})})},p=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(e)){const N=b;if(!m.includes(N)){const _=s.toRef(()=>e[N]),g=n[N];s.isRef(g)&&o.run(()=>{s.watch(_,x=>{ke(x)&&(g.value=x)},{immediate:!0})})}}};i(),r(),a(),u(),l(),c(),d(),f(),h(),p()}),()=>o.stop()}function vg(){return{edgesChange:le(),nodesChange:le(),nodeDoubleClick:le(),nodeClick:le(),nodeMouseEnter:le(),nodeMouseMove:le(),nodeMouseLeave:le(),nodeContextMenu:le(),nodeDragStart:le(),nodeDrag:le(),nodeDragStop:le(),nodesInitialized:le(),miniMapNodeClick:le(),miniMapNodeDoubleClick:le(),miniMapNodeMouseEnter:le(),miniMapNodeMouseMove:le(),miniMapNodeMouseLeave:le(),connect:le(),connectStart:le(),connectEnd:le(),clickConnectStart:le(),clickConnectEnd:le(),paneReady:le(),init:le(),move:le(),moveStart:le(),moveEnd:le(),selectionDragStart:le(),selectionDrag:le(),selectionDragStop:le(),selectionContextMenu:le(),selectionStart:le(),selectionEnd:le(),viewportChangeStart:le(),viewportChange:le(),viewportChangeEnd:le(),paneScroll:le(),paneClick:le(),paneContextMenu:le(),paneMouseEnter:le(),paneMouseMove:le(),paneMouseLeave:le(),edgeContextMenu:le(),edgeMouseEnter:le(),edgeMouseMove:le(),edgeMouseLeave:le(),edgeDoubleClick:le(),edgeClick:le(),edgeUpdateStart:le(),edgeUpdate:le(),edgeUpdateEnd:le(),updateNodeInternals:le(),error:le(t=>zn(t.message))}}function bg(t,e){const n=s.getCurrentInstance();s.onBeforeMount(()=>{for(const[i,r]of Object.entries(e.value)){const a=l=>{t(i,l)};r.setEmitter(a),mn(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),mn(r.removeHasEmitListeners)}});function o(i){var r;const a=wg(i);return!!((r=n?.vnode.props)==null?void 0:r[a])}}function wg(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function tl(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:er.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Dn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Rt.Bezier,style:{}},connectionMode:gt.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:No()?"Meta":"Control",zoomActivationKeyCode:No()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:vg(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const _g=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function xg(t,e,n){const o=mg(t),i=A=>{const M=A??[];t.hooks.updateNodeInternals.trigger(M)},r=A=>Pp(A,t.nodes,t.edges),a=A=>Ap(A,t.nodes,t.edges),l=A=>Sa(A,t.edges),u=({id:A,type:M,nodeId:V})=>{var X;const T=A?`-${M}-${A}`:`-${M}`;return Array.from(((X=t.connectionLookup.get(`${V}${T}`))==null?void 0:X.values())??[])},c=A=>{if(A)return e.value.get(A)},d=A=>{if(A)return n.value.get(A)},f=(A,M,V)=>{var X,T;const U=[];for(const W of A){const Z={id:W.id,type:"position",dragging:V,from:W.from};if(M&&(Z.position=W.position,W.parentNode)){const ne=c(W.parentNode);Z.position={x:Z.position.x-(((X=ne?.computedPosition)==null?void 0:X.x)??0),y:Z.position.y-(((T=ne?.computedPosition)==null?void 0:T.y)??0)}}U.push(Z)}U?.length&&t.hooks.nodesChange.trigger(U)},h=A=>{if(!t.vueFlowRef)return;const M=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!M)return;const V=window.getComputedStyle(M),{m22:X}=new window.DOMMatrixReadOnly(V.transform),T=[];for(const U of A){const W=U,Z=c(W.id);if(Z){const ne=Eo(W.nodeElement);if(!!(ne.width&&ne.height&&(Z.dimensions.width!==ne.width||Z.dimensions.height!==ne.height||W.forceUpdate))){const fe=W.nodeElement.getBoundingClientRect();Z.dimensions=ne,Z.handleBounds.source=Ga("source",W.nodeElement,fe,X,Z.id),Z.handleBounds.target=Ga("target",W.nodeElement,fe,X,Z.id),T.push({id:Z.id,type:"dimensions",dimensions:ne})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&o.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),T.length&&t.hooks.nodesChange.trigger(T)},p=(A,M)=>{const V=new Set,X=new Set;for(const W of A)Vt(W)?V.add(W.id):St(W)&&X.add(W.id);const T=kt(e.value,V,!0),U=kt(n.value,X);if(t.multiSelectionActive){for(const W of V)T.push(Nt(W,M));for(const W of X)U.push(Nt(W,M))}T.length&&t.hooks.nodesChange.trigger(T),U.length&&t.hooks.edgesChange.trigger(U)},y=A=>{if(t.multiSelectionActive){const M=A.map(V=>Nt(V.id,!0));t.hooks.nodesChange.trigger(M);return}t.hooks.nodesChange.trigger(kt(e.value,new Set(A.map(M=>M.id)),!0)),t.hooks.edgesChange.trigger(kt(n.value))},m=A=>{if(t.multiSelectionActive){const M=A.map(V=>Nt(V.id,!0));t.hooks.edgesChange.trigger(M);return}t.hooks.edgesChange.trigger(kt(n.value,new Set(A.map(M=>M.id)))),t.hooks.nodesChange.trigger(kt(e.value,new Set,!0))},b=A=>{p(A,!0)},N=A=>{const V=(A||t.nodes).map(X=>(X.selected=!1,Nt(X.id,!1)));t.hooks.nodesChange.trigger(V)},_=A=>{const V=(A||t.edges).map(X=>(X.selected=!1,Nt(X.id,!1)));t.hooks.edgesChange.trigger(V)},g=A=>{if(!A||!A.length)return p([],!1);const M=A.reduce((V,X)=>{const T=Nt(X.id,!1);return Vt(X)?V.nodes.push(T):V.edges.push(T),V},{nodes:[],edges:[]});M.nodes.length&&t.hooks.nodesChange.trigger(M.nodes),M.edges.length&&t.hooks.edgesChange.trigger(M.edges)},x=A=>{var M;(M=t.d3Zoom)==null||M.scaleExtent([A,t.maxZoom]),t.minZoom=A},z=A=>{var M;(M=t.d3Zoom)==null||M.scaleExtent([t.minZoom,A]),t.maxZoom=A},$=A=>{var M;(M=t.d3Zoom)==null||M.translateExtent(A),t.translateExtent=A},F=A=>{t.nodeExtent=A,i()},Y=A=>{var M;(M=t.d3Zoom)==null||M.clickDistance(A)},G=A=>{t.nodesDraggable=A,t.nodesConnectable=A,t.elementsSelectable=A},S=A=>{const M=A instanceof Function?A(t.nodes):A;!t.initialized&&!M.length||(t.nodes=Wa(M,c,t.hooks.error.trigger))},I=A=>{const M=A instanceof Function?A(t.edges):A;if(!t.initialized&&!M.length)return;const V=dr(M,t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);cr(t.connectionLookup,n.value,V),t.edges=V},E=A=>{const M=A instanceof Function?A([...t.nodes,...t.edges]):A;!t.initialized&&!M.length||(S(M.filter(Vt)),I(M.filter(St)))},H=A=>{let M=A instanceof Function?A(t.nodes):A;M=Array.isArray(M)?M:[M];const V=Wa(M,c,t.hooks.error.trigger),X=[];for(const T of V)X.push(Ba(T));X.length&&t.hooks.nodesChange.trigger(X)},w=A=>{let M=A instanceof Function?A(t.edges):A;M=Array.isArray(M)?M:[M];const V=dr(M,t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),X=[];for(const T of V)X.push(Ba(T));X.length&&t.hooks.edgesChange.trigger(X)},D=(A,M=!0,V=!1)=>{const X=A instanceof Function?A(t.nodes):A,T=Array.isArray(X)?X:[X],U=[],W=[];function Z(te){const fe=l(te);for(const ge of fe)(!ke(ge.deletable)||ge.deletable)&&W.push(za(ge.id,ge.source,ge.target,ge.sourceHandle,ge.targetHandle))}function ne(te){const fe=[];for(const ge of t.nodes)ge.parentNode===te&&fe.push(ge);if(fe.length){for(const ge of fe)U.push($a(ge.id));M&&Z(fe);for(const ge of fe)ne(ge.id)}}for(const te of T){const fe=typeof te=="string"?c(te):te;fe&&(ke(fe.deletable)&&!fe.deletable||(U.push($a(fe.id)),M&&Z([fe]),V&&ne(fe.id)))}W.length&&t.hooks.edgesChange.trigger(W),U.length&&t.hooks.nodesChange.trigger(U)},v=A=>{const M=A instanceof Function?A(t.edges):A,V=Array.isArray(M)?M:[M],X=[];for(const T of V){const U=typeof T=="string"?d(T):T;U&&(ke(U.deletable)&&!U.deletable||X.push(za(typeof T=="string"?T:T.id,U.source,U.target,U.sourceHandle,U.targetHandle)))}t.hooks.edgesChange.trigger(X)},C=(A,M,V=!0)=>{const X=d(A.id);if(!X)return!1;const T=t.edges.indexOf(X),U=rg(A,M,X,V,t.hooks.error.trigger);if(U){const[W]=dr([U],t.isValidConnection,c,d,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((Z,ne)=>ne===T?W:Z),cr(t.connectionLookup,n.value,[W]),W}return!1},k=(A,M,V={replace:!1})=>{const X=d(A);if(!X)return;const T=typeof M=="function"?M(X):M;X.data=V.replace?T:{...X.data,...T}},O=A=>Ma(A,t.nodes),R=A=>{const M=Ma(A,t.edges);return cr(t.connectionLookup,n.value,M),M},B=(A,M,V={replace:!1})=>{const X=c(A);if(!X)return;const T=typeof M=="function"?M(X):M;V.replace?t.nodes.splice(t.nodes.indexOf(X),1,T):Object.assign(X,T)},P=(A,M,V={replace:!1})=>{const X=c(A);if(!X)return;const T=typeof M=="function"?M(X):M;X.data=V.replace?T:{...X.data,...T}},L=(A,M,V=!1)=>{V?t.connectionClickStartHandle=A:t.connectionStartHandle=A,t.connectionEndHandle=null,t.connectionStatus=null,M&&(t.connectionPosition=M)},j=(A,M=null,V=null)=>{t.connectionStartHandle&&(t.connectionPosition=A,t.connectionEndHandle=M,t.connectionStatus=V)},K=(A,M)=>{t.connectionPosition={x:Number.NaN,y:Number.NaN},t.connectionEndHandle=null,t.connectionStatus=null,M?t.connectionClickStartHandle=null:t.connectionStartHandle=null},Q=A=>{const M=$p(A),V=M?null:In(A)?A:c(A.id);return!M&&!V?[null,null,M]:[M?A:xo(V),V,M]},q=(A,M=!0,V=t.nodes)=>{const[X,T,U]=Q(A);if(!X)return[];const W=[];for(const Z of V||t.nodes){if(!U&&(Z.id===T.id||!Z.computedPosition))continue;const ne=xo(Z),te=Co(ne,X);(M&&te>0||te>=ne.width*ne.height||te>=Number(X.width)*Number(X.height))&&W.push(Z)}return W},ee=(A,M,V=!0)=>{const[X]=Q(A);if(!X)return!1;const T=Co(X,M);return V&&T>0||T>=Number(X.width)*Number(X.height)},re=A=>{const{viewport:M,dimensions:V,d3Zoom:X,d3Selection:T,translateExtent:U}=t;if(!X||!T||!A.x&&!A.y)return!1;const W=Qt.translate(M.x+A.x,M.y+A.y).scale(M.zoom),Z=[[0,0],[V.width,V.height]],ne=X.constrain()(W,Z,U),te=t.viewport.x!==ne.x||t.viewport.y!==ne.y||t.viewport.zoom!==ne.k;return X.transform(T,ne),te},oe=A=>{const M=A instanceof Function?A(t):A,V=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];ke(M.defaultEdgeOptions)&&(t.defaultEdgeOptions=M.defaultEdgeOptions);const X=M.modelValue||M.nodes||M.edges?[]:void 0;X&&(M.modelValue&&X.push(...M.modelValue),M.nodes&&X.push(...M.nodes),M.edges&&X.push(...M.edges),E(X));const T=()=>{ke(M.maxZoom)&&z(M.maxZoom),ke(M.minZoom)&&x(M.minZoom),ke(M.translateExtent)&&$(M.translateExtent)};for(const U of Object.keys(M)){const W=U,Z=M[W];![..._g,...V].includes(W)&&ke(Z)&&(t[W]=Z)}$i(()=>t.d3Zoom).not.toBeNull().then(T),t.initialized||(t.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:h,setElements:E,setNodes:S,setEdges:I,addNodes:H,addEdges:w,removeNodes:D,removeEdges:v,findNode:c,findEdge:d,updateEdge:C,updateEdgeData:k,updateNode:B,updateNodeData:P,applyEdgeChanges:R,applyNodeChanges:O,addSelectedElements:b,addSelectedNodes:y,addSelectedEdges:m,setMinZoom:x,setMaxZoom:z,setTranslateExtent:$,setNodeExtent:F,setPaneClickDistance:Y,removeSelectedElements:g,removeSelectedNodes:N,removeSelectedEdges:_,startConnection:L,updateConnection:j,endConnection:K,setInteractive:G,setState:oe,getIntersectingNodes:q,getIncomers:r,getOutgoers:a,getConnectedEdges:l,getHandleConnections:u,isNodeIntersecting:ee,panBy:re,fitView:A=>o.value.fitView(A),zoomIn:A=>o.value.zoomIn(A),zoomOut:A=>o.value.zoomOut(A),zoomTo:(A,M)=>o.value.zoomTo(A,M),setViewport:(A,M)=>o.value.setViewport(A,M),setTransform:(A,M)=>o.value.setTransform(A,M),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(A,M,V)=>o.value.setCenter(A,M,V),fitBounds:(A,M)=>o.value.fitBounds(A,M),project:A=>o.value.project(A),screenToFlowCoordinate:A=>o.value.screenToFlowCoordinate(A),flowToScreenCoordinate:A=>o.value.flowToScreenCoordinate(A),toObject:()=>{const A=[],M=[];for(const V of t.nodes){const{computedPosition:X,handleBounds:T,selected:U,dimensions:W,isParent:Z,resizing:ne,dragging:te,events:fe,...ge}=V;A.push(ge)}for(const V of t.edges){const{selected:X,sourceNode:T,targetNode:U,events:W,...Z}=V;M.push(Z)}return JSON.parse(JSON.stringify({nodes:A,edges:M,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:A=>new Promise(M=>{const{nodes:V,edges:X,position:T,zoom:U,viewport:W}=A;V&&S(V),X&&I(X);const[Z,ne]=W?.x&&W?.y?[W.x,W.y]:T??[null,null];if(Z&&ne){const te=W?.zoom||U||t.viewport.zoom;return $i(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:Z,y:ne,zoom:te}).then(()=>{M(!0)})})}else M(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const A=tl();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const M=Qt.translate(A.defaultViewport.x??0,A.defaultViewport.y??0).scale(Ht(A.defaultViewport.zoom??1,A.minZoom,A.maxZoom)),V=t.viewportRef.getBoundingClientRect(),X=[[0,0],[V.width,V.height]],T=t.d3Zoom.constrain()(M,X,A.translateExtent);t.d3Zoom.transform(t.d3Selection,T)}oe(A)},$destroy:()=>{}}}const Cg=["data-id","data-handleid","data-nodeid","data-handlepos"],Eg={name:"Handle",compatConfig:{MODE:3}},on=s.defineComponent({...Eg,props:{id:{default:null},type:{},position:{default:()=>de.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=s.createPropsRestProxy(t,["position","connectable","connectableStart","connectableEnd","id"]),o=s.toRef(()=>n.type??"source"),i=s.toRef(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:u,vueFlowRef:c,nodesConnectable:d,noDragClassName:f,noPanClassName:h}=we(),{id:p,node:y,nodeEl:m,connectedEdges:b}=Qa(),N=s.ref(),_=s.toRef(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),g=s.toRef(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),x=s.toRef(()=>{var I,E,H,w,D,v;return((I=a.value)==null?void 0:I.nodeId)===p&&((E=a.value)==null?void 0:E.id)===t.id&&((H=a.value)==null?void 0:H.type)===o.value||((w=u.value)==null?void 0:w.nodeId)===p&&((D=u.value)==null?void 0:D.id)===t.id&&((v=u.value)==null?void 0:v.type)===o.value}),z=s.toRef(()=>{var I,E,H;return((I=l.value)==null?void 0:I.nodeId)===p&&((E=l.value)==null?void 0:E.id)===t.id&&((H=l.value)==null?void 0:H.type)===o.value}),{handlePointerDown:$,handleClick:F}=Ja({nodeId:p,handleId:t.id,isValidConnection:i,type:o}),Y=s.computed(()=>typeof t.connectable=="string"&&t.connectable==="single"?!b.value.some(I=>{const E=I[`${o.value}Handle`];return I[o.value]!==p?!1:E?E===t.id:!0}):typeof t.connectable=="number"?b.value.filter(I=>{const E=I[`${o.value}Handle`];return I[o.value]!==p?!1:E?E===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(y,b.value):ke(t.connectable)?t.connectable:d.value);s.onMounted(()=>{var I;if(!y.dimensions.width||!y.dimensions.height)return;const E=(I=y.handleBounds[o.value])==null?void 0:I.find(O=>O.id===t.id);if(!c.value||E)return;const H=c.value.querySelector(".vue-flow__transformationpane");if(!m.value||!N.value||!H||!t.id)return;const w=m.value.getBoundingClientRect(),D=N.value.getBoundingClientRect(),v=window.getComputedStyle(H),{m22:C}=new window.DOMMatrixReadOnly(v.transform),k={id:t.id,position:t.position,x:(D.left-w.left)/C,y:(D.top-w.top)/C,type:o.value,nodeId:p,...Eo(N.value)};y.handleBounds[o.value]=[...y.handleBounds[o.value]??[],k]});function G(I){const E=rr(I);Y.value&&_.value&&(E&&I.button===0||!E)&&$(I)}function S(I){!p||!l.value&&!_.value||Y.value&&F(I)}return e({handleClick:F,handlePointerDown:$,onClick:S,onPointerDown:G}),(I,E)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"handle",ref:N,"data-id":`${s.unref(r)}-${s.unref(p)}-${t.id}-${o.value}`,"data-handleid":t.id,"data-nodeid":s.unref(p),"data-handlepos":I.position,class:s.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${I.position}`,`vue-flow__handle-${t.id}`,s.unref(f),s.unref(h),o.value,{connectable:Y.value,connecting:z.value,connectablestart:_.value,connectableend:g.value,connectionindicator:Y.value&&(_.value&&!x.value||g.value&&x.value)}]]),onMousedown:G,onTouchstartPassive:G,onClick:S},[s.renderSlot(I.$slots,"default",{id:I.id})],42,Cg))}}),Mo=function({sourcePosition:t=de.Bottom,targetPosition:e=de.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const l=a.label??n;return[s.h(on,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?s.h(l):s.h(s.Fragment,[l]),s.h(on,{type:"source",position:t,connectable:o,isValidConnection:r})]};Mo.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Mo.inheritAttrs=!1,Mo.compatConfig={MODE:3};const Sg=Mo,Bo=function({targetPosition:t=de.Top,label:e,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??e;return[s.h(on,{type:"target",position:t,connectable:n,isValidConnection:o}),typeof r!="string"&&r?s.h(r):s.h(s.Fragment,[r])]};Bo.props=["targetPosition","label","isValidTargetPos","connectable","data"],Bo.inheritAttrs=!1,Bo.compatConfig={MODE:3};const Ng=Bo,$o=function({sourcePosition:t=de.Bottom,label:e,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??e;return[typeof r!="string"&&r?s.h(r):s.h(s.Fragment,[r]),s.h(on,{type:"source",position:t,connectable:n,isValidConnection:o})]};$o.props=["sourcePosition","label","isValidSourcePos","connectable","data"],$o.inheritAttrs=!1,$o.compatConfig={MODE:3};const kg=$o,Dg=["transform"],Tg=["width","height","x","y","rx","ry"],Ig=["y"],Mg={name:"EdgeText",compatConfig:{MODE:3}},Bg=s.defineComponent({...Mg,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=s.ref({x:0,y:0,width:0,height:0}),n=s.ref(null),o=s.computed(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);s.onMounted(i),s.watch([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==e.value.width||r.height!==e.value.height)&&(e.value=r)}return(r,a)=>(s.openBlock(),s.createElementBlock("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(s.openBlock(),s.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*r.labelBgPadding[0]}px`,height:`${e.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:s.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,Tg)):s.createCommentVNode("",!0),s.createElementVNode("text",s.mergeProps(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:r.labelStyle}),[s.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.label),{key:0})):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createTextVNode(s.toDisplayString(r.label),1)],64))])],16,Ig)],8,Dg))}}),$g=["id","d","marker-end","marker-start"],zg=["d","stroke-width"],Ag={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},An=s.defineComponent({...Ag,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=s.ref(null),o=s.ref(null),i=s.ref(null),r=s.useAttrs();return e({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("path",s.mergeProps(s.unref(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,$g),a.interactionWidth?(s.openBlock(),s.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,zg)):s.createCommentVNode("",!0),a.label&&a.labelX&&a.labelY?(s.openBlock(),s.createBlock(Bg,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):s.createCommentVNode("",!0)],64))}});function nl({sourceX:t,sourceY:e,targetX:n,targetY:o}){const i=Math.abs(n-t)/2,r=n<t?n+i:n-i,a=Math.abs(o-e)/2,l=o<e?o+a:o-a;return[r,l,i,a]}function ol({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const u=t*.125+i*.375+a*.375+n*.125,c=e*.125+r*.375+l*.375+o*.125,d=Math.abs(u-t),f=Math.abs(c-e);return[u,c,d,f]}function zo(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function il({pos:t,x1:e,y1:n,x2:o,y2:i,c:r}){let a,l;switch(t){case de.Left:a=e-zo(e-o,r),l=n;break;case de.Right:a=e+zo(o-e,r),l=n;break;case de.Top:a=e,l=n-zo(n-i,r);break;case de.Bottom:a=e,l=n+zo(i-n,r);break}return[a,l]}function fr(t){const{sourceX:e,sourceY:n,sourcePosition:o=de.Bottom,targetX:i,targetY:r,targetPosition:a=de.Top,curvature:l=.25}=t,[u,c]=il({pos:o,x1:e,y1:n,x2:i,y2:r,c:l}),[d,f]=il({pos:a,x1:i,y1:r,x2:e,y2:n,c:l}),[h,p,y,m]=ol({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:u,sourceControlY:c,targetControlX:d,targetControlY:f});return[`M${e},${n} C${u},${c} ${d},${f} ${i},${r}`,h,p,y,m]}function rl({pos:t,x1:e,y1:n,x2:o,y2:i}){let r,a;switch(t){case de.Left:case de.Right:r=.5*(e+o),a=n;break;case de.Top:case de.Bottom:r=e,a=.5*(n+i);break}return[r,a]}function sl(t){const{sourceX:e,sourceY:n,sourcePosition:o=de.Bottom,targetX:i,targetY:r,targetPosition:a=de.Top}=t,[l,u]=rl({pos:o,x1:e,y1:n,x2:i,y2:r}),[c,d]=rl({pos:a,x1:i,y1:r,x2:e,y2:n}),[f,h,p,y]=ol({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${e},${n} C${l},${u} ${c},${d} ${i},${r}`,f,h,p,y]}const al={[de.Left]:{x:-1,y:0},[de.Right]:{x:1,y:0},[de.Top]:{x:0,y:-1},[de.Bottom]:{x:0,y:1}};function Pg({source:t,sourcePosition:e=de.Bottom,target:n}){return e===de.Left||e===de.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function ll(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Og({source:t,sourcePosition:e=de.Bottom,target:n,targetPosition:o=de.Top,center:i,offset:r}){const a=al[e],l=al[o],u={x:t.x+a.x*r,y:t.y+a.y*r},c={x:n.x+l.x*r,y:n.y+l.y*r},d=Pg({source:u,sourcePosition:e,target:c}),f=d.x!==0?"x":"y",h=d[f];let p,y,m;const b={x:0,y:0},N={x:0,y:0},[_,g,x,z]=nl({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){y=i.x??_,m=i.y??g;const F=[{x:y,y:u.y},{x:y,y:c.y}],Y=[{x:u.x,y:m},{x:c.x,y:m}];a[f]===h?p=f==="x"?F:Y:p=f==="x"?Y:F}else{const F=[{x:u.x,y:c.y}],Y=[{x:c.x,y:u.y}];if(f==="x"?p=a.x===h?Y:F:p=a.y===h?F:Y,e===o){const H=Math.abs(t[f]-n[f]);if(H<=r){const w=Math.min(r-1,r-H);a[f]===h?b[f]=(u[f]>t[f]?-1:1)*w:N[f]=(c[f]>n[f]?-1:1)*w}}if(e!==o){const H=f==="x"?"y":"x",w=a[f]===l[H],D=u[H]>c[H],v=u[H]<c[H];(a[f]===1&&(!w&&D||w&&v)||a[f]!==1&&(!w&&v||w&&D))&&(p=f==="x"?F:Y)}const G={x:u.x+b.x,y:u.y+b.y},S={x:c.x+N.x,y:c.y+N.y},I=Math.max(Math.abs(G.x-p[0].x),Math.abs(S.x-p[0].x)),E=Math.max(Math.abs(G.y-p[0].y),Math.abs(S.y-p[0].y));I>=E?(y=(G.x+S.x)/2,m=p[0].y):(y=p[0].x,m=(G.y+S.y)/2)}return[[t,{x:u.x+b.x,y:u.y+b.y},...p,{x:c.x+N.x,y:c.y+N.y},n],y,m,x,z]}function Rg(t,e,n,o){const i=Math.min(ll(t,e)/2,ll(e,n)/2,o),{x:r,y:a}=e;if(t.x===r&&r===n.x||t.y===a&&a===n.y)return`L${r} ${a}`;if(t.y===a){const c=t.x<n.x?-1:1,d=t.y<n.y?1:-1;return`L ${r+i*c},${a}Q ${r},${a} ${r},${a+i*d}`}const l=t.x<n.x?1:-1,u=t.y<n.y?-1:1;return`L ${r},${a+i*u}Q ${r},${a} ${r+i*l},${a}`}function hr(t){const{sourceX:e,sourceY:n,sourcePosition:o=de.Bottom,targetX:i,targetY:r,targetPosition:a=de.Top,borderRadius:l=5,centerX:u,centerY:c,offset:d=20}=t,[f,h,p,y,m]=Og({source:{x:e,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:u,y:c},offset:d});return[f.reduce((N,_,g)=>{let x;return g>0&&g<f.length-1?x=Rg(f[g-1],_,f[g+1],l):x=`${g===0?"M":"L"}${_.x} ${_.y}`,N+=x,N},""),h,p,y,m]}function Hg(t){const{sourceX:e,sourceY:n,targetX:o,targetY:i}=t,[r,a,l,u]=nl({sourceX:e,sourceY:n,targetX:o,targetY:i});return[`M ${e},${n}L ${o},${i}`,r,a,l,u]}const Vg=s.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Hg(t);return s.h(An,{path:n,labelX:o,labelY:i,...e,...t})}}}),cl=s.defineComponent({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=hr({...t,sourcePosition:t.sourcePosition??de.Bottom,targetPosition:t.targetPosition??de.Top});return s.h(An,{path:n,labelX:o,labelY:i,...e,...t})}}}),Lg=s.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>s.h(cl,{...t,...e,borderRadius:0})}}),Fg=s.defineComponent({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=fr({...t,sourcePosition:t.sourcePosition??de.Bottom,targetPosition:t.targetPosition??de.Top});return s.h(An,{path:n,labelX:o,labelY:i,...e,...t})}}}),jg=s.defineComponent({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=sl({...t,sourcePosition:t.sourcePosition??de.Bottom,targetPosition:t.targetPosition??de.Top});return s.h(An,{path:n,labelX:o,labelY:i,...e,...t})}}}),Gg={input:kg,default:Sg,output:Ng},Wg={default:Fg,straight:Vg,step:Lg,smoothstep:cl,simplebezier:jg};function Yg(t,e,n){const o=s.computed(()=>m=>e.value.get(m)),i=s.computed(()=>m=>n.value.get(m)),r=s.computed(()=>{const m={...Wg,...t.edgeTypes},b=Object.keys(m);for(const N of t.edges)N.type&&!b.includes(N.type)&&(m[N.type]=N.type);return m}),a=s.computed(()=>{const m={...Gg,...t.nodeTypes},b=Object.keys(m);for(const N of t.nodes)N.type&&!b.includes(N.type)&&(m[N.type]=N.type);return m}),l=s.computed(()=>t.onlyRenderVisibleElements?Ea(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),u=s.computed(()=>{if(t.onlyRenderVisibleElements){const m=[];for(const b of t.edges){const N=e.value.get(b.source),_=e.value.get(b.target);Up({sourcePos:N.computedPosition||{x:0,y:0},targetPos:_.computedPosition||{x:0,y:0},sourceWidth:N.dimensions.width,sourceHeight:N.dimensions.height,targetWidth:_.dimensions.width,targetHeight:_.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&m.push(b)}return m}return t.edges}),c=s.computed(()=>[...l.value,...u.value]),d=s.computed(()=>{const m=[];for(const b of t.nodes)b.selected&&m.push(b);return m}),f=s.computed(()=>{const m=[];for(const b of t.edges)b.selected&&m.push(b);return m}),h=s.computed(()=>[...d.value,...f.value]),p=s.computed(()=>{const m=[];for(const b of t.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&m.push(b);return m}),y=s.computed(()=>l.value.length>0&&p.value.length===l.value.length);return{getNode:o,getEdge:i,getElements:c,getEdgeTypes:r,getNodeTypes:a,getEdges:u,getNodes:l,getSelectedElements:h,getSelectedNodes:d,getSelectedEdges:f,getNodesInitialized:p,areNodesInitialized:y}}class Lt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=s.getCurrentInstance())==null?void 0:e.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??Lt.instance;return Lt.instance=o??new Lt,n&&(n.config.globalProperties.$vueFlowStorage=Lt.instance),Lt.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const o=tl(),i=s.reactive(o),r={};for(const[h,p]of Object.entries(i.hooks)){const y=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[y]=p.on}const a={};for(const[h,p]of Object.entries(i.hooks))a[h]=p.trigger;const l=s.computed(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),u=s.computed(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),c=Yg(i,l,u),d=xg(i,l,u);d.setState({...i,...n});const f={...r,...c,...d,...Ld(i),nodeLookup:l,edgeLookup:u,emits:a,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,f),f}getId(){return`vue-flow-${this.currentId++}`}}function we(t){const e=Lt.getInstance(),n=s.getCurrentScope(),o=typeof t=="object",i=o?t:{id:t},r=i.id,a=r??n?.vueFlowId;let l;if(n){const u=s.inject(Xa,null);typeof u<"u"&&u!==null&&(!a||u.id===a)&&(l=u)}if(l||a&&(l=e.get(a)),!l||a&&l.id!==a){const u=r??e.getId(),c=e.create(u,i);l=c,(n??s.effectScope(!0)).run(()=>{s.watch(c.applyDefault,(f,h,p)=>{const y=b=>{c.applyNodeChanges(b)},m=b=>{c.applyEdgeChanges(b)};f?(c.onNodesChange(y),c.onEdgesChange(m)):(c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(m)),p(()=>{c.hooks.value.nodesChange.off(y),c.hooks.value.edgesChange.off(m)})},{immediate:!0}),mn(()=>{if(l){const f=e.get(l.id);f?f.$destroy():zn(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&(s.provide(Xa,l),n.vueFlowId=l.id),o){const u=s.getCurrentInstance();u?.type.name!=="VueFlow"&&l.emits.error(new Be(Ne.USEVUEFLOW_OPTIONS))}return l}function Ug(t){const{emits:e,dimensions:n}=we();let o;s.onMounted(()=>{const i=()=>{var r,a;if(!t.value||!(((a=(r=t.value).checkVisibility)==null?void 0:a.call(r))??!0))return;const l=Eo(t.value);(l.width===0||l.height===0)&&e.error(new Be(Ne.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),t.value&&(o=new ResizeObserver(()=>i()),o.observe(t.value)),s.onBeforeUnmount(()=>{window.removeEventListener("resize",i),o&&t.value&&o.unobserve(t.value)})})}const Xg={name:"UserSelection",compatConfig:{MODE:3}},qg=s.defineComponent({...Xg,props:{userSelectionRect:{}},setup(t){return(e,n)=>(s.openBlock(),s.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:s.normalizeStyle({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Kg=["tabIndex"],Zg={name:"NodesSelection",compatConfig:{MODE:3}},Jg=s.defineComponent({...Zg,setup(t){const{emits:e,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=we(),l=el(),u=s.ref(null),c=Za({el:u,onStart(y){e.selectionDragStart(y),e.nodeDragStart(y)},onDrag(y){e.selectionDrag(y),e.nodeDrag(y)},onStop(y){e.selectionDragStop(y),e.nodeDragStop(y)}});s.onMounted(()=>{var y;r.value||(y=u.value)==null||y.focus({preventScroll:!0})});const d=s.computed(()=>Ca(o.value)),f=s.computed(()=>({width:`${d.value.width}px`,height:`${d.value.height}px`,top:`${d.value.y}px`,left:`${d.value.x}px`}));function h(y){e.selectionContextMenu({event:y,nodes:o.value})}function p(y){r.value||en[y.key]&&(y.preventDefault(),l({x:en[y.key].x,y:en[y.key].y},y.shiftKey))}return(y,m)=>!s.unref(a)&&d.value.width&&d.value.height?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["vue-flow__nodesselection vue-flow__container",s.unref(i)]),style:s.normalizeStyle({transform:`translate(${s.unref(n).x}px,${s.unref(n).y}px) scale(${s.unref(n).zoom})`})},[s.createElementVNode("div",{ref_key:"el",ref:u,class:s.normalizeClass([{dragging:s.unref(c)},"vue-flow__nodesselection-rect"]),style:s.normalizeStyle(f.value),tabIndex:s.unref(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,Kg)],6)):s.createCommentVNode("",!0)}});function Qg(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}const em={name:"Pane",compatConfig:{MODE:3}},tm=s.defineComponent({...em,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:u,nodesSelectionActive:c,getSelectedEdges:d,getSelectedNodes:f,removeNodes:h,removeEdges:p,selectionMode:y,deleteKeyCode:m,multiSelectionKeyCode:b,multiSelectionActive:N,edgeLookup:_,nodeLookup:g,connectionLookup:x,defaultEdgeOptions:z,connectionStartHandle:$,panOnDrag:F}=we(),Y=s.shallowRef(null),G=s.shallowRef(new Set),S=s.shallowRef(new Set),I=s.shallowRef(null),E=s.toRef(()=>u.value&&(t.isSelecting||r.value)),H=s.toRef(()=>$.value!==null);let w=!1,D=!1;const v=Tn(m,{actInsideInputWithModifier:!1}),C=Tn(b);s.watch(v,K=>{K&&(h(f.value),p(d.value),c.value=!1)}),s.watch(C,K=>{N.value=K});function k(K,Q){return q=>{q.target===Q&&K?.(q)}}function O(K){if(w||H.value){w=!1;return}i.paneClick(K),a(),c.value=!1}function R(K){var Q;if(Array.isArray(F.value)&&((Q=F.value)!=null&&Q.includes(2))){K.preventDefault();return}i.paneContextMenu(K)}function B(K){i.paneScroll(K)}function P(K){var Q,q,ee;if(I.value=((Q=e.value)==null?void 0:Q.getBoundingClientRect())??null,!u.value||!t.isSelecting||K.button!==0||K.target!==Y.value||!I.value)return;(ee=(q=K.target)==null?void 0:q.setPointerCapture)==null||ee.call(q,K.pointerId);const{x:re,y:oe}=Qg(K,I.value);D=!0,w=!1,a(),l.value={width:0,height:0,startX:re,startY:oe,x:re,y:oe},i.selectionStart(K)}function L(K){var Q;if(!I.value||!l.value)return;w=!0;const{x:q,y:ee}=lt(K,I.value),{startX:re=0,startY:oe=0}=l.value,ce={startX:re,startY:oe,x:q<re?q:re,y:ee<oe?ee:oe,width:Math.abs(q-re),height:Math.abs(ee-oe)},ie=G.value,se=S.value;G.value=new Set(Ea(n.value,ce,o.value,y.value===er.Partial,!0).map(M=>M.id)),S.value=new Set;const A=((Q=z.value)==null?void 0:Q.selectable)??!0;for(const M of G.value){const V=x.value.get(M);if(V)for(const{edgeId:X}of V.values()){const T=_.value.get(X);T&&(T.selectable??A)&&S.value.add(X)}}if(!Ua(ie,G.value)){const M=kt(g.value,G.value,!0);i.nodesChange(M)}if(!Ua(se,S.value)){const M=kt(_.value,S.value);i.edgesChange(M)}l.value=ce,r.value=!0,c.value=!1}function j(K){var Q;K.button!==0||!D||((Q=K.target)==null||Q.releasePointerCapture(K.pointerId),!r.value&&l.value&&K.target===Y.value&&O(K),r.value=!1,l.value=null,c.value=G.value.size>0,i.selectionEnd(K),t.selectionKeyPressed&&(w=!1),D=!1)}return(K,Q)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"container",ref:Y,class:s.normalizeClass(["vue-flow__pane vue-flow__container",{selection:K.isSelecting}]),onClick:Q[0]||(Q[0]=q=>E.value?void 0:k(O,Y.value)(q)),onContextmenu:Q[1]||(Q[1]=q=>k(R,Y.value)(q)),onWheelPassive:Q[2]||(Q[2]=q=>k(B,Y.value)(q)),onPointerenter:Q[3]||(Q[3]=q=>E.value?void 0:s.unref(i).paneMouseEnter(q)),onPointerdown:Q[4]||(Q[4]=q=>E.value?P(q):s.unref(i).paneMouseMove(q)),onPointermove:Q[5]||(Q[5]=q=>E.value?L(q):s.unref(i).paneMouseMove(q)),onPointerup:Q[6]||(Q[6]=q=>E.value?j(q):void 0),onPointerleave:Q[7]||(Q[7]=q=>s.unref(i).paneMouseLeave(q))},[s.renderSlot(K.$slots,"default"),s.unref(r)&&s.unref(l)?(s.openBlock(),s.createBlock(qg,{key:0,"user-selection-rect":s.unref(l)},null,8,["user-selection-rect"])):s.createCommentVNode("",!0),s.unref(c)&&s.unref(f).length?(s.openBlock(),s.createBlock(Jg,{key:1})):s.createCommentVNode("",!0)],34))}}),nm={name:"Transform",compatConfig:{MODE:3}},om=s.defineComponent({...nm,setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:o}=we(),i=s.computed(()=>n.value?!o.value:!1),r=s.computed(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>(s.openBlock(),s.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:s.normalizeStyle({transform:r.value,opacity:i.value?0:void 0})},[s.renderSlot(a.$slots,"default")],4))}}),im={name:"Viewport",compatConfig:{MODE:3}},rm=s.defineComponent({...im,setup(t){const{minZoom:e,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:u,panOnScrollMode:c,panOnScrollSpeed:d,panOnDrag:f,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:y,preventScrolling:m,noWheelClassName:b,noPanClassName:N,emits:_,connectionStartHandle:g,userSelectionActive:x,paneDragging:z,d3Zoom:$,d3Selection:F,d3ZoomHandler:Y,viewport:G,viewportRef:S,paneClickDistance:I}=we();Ug(S);const E=s.shallowRef(!1),H=s.shallowRef(!1);let w=null,D=!1,v=0,C={x:0,y:0,zoom:0};const k=Tn(l),O=Tn(a),R=Tn(r),B=s.toRef(()=>(!O.value||O.value&&a.value===!0)&&(k.value||f.value)),P=s.toRef(()=>k.value||u.value),L=s.toRef(()=>a.value===!0&&B.value!==!0),j=s.toRef(()=>O.value&&a.value!==!0||x.value||L.value),K=s.toRef(()=>g.value!==null);s.onMounted(()=>{if(!S.value){zn("Viewport element is missing");return}const oe=S.value,ce=oe.getBoundingClientRect(),ie=Np().clickDistance(I.value).scaleExtent([e.value,n.value]).translateExtent(i.value),se=Je(oe).call(ie),A=se.on("wheel.zoom"),M=Qt.translate(o.value.x??0,o.value.y??0).scale(Ht(o.value.zoom??1,e.value,n.value)),V=[[0,0],[ce.width,ce.height]],X=ie.constrain()(M,V,i.value);ie.transform(se,X),ie.wheelDelta(Da),$.value=ie,F.value=se,Y.value=A,G.value={x:X.x,y:X.y,zoom:X.k},ie.on("start",T=>{var U;if(!T.sourceEvent)return null;v=T.sourceEvent.button,E.value=!0;const W=ee(T.transform);((U=T.sourceEvent)==null?void 0:U.type)==="mousedown"&&(z.value=!0),C=W,_.viewportChangeStart(W),_.moveStart({event:T,flowTransform:W})}),ie.on("end",T=>{if(!T.sourceEvent)return null;if(E.value=!1,z.value=!1,Q(B.value,v??0)&&!D&&_.paneContextMenu(T.sourceEvent),D=!1,q(C,T.transform)){const U=ee(T.transform);C=U,_.viewportChangeEnd(U),_.moveEnd({event:T,flowTransform:U})}}),ie.filter(T=>{var U;const W=R.value||y.value,Z=p.value&&T.ctrlKey,ne=T.button,te=T.type==="wheel";if(ne===1&&T.type==="mousedown"&&(re(T,"vue-flow__node")||re(T,"vue-flow__edge")))return!0;if(!B.value&&!W&&!P.value&&!h.value&&!p.value||x.value||K.value&&!te||!h.value&&T.type==="dblclick"||re(T,b.value)&&te||re(T,N.value)&&(!te||P.value&&te&&!R.value)||!p.value&&T.ctrlKey&&te||!W&&!P.value&&!Z&&te)return!1;if(!p&&T.type==="touchstart"&&((U=T.touches)==null?void 0:U.length)>1)return T.preventDefault(),!1;if(!B.value&&(T.type==="mousedown"||T.type==="touchstart")||L.value&&Array.isArray(f.value)&&f.value.includes(0)&&ne===0||Array.isArray(f.value)&&!f.value.includes(ne)&&(T.type==="mousedown"||T.type==="touchstart"))return!1;const fe=Array.isArray(f.value)&&f.value.includes(ne)||a.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!ne||ne<=1;return(!T.ctrlKey||k.value||te)&&fe}),s.watch([x,B],()=>{x.value&&!E.value?ie.on("zoom",null):x.value||ie.on("zoom",T=>{G.value={x:T.transform.x,y:T.transform.y,zoom:T.transform.k};const U=ee(T.transform);D=Q(B.value,v??0),_.viewportChange(U),_.move({event:T,flowTransform:U})})},{immediate:!0}),s.watch([x,P,c,R,p,m,b],()=>{P.value&&!R.value&&!x.value?se.on("wheel.zoom",T=>{if(re(T,b.value))return!1;const U=R.value||y.value,W=p.value&&T.ctrlKey;if(!(!m.value||P.value||U||W))return!1;T.preventDefault(),T.stopImmediatePropagation();const ne=se.property("__zoom").k||1,te=No();if(!k.value&&T.ctrlKey&&p.value&&te){const Ze=it(T),_e=Da(T),xt=ne*2**_e;ie.scaleTo(se,xt,Ze,T);return}const fe=T.deltaMode===1?20:1;let ge=c.value===Dn.Vertical?0:T.deltaX*fe,Ie=c.value===Dn.Horizontal?0:T.deltaY*fe;!te&&T.shiftKey&&c.value!==Dn.Vertical&&!ge&&Ie&&(ge=Ie,Ie=0),ie.translateBy(se,-(ge/ne)*d.value,-(Ie/ne)*d.value);const Me=ee(se.property("__zoom"));w&&clearTimeout(w),H.value?(_.move({event:T,flowTransform:Me}),_.viewportChange(Me),w=setTimeout(()=>{_.moveEnd({event:T,flowTransform:Me}),_.viewportChangeEnd(Me),H.value=!1},150)):(H.value=!0,_.moveStart({event:T,flowTransform:Me}),_.viewportChangeStart(Me))},{passive:!1}):typeof A<"u"&&se.on("wheel.zoom",function(T,U){const W=!m.value&&T.type==="wheel"&&!T.ctrlKey,Z=R.value||y.value,ne=p.value&&T.ctrlKey;if(!Z&&!u.value&&!ne&&T.type==="wheel"||W||re(T,b.value))return null;T.preventDefault(),A.call(this,T,U)},{passive:!1})},{immediate:!0})});function Q(oe,ce){return ce===2&&Array.isArray(oe)&&oe.includes(2)}function q(oe,ce){return oe.x!==ce.x&&!Number.isNaN(ce.x)||oe.y!==ce.y&&!Number.isNaN(ce.y)||oe.zoom!==ce.k&&!Number.isNaN(ce.k)}function ee(oe){return{x:oe.x,y:oe.y,zoom:oe.k}}function re(oe,ce){return oe.target.closest(`.${ce}`)}return(oe,ce)=>(s.openBlock(),s.createElementBlock("div",{ref_key:"viewportRef",ref:S,class:"vue-flow__viewport vue-flow__container"},[s.createVNode(tm,{"is-selecting":j.value,"selection-key-pressed":s.unref(O),class:s.normalizeClass({connecting:K.value,dragging:s.unref(z),draggable:s.unref(f)===!0||Array.isArray(s.unref(f))&&s.unref(f).includes(0)})},{default:s.withCtx(()=>[s.createVNode(om,null,{default:s.withCtx(()=>[s.renderSlot(oe.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),sm=["id"],am=["id"],lm=["id"],cm={name:"A11yDescriptions",compatConfig:{MODE:3}},dm=s.defineComponent({...cm,setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:o}=we();return(i,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",{id:`${s.unref(pa)}-${s.unref(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+s.toDisplayString(s.unref(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,sm),s.createElementVNode("div",{id:`${s.unref(ga)}-${s.unref(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,am),s.unref(n)?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:0,id:`${s.unref(Bp)}-${s.unref(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},s.toDisplayString(s.unref(o)),9,lm))],64))}});function um(){const t=we();s.watch(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function fm(t,e,n){return n===de.Left?t-e:n===de.Right?t+e:t}function hm(t,e,n){return n===de.Top?t-e:n===de.Bottom?t+e:t}const pr=function({radius:t=10,centerX:e=0,centerY:n=0,position:o=de.Top,type:i}){return s.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:fm(e,t,o),cy:hm(n,t,o),r:t,stroke:"transparent",fill:"transparent"})};pr.props=["radius","centerX","centerY","position","type"],pr.compatConfig={MODE:3};const dl=pr,pm=s.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:u,removeSelectedEdges:c,findEdge:d,findNode:f,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:y,elementsSelectable:m,edgesUpdatable:b,edgesFocusable:N,hooks:_}=we(),g=s.computed(()=>d(t.id)),{emit:x,on:z}=cg(g.value,r),$=s.inject(Do),F=s.getCurrentInstance(),Y=s.ref(!1),G=s.ref(!1),S=s.ref(""),I=s.ref(null),E=s.ref("source"),H=s.ref(null),w=s.toRef(()=>typeof g.value.selectable>"u"?m.value:g.value.selectable),D=s.toRef(()=>typeof g.value.updatable>"u"?b.value:g.value.updatable),v=s.toRef(()=>typeof g.value.focusable>"u"?N.value:g.value.focusable);s.provide(sg,t.id),s.provide(ag,H);const C=s.computed(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),k=s.computed(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),O=s.computed(()=>{const M=g.value.type||"default",V=$?.[`edge-${M}`];if(V)return V;let X=g.value.template??u.value[M];if(typeof X=="string"&&F){const T=Object.keys(F.appContext.components);T&&T.includes(M)&&(X=s.resolveComponent(M,!1))}return X&&typeof X!="string"?X:(r.error(new Be(Ne.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:R}=Ja({nodeId:S,handleId:I,type:E,isValidConnection:h,edgeUpdaterType:E,onEdgeUpdate:L,onEdgeUpdateEnd:j});return()=>{const M=f(g.value.source),V=f(g.value.target),X="pathOptions"in g.value?g.value.pathOptions:{};if(!M&&!V)return r.error(new Be(Ne.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!M)return r.error(new Be(Ne.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!V)return r.error(new Be(Ne.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||M.hidden||V.hidden)return null;let T;o.value===gt.Strict?T=M.handleBounds.source:T=[...M.handleBounds.source||[],...M.handleBounds.target||[]];const U=Ra(T,g.value.sourceHandle);let W;o.value===gt.Strict?W=V.handleBounds.target:W=[...V.handleBounds.target||[],...V.handleBounds.source||[]];const Z=Ra(W,g.value.targetHandle),ne=U?.position||de.Bottom,te=Z?.position||de.Top,{x:fe,y:ge}=nn(M,U,ne),{x:Ie,y:Me}=nn(V,Z,te);return g.value.sourceX=fe,g.value.sourceY=ge,g.value.targetX=Ie,g.value.targetY=Me,s.h("g",{ref:H,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${O.value===!1?"default":g.value.type||"default"}`,l.value,C.value,{updating:Y.value,selected:g.value.selected,animated:g.value.animated,inactive:!w.value&&!_.value.edgeClick.hasListeners()}],tabIndex:v.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel??`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":v.value?`${ga}-${e}`:void 0,"aria-roledescription":"edge",role:v.value?"group":"img",...g.value.domAttributes,onClick:Q,onContextmenu:q,onDblclick:ee,onMouseenter:re,onMousemove:oe,onMouseleave:ce,onKeyDown:v.value?A:void 0},[G.value?null:s.h(O.value===!1?u.value.default:O.value,{id:t.id,sourceNode:M,targetNode:V,source:g.value.source,target:g.value.target,type:g.value.type,updatable:D.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...z},style:k.value,markerStart:`url('#${$n(g.value.markerStart,e)}')`,markerEnd:`url('#${$n(g.value.markerEnd,e)}')`,sourcePosition:ne,targetPosition:te,sourceX:fe,sourceY:ge,targetX:Ie,targetY:Me,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...X}),[D.value==="source"||D.value===!0?[s.h("g",{onMousedown:ie,onMouseenter:B,onMouseout:P},s.h(dl,{position:ne,centerX:fe,centerY:ge,radius:i.value,type:"source","data-type":"source"}))]:null,D.value==="target"||D.value===!0?[s.h("g",{onMousedown:se,onMouseenter:B,onMouseout:P},s.h(dl,{position:te,centerX:Ie,centerY:Me,radius:i.value,type:"target","data-type":"target"}))]:null]])};function B(){Y.value=!0}function P(){Y.value=!1}function L(M,V){x.update({event:M,edge:g.value,connection:V})}function j(M){x.updateEnd({event:M,edge:g.value}),G.value=!1}function K(M,V){M.button===0&&(G.value=!0,S.value=V?g.value.target:g.value.source,I.value=(V?g.value.targetHandle:g.value.sourceHandle)??null,E.value=V?"target":"source",x.updateStart({event:M,edge:g.value}),R(M))}function Q(M){var V;const X={event:M,edge:g.value};w.value&&(a.value=!1,g.value.selected&&p.value?(c([g.value]),(V=H.value)==null||V.blur()):n([g.value])),x.click(X)}function q(M){x.contextMenu({event:M,edge:g.value})}function ee(M){x.doubleClick({event:M,edge:g.value})}function re(M){x.mouseEnter({event:M,edge:g.value})}function oe(M){x.mouseMove({event:M,edge:g.value})}function ce(M){x.mouseLeave({event:M,edge:g.value})}function ie(M){K(M,!0)}function se(M){K(M,!1)}function A(M){var V;!y.value&&ma.includes(M.key)&&w.value&&(M.key==="Escape"?((V=H.value)==null||V.blur(),c([d(t.id)])):n([d(t.id)]))}}}),gm=s.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:u,connectionStatus:c,viewport:d,findNode:f}=we(),h=(t=s.inject(Do))==null?void 0:t["connection-line"],p=s.computed(()=>{var _;return f((_=o.value)==null?void 0:_.nodeId)}),y=s.computed(()=>{var _;return f((_=i.value)==null?void 0:_.nodeId)??null}),m=s.computed(()=>({x:(r.value.x-d.value.x)/d.value.zoom,y:(r.value.y-d.value.y)/d.value.zoom})),b=s.computed(()=>u.value.markerStart?`url(#${$n(u.value.markerStart,e)})`:""),N=s.computed(()=>u.value.markerEnd?`url(#${$n(u.value.markerEnd,e)})`:"");return()=>{var _,g,x;if(!p.value||!o.value)return null;const z=o.value.id,$=o.value.type,F=p.value.handleBounds;let Y=F?.[$]??[];if(n.value===gt.Loose){const k=F?.[$==="source"?"target":"source"]??[];Y=[...Y,...k]}if(!Y)return null;const G=(z?Y.find(k=>k.id===z):Y[0])??null,S=G?.position??de.Top,{x:I,y:E}=nn(p.value,G,S);let H=null;y.value&&(n.value===gt.Strict?H=((_=y.value.handleBounds[$==="source"?"target":"source"])==null?void 0:_.find(k=>{var O;return k.id===((O=i.value)==null?void 0:O.id)}))||null:H=((g=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:g.find(k=>{var O;return k.id===((O=i.value)==null?void 0:O.id)}))||null);const w=((x=i.value)==null?void 0:x.position)??(S?ar[S]:null);if(!S||!w)return null;const D=a.value??u.value.type??Rt.Bezier;let v="";const C={sourceX:I,sourceY:E,sourcePosition:S,targetX:m.value.x,targetY:m.value.y,targetPosition:w};return D===Rt.Bezier?[v]=fr(C):D===Rt.Step?[v]=hr({...C,borderRadius:0}):D===Rt.SmoothStep?[v]=hr(C):D===Rt.SimpleBezier?[v]=sl(C):v=`M${I},${E} ${m.value.x},${m.value.y}`,s.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},s.h("g",{class:"vue-flow__connection"},h?s.h(h,{sourceX:I,sourceY:E,sourcePosition:S,targetX:m.value.x,targetY:m.value.y,targetPosition:w,sourceNode:p.value,sourceHandle:G,targetNode:y.value,targetHandle:H,markerEnd:N.value,markerStart:b.value,connectionStatus:c.value}):s.h("path",{d:v,class:[u.value.class,c.value,"vue-flow__connection-path"],style:{...l.value,...u.value.style},"marker-end":N.value,"marker-start":b.value})))}}}),mm=["id","markerWidth","markerHeight","markerUnits","orient"],ym={name:"MarkerType",compatConfig:{MODE:3}},vm=s.defineComponent({...ym,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>(s.openBlock(),s.createElementBlock("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===s.unref(mt).ArrowClosed?(s.openBlock(),s.createElementBlock("polyline",{key:0,style:s.normalizeStyle({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):s.createCommentVNode("",!0),e.type===s.unref(mt).Arrow?(s.openBlock(),s.createElementBlock("polyline",{key:1,style:s.normalizeStyle({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):s.createCommentVNode("",!0)],8,mm))}}),bm={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},wm={name:"MarkerDefinitions",compatConfig:{MODE:3}},_m=s.defineComponent({...wm,setup(t){const{id:e,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=we(),r=s.computed(()=>{const a=new Set,l=[],u=c=>{if(c){const d=$n(c,e);a.has(d)||(typeof c=="object"?l.push({...c,id:d,color:c.color||i.value}):l.push({id:d,color:i.value,type:c}),a.add(d))}};for(const c of[o.value.markerEnd,o.value.markerStart])u(c);for(const c of n.value)for(const d of[c.markerStart,c.markerEnd])u(d);return l.sort((c,d)=>c.id.localeCompare(d.id))});return(a,l)=>(s.openBlock(),s.createElementBlock("svg",bm,[s.createElementVNode("defs",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.value,u=>(s.openBlock(),s.createBlock(vm,{id:u.id,key:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,"stroke-width":u.strokeWidth,orient:u.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),xm={name:"Edges",compatConfig:{MODE:3}},Cm=s.defineComponent({...xm,setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:o}=we();return(i,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(_m),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(n),a=>(s.openBlock(),s.createElementBlock("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:s.normalizeStyle({zIndex:s.unref(Xp)(a,s.unref(e),s.unref(o))})},[s.createVNode(s.unref(pm),{id:a.id},null,8,["id"])],4))),128)),s.createVNode(s.unref(gm))],64))}}),Em=s.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:l,addSelectedNodes:u,updateNodeDimensions:c,onUpdateNodeInternals:d,getNodeTypes:f,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:y,ariaLiveMessage:m,snapToGrid:b,snapGrid:N,nodeDragThreshold:_,nodesDraggable:g,elementsSelectable:x,nodesConnectable:z,nodesFocusable:$,hooks:F}=we(),Y=s.ref(null);s.provide(Ka,Y),s.provide(qa,t.id);const G=s.inject(Do),S=s.getCurrentInstance(),I=el(),{node:E,parentNode:H}=Qa(t.id),{emit:w,on:D}=hg(E,a),v=s.toRef(()=>typeof E.draggable>"u"?g.value:E.draggable),C=s.toRef(()=>typeof E.selectable>"u"?x.value:E.selectable),k=s.toRef(()=>typeof E.connectable>"u"?z.value:E.connectable),O=s.toRef(()=>typeof E.focusable>"u"?$.value:E.focusable),R=s.computed(()=>C.value||v.value||F.value.nodeClick.hasListeners()||F.value.nodeDoubleClick.hasListeners()||F.value.nodeMouseEnter.hasListeners()||F.value.nodeMouseMove.hasListeners()||F.value.nodeMouseLeave.hasListeners()),B=s.toRef(()=>!!E.dimensions.width&&!!E.dimensions.height),P=s.computed(()=>{const V=E.type||"default",X=G?.[`node-${V}`];if(X)return X;let T=E.template||f.value[V];if(typeof T=="string"&&S){const U=Object.keys(S.appContext.components);U&&U.includes(V)&&(T=s.resolveComponent(V,!1))}return T&&typeof T!="string"?T:(a.error(new Be(Ne.NODE_TYPE_MISSING,T)),!1)}),L=Za({id:t.id,el:Y,disabled:()=>!v.value,selectable:C,dragHandle:()=>E.dragHandle,onStart(V){w.dragStart(V)},onDrag(V){w.drag(V)},onStop(V){w.dragStop(V)},onClick(V){A(V)}}),j=s.computed(()=>E.class instanceof Function?E.class(E):E.class),K=s.computed(()=>{const V=(E.style instanceof Function?E.style(E):E.style)||{},X=E.width instanceof Function?E.width(E):E.width,T=E.height instanceof Function?E.height(E):E.height;return!V.width&&X&&(V.width=typeof X=="string"?X:`${X}px`),!V.height&&T&&(V.height=typeof T=="string"?T:`${T}px`),V}),Q=s.toRef(()=>Number(E.zIndex??K.value.zIndex??0));return d(V=>{(V.includes(t.id)||!V.length)&&ee()}),s.onMounted(()=>{s.watch(()=>E.hidden,(V=!1,X,T)=>{!V&&Y.value&&(t.resizeObserver.observe(Y.value),T(()=>{Y.value&&t.resizeObserver.unobserve(Y.value)}))},{immediate:!0,flush:"post"})}),s.watch([()=>E.type,()=>E.sourcePosition,()=>E.targetPosition],()=>{s.nextTick(()=>{c([{id:t.id,nodeElement:Y.value,forceUpdate:!0}])})}),s.watch([()=>E.position.x,()=>E.position.y,()=>{var V;return(V=H.value)==null?void 0:V.computedPosition.x},()=>{var V;return(V=H.value)==null?void 0:V.computedPosition.y},()=>{var V;return(V=H.value)==null?void 0:V.computedPosition.z},Q,()=>E.selected,()=>E.dimensions.height,()=>E.dimensions.width,()=>{var V;return(V=H.value)==null?void 0:V.dimensions.height},()=>{var V;return(V=H.value)==null?void 0:V.dimensions.width}],([V,X,T,U,W,Z])=>{const ne={x:V,y:X,z:Z+(p.value&&E.selected?1e3:0)};typeof T<"u"&&typeof U<"u"?E.computedPosition=Fp({x:T,y:U,z:W},ne):E.computedPosition=ne},{flush:"post",immediate:!0}),s.watch([()=>E.extent,h],([V,X],[T,U])=>{(V!==T||X!==U)&&q()}),E.extent==="parent"||typeof E.extent=="object"&&"range"in E.extent&&E.extent.range==="parent"?$i(()=>B).toBe(!0).then(q):q(),()=>E.hidden?null:s.h("div",{ref:Y,"data-id":E.id,class:["vue-flow__node",`vue-flow__node-${P.value===!1?"default":E.type||"default"}`,{[n.value]:v.value,dragging:L?.value,draggable:v.value,selected:E.selected,selectable:C.value,parent:E.isParent},j.value],style:{visibility:B.value?"visible":"hidden",zIndex:E.computedPosition.z??Q.value,transform:`translate(${E.computedPosition.x}px,${E.computedPosition.y}px)`,pointerEvents:R.value?"all":"none",...K.value},tabIndex:O.value?0:void 0,role:O.value?"group":void 0,"aria-describedby":y.value?void 0:`${pa}-${e}`,"aria-label":E.ariaLabel,"aria-roledescription":"node",...E.domAttributes,onMouseenter:re,onMousemove:oe,onMouseleave:ce,onContextmenu:ie,onClick:A,onDblclick:se,onKeydown:M},[s.h(P.value===!1?f.value.default:P.value,{id:E.id,type:E.type,data:E.data,events:{...E.events,...D},selected:E.selected,resizing:E.resizing,dragging:L.value,connectable:k.value,position:E.computedPosition,dimensions:E.dimensions,isValidTargetPos:E.isValidTargetPos,isValidSourcePos:E.isValidSourcePos,parent:E.parentNode,parentNodeId:E.parentNode,zIndex:E.computedPosition.z??Q.value,targetPosition:E.targetPosition,sourcePosition:E.sourcePosition,label:E.label,dragHandle:E.dragHandle,onUpdateNodeInternals:ee})]);function q(){const V=E.computedPosition,{computedPosition:X,position:T}=ir(E,b.value?ko(V,N.value):V,a.error,h.value,H.value);(E.computedPosition.x!==X.x||E.computedPosition.y!==X.y)&&(E.computedPosition={...E.computedPosition,...X}),(E.position.x!==T.x||E.position.y!==T.y)&&(E.position=T)}function ee(){Y.value&&c([{id:t.id,nodeElement:Y.value,forceUpdate:!0}])}function re(V){L?.value||w.mouseEnter({event:V,node:E})}function oe(V){L?.value||w.mouseMove({event:V,node:E})}function ce(V){L?.value||w.mouseLeave({event:V,node:E})}function ie(V){return w.contextMenu({event:V,node:E})}function se(V){return w.doubleClick({event:V,node:E})}function A(V){C.value&&(!o.value||!v.value||_.value>0)&&lr(E,r.value,u,l,i,!1,Y.value),w.click({event:V,node:E})}function M(V){if(!(tr(V)||y.value))if(ma.includes(V.key)&&C.value){const X=V.key==="Escape";lr(E,r.value,u,l,i,X,Y.value)}else v.value&&E.selected&&en[V.key]&&(V.preventDefault(),m.value=`Moved selected node ${V.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.position.x}, y: ${~~E.position.y}`,I({x:en[V.key].x,y:en[V.key].y},V.shiftKey))}}}),Sm={height:"0",width:"0"},Nm={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},km=s.defineComponent({...Nm,setup(t){const{viewportRef:e}=we(),n=s.toRef(()=>{var o;return(o=e.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(s.openBlock(),s.createElementBlock("svg",null,[(s.openBlock(),s.createElementBlock("foreignObject",Sm,[(s.openBlock(),s.createBlock(s.Teleport,{to:n.value,disabled:!n.value},[s.renderSlot(o.$slots,"default")],8,["to","disabled"]))]))]))}});function Dm(t={includeHiddenNodes:!1}){const{nodes:e}=we();return s.computed(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Tm={class:"vue-flow__nodes vue-flow__container"},Im={name:"Nodes",compatConfig:{MODE:3}},Mm=s.defineComponent({...Im,setup(t){const{getNodes:e,updateNodeDimensions:n,emits:o}=we(),i=Dm(),r=s.ref();return s.watch(i,a=>{a&&s.nextTick(()=>{o.nodesInitialized(e.value)})},{immediate:!0}),s.onMounted(()=>{r.value=new ResizeObserver(a=>{const l=a.map(u=>({id:u.target.getAttribute("data-id"),nodeElement:u.target,forceUpdate:!0}));s.nextTick(()=>n(l))})}),s.onBeforeUnmount(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,l)=>(s.openBlock(),s.createElementBlock("div",Tm,[r.value?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(e),(u,c,d,f)=>{const h=[u.id];if(f&&f.key===u.id&&s.isMemoSame(f,h))return f;const p=(s.openBlock(),s.createBlock(s.unref(Em),{id:u.id,key:u.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},l,0),128)):s.createCommentVNode("",!0)]))}});function Bm(){const{emits:t}=we();s.onMounted(()=>{if(ja()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Be(Ne.MISSING_STYLES))}})}const $m=s.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),zm={name:"VueFlow",compatConfig:{MODE:3}},Am=s.defineComponent({...zm,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const o=t,i=s.useSlots(),r=zi(o,"modelValue",n),a=zi(o,"nodes",n),l=zi(o,"edges",n),u=we(o),c=yg({modelValue:r,nodes:a,edges:l},o,u);return bg(n,u.hooks),um(),Bm(),s.provide(Do,i),s.onUnmounted(c),e(u),(d,f)=>(s.openBlock(),s.createElementBlock("div",{ref:s.unref(u).vueFlowRef,class:"vue-flow"},[s.createVNode(rm,null,{default:s.withCtx(()=>[s.createVNode(Cm),$m,s.createVNode(Mm),s.renderSlot(d.$slots,"zoom-pane")]),_:3}),s.renderSlot(d.$slots,"default"),s.createVNode(dm)],512))}}),Pm={name:"Panel",compatConfig:{MODE:3}},Om=s.defineComponent({...Pm,props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=we(),o=s.computed(()=>`${e.position}`.split("-"));return(i,r)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["vue-flow__panel",o.value]),style:s.normalizeStyle({pointerEvents:s.unref(n)?"none":"all"})},[s.renderSlot(i.$slots,"default")],6))}});var yt=(t=>(t.Lines="lines",t.Dots="dots",t))(yt||{});const ul=function({dimensions:t,size:e,color:n}){return s.h("path",{stroke:n,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},fl=function({radius:t,color:e}){return s.h("circle",{cx:t,cy:t,r:t,fill:e})};yt.Lines+"",yt.Dots+"";const Rm={[yt.Dots]:"#81818a",[yt.Lines]:"#eee"},Hm=["id","x","y","width","height","patternTransform"],Vm={key:2,height:"100",width:"100"},Lm=["fill"],Fm=["x","y","fill"],jm={name:"Background",compatConfig:{MODE:3}},Gm=s.defineComponent({...jm,props:{id:{},variant:{default:()=>yt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(t){const{id:e,viewport:n}=we(),o=s.computed(()=>{const a=n.value.zoom,[l,u]=Array.isArray(t.gap)?t.gap:[t.gap,t.gap],c=[l*a||1,u*a||1],d=t.size*a,[f,h]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset],p=[f*a||1+c[0]/2,h*a||1+c[1]/2];return{scaledGap:c,offset:p,size:d}}),i=s.toRef(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),r=s.toRef(()=>t.color||t.patternColor||Rm[t.variant||yt.Dots]);return(a,l)=>(s.openBlock(),s.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:s.normalizeStyle({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[s.renderSlot(a.$slots,"pattern-container",{id:i.value},()=>[s.createElementVNode("pattern",{id:i.value,x:s.unref(n).x%o.value.scaledGap[0],y:s.unref(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[s.renderSlot(a.$slots,"pattern",{},()=>[a.variant===s.unref(yt).Lines?(s.openBlock(),s.createBlock(s.unref(ul),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===s.unref(yt).Dots?(s.openBlock(),s.createBlock(s.unref(fl),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):s.createCommentVNode("",!0),a.bgColor?(s.openBlock(),s.createElementBlock("svg",Vm,[s.createElementVNode("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,Lm)])):s.createCommentVNode("",!0)])],8,Hm)]),s.createElementVNode("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Fm),s.renderSlot(a.$slots,"default",{id:i.value})],4))}}),Wm={name:"ControlButton",compatConfig:{MODE:3}},Ym=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Um={type:"button",class:"vue-flow__controls-button"};function Xm(t,e,n,o,i,r){return s.openBlock(),s.createElementBlock("button",Um,[s.renderSlot(t.$slots,"default")])}const Ao=Ym(Wm,[["render",Xm]]),qm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Km=[s.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Zm(t,e){return s.openBlock(),s.createElementBlock("svg",qm,Km)}const Jm={render:Zm},Qm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ey=[s.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function ty(t,e){return s.openBlock(),s.createElementBlock("svg",Qm,ey)}const ny={render:ty},oy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},iy=[s.createElementVNode("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function ry(t,e){return s.openBlock(),s.createElementBlock("svg",oy,iy)}const sy={render:ry},ay={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ly=[s.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function cy(t,e){return s.openBlock(),s.createElementBlock("svg",ay,ly)}const dy={render:cy},uy={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},fy=[s.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function hy(t,e){return s.openBlock(),s.createElementBlock("svg",uy,fy)}const py={render:hy},gy={name:"Controls",compatConfig:{MODE:3}},my=s.defineComponent({...gy,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>fa.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:a,zoomOut:l,fitView:u,viewport:c,minZoom:d,maxZoom:f}=we(),h=s.toRef(()=>n.value||o.value||i.value),p=s.toRef(()=>c.value.zoom<=d.value),y=s.toRef(()=>c.value.zoom>=f.value);function m(){a(),e("zoomIn")}function b(){l(),e("zoomOut")}function N(){u(t.fitViewParams),e("fitView")}function _(){r(!h.value),e("interactionChange",!h.value)}return(g,x)=>(s.openBlock(),s.createBlock(s.unref(Om),{class:"vue-flow__controls",position:g.position},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"top"),g.showZoom?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.renderSlot(g.$slots,"control-zoom-in",{},()=>[s.createVNode(Ao,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:m},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-zoom-in",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(Jm))))])]),_:3},8,["disabled"])]),s.renderSlot(g.$slots,"control-zoom-out",{},()=>[s.createVNode(Ao,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:b},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-zoom-out",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(ny))))])]),_:3},8,["disabled"])])],64)):s.createCommentVNode("",!0),g.showFitView?s.renderSlot(g.$slots,"control-fit-view",{key:1},()=>[s.createVNode(Ao,{class:"vue-flow__controls-fitview",onClick:N},{default:s.withCtx(()=>[s.renderSlot(g.$slots,"icon-fit-view",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(sy))))])]),_:3})]):s.createCommentVNode("",!0),g.showInteractive?s.renderSlot(g.$slots,"control-interactive",{key:2},()=>[g.showInteractive?(s.openBlock(),s.createBlock(Ao,{key:0,class:"vue-flow__controls-interactive",onClick:_},{default:s.withCtx(()=>[h.value?s.renderSlot(g.$slots,"icon-unlock",{key:0},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(py))))]):s.createCommentVNode("",!0),h.value?s.createCommentVNode("",!0):s.renderSlot(g.$slots,"icon-lock",{key:1},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(s.unref(dy))))])]),_:3})):s.createCommentVNode("",!0)]):s.createCommentVNode("",!0),s.renderSlot(g.$slots,"default")]),_:3},8,["position"]))}}),yy=["onClick"],vy={class:"d-flow-node-menus-item-name"},gr=s.defineComponent({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(t,{emit:e}){const n=t,o=e,i=s.inject("d_flow_design_provide",{}),r=i.getFlowComponents?.()||[],a=l=>{o("addNode",l.type),s.nextTick(()=>{n.handleId==="line"?i.addNodeByLine?.(l.type,n.fromNodeId||""):i.addNode?.(l.type,n.fromNodeId||"",n.handleId||"")})};return(l,u)=>{const c=s.resolveComponent("j-icon");return s.openBlock(),s.createElementBlock("div",{class:"d-flow-node-menus",onClick:s.withModifiers(()=>{},["stop"])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(r),(d,f)=>(s.openBlock(),s.createElementBlock("div",{key:f,class:"d-flow-node-menus-item",onClick:h=>a(d)},[s.createElementVNode("div",{class:"d-flow-node-menus-item-icon",style:s.normalizeStyle({backgroundColor:d.iconColor||"var(--j-color-primary)"})},[s.createVNode(c,{icon:d.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",vy,s.toDisplayString(d.name),1)],8,yy))),128))])}}}),by={class:"d-flow-step-name"},wy={key:0,style:{color:"var(--j-color-text-2)"}},_y={style:{color:"var(--j-color-text)"}},xy=s.defineComponent({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(t){const e=t,{onNodeClick:n,onEdgeClick:o,onMoveStart:i,onConnectStart:r,onNodeDragStart:a,removeNodes:l,getEdges:u,getNodes:c,onNodesChange:d}=we(),f=s.inject("d_flow_design_provide",{}),h=s.computed(()=>f.getFlowComponentMap?.value?.[e.data.type]||{}),p=()=>{l(e.id),f.onRemoveNode?.(e.id)},y=s.ref({});d(H=>{if(e.data.isInit&&H.findIndex(w=>w.type==="select"&&w.id===e.id&&w.id==="start"&&w.selected)!==-1){const w=c.value.find(D=>D.id==="start");w&&(w.data.isInit=!1),y.value.s1=!0}});const m=s.ref(!1),b=H=>{H.indexOf("t")!==-1&&!N.value||(m.value=!0,y.value[H]=!0)},N=s.computed(()=>u.value.findIndex(H=>H.target===e.id)===-1),_=s.ref(!1),g=()=>{_.value=!0},x=(H,w)=>{if(u.value.find(C=>C.source===w&&C.target===H))return!0;const v=u.value.filter(C=>C.target===H);for(let C=0;C<v.length;C++)if(x(v[C].source,w))return!0;return!1},z=H=>_.value?(_.value=!1,!1):x(H.source,H.target)?!1:H.source!==H.target&&H.sourceHandle!==H.targetHandle&&H.sourceHandle.indexOf("s")!==-1&&H.targetHandle.indexOf("t")!==-1,$=()=>{I(),Object.keys(y.value).forEach(H=>{y.value[H]=!1})},F=()=>{$()};n(()=>{console.log("onNodeClick"),m.value?m.value=!1:$()}),o(()=>{$()}),i(()=>{$()}),r(()=>{$()}),a(()=>{$()});const Y=s.ref(),G=s.ref({top:0,left:0,bottom:0,right:0}),S=s.ref({getBoundingClientRect:()=>G.value}),I=()=>{Y.value?.handleClose()},E=H=>{const{clientX:w,clientY:D}=H;G.value=DOMRect.fromRect({x:w,y:D}),H.preventDefault(),Y.value?.handleOpen()};return(H,w)=>{const D=s.resolveComponent("el-popover"),v=s.resolveComponent("el-tooltip"),C=s.resolveComponent("el-dropdown-item"),k=s.resolveComponent("el-dropdown-menu"),O=s.resolveComponent("el-dropdown");return s.openBlock(),s.createElementBlock("div",{class:"d-flow-step",onContextmenu:s.withModifiers(E,["stop"])},[s.createElementVNode("div",{class:"d-flow-step-icon",style:s.normalizeStyle({backgroundColor:h.value.iconColor||"var(--j-color-primary)"})},[s.createVNode(gn,{icon:h.value.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",by,s.toDisplayString(h.value.name),1),t.data.type!=="start"?(s.openBlock(),s.createBlock(v,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:s.withCtx(()=>[N.value?(s.openBlock(),s.createElementBlock("div",wy,[...w[4]||(w[4]=[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),s.createTextVNode("添加节点 ",-1)])])):s.createCommentVNode("",!0),w[5]||(w[5]=s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),s.createTextVNode("连接节点 ")],-1))]),default:s.withCtx(()=>[s.createVNode(s.unref(on),{onClick:w[1]||(w[1]=R=>b("t1")),onMousedown:g,id:"t1",class:s.normalizeClass(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!N.value}]),type:"target",position:s.unref(de).Left,"is-valid-connection":z},{default:s.withCtx(()=>[N.value?(s.openBlock(),s.createBlock(D,{key:0,visible:y.value.t1,"onUpdate:visible":w[0]||(w[0]=R=>y.value.t1=R),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:s.withCtx(()=>[s.createVNode(gn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:s.withCtx(()=>[s.createVNode(gr,{"handle-id":"t1","from-node-id":t.id,onAddNode:F},null,8,["from-node-id"])]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),_:1},8,["class","position"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(v,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:s.withCtx(()=>[...w[6]||(w[6]=[s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),s.createTextVNode("添加节点 ")],-1),s.createElementVNode("div",{style:{color:"var(--j-color-text-2)"}},[s.createElementVNode("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),s.createTextVNode("连接节点 ")],-1)])]),default:s.withCtx(()=>[s.createVNode(s.unref(on),{onClick:w[3]||(w[3]=R=>b("s1")),onMousedown:g,id:"s1",class:"d-flow-step-source-handle",type:"source",position:s.unref(de).Right,"is-valid-connection":z},{default:s.withCtx(()=>[s.createVNode(D,{visible:y.value.s1,"onUpdate:visible":w[2]||(w[2]=R=>y.value.s1=R),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:s.withCtx(()=>[s.createVNode(gn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:s.withCtx(()=>[s.createVNode(gr,{"handle-id":"s1","from-node-id":t.id,onAddNode:F},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),s.createVNode(O,{ref_key:"dropdownRef",ref:Y,"popper-class":"d-flow-step-dropdown","virtual-ref":S.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:s.withCtx(()=>[s.createVNode(k,null,{default:s.withCtx(()=>[t.data.type!="start"?(s.openBlock(),s.createBlock(C,{key:0,onClick:p},{default:s.withCtx(()=>[...w[7]||(w[7]=[s.createTextVNode("删除",-1)])]),_:1})):s.createCommentVNode("",!0),h.value.des?(s.openBlock(),s.createElementBlock("div",{key:1,style:s.normalizeStyle({width:"160px",padding:"4px 16px 0 16px","font-size":"12px","border-top":t.data.type!="start"?"1px solid var(--j-color-border)":void 0,"margin-top":t.data.type!="start"?"4px":void 0})},[w[8]||(w[8]=s.createElementVNode("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),s.createElementVNode("div",_y,s.toDisplayString(h.value.des),1)],4)):s.createCommentVNode("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),Cy=s.defineComponent({name:"DEdgeWithButton",__name:"edgeWithButton",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},markerEnd:{},style:{}},setup(t){const e=t,{onEdgeMouseEnter:n,onEdgeMouseLeave:o,onNodeClick:i,onEdgeClick:r,onMoveStart:a,onConnectStart:l,onNodeDragStart:u}=we(),c=s.computed(()=>fr(e)),d=s.ref(!1),f=s.ref(!1);n(({edge:b})=>{b.id===e.id&&(d.value=!0)}),o(()=>{d.value=!1});const h=s.ref(!1),p=()=>{h.value=!1,s.nextTick(()=>{f.value=!1})},y=()=>{f.value=!0,h.value=!0},m=()=>{p()};return i(()=>{p()}),r(()=>{p()}),a(()=>{p()}),l(()=>{p()}),u(()=>{p()}),(b,N)=>{const _=s.resolveComponent("j-icon"),g=s.resolveComponent("el-popover");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createVNode(s.unref(An),{id:t.id,style:s.normalizeStyle(t.style),path:c.value[0],"marker-end":t.markerEnd},null,8,["id","style","path","marker-end"]),s.createVNode(s.unref(km),null,{default:s.withCtx(()=>[s.createElementVNode("div",{style:s.normalizeStyle({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${c.value[1]}px,${c.value[2]}px)`}),class:"nodrag nopan"},[s.createVNode(g,{visible:h.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{onClick:s.withModifiers(y,["stop"]),class:"d-flow-edge-button"},[s.createVNode(_,{icon:"mdi:plus-circle"})],512),[[s.vShow,d.value||f.value]])]),default:s.withCtx(()=>[s.createVNode(gr,{"handle-id":"line","from-node-id":t.id,onAddNode:m},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),Ey=s.defineComponent({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(t){return(e,n)=>(s.openBlock(),s.createBlock(s.unref(Am),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":s.unref(gt).Strict,nodes:t.nodes,edges:t.edges},{"edge-button":s.withCtx(o=>[s.createVNode(Cy,{id:o.id,"source-x":o.sourceX,"source-y":o.sourceY,"target-x":o.targetX,"target-y":o.targetY,"source-position":o.sourcePosition,"target-position":o.targetPosition,"marker-end":o.markerEnd,style:s.normalizeStyle(o.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":s.withCtx(o=>[s.createVNode(xy,s.normalizeProps(s.guardReactiveProps(o)),null,16)]),default:s.withCtx(()=>[s.createVNode(s.unref(my),{position:"bottom-left"}),s.createVNode(s.unref(Gm))]),_:1},8,["connection-mode","nodes","edges"]))}}),Sy={class:"d-flow-design"},Ny={class:"d-flow-design-canvas"},ky={class:"d-flow-design-right"},Dy={class:"d-flow-design-title"},Ty={class:"d-flow-design-title-name"},Iy={class:"d-flow-design-panel"},hl=$t(s.defineComponent({name:"DFlowDesign",__name:"flowDesign",props:{components:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["nodeClick","edgeClick","paneClick","connect"],setup(t,{expose:e,emit:n}){const o=t,i=n,{addNodes:r,addEdges:a,removeEdges:l,addSelectedNodes:u,removeSelectedNodes:c,onConnect:d,onNodeClick:f,onPaneClick:h,onEdgeClick:p,getNodes:y,getEdges:m}=we(),b=s.computed(()=>{const O={};return o.components.forEach(R=>{O[R.type]=R}),O.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},O}),N={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},_=s.ref([N]),g=s.ref([]),x=(O,R)=>{if(R.indexOf("t")===-1){const B=m.value.filter(P=>P.source===O.id);if(B.length>0){let P=-1e6,L=0;return B.forEach(j=>{P=Math.max(P,j.targetNode.position.y+j.targetNode.dimensions.height+32),L=j.targetNode.position.x||0}),{x:L,y:P}}return{x:O.position.x+O.dimensions.width+100,y:O.position.y}}return{x:O.position.x-100-O.dimensions.width,y:O.position.y}},z=(O,R,B)=>{const P=y.value.find(j=>j.id===R);if(!P)return;const L={id:Wt(),type:"step",data:{type:O},position:x(P,B)};if(o.flowInit){const j=o.flowInit(L.data.type);j&&Object.keys(j).forEach(K=>{L.data[K]=j[K]})}r(L),B.indexOf("t")===-1?a({id:`${R}-${L.id}`,source:R,target:L.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}):a({id:`${R}-${L.id}`,source:L.id,target:R,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),E(L.id)},$=O=>{const R=y.value.find(B=>B.id===O);R&&(R.position.x+=100+R.dimensions.width,m.value.filter(P=>P.source===O).forEach(P=>{$(P.target)}))},F=(O,R)=>{const B=m.value.find(L=>L.id===R);if(!B)return;const P={id:Wt(),type:"step",data:{type:O},position:{x:B.targetNode.position.x,y:B.targetNode.position.y}};if(o.flowInit){const L=o.flowInit(P.data.type);L&&Object.keys(L).forEach(j=>{P.data[j]=L[j]})}r(P),a({id:`${B.sourceNode.id}-${P.id}`,source:B.sourceNode.id,target:P.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),a({id:`${P.id}-${B.targetNode.id}`,source:P.id,target:B.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),l(R),$(B.target),E(P.id)};d(O=>{console.log("onConnect",O),O.type="button",O.markerEnd=mt.Arrow,a(O),i("connect",O)});const Y=()=>o.components||[],G=s.ref(),S=s.computed(()=>G.value?b.value[G.value.data.type]:void 0);f(O=>{G.value?.id!==O.node.id&&(G.value=O.node,D()),i("nodeClick",O.node)}),h(()=>{G.value=void 0,i("paneClick")}),p(O=>{G.value=void 0,i("edgeClick",O.edge)});const I=O=>{G.value?.id===O&&(G.value=void 0)},E=O=>{G.value&&c([G.value]),G.value=y.value.find(R=>R.id===O),G.value&&(D(),setTimeout(()=>{G.value&&u([G.value])},100))},H=s.ref(),w={};Object.keys(o.flowComponentConfigs).forEach(O=>{const R={type:"j-collapse",config:{defaultValue:[]},children:[]};o.flowComponentConfigs[O].forEach((B,P)=>{const L=`_collapse${P}`;R.config?.defaultValue.push(L),R.children?.push(B)}),w[O]=[R]});const D=()=>{const O=w[G.value?.data.type||""];O&&H.value?(H.value.init&&H.value.init(O,G.value?.data),o.flowComponentConfigInit&&o.flowComponentConfigInit({configRef:H,inputParams:o.inputParams,components:y.value,configData:G.value?.data})):H.value&&H.value.init&&H.value.init([])},v=(O,R)=>{G.value&&o.flowComponentConfigChange&&o.flowComponentConfigChange(G.value.data.type,{configRef:H,component:O,configData:G.value.data,...R,isFlowNode:!0})};return s.provide("d_flow_design_provide",{getFlowComponents:Y,addNode:z,addNodeByLine:F,onRemoveNode:I,getFlowComponentMap:b}),e({getData:()=>{const O=[];return y.value.forEach(R=>{O.push({config:R.data,id:R.id,position:R.position,type:R.type})}),m.value.forEach(R=>{O.push({id:R.id,source:R.source,target:R.target,sourceHandle:R.sourceHandle,targetHandle:R.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),O},setData:O=>{if(!O||O.length===0)N.data.isInit=!0,_.value=[N],E(N.id);else{N.data.isInit=!1;const R=[],B=[];O.forEach(P=>{if(P.type==="line")P.type="button",P.markerEnd=mt.Arrow,B.push(P);else{const L={id:P.id,type:P.type,data:P.config,position:P.position};R.push(L)}}),_.value=R,g.value=B}}}),(O,R)=>{const B=s.resolveComponent("j-icon"),P=s.resolveComponent("j-form");return s.openBlock(),s.createElementBlock("div",Sy,[s.createElementVNode("div",Ny,[s.createVNode(Ey,{nodes:_.value,edges:g.value},null,8,["nodes","edges"])]),s.withDirectives(s.createElementVNode("div",ky,[s.createElementVNode("div",Dy,[s.createElementVNode("div",{class:"d-flow-design-title-icon",style:s.normalizeStyle({backgroundColor:S.value?.iconColor||"var(--j-color-primary)"})},[s.createVNode(B,{icon:S.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),s.createElementVNode("div",Ty,s.toDisplayString(S.value?.name||""),1)]),s.createElementVNode("div",Iy,[s.createVNode(P,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:H,onChange:v},null,512)])],512),[[s.vShow,G.value&&w[G.value.data.type]]])])}}})),My={class:"d-input-flow j-block"},pl=$t(s.defineComponent({name:"DInputFlow",__name:"inputFlow",props:{modelValue:{},type:{},btnText:{default:"事件"},title:{},size:{default:"default"},width:{default:1200},height:{default:800},beforeClose:{},flowComponents:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=s.ref(),r=s.computed({get(){return n.modelValue},set(f){o("update:modelValue",f)}}),a=s.computed(()=>(n.modelValue?.trim(),n.btnText)),l=f=>{const h=typeof f=="string"?f:void 0;try{i.value?.setData(JSON.parse(h||"[]"))}catch{i.value?.setData([])}},u=async()=>{const f=i.value?.getData();return f?JSON.stringify(f):void 0},c=f=>{if(n.beforeClose){const h=typeof f=="string"?f:void 0;return n.beforeClose(h)}return!0},d=f=>{const h=f.value;o("change",{value:typeof h=="string"?h:void 0})};return(f,h)=>{const p=s.resolveComponent("d-flow-design"),y=s.resolveComponent("j-input-button");return s.openBlock(),s.createBlock(y,s.mergeProps(f.$attrs,{type:t.type,"btn-text":a.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":c,ok:u,open:l,"destroy-on-close":"",modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),onChange:d}),{default:s.withCtx(()=>[s.createElementVNode("div",My,[s.createVNode(p,{ref_key:"flowRef",ref:i,components:t.flowComponents,"flow-init":t.flowInit,"flow-component-config-init":t.flowComponentConfigInit,"flow-component-configs":t.flowComponentConfigs,"flow-component-config-change":t.flowComponentConfigChange,"input-params":t.inputParams},null,8,["components","flow-init","flow-component-config-init","flow-component-configs","flow-component-config-change","input-params"])])]),_:1},16,["type","btn-text","title","size","width","height","modelValue"])}}}));class J{static getElements(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(o&&!isNaN(+e[0])){const r=o.getElementById(e);return r?[r]:[]}let i=n.querySelectorAll(e);if(!i.length&&e[0]!=="."&&e[0]!=="#"&&(i=n.querySelectorAll("."+e),i.length||(i=n.querySelectorAll("#"+e)),!i.length)){const r=n.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(i)}return[e]}static getElement(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(!e.length)return null;if(o&&e[0]==="#")return o.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return n.querySelector(e);if(o&&!isNaN(+e[0]))return o.getElementById(e);let i=n.querySelector(e);return o&&!i&&(i=o.getElementById(e)),i||(i=n.querySelector("."+e)),i}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,n){const o=document.createElement("div");return e.forEach(i=>{i&&o.classList.add(i)}),n?.appendChild(o),o}static shouldSizeToContent(e,n=!1){return e?.grid&&(n?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,n){return!(e.y>=n.y+n.h||e.y+e.h<=n.y||e.x+e.w<=n.x||e.x>=n.x+n.w)}static isTouching(e,n){return J.isIntercepted(e,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(e,n){const o=e.x>n.x?e.x:n.x,i=e.x+e.w<n.x+n.w?e.x+e.w:n.x+n.w;if(i<=o)return 0;const r=e.y>n.y?e.y:n.y,a=e.y+e.h<n.y+n.h?e.y+e.h:n.y+n.h;return a<=r?0:(i-o)*(a-r)}static area(e){return e.w*e.h}static sort(e,n=1){return e.sort((i,r)=>{const a=n*((i.y??1e4)-(r.y??1e4));return a===0?n*((i.x??1e4)-(r.x??1e4)):a})}static find(e,n){return n?e.find(o=>o.id===n):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let n,o="px";if(typeof e=="string")if(e==="auto"||e==="")n=0;else{const i=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${e}`);o=i[2]||"px",n=parseFloat(i[1])}else n=e;return{h:n,unit:o}}static defaults(e,...n){return n.forEach(o=>{for(const i in o){if(!o.hasOwnProperty(i))return;e[i]===null||e[i]===void 0?e[i]=o[i]:typeof o[i]=="object"&&typeof e[i]=="object"&&J.defaults(e[i],o[i])}}),e}static same(e,n){if(typeof e!="object")return e==n;if(typeof e!=typeof n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(e[o]!==n[o])return!1;return!0}static copyPos(e,n,o=!1){return n.x!==void 0&&(e.x=n.x),n.y!==void 0&&(e.y=n.y),n.w!==void 0&&(e.w=n.w),n.h!==void 0&&(e.h=n.h),o&&(n.minW&&(e.minW=n.minW),n.minH&&(e.minH=n.minH),n.maxW&&(e.maxW=n.maxW),n.maxH&&(e.maxH=n.maxH)),e}static samePos(e,n){return e&&n&&e.x===n.x&&e.y===n.y&&(e.w||1)===(n.w||1)&&(e.h||1)===(n.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,n){if(!(typeof e!="object"||typeof n!="object")&&!(Array.isArray(e)||Array.isArray(n)))for(let o in e){const i=e[o],r=n[o];o[0]==="_"||i===r?delete e[o]:i&&typeof i=="object"&&r!==void 0&&(J.removeInternalAndSame(i,r),Object.keys(i).length||delete e[o])}}static removeInternalForSave(e,n=!0){for(let o in e)(o[0]==="_"||e[o]===null||e[o]===void 0)&&delete e[o];delete e.grid,n&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,n){let o=!1;return(...i)=>{o||(o=!0,setTimeout(()=>{e(...i),o=!1},n))}}static removePositioningStyles(e){const n=e.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const n=getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowY)?e:J.getScrollElement(e.parentElement)}static updateScrollPosition(e,n,o){const i=J.getScrollElement(e);if(!i)return;const r=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,u=r.bottom-Math.min(a.bottom,l),c=r.top-Math.max(a.top,0),d=i.scrollTop;c<0&&o<0?e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=Math.abs(c)>Math.abs(o)?o:c:u>0&&o>0&&(e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=u>o?o:u),n.top+=i.scrollTop-d}static updateScrollResize(e,n,o){const i=J.getScrollElement(n),r=i.clientHeight,a=i===J.getScrollElement()?0:i.getBoundingClientRect().top,l=e.clientY-a,u=l<o,c=l>r-o;u?i.scrollBy({behavior:"smooth",top:l-o}):c&&i.scrollBy({behavior:"smooth",top:o-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const n=["parentGrid","el","grid","subGrid","engine"],o=J.clone(e);for(const i in o)o.hasOwnProperty(i)&&typeof o[i]=="object"&&i.substring(0,2)!=="__"&&!n.find(r=>r===i)&&(o[i]=J.cloneDeep(e[i]));return o}static cloneNode(e){const n=e.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(e,n){let o;typeof n=="string"?o=J.getElement(n):o=n,o&&o.appendChild(e)}static addElStyles(e,n){if(n instanceof Object)for(const o in n)n.hasOwnProperty(o)&&(Array.isArray(n[o])?n[o].forEach(i=>{e.style[o]=i}):e.style[o]=n[o])}static initEvent(e,n){const o={type:n.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>o[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>o[r]=e[r]),{...o,...i}}static simulateMouseEvent(e,n,o){const i=e,r=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:e.target});(o||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const n=document.createElement("div");J.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(n);const o=n.getBoundingClientRect();return e.removeChild(n),n.remove(),{xScale:1/o.width,yScale:1/o.height,xOffset:o.left,yOffset:o.top}}static swap(e,n,o){if(!e)return;const i=e[n];e[n]=e[o],e[o]=i}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class vt{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,n=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||n.y<=e.y)}_fixCollisions(e,n=e,o,i={}){if(this.sortNodes(-1),o=o||this.collide(e,n),!o)return!1;if(e._moving&&!i.nested&&!this.float&&this.swap(e,o))return!0;let r=n;!this._loading&&this._useEntireRowArea(e,n)&&(r={x:0,w:this.column,y:n.y,h:n.h},o=this.collide(e,r,i.skip));let a=!1;const l={nested:!0,pack:!1};let u=0;for(;o=o||this.collide(e,r,i.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(o.locked||this._loading||e._moving&&!e._skipDown&&n.y>e.y&&!this.float&&(!this.collide(o,{...o,y:e.y},e)||!this.collide(o,{...o,y:n.y-o.h},e))){e._skipDown=e._skipDown||n.y>e.y;const d={...n,y:o.y+o.h,...l};c=this._loading&&J.samePos(e,d)?!0:this.moveNode(e,d),(o.locked||this._loading)&&c?J.copyPos(n,e):!o.locked&&c&&i.pack&&(this._packNodes(),n.y=o.y+o.h,J.copyPos(e,n)),a=a||c}else c=this.moveNode(o,{...o,y:n.y+n.h,skip:e,...l});if(!c)return a;o=void 0}return a}collide(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.find(a=>a._id!==i&&a._id!==r&&J.isIntercepted(a,n))}collideAll(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.filter(a=>a._id!==i&&a._id!==r&&J.isIntercepted(a,n))}directionCollideCoverage(e,n,o){if(!n.rect||!e._rect)return;const i=e._rect,r={...n.rect};r.y>i.y?(r.h+=r.y-i.y,r.y=i.y):r.h+=i.y-r.y,r.x>i.x?(r.w+=r.x-i.x,r.x=i.x):r.w+=i.x-r.x;let a,l=.5;for(let u of o){if(u.locked||!u._rect)break;const c=u._rect;let d=Number.MAX_VALUE,f=Number.MAX_VALUE;i.y<c.y?d=(r.y+r.h-c.y)/c.h:i.y+i.h>c.y+c.h&&(d=(c.y+c.h-r.y)/c.h),i.x<c.x?f=(r.x+r.w-c.x)/c.w:i.x+i.w>c.x+c.w&&(f=(c.x+c.w-r.x)/c.w);const h=Math.min(f,d);h>l&&(l=h,a=u)}return n.collide=a,a}cacheRects(e,n,o,i,r,a){return this.nodes.forEach(l=>l._rect={y:l.y*n+o,x:l.x*e+a,w:l.w*e-a-i,h:l.h*n-o-r}),this}swap(e,n){if(!n||n.locked||!e||e.locked)return!1;function o(){const r=n.x,a=n.y;return n.x=e.x,n.y=e.y,e.h!=n.h?(e.x=r,e.y=n.y+n.h):e.w!=n.w?(e.x=n.x+n.w,e.y=a):(e.x=r,e.y=a),e._dirty=n._dirty=!0,!0}let i;if(e.w===n.w&&e.h===n.h&&(e.x===n.x||e.y===n.y)&&(i=J.isTouching(e,n)))return o();if(i!==!1){if(e.w===n.w&&e.x===n.x&&(i||(i=J.isTouching(e,n)))){if(n.y<e.y){const r=e;e=n,n=r}return o()}if(i!==!1){if(e.h===n.h&&e.y===n.y&&(i||(i=J.isTouching(e,n)))){if(n.x<e.x){const r=e;e=n,n=r}return o()}return!1}}}isAreaEmpty(e,n,o,i){const r={x:e||0,y:n||0,w:o||1,h:i||1};return!this.collide(r)}compact(e="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const o=this.batchMode;o||this.batchUpdate();const i=this._inColumnResize;i||(this._inColumnResize=!0);const r=this.nodes;return this.nodes=[],r.forEach((a,l,u)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=u[l-1])),this.addNode(a,!1,c)}),i||delete this._inColumnResize,o||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=J.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let n=e.y;for(;n>e._orig.y;)--n,this.collide(e,{x:e.x,y:n,w:e.w,h:e.h})||(e._dirty=!0,e.y=n)}):this.nodes.forEach((e,n)=>{if(!e.locked)for(;e.y>0;){const o=n===0?0:e.y-1;if(!(n===0||!this.collide(e,{x:e.x,y:o,w:e.w,h:e.h})))break;e._dirty=e.y!==o,e.y=o}}),this)}prepareNode(e,n){e._id=e._id??vt._idSeq++;const o=e.id;if(o){let r=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=o+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const i={x:0,y:0,w:1,h:1};return J.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,J.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,n),e}nodeBoundFix(e,n){const o=e._orig||J.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){const r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(n?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(n?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),J.samePos(e,o)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(n=>n._dirty&&!J.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const n=(e||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=J.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||J.samePos(e,e._orig)||(J.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,n=this.nodes,o=this.column,i){const r=i?i.y*o+(i.x+i.w):0;let a=!1;for(let l=r;!a;++l){const u=l%o,c=Math.floor(l/o);if(u+e.w>o)continue;const d={x:u,y:c,w:e.w,h:e.h};n.find(f=>J.isIntercepted(d,f))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,n=!1,o){const i=this.nodes.find(a=>a._id===e._id);if(i)return i;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,o)&&(delete e.autoPosition,r=!0),this.nodes.push(e),n&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,n=!0,o=!1){return this.nodes.find(i=>i._id===e._id)?(o&&this.removedNodes.push(e),n&&(e._removeDOM=!0),this.nodes=this.nodes.filter(i=>i._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(i=>i._removeDOM=!0);const o=this.nodes;return this.removedNodes=n?o:[],this.nodes=[],this._notify(o)}moveNodeCheck(e,n){if(!this.changedPosConstrain(e,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(e,n);let o;const i=new vt({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(o={...a},o):{...a})});if(!o)return!1;const r=i.moveNode(o,n)&&i.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!n.resizing&&n.collide){const a=n.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(i.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(u=>u._id===a._id);l&&(J.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const n=new vt({column:this.column,float:this.float,nodes:this.nodes.map(i=>({...i}))}),o={...e};return this.cleanupNode(o),delete o.el,delete o._id,delete o.content,delete o.grid,n.addNode(o),n.getRow()<=this.maxRow?(e._willFitPos=J.copyPos({},o),!0):!1}changedPosConstrain(e,n){return n.w=n.w||e.w,n.h=n.h||e.h,e.x!==n.x||e.y!==n.y?!0:(e.maxW&&(n.w=Math.min(n.w,e.maxW)),e.maxH&&(n.h=Math.min(n.h,e.maxH)),e.minW&&(n.w=Math.max(n.w,e.minW)),e.minH&&(n.h=Math.max(n.h,e.minH)),e.w!==n.w||e.h!==n.h)}moveNode(e,n){if(!e||!n)return!1;let o;n.pack===void 0&&!this.batchMode&&(o=n.pack=!0),typeof n.x!="number"&&(n.x=e.x),typeof n.y!="number"&&(n.y=e.y),typeof n.w!="number"&&(n.w=e.w),typeof n.h!="number"&&(n.h=e.h);const i=e.w!==n.w||e.h!==n.h,r=J.copyPos({},e,!0);if(J.copyPos(r,n),this.nodeBoundFix(r,i),J.copyPos(n,r),!n.forceCollide&&J.samePos(e,n))return!1;const a=J.copyPos({},e),l=this.collideAll(e,r,n.skip);let u=!0;if(l.length){const c=e._moving&&!n.nested;let d=c?this.directionCollideCoverage(e,n,l):l[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const f=J.areaIntercept(n.rect,d._rect),h=J.area(n.rect),p=J.area(d._rect);f/(h<p?h:p)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,r,d,n):(u=!1,o&&delete n.pack)}return u&&!J.samePos(e,r)&&(e._dirty=!0,J.copyPos(e,r)),n.pack&&this._packNodes()._notify(),!J.samePos(e,a)}getRow(){return this.nodes.reduce((e,n)=>Math.max(e,n.y+n.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(n=>n._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,n,o){const i=this._layouts?.length||0;let r;i&&(o?o!==this.column&&(r=this._layouts[o]):this.column!==i-1&&(r=this._layouts[i-1]));const a=[];return this.sortNodes(),this.nodes.forEach(l=>{const u=r?.find(d=>d._id===l._id),c={...l,...u||{}};J.removeInternalForSave(c,!e),n&&n(l,c),a.push(c)}),a}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,o)=>{if(!n||o===this.column)return this;if(o<this.column)this._layouts[o]=void 0;else{const i=o/this.column;e.forEach(r=>{if(!r._orig)return;const a=n.find(l=>l._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y,a.y<0&&(a.y=0)),r.x!==r._orig.x&&(a.x=Math.round(r.x*i),a.x<0&&(a.x=0)),r.w!==r._orig.w&&(a.w=Math.round(r.w*i),a.w<1&&(a.w=1)))})}}),this)}columnChanged(e,n,o="moveScale"){if(!this.nodes.length||!n||e===n)return this;const i=o==="compact"||o==="list";i&&this.sortNodes(1),n<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],a=i?this.nodes:J.sort(this.nodes,-1);if(n>e&&this._layouts){const l=this._layouts[n]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{const d=a.find(f=>f._id===c._id);d&&(!i&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{const d=a.findIndex(f=>f._id===c._id);if(d!==-1){const f=a[d];if(i){f.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(f.x=c.x??f.x,f.y=c.y??f.y,f.w=c.w??f.w,r.push(f)),a.splice(d,1)}})}if(i)this.compact(o,!1);else{if(a.length)if(typeof o=="function")o(n,e,r,a);else{const l=i||o==="none"?1:n/e,u=o==="move"||o==="moveScale",c=o==="scale"||o==="moveScale";a.forEach(d=>{d.x=n===1?0:u?Math.round(d.x*l):Math.min(d.x,n-1),d.w=n===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,n),r.push(d)}),a=[]}r=J.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!i),delete this._inColumnResize,this}cacheLayout(e,n,o=!1){const i=[];return e.forEach((r,a)=>{if(r._id===void 0){const l=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=l?._id??vt._idSeq++}i[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[n]=i,this}cacheOneLayout(e,n){e._id=e._id??vt._idSeq++;const o={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete o.x,delete o.y,e.autoPosition&&(o.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const i=this.findCacheLayout(e,n);return i===-1?this._layouts[n].push(o):this._layouts[n][i]=o,this}findCacheLayout(e,n){return this._layouts?.[n]?.findIndex(o=>o._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const o=this.findCacheLayout(e,n);o!==-1&&this._layouts[n].splice(o,1)}}cleanupNode(e){for(const n in e)n[0]==="_"&&n!=="_id"&&delete e[n];return this}}vt._idSeq=0;const Ge={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class he{}const tt=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class We{}function Po(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),J.simulateMouseEvent(t.changedTouches[0],e))}function gl(t,e){t.cancelable&&t.preventDefault(),J.simulateMouseEvent(t,e)}function Oo(t){We.touchHandled||(We.touchHandled=!0,Po(t,"mousedown"))}function Ro(t){We.touchHandled&&Po(t,"mousemove")}function Ho(t){if(!We.touchHandled)return;We.pointerLeaveTimeout&&(window.clearTimeout(We.pointerLeaveTimeout),delete We.pointerLeaveTimeout);const e=!!he.dragElement;Po(t,"mouseup"),e||Po(t,"click"),We.touchHandled=!1}function Vo(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function ml(t){he.dragElement&&t.pointerType!=="mouse"&&gl(t,"mouseenter")}function yl(t){he.dragElement&&t.pointerType!=="mouse"&&(We.pointerLeaveTimeout=window.setTimeout(()=>{delete We.pointerLeaveTimeout,gl(t,"mouseleave")},10))}class Lo{constructor(e,n,o){this.host=e,this.dir=n,this.option=o,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Lo.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),tt&&(this.el.addEventListener("touchstart",Oo),this.el.addEventListener("pointerdown",Vo)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),tt&&(this.el.removeEventListener("touchstart",Oo),this.el.removeEventListener("pointerdown",Vo)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),tt&&(this.el.addEventListener("touchmove",Ro),this.el.addEventListener("touchend",Ho)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),tt&&(this.el.removeEventListener("touchmove",Ro),this.el.removeEventListener("touchend",Ho)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,n){return this.option[e]&&this.option[e](n),this}}Lo.prefix="ui-resizable-";class mr{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,n){this._eventRegister[e]=n}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,n){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](n)}}class Pn extends mr{constructor(e,n={}){super(),this.el=e,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const i=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||r;return{position:{left:(a.left-i.left)*this.rectScale.x,top:(a.top-i.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const n=e.handles&&e.handles!==this.option.handles,o=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(i=>this.option[i]=e[i]),n&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),he.overResizeElement===this&&delete he.overResizeElement),this}_mouseOver(e){he.overResizeElement||he.dragElement||(he.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){he.overResizeElement===this&&(delete he.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Lo(this.el,e,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,e)})),this}_resizeStart(e){this.sizeToContent=J.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=J.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const n=J.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(e,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,n),this._applyChange();const o=J.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(o,this._ui()),this.triggerEvent("resize",o),this}_resizeStop(e){const n=J.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Pn._originStyleProp.map(o=>this.el.style[o]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,n=J.getValuesFromTransformedElement(e);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Pn._originStyleProp.forEach((e,n)=>{this.el.style[e]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,n){const o=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-o.clientX,a=this.sizeToContent?0:e.clientY-o.clientY;let l,u;n.indexOf("e")>-1?i.width+=r:n.indexOf("w")>-1&&(i.width-=r,i.left+=r,l=!0),n.indexOf("s")>-1?i.height+=a:n.indexOf("n")>-1&&(i.height-=a,i.top+=a,u=!0);const c=this._constrainSize(i.width,i.height,l,u);return Math.round(i.width)!==Math.round(c.width)&&(n.indexOf("w")>-1&&(i.left+=i.width-c.width),i.width=c.width),Math.round(i.height)!==Math.round(c.height)&&(n.indexOf("n")>-1&&(i.top+=i.height-c.height),i.height=c.height),i}_constrainSize(e,n,o,i){const r=this.option,a=(o?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,u=(i?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||n,d=Math.min(a,Math.max(l,e)),f=Math.min(u,Math.max(c,n));return{width:d,height:f}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const n=this.el.parentElement,{left:o,top:i}=n.getBoundingClientRect();e={left:o,top:i,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const o=this.temporalRect[n],i=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(o-e[n])*i+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}Pn._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const By='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class On extends mr{constructor(e,n={}){super(),this.el=e,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const o=n?.handle?.substring(1),i=e.gridstackNode;this.dragEls=!o||e.classList.contains(o)?[e]:i?.subGrid?[e.querySelector(n.handle)||e]:Array.from(e.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),tt&&(e.addEventListener("touchstart",Oo),e.addEventListener("pointerdown",Vo))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),tt&&(n.removeEventListener("touchstart",Oo),n.removeEventListener("pointerdown",Vo))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this}_mouseDown(e){if(We.touchHandled&&e.isTrusted&&(We.touchHandled=!1),!he.mouseHandled)return e.button!==0||!this.dragEls.find(n=>n===e.target)&&e.target.closest(By)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete he.dragElement,delete he.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),tt&&(e.currentTarget.addEventListener("touchmove",Ro),e.currentTarget.addEventListener("touchend",Ho)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),he.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const n=J.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(e){const n=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),he.pauseDrag){const o=Number.isInteger(he.pauseDrag)?he.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),o)}else this._callDrag(e);else if(Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>3){this.dragging=!0,he.dragElement=this;const o=this.el.gridstackNode?.grid;o?he.dropElement=o.el.ddElement.ddDroppable:delete he.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=J.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const i=J.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(i,this.ui()),this.triggerEvent("dragstart",i),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),tt&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ro,!0),e.currentTarget.removeEventListener("touchend",Ho,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),he.dropElement?.el===this.el.parentElement&&delete he.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const n=J.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),he.dropElement&&he.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete he.dragElement,delete he.dropElement,delete he.mouseHandled,e.preventDefault()}_keyEvent(e){const n=this.el.gridstackNode,o=n?.grid||he.dropElement?.el?.gridstack;if(e.key==="Escape")n&&n._origRotate&&(n._orig=n._origRotate,delete n._origRotate),o?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(n&&o&&(e.key==="r"||e.key==="R")){if(!J.canBeRotated(n))return;n._origRotate=n._origRotate||{...n._orig},delete n._moving,o.setAnimation(!1).rotate(n.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),n._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,n.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",J.swap(n._orig,"w","h"),delete n._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=J.cloneNode(this.el)),e.parentElement||J.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=On.originStyleProp.map(n=>this.el.style[n]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const n=this.helper.style;return n.pointerEvents="none",n.width=this.dragOffset.width+"px",n.height=this.dragOffset.height+"px",n.willChange="left, top",n.position="fixed",this._dragFollow(e),n.transition="none",setTimeout(()=>{this.helper&&(n.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const n=this.helper,o=this.dragElementOriginStyle.transition||null;n.style.transition=this.dragElementOriginStyle.transition="none",On.originStyleProp.forEach(i=>n.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>n.style.transition=o,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const n={left:0,top:0},o=this.helper.style,i=this.dragOffset;o.left=(e.clientX+i.offsetLeft-n.left)*this.dragTransform.xScale+"px",o.top=(e.clientY+i.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,n,o){let i=0,r=0;o&&(i=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const a=n.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-i,offsetTop:-e.clientY+a.top-r,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const n=this.el.parentElement.getBoundingClientRect(),o=this.helper.getBoundingClientRect();return{position:{top:(o.top-n.top)*this.dragTransform.yScale,left:(o.left-n.left)*this.dragTransform.xScale}}}}On.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class $y extends mr{constructor(e,n={}){super(),this.el=e,this.option=n,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),tt&&(this.el.addEventListener("pointerenter",ml),this.el.addEventListener("pointerleave",yl)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),tt&&(this.el.removeEventListener("pointerenter",ml),this.el.removeEventListener("pointerleave",yl)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this._setupAccept(),this}_mouseEnter(e){if(!he.dragElement||We.touchHandled&&e.isTrusted||!this._canDrop(he.dragElement.el))return;e.preventDefault(),e.stopPropagation(),he.dropElement&&he.dropElement!==this&&he.dropElement._mouseLeave(e,!0),he.dropElement=this;const n=J.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(n,this._ui(he.dragElement)),this.triggerEvent("dropover",n),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,n=!1){if(!he.dragElement||he.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const o=J.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(o,this._ui(he.dragElement)),this.triggerEvent("dropout",o),he.dropElement===this&&(delete he.dropElement,!n)){let i,r=this.el.parentElement;for(;!i&&r;)i=r.ddElement?.ddDroppable,r=r.parentElement;i&&i._mouseEnter(e)}}drop(e){e.preventDefault();const n=J.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(n,this._ui(he.dragElement)),this.triggerEvent("drop",n)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class yr{static init(e){return e.ddElement||(e.ddElement=new yr(e)),e.ddElement}constructor(e){this.el=e}on(e,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,n),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new On(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Pn(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new $y(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class zy{resizable(e,n,o,i){return this._getDDElements(e,n).forEach(r=>{if(n==="disable"||n==="enable")r.ddResizable&&r.ddResizable[n]();else if(n==="destroy")r.ddResizable&&r.cleanResizable();else if(n==="option")r.setupResizable({[o]:i});else{const l=r.el.gridstackNode.grid;let u=r.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const c=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:u,autoHide:c,start:n.start,stop:n.stop,resize:n.resize})}}),this}draggable(e,n,o,i){return this._getDDElements(e,n).forEach(r=>{if(n==="disable"||n==="enable")r.ddDraggable&&r.ddDraggable[n]();else if(n==="destroy")r.ddDraggable&&r.cleanDraggable();else if(n==="option")r.setupDraggable({[o]:i});else{const a=r.el.gridstackNode.grid;r.setupDraggable({...a.opts.draggable,start:n.start,stop:n.stop,drag:n.drag})}}),this}dragIn(e,n){return this._getDDElements(e).forEach(o=>o.setupDraggable(n)),this}droppable(e,n,o,i){return typeof n.accept=="function"&&!n._accept&&(n._accept=n.accept,n.accept=r=>n._accept(r)),this._getDDElements(e,n).forEach(r=>{n==="disable"||n==="enable"?r.ddDroppable&&r.ddDroppable[n]():n==="destroy"?r.ddDroppable&&r.cleanDroppable():n==="option"?r.setupDroppable({[o]:i}):r.setupDroppable(n)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,n,o){return this._getDDElements(e).forEach(i=>i.on(n,r=>{o(r,he.dragElement?he.dragElement.el:r.target,he.dragElement?he.dragElement.helper:null)})),this}off(e,n){return this._getDDElements(e).forEach(o=>o.off(n)),this}_getDDElements(e,n){const o=e.gridstack||n!=="destroy"&&n!=="disable",i=J.getElements(e);return i.length?i.map(a=>a.ddElement||(o?yr.init(a):null)).filter(a=>a):[]}}const Oe=new zy;class ue{static init(e={},n=".grid-stack"){if(typeof document>"u")return null;const o=ue.getGridElement(n);return o?(o.gridstack||(o.gridstack=new ue(o,J.cloneDeep(e))),o.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
27
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},n=".grid-stack"){const o=[];return typeof document>"u"||(ue.getGridElements(n).forEach(i=>{i.gridstack||(i.gridstack=new ue(i,
|
|
28
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(e,n={}){if(!e)return null;let o=e;if(o.gridstack){const a=o.gridstack;return n&&(a.opts={...a.opts,...n}),n.children!==void 0&&a.load(n.children),a}return(!e.classList.contains("grid-stack")||ue.addRemoveCB)&&(ue.addRemoveCB?o=ue.addRemoveCB(e,n,!0,!0):o=J.createDiv(["grid-stack",n.class],e)),ue.init(n,o)}static registerEngine(e){ue.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=J.createDiv([this.opts.placeholderClass,Ge.itemClass,this.opts.itemClass]);const e=J.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,n={}){this.el=e,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=n=n||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const o=J.toNumber(e.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const i=n.columnOpts;if(i){const c=i.breakpoints;!i.columnWidth&&!c?.length?delete n.columnOpts:(i.columnMax=i.columnMax||12,c?.length>1&&c.sort((d,f)=>(f.w||0)-(d.w||0)))}const r={...J.cloneDeep(Ge),column:J.toNumber(e.getAttribute("gs-column"))||Ge.column,minRow:o||J.toNumber(e.getAttribute("gs-min-row"))||Ge.minRow,maxRow:o||J.toNumber(e.getAttribute("gs-max-row"))||Ge.maxRow,staticGrid:J.toBool(e.getAttribute("gs-static"))||Ge.staticGrid,sizeToContent:J.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||Ge.draggable.handle},removableOptions:{accept:n.itemClass||Ge.removableOptions.accept,decline:Ge.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=J.toBool(e.getAttribute("gs-animate"))),n=J.defaults(n,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=e.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const l=this.el.closest("."+Ge.itemClass)?.gridstackNode;if(l&&(l.subGrid=this,this.parentGridNode=l,this.el.classList.add("grid-stack-nested"),l.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==Ge.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const c=n.cellHeight;delete n.cellHeight,this.cellHeight(c)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=tt),this._setStaticClass();const u=n.engineClass||ue.engineClass||vt;if(this.engine=new u({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:c=>{c.forEach(d=>{const f=d.el;f&&(d._removeDOM?(f&&f.remove(),delete d._removeDOM):this._writePosAttr(f,d))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const c=n.children;delete n.children,c.length&&this.load(c)}this.setAnimation(),n.subGridDynamic&&!he.pauseDrag&&(he.pauseDrag=!0),n.draggable?.pause!==void 0&&(he.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let n,o=e;if(o.grid=this,o.el?n=o.el:ue.addRemoveCB?n=ue.addRemoveCB(this.el,e,!0,!1):n=this.createWidgetDivs(o),!n)return;if(o=n.gridstackNode,o&&n.parentElement===this.el&&this.engine.nodes.find(r=>r._id===o._id))return n;const i=this._readAttr(n);return J.defaults(e,i),this.engine.prepareNode(e),this.el.appendChild(n),this.makeWidget(n,e),n}createWidgetDivs(e){const n=J.createDiv(["grid-stack-item",this.opts.itemClass]),o=J.createDiv(["grid-stack-item-content"],n);return J.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,ue.renderCB(o,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(n))):ue.renderCB(o,e),n}makeSubGrid(e,n,o,i=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;n=J.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...n||r.subGridOpts||{}}),r.subGridOpts=n;let u;n.column==="auto"&&(u=!0,n.column=Math.max(r.w||1,o?.w||1),delete n.columnOpts);let c=r.el.querySelector(".grid-stack-item-content"),d,f;if(i&&(this._removeDD(r.el),f={...r,x:0,y:0},J.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),ue.addRemoveCB?d=ue.addRemoveCB(this.el,f,!0,!1):(d=J.createDiv(["grid-stack-item"]),d.appendChild(c),c=J.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),o){const p=u?n.column:r.w,y=r.h+o.h,m=r.el.style;m.transition="none",this.update(r.el,{w:p,h:y}),setTimeout(()=>m.transition=null)}const h=r.subGrid=ue.addGrid(c,n);return o?._moving&&(h._isTemp=!0),u&&(h._autoColumn=!0),i&&h.makeWidget(d,f),o&&(o._moving?window.setTimeout(()=>J.simulateMouseEvent(o._event,"mouseenter",h.el),0):h.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),h}removeAsSubGrid(e){const n=this.parentGridNode?.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x+=this.parentGridNode.x,o.y+=this.parentGridNode.y,n.makeWidget(o.el,o)}),n.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>J.simulateMouseEvent(e._event,"mouseenter",n.el),0))}save(e=!0,n=!1,o=ue.saveCB,i){const r=this.engine.save(e,o,i);if(r.forEach(a=>{if(e&&a.el&&!a.subGrid&&!o){const l=a.el.querySelector(".grid-stack-item-content");a.content=l?.innerHTML,a.content||delete a.content}else if(!e&&!o&&delete a.content,a.subGrid?.el){const l=a.w||a.subGrid.getColumn(),u=a.subGrid.save(e,n,o,l);a.subGridOpts=n?u:{children:u},delete a.subGrid}delete a.el}),n){const a=J.cloneDeep(this.opts);a.marginBottom===a.marginTop&&a.marginRight===a.marginLeft&&a.marginTop===a.marginRight&&(a.margin=a.marginTop,delete a.marginTop,delete a.marginRight,delete a.marginBottom,delete a.marginLeft),a.rtl===(this.el.style.direction==="rtl")&&(a.rtl="auto"),this._isAutoCellHeight&&(a.cellHeight="auto"),this._autoColumn&&(a.column="auto");const l=a._alwaysShowResizeHandle;return delete a._alwaysShowResizeHandle,l!==void 0?a.alwaysShowResizeHandle=l:delete a.alwaysShowResizeHandle,J.removeInternalAndSame(a,Ge),a.children=r,a}return r}load(e,n=ue.addRemoveCB||!0){e=J.cloneDeep(e);const o=this.getColumn();e.forEach(d=>{d.w=d.w||d.minW||1,d.h=d.h||d.minH||1}),e=J.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let i=0;e.forEach(d=>{i=Math.max(i,(d.x||0)+d.w)}),i>this.engine.defaultColumn&&(this.engine.defaultColumn=i),i>o&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(i,o,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,i,!0));const r=ue.addRemoveCB;typeof n=="function"&&(ue.addRemoveCB=n);const a=[];this.batchUpdate();const l=!this.engine.nodes.length,u=l&&this.opts.animate;u&&this.setAnimation(!1),!l&&n&&[...this.engine.nodes].forEach(f=>{if(!f.id)return;J.find(e,f.id)||(ue.addRemoveCB&&ue.addRemoveCB(this.el,f,!1,!1),a.push(f),this.removeWidget(f.el,!0,!1))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(d=>J.find(e,d.id)?(c.push(d),!1):!0),e.forEach(d=>{const f=J.find(c,d.id);if(f){if(J.shouldSizeToContent(f)&&(d.h=f.h),this.engine.nodeBoundFix(d),(d.autoPosition||d.x===void 0||d.y===void 0)&&(d.w=d.w||f.w,d.h=d.h||f.h,this.engine.findEmptyPosition(d)),this.engine.nodes.push(f),J.samePos(f,d)&&this.engine.nodes.length>1&&(this.moveNode(f,{...d,forceCollide:!0}),J.copyPos(d,f)),this.update(f.el,d),d.subGridOpts?.children){const h=f.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(d.subGridOpts.children)}}else n&&this.addWidget(d)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?ue.addRemoveCB=r:delete ue.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const n=this.el.querySelector("."+this.opts.itemClass);if(n){const i=J.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/i)}const o=parseInt(this.el.getAttribute("gs-current-row"));return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+o}const n=J.parseHeight(e);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const n=this.getColumn();let o=n;const i=this._widthOrContainer(!0);if(e.columnWidth)o=Math.min(Math.round(i/e.columnWidth)||1,e.columnMax);else{o=e.columnMax;let r=0;for(;r<e.breakpoints.length&&i<=e.breakpoints[r].w;)o=e.breakpoints[r++].c||n}if(o!==n){const r=e.breakpoints?.find(a=>a.c===o);return this.column(o,r?.layout||e.layout),!0}return!1}compact(e="compact",n=!0){return this.engine.compact(e,n),this._triggerChangeEvent(),this}column(e,n="moveScale"){if(!e||e<1||this.opts.column===e)return this;const o=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,e,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,n=!1){const o=this.el.getBoundingClientRect();let i;n?i={top:o.top+document.documentElement.scrollTop,left:o.left}:i={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-i.left,a=e.top-i.top,l=o.width/this.getColumn(),u=o.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(a/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,n,o,i){return this.engine.isAreaEmpty(e,n,o,i)}makeWidget(e,n){const o=ue.getElement(e);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,n);const i=o.gridstackNode;this._updateContainerHeight(),i.subGridOpts&&this.makeSubGrid(o,i.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,o}on(e,n){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.on(i,n)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=i=>n(i):this._gsEventHandler[e]=i=>{i.detail&&n(i,i.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=n:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(o=>this.off(o)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,n=!0,o=!0){return e?(ue.getElements(e).forEach(i=>{if(i.parentElement&&i.parentElement!==this.el)return;let r=i.gridstackNode;r||(r=this.engine.nodes.find(a=>i===a.el)),r&&(n&&ue.addRemoveCB&&ue.addRemoveCB(this.el,r,!1,!1),delete i.gridstackNode,this._removeDD(i),this.engine.removeNode(r,n,o),n&&i.parentElement&&i.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,n=!0){return this.engine.nodes.forEach(o=>{e&&ue.addRemoveCB&&ue.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(e,n),n&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,n=!0,o=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&o&&i.subGrid.setStatic(e,n,o)}),n&&this._setStaticClass(),this)}updateOptions(e){const n=this.opts;return e===n?this:(e.acceptWidgets!==void 0&&(n.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==n.class&&(n.class&&this.el.classList.remove(n.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(n.minRow=n.maxRow=n.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(n.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(n.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(n.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this)}update(e,n){return ue.getElements(e).forEach(o=>{const i=o?.gridstackNode;if(!i)return;const r={...J.copyPos({},i),...J.cloneDeep(n)};this.engine.nodeBoundFix(r),delete r.autoPosition;const a=["x","y","w","h"];let l;if(a.some(d=>r[d]!==void 0&&r[d]!==i[d])&&(l={},a.forEach(d=>{l[d]=r[d]!==void 0?r[d]:i[d],delete r[d]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const d=o.querySelector(".grid-stack-item-content");d&&d.textContent!==r.content&&(i.content=r.content,ue.renderCB(d,r),i.subGrid?.el&&(d.appendChild(i.subGrid.el),i.subGrid._updateContainerHeight())),delete r.content}let u=!1,c=!1;for(const d in r)d[0]!=="_"&&i[d]!==r[d]&&(i[d]=r[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(J.sanitizeMinMax(i),l){const d=l.w!==void 0&&l.w!==i.w;this.moveNode(i,l),d&&i.subGrid?i.subGrid.onResize(this.hasAnimationCSS()?i.w:void 0):this.resizeToContentCheck(d,i),delete i._orig}(l||u)&&this._writeAttr(o,i),c&&this.prepareDragDrop(i.el),ue.updateCB&&ue.updateCB(i)}),this}moveNode(e,n){const o=e._updating;o||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,n),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const n=e.gridstackNode;if(!n)return;const o=n.grid;if(!o||e.parentElement!==o.el)return;const i=o.getCellHeight(!0);if(!i)return;let r=n.h?n.h*i:e.clientHeight,a;if(n.resizeToContentParent&&(a=e.querySelector(n.resizeToContentParent)),a||(a=e.querySelector(ue.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,u=n.h?n.h*i-l:a.clientHeight;let c;if(n.subGrid){c=n.subGrid.getRow()*n.subGrid.getCellHeight(!0);const h=n.subGrid.el.getBoundingClientRect(),p=e.getBoundingClientRect();c+=h.top-p.top}else{if(n.subGridOpts?.children?.length)return;{const h=a.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${n.id} '${ue.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=h.getBoundingClientRect().height||u}}if(u===c)return;r+=c-u;let d=Math.ceil(r/i);const f=Number.isInteger(n.sizeToContent)?n.sizeToContent:0;f&&d>f&&(d=f,e.classList.add("size-to-content-max")),n.minH&&d<n.minH?d=n.minH:n.maxH&&d>n.maxH&&(d=n.maxH),d!==n.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(n,{h:d}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){ue.resizeToContentCB?ue.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,n){return ue.getElements(e).forEach(o=>{const i=o.gridstackNode;if(!J.canBeRotated(i))return;const r={w:i.h,h:i.w,minH:i.minW,minW:i.minH,maxH:i.maxW,maxW:i.maxH};if(n){const l=n.left>0?Math.floor(n.left/this.cellWidth()):0,u=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;r.x=i.x+l-(i.h-(u+1)),r.y=i.y+u-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const a=i._orig;this.update(o,r),i._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const o=J.parseHeight(e);if(this.opts.marginUnit===o.unit&&this.opts.margin===o.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(n=>{delete n._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,n){const o=n?new CustomEvent(e,{bubbles:!1,detail:n}):new Event(e);let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;return i.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const o=this.opts.cellHeight,i=this.opts.cellHeightUnit;if(!o)return this;if(!e&&!this.opts.minRow){const r=J.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===i){const a=Math.floor(r.h/o);n<a&&(n=a)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[e?"minHeight":"height"]=n*o+i),e&&J.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,n=!1,o){o=o||this._readAttr(e),e.gridstackNode=o,o.el=e,o.grid=this,o=this.engine.addNode(o,n),this._writeAttr(e,o),e.classList.add(Ge.itemClass,this.opts.itemClass);const i=J.shouldSizeToContent(o);return i?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),i&&this.resizeToContentCheck(!1,o),J.lazyLoad(o)||this.prepareDragDrop(o.el),this}_writePosAttr(e,n){return(!n._moving&&!n._resizing||this._placeholder===e)&&(e.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,e.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,e.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,e.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),e.setAttribute("gs-x",String(n.x)),e.setAttribute("gs-y",String(n.y)),n.w>1?e.setAttribute("gs-w",String(n.w)):e.removeAttribute("gs-w"),n.h>1?e.setAttribute("gs-h",String(n.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,n){if(!n)return this;this._writePosAttr(e,n);const o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const i in o)n[i]?e.setAttribute(o[i],String(n[i])):e.removeAttribute(o[i]);return this}_readAttr(e,n=!0){const o={};o.x=J.toNumber(e.getAttribute("gs-x")),o.y=J.toNumber(e.getAttribute("gs-y")),o.w=J.toNumber(e.getAttribute("gs-w")),o.h=J.toNumber(e.getAttribute("gs-h")),o.autoPosition=J.toBool(e.getAttribute("gs-auto-position")),o.noResize=J.toBool(e.getAttribute("gs-no-resize")),o.noMove=J.toBool(e.getAttribute("gs-no-move")),o.locked=J.toBool(e.getAttribute("gs-locked"));const i=e.getAttribute("gs-size-to-content");i&&(i==="true"||i==="false"?o.sizeToContent=J.toBool(i):o.sizeToContent=parseInt(i,10)),o.id=e.getAttribute("gs-id"),o.maxW=J.toNumber(e.getAttribute("gs-max-w")),o.minW=J.toNumber(e.getAttribute("gs-min-w")),o.maxH=J.toNumber(e.getAttribute("gs-max-h")),o.minH=J.toNumber(e.getAttribute("gs-min-h")),n&&(o.w===1&&e.removeAttribute("gs-w"),o.h===1&&e.removeAttribute("gs-h"),o.maxW&&e.removeAttribute("gs-max-w"),o.minW&&e.removeAttribute("gs-min-w"),o.maxH&&e.removeAttribute("gs-max-h"),o.minH&&e.removeAttribute("gs-min-h"));for(const r in o){if(!o.hasOwnProperty(r))return;!o[r]&&o[r]!==0&&r!=="sizeToContent"&&delete o[r]}return o}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,n=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)J.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(o=>J.shouldSizeToContent(o))){const o=[...this.engine.nodes];this.batchUpdate(),o.forEach(i=>{J.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(e=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!e&&n&&!this.resizeObserver?(this._sizeThrottle=J.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return J.getElement(e)}static getElements(e=".grid-stack-item"){return J.getElements(e)}static getGridElement(e){return ue.getElement(e)}static getGridElements(e){return J.getElements(e)}_initMargin(){let e,n=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(e=J.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,n=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(a=>{this.opts[a]===void 0?this.opts[a]=n:(e=J.parseHeight(this.opts[a]),this.opts[a]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const r=this.el.style;return r.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Oe}static setupDragIn(e,n,o,i=document){n?.pause!==void 0&&(he.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof e=="string"?J.getElements(e,i):e).forEach((a,l)=>{Oe.isDraggable(a)||Oe.dragIn(a,n),o?.[l]&&(a.gridstackNode=o[l])})}movable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noMove:i.noMove=!0,this.prepareDragDrop(i.el))}),this)}resizable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noResize:i.noResize=!0,this.prepareDragDrop(i.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableMove(e,n)}),this)}enableResize(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableResize(e,n)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&ue._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Oe.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Oe.droppable(this.el,"destroy"),this;let e,n;const o=(i,r,a)=>{a=a||r;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const h=a.getBoundingClientRect();a.style.left=h.x+(this.dragTransform.xScale-1)*(i.clientX-h.x)/this.dragTransform.xScale+"px",a.style.top=h.y+(this.dragTransform.yScale-1)*(i.clientY-h.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:u,left:c}=a.getBoundingClientRect();const d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;const f={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/n)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Oe.off(r,"drag");return}l._willFitPos&&(J.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,i,f,l,n,e)}else this._dragOrResize(a,i,f,l,n,e)};return Oe.droppable(this.el,{accept:i=>{const r=i.gridstackNode||this._readAttr(i,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(i);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=i.matches(l)}if(a&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(i,r,a)=>{let l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,a),a=a||r,n=this.cellWidth(),e=this.getCellHeight(!0),!l){const d=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(d){try{l=JSON.parse(d)}catch{console.error("Gridstack dropover: Bad JSON format: ",d)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const u=l.w||Math.round(a.offsetWidth/n)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:u,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=c,l._temporaryRemoved=!0),ue._itemRemoving(l.el,!1),Oe.on(r,"drag",o),o(i,r,a),!1}).on(this.el,"dropout",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,c=r!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const d=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&d?.grid&&d.grid!==this){const h=d.grid;h.engine.removeNodeFromLayoutCache(d),h.engine.removedNodes.push(d),h._triggerRemoveEvent()._triggerChangeEvent(),h.parentGridNode&&!h.engine.nodes.length&&h.opts.subGridDynamic&&h.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Oe.off(r,"drag"),a!==r?(a.remove(),r=a):r.remove(),this._removeDD(r),!u))return!1;const f=l.subGrid?.el?.gridstack;return J.copyPos(l,this._readAttr(this.placeholder)),J.removePositioningStyles(r),c&&(l.content||l.subGridOpts||ue.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...i,type:"dropped"},d&&d.grid?d:void 0,l),!1}),this}static _itemRemoving(e,n){if(!e)return;const o=e?e.gridstackNode:void 0;!o?.grid||e.classList.contains(o.grid.opts.removableOptions.decline)||(n?o._isAboutToRemove=!0:delete o._isAboutToRemove,n?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Oe.isDroppable(e)&&Oe.droppable(e,this.opts.removableOptions).on(e,"dropover",(n,o)=>ue._itemRemoving(o,!0)).on(e,"dropout",(n,o)=>ue._itemRemoving(o,!1)),this):this}prepareDragDrop(e,n=!1){const o=e?.gridstackNode;if(!o)return;const i=o.noMove||this.opts.disableDrag,r=o.noResize||this.opts.disableResize,a=this.opts.staticGrid||i&&r;if((n||a)&&(o._initDD&&(this._removeDD(e),delete o._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!o._initDD){let l,u;const c=(h,p)=>{this.triggerEvent(h,h.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,h,p,o,l,u)},d=(h,p)=>{this._dragOrResize(e,h,p,o,l,u)},f=h=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;const p=o.w!==o._orig.w,y=h.target;if(!(!y.gridstackNode||y.gridstackNode.grid!==this)){if(o.el=y,o._isAboutToRemove){const m=e.gridstackNode.grid;m._gsEventHandler[h.type]&&m._gsEventHandler[h.type](h,y),m.engine.nodes.push(o),m.removeWidget(e,!0,!0)}else J.removePositioningStyles(y),o._temporaryRemoved?(this._writePosAttr(y,o),this.engine.addNode(o)):this._writePosAttr(y,o),this.triggerEvent(h,y);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),h.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(p,o))}};Oe.draggable(e,{start:c,stop:f,drag:d}).resizable(e,{start:c,stop:f,resize:d}),o._initDD=!0}return Oe.draggable(e,i?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,n,o,i,r,a){if(this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=i,i.grid?.el)this.dragTransform=J.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=J.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(i.el=this.placeholder,i._lastUiPosition=o.position,i._prevYPix=o.position.top,i._moving=n.type==="dragstart",i._resizing=n.type==="resizestart",delete i._lastTried,n.type==="dropover"&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const l=this.getColumn()-i.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-i.y;Oe.resizable(e,"option","minWidth",r*Math.min(i.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(i.minH||1,u)).resizable(e,"option","maxWidth",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,i.x+i.w)).resizable(e,"option","maxHeight",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,i.y+i.h))}}_dragOrResize(e,n,o,i,r,a){const l={...i._orig};let u,c=this.opts.marginLeft,d=this.opts.marginRight,f=this.opts.marginTop,h=this.opts.marginBottom;const p=Math.round(a*.1),y=Math.round(r*.1);if(c=Math.min(c,y),d=Math.min(d,y),f=Math.min(f,p),h=Math.min(h,p),n.type==="drag"){if(i._temporaryRemoved)return;const b=o.position.top-i._prevYPix;i._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&J.updateScrollPosition(e,o.position,b);const N=o.position.left+(o.position.left>i._lastUiPosition.left?-d:c),_=o.position.top+(o.position.top>i._lastUiPosition.top?-h:f);l.x=Math.round(N/r),l.y=Math.round(_/a);const g=this._extraDragRow;if(this.engine.collide(i,l)){const x=this.getRow();let z=Math.max(0,l.y+i.h-x);this.opts.maxRow&&x+z>this.opts.maxRow&&(z=Math.max(0,this.opts.maxRow-x)),this._extraDragRow=z}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if(n.type==="resize"){if(l.x<0||(J.updateScrollResize(n,e,a),l.w=Math.round((o.size.width-c)/r),l.h=Math.round((o.size.height-f)/a),i.w===l.w&&i.h===l.h)||i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;const b=o.position.left+c,N=o.position.top+f;l.x=Math.round(b/r),l.y=Math.round(N/a),u=!0}i._event=n,i._lastTried=l;const m={x:o.position.left+c,y:o.position.top+f,w:(o.size?o.size.width:i.w*r)-c-d,h:(o.size?o.size.height:i.h*a)-f-h};if(this.engine.moveNodeCheck(i,{...l,cellWidth:r,cellHeight:a,rect:m,resizing:u})){i._lastUiPosition=o.position,this.engine.cacheRects(r,a,f,d,h,c),delete i._skipDown,u&&i.subGrid&&i.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const b=n.target;i._sidebarOrig||this._writePosAttr(b,i),this.triggerEvent(n,b)}}triggerEvent(e,n){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[e.type]&&o._gsEventHandler[e.type](e,n)}_leave(e,n){n=n||e;const o=n.gridstackNode;if(!o||(n.style.transform=n.style.transformOrigin=null,Oe.off(e,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&n?n:e;const i=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=i,this.opts.removable===!0&&ue._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}}ue.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)},ue.resizeToContentParent=".grid-stack-item-content",ue.Utils=J,ue.Engine=vt,ue.GDRev="12.4.2";const Ay={class:"d-layout"},Py=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-locked","gs-no-resize","gs-no-move","gs-min-w","gs-min-h","gs-max-w","gs-max-h"],vl=$t(s.defineComponent({name:"DLayout",__name:"layout",props:{modelValue:{default:()=>[]},column:{default:24},cellHeight:{default:60},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},float:{type:Boolean,default:!0},removable:{type:Boolean,default:!1},removableOptions:{}},emits:["update:modelValue","added","removed","changed","dragStart","dragStop","resizeStart","resizeStop"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=s.ref();let a=null;const l=async()=>{r.value&&(await s.nextTick(),a&&a.destroy(!1),a=ue.init({column:o.column,cellHeight:o.cellHeight,disableDrag:!(o.draggable&&!o.disable),disableResize:!(o.resizable&&!o.disable),animate:o.animate,float:o.float,removable:o.removable,removableOptions:o.removableOptions},r.value),a.on("added",(h,p)=>{const y=p[0];if(y){const m=u(y);i("added",m),d()}}),a.on("removed",(h,p)=>{const y=p[0];if(y){const m=u(y);i("removed",m),d()}}),a.on("change",()=>{d();const p=(a?.save()||[]).map(y=>u(y));i("changed",p)}),a.on("dragstart",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("dragStart",h,m)}}),a.on("dragstop",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("dragStop",h,m)}}),a.on("resizestart",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("resizeStart",h,m)}}),a.on("resizestop",(h,p)=>{if(p){const y=p.gridstackNode||p,m=u(y);i("resizeStop",h,m)}}))},u=h=>({id:h.id||h.el?.getAttribute("gs-id")||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1,locked:h.locked||!1,noResize:h.noResize||!1,noMove:h.noMove||!1,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}),c=async()=>{if(!a||!r.value)return;await s.nextTick();const h=a.engine.nodes;new Set(h.map(y=>y.id));const p=new Set(o.modelValue.map(y=>y.id));h.forEach(y=>{if(!p.has(y.id||"")){const m=y.el;m&&a&&a.removeWidget(m,!1)}}),o.modelValue.forEach(y=>{const m=h.find(b=>b.id===y.id);if(m)m.el&&a&&a.update(m.el,{x:y.x,y:y.y,w:y.w,h:y.h,locked:y.locked,noResize:y.noResize,noMove:y.noMove,minW:y.minW,minH:y.minH,maxW:y.maxW,maxH:y.maxH});else{if(!r.value||!a)return;const b=r.value.querySelector(`[gs-id="${y.id}"]`);b&&a.makeWidget(b)}})},d=()=>{if(!a)return;const p=a.save().map(y=>{const m={id:y.id||"",x:y.x||0,y:y.y||0,w:y.w||1,h:y.h||1},b=o.modelValue.find(N=>N.id===m.id);return b&&Object.keys(b).forEach(N=>{["id","x","y","w","h"].includes(N)||(m[N]=b[N])}),m});i("update:modelValue",p)},f=s.computed(()=>o.modelValue);return s.watch(()=>o.modelValue,async()=>{a&&(await s.nextTick(),c())},{deep:!0}),s.watch(()=>[o.column,o.cellHeight,o.draggable,o.resizable,o.disable,o.animate,o.float,o.removable],()=>{l()}),s.onMounted(()=>{l()}),s.onBeforeUnmount(()=>{a&&(a.destroy(!1),a=null)}),e({addItem:async h=>{if(a&&r.value){await s.nextTick();const p=r.value.querySelector(`[gs-id="${h.id}"]`);p&&(a.makeWidget(p),a.update(p,{x:h.x,y:h.y,w:h.w,h:h.h,locked:h.locked,noResize:h.noResize,noMove:h.noMove,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}))}},removeItem:h=>{if(a&&r.value){const p=r.value.querySelector(`[gs-id="${h}"]`);p&&a.removeWidget(p,!1)}},clear:()=>{a&&a.removeAll(!1)},getGrid:()=>a}),(h,p)=>(s.openBlock(),s.createElementBlock("div",Ay,[s.createElementVNode("div",{ref_key:"gridContainerRef",ref:r},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.value,y=>(s.openBlock(),s.createElementBlock("div",{key:y.id,"gs-id":y.id,"gs-x":y.x,"gs-y":y.y,"gs-w":y.w,"gs-h":y.h,"gs-locked":y.locked,"gs-no-resize":y.noResize,"gs-no-move":y.noMove,"gs-min-w":y.minW,"gs-min-h":y.minH,"gs-max-w":y.maxW,"gs-max-h":y.maxH,class:"d-layout-item"},[s.renderSlot(h.$slots,"item",{item:y})],8,Py))),128))],512)]))}})),ze=(t,e="",n=!1)=>n?`${t}pt`:e?`${t}${e}`:`${t}px`,Ve=(t,e=0)=>t==null||isNaN(t)?0:Number(Number(t).toFixed(e)),Oy=t=>t*3/4,Ry=t=>t*4/3,Hy=["onMousedown"],Vy={key:2,class:"d-draggable__mask"},bl=$t(s.defineComponent({name:"DDraggable",__name:"draggable",props:{index:{},mask:{type:Boolean,default:!0},scale:{default:1},readonly:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},step:{default:1},zIndex:{default:1},isActiveBgTransparent:{type:Boolean,default:!1},left:{default:0},top:{default:0},width:{},height:{},activeFlag:{type:Boolean,default:!1},isPt:{type:Boolean,default:!1}},emits:["focus","blur","over","out"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=s.ref(),a=s.ref(),l=s.ref(0),u=s.ref(0),c=s.ref(0),d=s.ref(0),f=s.ref(null),h=s.ref(!1),p=s.ref(!1),y=s.ref(!1),m=s.ref(!1),b=s.ref([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),N=s.computed(()=>o.scale),_=s.computed(()=>({left:ze(N.value,"",o.isPt)})),g=s.computed(()=>({left:ze(-N.value,"",o.isPt)})),x=s.computed(()=>({left:"auto",right:ze(-N.value,"",o.isPt)})),z=s.computed(()=>({top:ze(-N.value,"",o.isPt)})),$=s.computed(()=>({top:"auto",bottom:ze(-N.value,"",o.isPt)})),F=s.computed(()=>{const K=8*N.value;return{width:ze(K,"",o.isPt),height:ze(K,"",o.isPt)}}),Y=s.computed(()=>({fontSize:ze(16*N.value,"",o.isPt)})),G=s.computed(()=>Object.assign((()=>{if(m.value){const K={zIndex:9999,..._.value};return o.isActiveBgTransparent&&(m.value||p.value)&&!o.readonly&&!o.disabled&&(K.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),K}return{zIndex:o.zIndex}})(),{top:ze(d.value,"",o.isPt),width:ze(l.value,"",o.isPt),height:ze(u.value,"",o.isPt),padding:ze(8*N.value,"",o.isPt),..._.value,left:ze(c.value,"",o.isPt)}));s.watch(()=>o.width,K=>{l.value=Ve(I(K))||(f.value?.offsetWidth??0)}),s.watch(()=>o.height,K=>{u.value=Ve(I(K))||(f.value?.offsetHeight??0)},{deep:!0}),s.watch(()=>o.left,K=>{c.value=Ve(I(K))}),s.watch(()=>o.top,K=>{d.value=Ve(I(K))}),s.watch(l,K=>{r.value&&(r.value.style.width=ze(K,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.width=ze(K,"",o.isPt)))}),s.watch(u,K=>{r.value&&(r.value.style.height=ze(K,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.height=ze(K,"",o.isPt)))}),s.watch(()=>o.activeFlag,K=>{S(K)});const S=K=>{m.value=K},I=K=>K===void 0?0:o.isPt?Ry(K):K,E=()=>{a.value&&a.value.firstChild&&(f.value=a.value.firstChild,l.value=Ve(I(o.width))||(f.value?.offsetWidth??0),u.value=Ve(I(o.height))||(f.value?.offsetHeight??0),c.value=Ve(I(o.left)),d.value=Ve(I(o.top)),S(o.activeFlag))},H=K=>{c.value=K},w=K=>{d.value=K},D=K=>{const Q=8*N.value/2,q={};return K.split("-").forEach(re=>{q[re]=ze(-Q,"",o.isPt)}),q},v=K=>{p.value=K},C=K=>o.isPt?Oy(K):K,k=()=>{h.value=!0,i("focus",{index:o.index,width:C(l.value),height:C(u.value),left:C(c.value),top:C(d.value)})},O=()=>{h.value=!1,y.value=!1,i("blur",{index:o.index,width:C(l.value),height:C(u.value),left:C(c.value),top:C(d.value)})},R=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,O()}},B=(K,Q)=>{if(o.disabled||o.readonly)return;let q,ee,re,oe,ce,ie;y.value=!0,k();let se=K.clientX,A=K.clientY;document.onmousemove=M=>{h.value=!0,Q==="right"?(q=!0,ee=!1):Q==="left"?(q=!0,re=!0,ce=!0,ee=!1):Q==="top"?(q=!1,ee=!0,oe=!0,ie=!0):Q==="bottom"?(q=!1,ee=!0):Q==="bottom-right"?(q=!0,ee=!0):Q==="bottom-left"?(q=!0,ee=!0,re=!0,ce=!0):Q==="top-right"?(q=!0,ee=!0,oe=!0,ie=!0):Q==="top-left"&&(q=!0,ee=!0,re=!0,ce=!0,oe=!0,ie=!0);const V=M.clientX-se,X=M.clientY-A;if(se=M.clientX,A=M.clientY,q){let T=V*o.step;ce&&(T=-T),re&&(c.value=Ve(c.value-T)),l.value=Ve(l.value+T)}if(ee){let T=X*o.step;ie&&(T=-T),oe&&(d.value=Ve(d.value-T)),u.value=Ve(u.value+T)}},R()},P=()=>{p.value=!1,i("out",{index:o.index,width:C(l.value),height:C(u.value),left:C(c.value),top:C(d.value)})},L=()=>{o.disabled||o.readonly||(p.value=!0,i("over",{index:o.index,width:C(l.value),height:C(u.value),left:C(c.value),top:C(d.value)}))},j=K=>{if(o.disabled||o.readonly)return;m.value=!0,k();let Q=K.clientX,q=K.clientY;document.onmousemove=ee=>{const re=ee.clientX-Q,oe=ee.clientY-q;Q=ee.clientX,q=ee.clientY,c.value=Ve(c.value+re*o.step),d.value=Ve(d.value+oe*o.step)},R()};return s.onMounted(()=>{E()}),e({setActive:S,setLeft:H,setTop:w,setOverActive:v}),(K,Q)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["d-draggable",{"d-draggable--active":(m.value||p.value)&&!t.readonly&&!t.disabled},{"d-draggable--pt":t.isPt&&!t.readonly&&!t.disabled},{"d-draggable--move":h.value},{"d-draggable--click":t.disabled}]),onMousedown:s.withModifiers(j,["stop"]),onMouseover:s.withModifiers(L,["stop"]),onMouseout:s.withModifiers(P,["stop"]),style:s.normalizeStyle(G.value)},[s.createElementVNode("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:r},[(m.value||p.value||h.value)&&!t.readonly&&!t.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...z.value}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...g.value}),class:"d-draggable__line d-draggable__line--top"},null,4),t.isPt?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...z.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...g.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...$.value}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...x.value}),class:"d-draggable__line d-draggable__line--top"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...$.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),s.createElementVNode("div",{style:s.normalizeStyle({..._.value,...x.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):(s.openBlock(),s.createElementBlock("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:s.normalizeStyle(Y.value)},s.toDisplayString(c.value)+","+s.toDisplayString(d.value),5))],64)):s.createCommentVNode("",!0),!t.readonly&&!t.disabled?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(b.value,(q,ee)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:ee},[m.value?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["d-draggable__range",`d-draggable__range--${q.classname}`]),style:s.normalizeStyle([F.value,D(q.classname)]),onMousedown:s.withModifiers(re=>B(re,q.classname),["stop"])},null,46,Hy)):s.createCommentVNode("",!0)],64))),128)):s.createCommentVNode("",!0),s.createElementVNode("div",{class:"d-draggable__item",ref_key:"item",ref:a},[s.renderSlot(K.$slots,"default")],512),!t.disabled&&t.mask?(s.openBlock(),s.createElementBlock("div",Vy)):s.createCommentVNode("",!0)],512)],38))}})),Ly=t=>{const e=jy(t.components);return{formConfig:t.form,componentList:e}},Fy=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.form;const a={};r.components.forEach(l=>{const u=e[l.type];a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:u?.dragType||"component",componentName:u?.componentName||"",runtimeType:u?.runtimeType,groupId:l.groupId,config:l.config,isInput:u?.isInput!==!1,containerId:l.containerId,level:l.level};u?.dragType==="container"&&(c.children=[]),i[c.id]=c,a[l.containerId].push(c)}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.form||[]}return{formConfig:n,componentList:o,componentDic:i}},vr=(t,e)=>{const n={ver:"V3",form:{...t},components:[],db:{}};return wl(e||[],n.components),n},wl=(t,e)=>{t.forEach(n=>{if(n.type==="pkey")return;const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};if(n.dragType==="container"){const i=n.children||[];wl(i,e)}e.push(o)})},jy=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{rule:[]}};o.config&&Object.keys(o.config).forEach(r=>{if(r==="required"){o.config.required&&i.config?.rule?.push({required:!0,message:o.config.requiredMsg||"请输入"});return}if(r==="patterns"){o.config.patterns.forEach(a=>{a.reg&&a.msg&&i.config?.rule?.push({pattern:new RegExp(a.reg),message:`请输入${a.msg||""}`})});return}i.config[r]=o.config[r]}),o.type==="pkey"&&(i.config.isPkey=!0),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{const i=n[o];if(i){const r=e[o];if(["j-tabs","j-collapse"].includes(i.type||"")&&i.config?.groups){const a={};r.forEach(u=>{if(u.slot!==void 0&&u.slot!==null){const c=u.slot.toString();a[c]||(a[c]=[]),delete u.slot,a[c].push(u)}});const l=i.config.groups.map(u=>{const c=u._i,d=a[c]||[],f={label:u.label};u.active&&i.type==="j-collapse"&&(f.active=u.active);let h;if(i.type==="j-tabs"&&i.config?.tabKey&&i.config?.options.length>0){const y=i.config.options.find(m=>m.label===u._i);y&&(h=({formData:m})=>({display:y.value.includes(m[i.config?.tabKey||""])?y.display:!y.display}))}const p={config:f,children:d};return h&&(p.getCompConfig=h),p});i.children=l,delete i.config.groups}else i.children=r}}),e.form};function Gy(t){const{toString:e}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&t instanceof Element?"element":n[e.call(t)]}function br(t){const e=Gy(t);let n;if(e==="array")n=[];else if(e==="object")n={};else return t;if(e==="array")for(let o=0,i=t.length;o<i;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,n.push(br(t[o]));else e==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,n[o]=br(t[o])});return n}var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Wy(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function o(){var i=!1;try{i=this instanceof o}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:function(){return t[o]}})}),n}var Fo={exports:{}},Yy=Fo.exports,xl;function Uy(){return xl||(xl=1,(function(t,e){(function(n,o){t.exports=o()})(Yy,(function(){var n=1e3,o=6e4,i=36e5,r="millisecond",a="second",l="minute",u="hour",c="day",d="week",f="month",h="quarter",p="year",y="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,N=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var D=["th","st","nd","rd"],v=w%100;return"["+w+(D[(v-20)%10]||D[v]||D[0])+"]"}},g=function(w,D,v){var C=String(w);return!C||C.length>=D?w:""+Array(D+1-C.length).join(v)+w},x={s:g,z:function(w){var D=-w.utcOffset(),v=Math.abs(D),C=Math.floor(v/60),k=v%60;return(D<=0?"+":"-")+g(C,2,"0")+":"+g(k,2,"0")},m:function w(D,v){if(D.date()<v.date())return-w(v,D);var C=12*(v.year()-D.year())+(v.month()-D.month()),k=D.clone().add(C,f),O=v-k<0,R=D.clone().add(C+(O?-1:1),f);return+(-(C+(v-k)/(O?k-R:R-k))||0)},a:function(w){return w<0?Math.ceil(w)||0:Math.floor(w)},p:function(w){return{M:f,y:p,w:d,d:c,D:y,h:u,m:l,s:a,ms:r,Q:h}[w]||String(w||"").toLowerCase().replace(/s$/,"")},u:function(w){return w===void 0}},z="en",$={};$[z]=_;var F="$isDayjsObject",Y=function(w){return w instanceof E||!(!w||!w[F])},G=function w(D,v,C){var k;if(!D)return z;if(typeof D=="string"){var O=D.toLowerCase();$[O]&&(k=O),v&&($[O]=v,k=O);var R=D.split("-");if(!k&&R.length>1)return w(R[0])}else{var B=D.name;$[B]=D,k=B}return!C&&k&&(z=k),k||!C&&z},S=function(w,D){if(Y(w))return w.clone();var v=typeof D=="object"?D:{};return v.date=w,v.args=arguments,new E(v)},I=x;I.l=G,I.i=Y,I.w=function(w,D){return S(w,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var E=(function(){function w(v){this.$L=G(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[F]=!0}var D=w.prototype;return D.parse=function(v){this.$d=(function(C){var k=C.date,O=C.utc;if(k===null)return new Date(NaN);if(I.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var R=k.match(b);if(R){var B=R[2]-1||0,P=(R[7]||"0").substring(0,3);return O?new Date(Date.UTC(R[1],B,R[3]||1,R[4]||0,R[5]||0,R[6]||0,P)):new Date(R[1],B,R[3]||1,R[4]||0,R[5]||0,R[6]||0,P)}}return new Date(k)})(v),this.init()},D.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(v,C){var k=S(v);return this.startOf(C)<=k&&k<=this.endOf(C)},D.isAfter=function(v,C){return S(v)<this.startOf(C)},D.isBefore=function(v,C){return this.endOf(C)<S(v)},D.$g=function(v,C,k){return I.u(v)?this[C]:this.set(k,v)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(v,C){var k=this,O=!!I.u(C)||C,R=I.p(v),B=function(re,oe){var ce=I.w(k.$u?Date.UTC(k.$y,oe,re):new Date(k.$y,oe,re),k);return O?ce:ce.endOf(c)},P=function(re,oe){return I.w(k.toDate()[re].apply(k.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(oe)),k)},L=this.$W,j=this.$M,K=this.$D,Q="set"+(this.$u?"UTC":"");switch(R){case p:return O?B(1,0):B(31,11);case f:return O?B(1,j):B(0,j+1);case d:var q=this.$locale().weekStart||0,ee=(L<q?L+7:L)-q;return B(O?K-ee:K+(6-ee),j);case c:case y:return P(Q+"Hours",0);case u:return P(Q+"Minutes",1);case l:return P(Q+"Seconds",2);case a:return P(Q+"Milliseconds",3);default:return this.clone()}},D.endOf=function(v){return this.startOf(v,!1)},D.$set=function(v,C){var k,O=I.p(v),R="set"+(this.$u?"UTC":""),B=(k={},k[c]=R+"Date",k[y]=R+"Date",k[f]=R+"Month",k[p]=R+"FullYear",k[u]=R+"Hours",k[l]=R+"Minutes",k[a]=R+"Seconds",k[r]=R+"Milliseconds",k)[O],P=O===c?this.$D+(C-this.$W):C;if(O===f||O===p){var L=this.clone().set(y,1);L.$d[B](P),L.init(),this.$d=L.set(y,Math.min(this.$D,L.daysInMonth())).$d}else B&&this.$d[B](P);return this.init(),this},D.set=function(v,C){return this.clone().$set(v,C)},D.get=function(v){return this[I.p(v)]()},D.add=function(v,C){var k,O=this;v=Number(v);var R=I.p(C),B=function(j){var K=S(O);return I.w(K.date(K.date()+Math.round(j*v)),O)};if(R===f)return this.set(f,this.$M+v);if(R===p)return this.set(p,this.$y+v);if(R===c)return B(1);if(R===d)return B(7);var P=(k={},k[l]=o,k[u]=i,k[a]=n,k)[R]||1,L=this.$d.getTime()+v*P;return I.w(L,this)},D.subtract=function(v,C){return this.add(-1*v,C)},D.format=function(v){var C=this,k=this.$locale();if(!this.isValid())return k.invalidDate||m;var O=v||"YYYY-MM-DDTHH:mm:ssZ",R=I.z(this),B=this.$H,P=this.$m,L=this.$M,j=k.weekdays,K=k.months,Q=k.meridiem,q=function(oe,ce,ie,se){return oe&&(oe[ce]||oe(C,O))||ie[ce].slice(0,se)},ee=function(oe){return I.s(B%12||12,oe,"0")},re=Q||function(oe,ce,ie){var se=oe<12?"AM":"PM";return ie?se.toLowerCase():se};return O.replace(N,(function(oe,ce){return ce||(function(ie){switch(ie){case"YY":return String(C.$y).slice(-2);case"YYYY":return I.s(C.$y,4,"0");case"M":return L+1;case"MM":return I.s(L+1,2,"0");case"MMM":return q(k.monthsShort,L,K,3);case"MMMM":return q(K,L);case"D":return C.$D;case"DD":return I.s(C.$D,2,"0");case"d":return String(C.$W);case"dd":return q(k.weekdaysMin,C.$W,j,2);case"ddd":return q(k.weekdaysShort,C.$W,j,3);case"dddd":return j[C.$W];case"H":return String(B);case"HH":return I.s(B,2,"0");case"h":return ee(1);case"hh":return ee(2);case"a":return re(B,P,!0);case"A":return re(B,P,!1);case"m":return String(P);case"mm":return I.s(P,2,"0");case"s":return String(C.$s);case"ss":return I.s(C.$s,2,"0");case"SSS":return I.s(C.$ms,3,"0");case"Z":return R}return null})(oe)||R.replace(":","")}))},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(v,C,k){var O,R=this,B=I.p(C),P=S(v),L=(P.utcOffset()-this.utcOffset())*o,j=this-P,K=function(){return I.m(R,P)};switch(B){case p:O=K()/12;break;case f:O=K();break;case h:O=K()/3;break;case d:O=(j-L)/6048e5;break;case c:O=(j-L)/864e5;break;case u:O=j/i;break;case l:O=j/o;break;case a:O=j/n;break;default:O=j}return k?O:I.a(O)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return $[this.$L]},D.locale=function(v,C){if(!v)return this.$L;var k=this.clone(),O=G(v,C,!0);return O&&(k.$L=O),k},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},w})(),H=E.prototype;return S.prototype=H,[["$ms",r],["$s",a],["$m",l],["$H",u],["$W",c],["$M",f],["$y",p],["$D",y]].forEach((function(w){H[w[1]]=function(D){return this.$g(D,w[0],w[1])}})),S.extend=function(w,D){return w.$i||(w(D,E,S),w.$i=!0),S},S.locale=G,S.isDayjs=Y,S.unix=function(w){return S(1e3*w)},S.en=$[z],S.Ls=$,S.p={},S}))})(Fo)),Fo.exports}Uy();var jo={exports:{}};function Xy(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Go={exports:{}};const qy=Wy(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ky=Go.exports,Cl;function qe(){return Cl||(Cl=1,(function(t,e){(function(n,o){t.exports=o()})(Ky,function(){var n=n||(function(o,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof wr<"u"&&wr.crypto&&(r=wr.crypto),!r&&typeof Xy=="function")try{r=qy}catch{}var a=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||(function(){function _(){}return function(g){var x;return _.prototype=g,x=new _,_.prototype=null,x}})(),u={},c=u.lib={},d=c.Base=(function(){return{extend:function(_){var g=l(this);return _&&g.mixIn(_),(!g.hasOwnProperty("init")||this.init===g.init)&&(g.init=function(){g.$super.init.apply(this,arguments)}),g.init.prototype=g,g.$super=this,g},create:function(){var _=this.extend();return _.init.apply(_,arguments),_},init:function(){},mixIn:function(_){for(var g in _)_.hasOwnProperty(g)&&(this[g]=_[g]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=d.extend({init:function(_,g){_=this.words=_||[],g!=i?this.sigBytes=g:this.sigBytes=_.length*4},toString:function(_){return(_||p).stringify(this)},concat:function(_){var g=this.words,x=_.words,z=this.sigBytes,$=_.sigBytes;if(this.clamp(),z%4)for(var F=0;F<$;F++){var Y=x[F>>>2]>>>24-F%4*8&255;g[z+F>>>2]|=Y<<24-(z+F)%4*8}else for(var G=0;G<$;G+=4)g[z+G>>>2]=x[G>>>2];return this.sigBytes+=$,this},clamp:function(){var _=this.words,g=this.sigBytes;_[g>>>2]&=4294967295<<32-g%4*8,_.length=o.ceil(g/4)},clone:function(){var _=d.clone.call(this);return _.words=this.words.slice(0),_},random:function(_){for(var g=[],x=0;x<_;x+=4)g.push(a());return new f.init(g,_)}}),h=u.enc={},p=h.Hex={stringify:function(_){for(var g=_.words,x=_.sigBytes,z=[],$=0;$<x;$++){var F=g[$>>>2]>>>24-$%4*8&255;z.push((F>>>4).toString(16)),z.push((F&15).toString(16))}return z.join("")},parse:function(_){for(var g=_.length,x=[],z=0;z<g;z+=2)x[z>>>3]|=parseInt(_.substr(z,2),16)<<24-z%8*4;return new f.init(x,g/2)}},y=h.Latin1={stringify:function(_){for(var g=_.words,x=_.sigBytes,z=[],$=0;$<x;$++){var F=g[$>>>2]>>>24-$%4*8&255;z.push(String.fromCharCode(F))}return z.join("")},parse:function(_){for(var g=_.length,x=[],z=0;z<g;z++)x[z>>>2]|=(_.charCodeAt(z)&255)<<24-z%4*8;return new f.init(x,g)}},m=h.Utf8={stringify:function(_){try{return decodeURIComponent(escape(y.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(_){return y.parse(unescape(encodeURIComponent(_)))}},b=c.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(_){typeof _=="string"&&(_=m.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},_process:function(_){var g,x=this._data,z=x.words,$=x.sigBytes,F=this.blockSize,Y=F*4,G=$/Y;_?G=o.ceil(G):G=o.max((G|0)-this._minBufferSize,0);var S=G*F,I=o.min(S*4,$);if(S){for(var E=0;E<S;E+=F)this._doProcessBlock(z,E);g=z.splice(0,S),x.sigBytes-=I}return new f.init(g,I)},clone:function(){var _=d.clone.call(this);return _._data=this._data.clone(),_},_minBufferSize:0});c.Hasher=b.extend({cfg:d.extend(),init:function(_){this.cfg=this.cfg.extend(_),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(_){return this._append(_),this._process(),this},finalize:function(_){_&&this._append(_);var g=this._doFinalize();return g},blockSize:16,_createHelper:function(_){return function(g,x){return new _.init(x).finalize(g)}},_createHmacHelper:function(_){return function(g,x){return new N.HMAC.init(_,x).finalize(g)}}});var N=u.algo={};return u})(Math);return n})})(Go)),Go.exports}var Wo={exports:{}},Zy=Wo.exports,El;function Sl(){return El||(El=1,(function(t,e){(function(n,o){t.exports=o(qe())})(Zy,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=o.enc;a.Base64={stringify:function(u){var c=u.words,d=u.sigBytes,f=this._map;u.clamp();for(var h=[],p=0;p<d;p+=3)for(var y=c[p>>>2]>>>24-p%4*8&255,m=c[p+1>>>2]>>>24-(p+1)%4*8&255,b=c[p+2>>>2]>>>24-(p+2)%4*8&255,N=y<<16|m<<8|b,_=0;_<4&&p+_*.75<d;_++)h.push(f.charAt(N>>>6*(3-_)&63));var g=f.charAt(64);if(g)for(;h.length%4;)h.push(g);return h.join("")},parse:function(u){var c=u.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h<d.length;h++)f[d.charCodeAt(h)]=h}var p=d.charAt(64);if(p){var y=u.indexOf(p);y!==-1&&(c=y)}return l(u,c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(u,c,d){for(var f=[],h=0,p=0;p<c;p++)if(p%4){var y=d[u.charCodeAt(p-1)]<<p%4*2,m=d[u.charCodeAt(p)]>>>6-p%4*2,b=y|m;f[h>>>2]|=b<<24-h%4*8,h++}return r.create(f,h)}})(),n.enc.Base64})})(Wo)),Wo.exports}var Yo={exports:{}},Jy=Yo.exports,Nl;function kl(){return Nl||(Nl=1,(function(t,e){(function(n,o){t.exports=o(qe())})(Jy,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,u=i.algo,c=[];(function(){for(var m=0;m<64;m++)c[m]=o.abs(o.sin(m+1))*4294967296|0})();var d=u.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var N=0;N<16;N++){var _=b+N,g=m[_];m[_]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360}var x=this._hash.words,z=m[b+0],$=m[b+1],F=m[b+2],Y=m[b+3],G=m[b+4],S=m[b+5],I=m[b+6],E=m[b+7],H=m[b+8],w=m[b+9],D=m[b+10],v=m[b+11],C=m[b+12],k=m[b+13],O=m[b+14],R=m[b+15],B=x[0],P=x[1],L=x[2],j=x[3];B=f(B,P,L,j,z,7,c[0]),j=f(j,B,P,L,$,12,c[1]),L=f(L,j,B,P,F,17,c[2]),P=f(P,L,j,B,Y,22,c[3]),B=f(B,P,L,j,G,7,c[4]),j=f(j,B,P,L,S,12,c[5]),L=f(L,j,B,P,I,17,c[6]),P=f(P,L,j,B,E,22,c[7]),B=f(B,P,L,j,H,7,c[8]),j=f(j,B,P,L,w,12,c[9]),L=f(L,j,B,P,D,17,c[10]),P=f(P,L,j,B,v,22,c[11]),B=f(B,P,L,j,C,7,c[12]),j=f(j,B,P,L,k,12,c[13]),L=f(L,j,B,P,O,17,c[14]),P=f(P,L,j,B,R,22,c[15]),B=h(B,P,L,j,$,5,c[16]),j=h(j,B,P,L,I,9,c[17]),L=h(L,j,B,P,v,14,c[18]),P=h(P,L,j,B,z,20,c[19]),B=h(B,P,L,j,S,5,c[20]),j=h(j,B,P,L,D,9,c[21]),L=h(L,j,B,P,R,14,c[22]),P=h(P,L,j,B,G,20,c[23]),B=h(B,P,L,j,w,5,c[24]),j=h(j,B,P,L,O,9,c[25]),L=h(L,j,B,P,Y,14,c[26]),P=h(P,L,j,B,H,20,c[27]),B=h(B,P,L,j,k,5,c[28]),j=h(j,B,P,L,F,9,c[29]),L=h(L,j,B,P,E,14,c[30]),P=h(P,L,j,B,C,20,c[31]),B=p(B,P,L,j,S,4,c[32]),j=p(j,B,P,L,H,11,c[33]),L=p(L,j,B,P,v,16,c[34]),P=p(P,L,j,B,O,23,c[35]),B=p(B,P,L,j,$,4,c[36]),j=p(j,B,P,L,G,11,c[37]),L=p(L,j,B,P,E,16,c[38]),P=p(P,L,j,B,D,23,c[39]),B=p(B,P,L,j,k,4,c[40]),j=p(j,B,P,L,z,11,c[41]),L=p(L,j,B,P,Y,16,c[42]),P=p(P,L,j,B,I,23,c[43]),B=p(B,P,L,j,w,4,c[44]),j=p(j,B,P,L,C,11,c[45]),L=p(L,j,B,P,R,16,c[46]),P=p(P,L,j,B,F,23,c[47]),B=y(B,P,L,j,z,6,c[48]),j=y(j,B,P,L,E,10,c[49]),L=y(L,j,B,P,O,15,c[50]),P=y(P,L,j,B,S,21,c[51]),B=y(B,P,L,j,C,6,c[52]),j=y(j,B,P,L,Y,10,c[53]),L=y(L,j,B,P,D,15,c[54]),P=y(P,L,j,B,$,21,c[55]),B=y(B,P,L,j,H,6,c[56]),j=y(j,B,P,L,R,10,c[57]),L=y(L,j,B,P,I,15,c[58]),P=y(P,L,j,B,k,21,c[59]),B=y(B,P,L,j,G,6,c[60]),j=y(j,B,P,L,v,10,c[61]),L=y(L,j,B,P,F,15,c[62]),P=y(P,L,j,B,w,21,c[63]),x[0]=x[0]+B|0,x[1]=x[1]+P|0,x[2]=x[2]+L|0,x[3]=x[3]+j|0},_doFinalize:function(){var m=this._data,b=m.words,N=this._nDataBytes*8,_=m.sigBytes*8;b[_>>>5]|=128<<24-_%32;var g=o.floor(N/4294967296),x=N;b[(_+64>>>9<<4)+15]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,b[(_+64>>>9<<4)+14]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var z=this._hash,$=z.words,F=0;F<4;F++){var Y=$[F];$[F]=(Y<<8|Y>>>24)&16711935|(Y<<24|Y>>>8)&4278255360}return z},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,b,N,_,g,x,z){var $=m+(b&N|~b&_)+g+z;return($<<x|$>>>32-x)+b}function h(m,b,N,_,g,x,z){var $=m+(b&_|N&~_)+g+z;return($<<x|$>>>32-x)+b}function p(m,b,N,_,g,x,z){var $=m+(b^N^_)+g+z;return($<<x|$>>>32-x)+b}function y(m,b,N,_,g,x,z){var $=m+(N^(b|~_))+g+z;return($<<x|$>>>32-x)+b}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)})(Math),n.MD5})})(Yo)),Yo.exports}var Uo={exports:{}},Xo={exports:{}},Qy=Xo.exports,Dl;function ev(){return Dl||(Dl=1,(function(t,e){(function(n,o){t.exports=o(qe())})(Qy,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=i.Hasher,l=o.algo,u=[],c=l.SHA1=a.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,f){for(var h=this._hash.words,p=h[0],y=h[1],m=h[2],b=h[3],N=h[4],_=0;_<80;_++){if(_<16)u[_]=d[f+_]|0;else{var g=u[_-3]^u[_-8]^u[_-14]^u[_-16];u[_]=g<<1|g>>>31}var x=(p<<5|p>>>27)+N+u[_];_<20?x+=(y&m|~y&b)+1518500249:_<40?x+=(y^m^b)+1859775393:_<60?x+=(y&m|y&b|m&b)-1894007588:x+=(y^m^b)-899497514,N=b,b=m,m=y<<30|y>>>2,y=p,p=x}h[0]=h[0]+p|0,h[1]=h[1]+y|0,h[2]=h[2]+m|0,h[3]=h[3]+b|0,h[4]=h[4]+N|0},_doFinalize:function(){var d=this._data,f=d.words,h=this._nDataBytes*8,p=d.sigBytes*8;return f[p>>>5]|=128<<24-p%32,f[(p+64>>>9<<4)+14]=Math.floor(h/4294967296),f[(p+64>>>9<<4)+15]=h,d.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var d=a.clone.call(this);return d._hash=this._hash.clone(),d}});o.SHA1=a._createHelper(c),o.HmacSHA1=a._createHmacHelper(c)})(),n.SHA1})})(Xo)),Xo.exports}var qo={exports:{}},tv=qo.exports,Tl;function nv(){return Tl||(Tl=1,(function(t,e){(function(n,o){t.exports=o(qe())})(tv,function(n){(function(){var o=n,i=o.lib,r=i.Base,a=o.enc,l=a.Utf8,u=o.algo;u.HMAC=r.extend({init:function(c,d){c=this._hasher=new c.init,typeof d=="string"&&(d=l.parse(d));var f=c.blockSize,h=f*4;d.sigBytes>h&&(d=c.finalize(d)),d.clamp();for(var p=this._oKey=d.clone(),y=this._iKey=d.clone(),m=p.words,b=y.words,N=0;N<f;N++)m[N]^=1549556828,b[N]^=909522486;p.sigBytes=y.sigBytes=h,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var d=this._hasher,f=d.finalize(c);d.reset();var h=d.finalize(this._oKey.clone().concat(f));return h}})})()})})(qo)),qo.exports}var ov=Uo.exports,Il;function Ml(){return Il||(Il=1,(function(t,e){(function(n,o,i){t.exports=o(qe(),ev(),nv())})(ov,function(n){return(function(){var o=n,i=o.lib,r=i.Base,a=i.WordArray,l=o.algo,u=l.MD5,c=l.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:u,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,f){for(var h,p=this.cfg,y=p.hasher.create(),m=a.create(),b=m.words,N=p.keySize,_=p.iterations;b.length<N;){h&&y.update(h),h=y.update(d).finalize(f),y.reset();for(var g=1;g<_;g++)h=y.finalize(h),y.reset();m.concat(h)}return m.sigBytes=N*4,m}});o.EvpKDF=function(d,f,h){return c.create(h).compute(d,f)}})(),n.EvpKDF})})(Uo)),Uo.exports}var Ko={exports:{}},iv=Ko.exports,Bl;function $l(){return Bl||(Bl=1,(function(t,e){(function(n,o,i){t.exports=o(qe(),Ml())})(iv,function(n){n.lib.Cipher||(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,u=r.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var d=c.Base64,f=i.algo,h=f.EvpKDF,p=r.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(S,I){return this.create(this._ENC_XFORM_MODE,S,I)},createDecryptor:function(S,I){return this.create(this._DEC_XFORM_MODE,S,I)},init:function(S,I,E){this.cfg=this.cfg.extend(E),this._xformMode=S,this._key=I,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(S){return this._append(S),this._process()},finalize:function(S){S&&this._append(S);var I=this._doFinalize();return I},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function S(I){return typeof I=="string"?G:$}return function(I){return{encrypt:function(E,H,w){return S(H).encrypt(I,E,H,w)},decrypt:function(E,H,w){return S(H).decrypt(I,E,H,w)}}}})()});r.StreamCipher=p.extend({_doFinalize:function(){var S=this._process(!0);return S},blockSize:1});var y=i.mode={},m=r.BlockCipherMode=a.extend({createEncryptor:function(S,I){return this.Encryptor.create(S,I)},createDecryptor:function(S,I){return this.Decryptor.create(S,I)},init:function(S,I){this._cipher=S,this._iv=I}}),b=y.CBC=(function(){var S=m.extend();S.Encryptor=S.extend({processBlock:function(E,H){var w=this._cipher,D=w.blockSize;I.call(this,E,H,D),w.encryptBlock(E,H),this._prevBlock=E.slice(H,H+D)}}),S.Decryptor=S.extend({processBlock:function(E,H){var w=this._cipher,D=w.blockSize,v=E.slice(H,H+D);w.decryptBlock(E,H),I.call(this,E,H,D),this._prevBlock=v}});function I(E,H,w){var D,v=this._iv;v?(D=v,this._iv=o):D=this._prevBlock;for(var C=0;C<w;C++)E[H+C]^=D[C]}return S})(),N=i.pad={},_=N.Pkcs7={pad:function(S,I){for(var E=I*4,H=E-S.sigBytes%E,w=H<<24|H<<16|H<<8|H,D=[],v=0;v<H;v+=4)D.push(w);var C=l.create(D,H);S.concat(C)},unpad:function(S){var I=S.words[S.sigBytes-1>>>2]&255;S.sigBytes-=I}};r.BlockCipher=p.extend({cfg:p.cfg.extend({mode:b,padding:_}),reset:function(){var S;p.reset.call(this);var I=this.cfg,E=I.iv,H=I.mode;this._xformMode==this._ENC_XFORM_MODE?S=H.createEncryptor:(S=H.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==S?this._mode.init(this,E&&E.words):(this._mode=S.call(H,this,E&&E.words),this._mode.__creator=S)},_doProcessBlock:function(S,I){this._mode.processBlock(S,I)},_doFinalize:function(){var S,I=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(I.pad(this._data,this.blockSize),S=this._process(!0)):(S=this._process(!0),I.unpad(S)),S},blockSize:128/32});var g=r.CipherParams=a.extend({init:function(S){this.mixIn(S)},toString:function(S){return(S||this.formatter).stringify(this)}}),x=i.format={},z=x.OpenSSL={stringify:function(S){var I,E=S.ciphertext,H=S.salt;return H?I=l.create([1398893684,1701076831]).concat(H).concat(E):I=E,I.toString(d)},parse:function(S){var I,E=d.parse(S),H=E.words;return H[0]==1398893684&&H[1]==1701076831&&(I=l.create(H.slice(2,4)),H.splice(0,4),E.sigBytes-=16),g.create({ciphertext:E,salt:I})}},$=r.SerializableCipher=a.extend({cfg:a.extend({format:z}),encrypt:function(S,I,E,H){H=this.cfg.extend(H);var w=S.createEncryptor(E,H),D=w.finalize(I),v=w.cfg;return g.create({ciphertext:D,key:E,iv:v.iv,algorithm:S,mode:v.mode,padding:v.padding,blockSize:S.blockSize,formatter:H.format})},decrypt:function(S,I,E,H){H=this.cfg.extend(H),I=this._parse(I,H.format);var w=S.createDecryptor(E,H).finalize(I.ciphertext);return w},_parse:function(S,I){return typeof S=="string"?I.parse(S,this):S}}),F=i.kdf={},Y=F.OpenSSL={execute:function(S,I,E,H,w){if(H||(H=l.random(64/8)),w)var D=h.create({keySize:I+E,hasher:w}).compute(S,H);else var D=h.create({keySize:I+E}).compute(S,H);var v=l.create(D.words.slice(I),E*4);return D.sigBytes=I*4,g.create({key:D,iv:v,salt:H})}},G=r.PasswordBasedCipher=$.extend({cfg:$.cfg.extend({kdf:Y}),encrypt:function(S,I,E,H){H=this.cfg.extend(H);var w=H.kdf.execute(E,S.keySize,S.ivSize,H.salt,H.hasher);H.iv=w.iv;var D=$.encrypt.call(this,S,I,w.key,H);return D.mixIn(w),D},decrypt:function(S,I,E,H){H=this.cfg.extend(H),I=this._parse(I,H.format);var w=H.kdf.execute(E,S.keySize,S.ivSize,I.salt,H.hasher);H.iv=w.iv;var D=$.decrypt.call(this,S,I,w.key,H);return D}})})()})})(Ko)),Ko.exports}var rv=jo.exports,zl;function sv(){return zl||(zl=1,(function(t,e){(function(n,o,i){t.exports=o(qe(),Sl(),kl(),Ml(),$l())})(rv,function(n){return(function(){var o=n,i=o.lib,r=i.BlockCipher,a=o.algo,l=[],u=[],c=[],d=[],f=[],h=[],p=[],y=[],m=[],b=[];(function(){for(var g=[],x=0;x<256;x++)x<128?g[x]=x<<1:g[x]=x<<1^283;for(var z=0,$=0,x=0;x<256;x++){var F=$^$<<1^$<<2^$<<3^$<<4;F=F>>>8^F&255^99,l[z]=F,u[F]=z;var Y=g[z],G=g[Y],S=g[G],I=g[F]*257^F*16843008;c[z]=I<<24|I>>>8,d[z]=I<<16|I>>>16,f[z]=I<<8|I>>>24,h[z]=I;var I=S*16843009^G*65537^Y*257^z*16843008;p[F]=I<<24|I>>>8,y[F]=I<<16|I>>>16,m[F]=I<<8|I>>>24,b[F]=I,z?(z=Y^g[g[g[S^Y]]],$^=g[g[$]]):z=$=1}})();var N=[0,1,2,4,8,16,32,64,128,27,54],_=a.AES=r.extend({_doReset:function(){var g;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var x=this._keyPriorReset=this._key,z=x.words,$=x.sigBytes/4,F=this._nRounds=$+6,Y=(F+1)*4,G=this._keySchedule=[],S=0;S<Y;S++)S<$?G[S]=z[S]:(g=G[S-1],S%$?$>6&&S%$==4&&(g=l[g>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[g&255]):(g=g<<8|g>>>24,g=l[g>>>24]<<24|l[g>>>16&255]<<16|l[g>>>8&255]<<8|l[g&255],g^=N[S/$|0]<<24),G[S]=G[S-$]^g);for(var I=this._invKeySchedule=[],E=0;E<Y;E++){var S=Y-E;if(E%4)var g=G[S];else var g=G[S-4];E<4||S<=4?I[E]=g:I[E]=p[l[g>>>24]]^y[l[g>>>16&255]]^m[l[g>>>8&255]]^b[l[g&255]]}}},encryptBlock:function(g,x){this._doCryptBlock(g,x,this._keySchedule,c,d,f,h,l)},decryptBlock:function(g,x){var z=g[x+1];g[x+1]=g[x+3],g[x+3]=z,this._doCryptBlock(g,x,this._invKeySchedule,p,y,m,b,u);var z=g[x+1];g[x+1]=g[x+3],g[x+3]=z},_doCryptBlock:function(g,x,z,$,F,Y,G,S){for(var I=this._nRounds,E=g[x]^z[0],H=g[x+1]^z[1],w=g[x+2]^z[2],D=g[x+3]^z[3],v=4,C=1;C<I;C++){var k=$[E>>>24]^F[H>>>16&255]^Y[w>>>8&255]^G[D&255]^z[v++],O=$[H>>>24]^F[w>>>16&255]^Y[D>>>8&255]^G[E&255]^z[v++],R=$[w>>>24]^F[D>>>16&255]^Y[E>>>8&255]^G[H&255]^z[v++],B=$[D>>>24]^F[E>>>16&255]^Y[H>>>8&255]^G[w&255]^z[v++];E=k,H=O,w=R,D=B}var k=(S[E>>>24]<<24|S[H>>>16&255]<<16|S[w>>>8&255]<<8|S[D&255])^z[v++],O=(S[H>>>24]<<24|S[w>>>16&255]<<16|S[D>>>8&255]<<8|S[E&255])^z[v++],R=(S[w>>>24]<<24|S[D>>>16&255]<<16|S[E>>>8&255]<<8|S[H&255])^z[v++],B=(S[D>>>24]<<24|S[E>>>16&255]<<16|S[H>>>8&255]<<8|S[w&255])^z[v++];g[x]=k,g[x+1]=O,g[x+2]=R,g[x+3]=B},keySize:256/32});o.AES=r._createHelper(_)})(),n.AES})})(jo)),jo.exports}var av=sv();const lv=_l(av);var Zo={exports:{}},cv=Zo.exports,Al;function dv(){return Al||(Al=1,(function(t,e){(function(n,o){t.exports=o(qe())})(cv,function(n){return n.enc.Utf8})})(Zo)),Zo.exports}var uv=dv();const fv=_l(uv);var Jo={exports:{}},hv=Jo.exports,Pl;function pv(){return Pl||(Pl=1,(function(t,e){(function(n,o,i){t.exports=o(qe(),$l())})(hv,function(n){return n.pad.Pkcs7})})(Jo)),Jo.exports}pv(),Sl(),kl();var Qo={exports:{}},gv=Qo.exports,Ol;function mv(){return Ol||(Ol=1,(function(t,e){(function(n,o){t.exports=o(qe())})(gv,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,u=i.algo,c=[],d=[];(function(){function p(N){for(var _=o.sqrt(N),g=2;g<=_;g++)if(!(N%g))return!1;return!0}function y(N){return(N-(N|0))*4294967296|0}for(var m=2,b=0;b<64;)p(m)&&(b<8&&(c[b]=y(o.pow(m,1/2))),d[b]=y(o.pow(m,1/3)),b++),m++})();var f=[],h=u.SHA256=l.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(p,y){for(var m=this._hash.words,b=m[0],N=m[1],_=m[2],g=m[3],x=m[4],z=m[5],$=m[6],F=m[7],Y=0;Y<64;Y++){if(Y<16)f[Y]=p[y+Y]|0;else{var G=f[Y-15],S=(G<<25|G>>>7)^(G<<14|G>>>18)^G>>>3,I=f[Y-2],E=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;f[Y]=S+f[Y-7]+E+f[Y-16]}var H=x&z^~x&$,w=b&N^b&_^N&_,D=(b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22),v=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),C=F+v+H+d[Y]+f[Y],k=D+w;F=$,$=z,z=x,x=g+C|0,g=_,_=N,N=b,b=C+k|0}m[0]=m[0]+b|0,m[1]=m[1]+N|0,m[2]=m[2]+_|0,m[3]=m[3]+g|0,m[4]=m[4]+x|0,m[5]=m[5]+z|0,m[6]=m[6]+$|0,m[7]=m[7]+F|0},_doFinalize:function(){var p=this._data,y=p.words,m=this._nDataBytes*8,b=p.sigBytes*8;return y[b>>>5]|=128<<24-b%32,y[(b+64>>>9<<4)+14]=o.floor(m/4294967296),y[(b+64>>>9<<4)+15]=m,p.sigBytes=y.length*4,this._process(),this._hash},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});i.SHA256=l._createHelper(h),i.HmacSHA256=l._createHmacHelper(h)})(Math),n.SHA256})})(Qo)),Qo.exports}mv();var ei={exports:{}},ti={exports:{}},yv=ti.exports,Rl;function vv(){return Rl||(Rl=1,(function(t,e){(function(n,o){t.exports=o(qe())})(yv,function(n){return(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,u=i.x64={};u.Word=a.extend({init:function(c,d){this.high=c,this.low=d}}),u.WordArray=a.extend({init:function(c,d){c=this.words=c||[],d!=o?this.sigBytes=d:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,d=c.length,f=[],h=0;h<d;h++){var p=c[h];f.push(p.high),f.push(p.low)}return l.create(f,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),d=c.words=this.words.slice(0),f=d.length,h=0;h<f;h++)d[h]=d[h].clone();return c}})})(),n})})(ti)),ti.exports}var bv=ei.exports,Hl;function wv(){return Hl||(Hl=1,(function(t,e){(function(n,o,i){t.exports=o(qe(),vv())})(bv,function(n){return(function(){var o=n,i=o.lib,r=i.Hasher,a=o.x64,l=a.Word,u=a.WordArray,c=o.algo;function d(){return l.create.apply(l,arguments)}var f=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],h=[];(function(){for(var y=0;y<80;y++)h[y]=d()})();var p=c.SHA512=r.extend({_doReset:function(){this._hash=new u.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(y,m){for(var b=this._hash.words,N=b[0],_=b[1],g=b[2],x=b[3],z=b[4],$=b[5],F=b[6],Y=b[7],G=N.high,S=N.low,I=_.high,E=_.low,H=g.high,w=g.low,D=x.high,v=x.low,C=z.high,k=z.low,O=$.high,R=$.low,B=F.high,P=F.low,L=Y.high,j=Y.low,K=G,Q=S,q=I,ee=E,re=H,oe=w,ce=D,ie=v,se=C,A=k,M=O,V=R,X=B,T=P,U=L,W=j,Z=0;Z<80;Z++){var ne,te,fe=h[Z];if(Z<16)te=fe.high=y[m+Z*2]|0,ne=fe.low=y[m+Z*2+1]|0;else{var ge=h[Z-15],Ie=ge.high,Me=ge.low,Ze=(Ie>>>1|Me<<31)^(Ie>>>8|Me<<24)^Ie>>>7,_e=(Me>>>1|Ie<<31)^(Me>>>8|Ie<<24)^(Me>>>7|Ie<<25),xt=h[Z-2],Ct=xt.high,Et=xt.low,Vr=(Ct>>>19|Et<<13)^(Ct<<3|Et>>>29)^Ct>>>6,mc=(Et>>>19|Ct<<13)^(Et<<3|Ct>>>29)^(Et>>>6|Ct<<26),yc=h[Z-7],M0=yc.high,B0=yc.low,vc=h[Z-16],$0=vc.high,bc=vc.low;ne=_e+B0,te=Ze+M0+(ne>>>0<_e>>>0?1:0),ne=ne+mc,te=te+Vr+(ne>>>0<mc>>>0?1:0),ne=ne+bc,te=te+$0+(ne>>>0<bc>>>0?1:0),fe.high=te,fe.low=ne}var z0=se&M^~se&X,wc=A&V^~A&T,A0=K&q^K&re^q&re,P0=Q&ee^Q&oe^ee&oe,O0=(K>>>28|Q<<4)^(K<<30|Q>>>2)^(K<<25|Q>>>7),_c=(Q>>>28|K<<4)^(Q<<30|K>>>2)^(Q<<25|K>>>7),R0=(se>>>14|A<<18)^(se>>>18|A<<14)^(se<<23|A>>>9),H0=(A>>>14|se<<18)^(A>>>18|se<<14)^(A<<23|se>>>9),xc=f[Z],V0=xc.high,Cc=xc.low,Xe=W+H0,Bt=U+R0+(Xe>>>0<W>>>0?1:0),Xe=Xe+wc,Bt=Bt+z0+(Xe>>>0<wc>>>0?1:0),Xe=Xe+Cc,Bt=Bt+V0+(Xe>>>0<Cc>>>0?1:0),Xe=Xe+ne,Bt=Bt+te+(Xe>>>0<ne>>>0?1:0),Ec=_c+P0,L0=O0+A0+(Ec>>>0<_c>>>0?1:0);U=X,W=T,X=M,T=V,M=se,V=A,A=ie+Xe|0,se=ce+Bt+(A>>>0<ie>>>0?1:0)|0,ce=re,ie=oe,re=q,oe=ee,q=K,ee=Q,Q=Xe+Ec|0,K=Bt+L0+(Q>>>0<Xe>>>0?1:0)|0}S=N.low=S+Q,N.high=G+K+(S>>>0<Q>>>0?1:0),E=_.low=E+ee,_.high=I+q+(E>>>0<ee>>>0?1:0),w=g.low=w+oe,g.high=H+re+(w>>>0<oe>>>0?1:0),v=x.low=v+ie,x.high=D+ce+(v>>>0<ie>>>0?1:0),k=z.low=k+A,z.high=C+se+(k>>>0<A>>>0?1:0),R=$.low=R+V,$.high=O+M+(R>>>0<V>>>0?1:0),P=F.low=P+T,F.high=B+X+(P>>>0<T>>>0?1:0),j=Y.low=j+W,Y.high=L+U+(j>>>0<W>>>0?1:0)},_doFinalize:function(){var y=this._data,m=y.words,b=this._nDataBytes*8,N=y.sigBytes*8;m[N>>>5]|=128<<24-N%32,m[(N+128>>>10<<5)+30]=Math.floor(b/4294967296),m[(N+128>>>10<<5)+31]=b,y.sigBytes=m.length*4,this._process();var _=this._hash.toX32();return _},clone:function(){var y=r.clone.call(this);return y._hash=this._hash.clone(),y},blockSize:1024/32});o.SHA512=r._createHelper(p),o.HmacSHA512=r._createHmacHelper(p)})(),n.SHA512})})(ei)),ei.exports}wv();const{decrypt:db,encrypt:ub}=lv;fv.parse;function _v(t,e,n){return(e=Sv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},bt.apply(null,arguments)}function Vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function ct(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(n),!0).forEach(function(o){_v(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function xv(t,e){if(t==null)return{};var n,o,i=Cv(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Cv(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;n[o]=t[o]}return n}function Ev(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sv(t){var e=Ev(t,"string");return typeof e=="symbol"?e:e+""}function _r(t){"@babel/helpers - typeof";return _r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(t)}var Nv="1.15.7";function wt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var _t=wt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Rn=wt(/Edge/i),Ll=wt(/firefox/i),Hn=wt(/safari/i)&&!wt(/chrome/i)&&!wt(/android/i),xr=wt(/iP(ad|od|hone)/i),Fl=wt(/chrome/i)&&wt(/android/i),jl={capture:!1,passive:!1};function be(t,e,n){t.addEventListener(e,n,!_t&&jl)}function ve(t,e,n){t.removeEventListener(e,n,!_t&&jl)}function ni(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Gl(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function nt(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&ni(t,e):ni(t,e))||o&&t===n)return t;if(t===n)break}while(t=Gl(t))}return null}var Wl=/\s+/g;function Ye(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Wl," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Wl," ")}}function pe(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function rn(t,e){var n="";if(typeof t=="string")n=t;else do{var o=pe(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Yl(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function dt(){var t=document.scrollingElement;return t||document.documentElement}function De(t,e,n,o,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,a,l,u,c,d,f;if(t!==window&&t.parentNode&&t!==dt()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,u=r.bottom,c=r.right,d=r.height,f=r.width):(a=0,l=0,u=window.innerHeight,c=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!_t))do if(i&&i.getBoundingClientRect&&(pe(i,"transform")!=="none"||n&&pe(i,"position")!=="static")){var h=i.getBoundingClientRect();a-=h.top+parseInt(pe(i,"border-top-width")),l-=h.left+parseInt(pe(i,"border-left-width")),u=a+r.height,c=l+r.width;break}while(i=i.parentNode);if(o&&t!==window){var p=rn(i||t),y=p&&p.a,m=p&&p.d;p&&(a/=m,l/=y,f/=y,d/=m,u=a+d,c=l+f)}return{top:a,left:l,bottom:u,right:c,width:f,height:d}}}function Ul(t,e,n){for(var o=Tt(t,!0),i=De(t)[e];o;){var r=De(o)[n],a=void 0;if(a=i>=r,!a)return o;if(o===dt())break;o=Tt(o,!1)}return!1}function sn(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==me.ghost&&(o||a[r]!==me.dragged)&&nt(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function Cr(t,e){for(var n=t.lastElementChild;n&&(n===me.ghost||pe(n,"display")==="none"||e&&!ni(n,e));)n=n.previousElementSibling;return n||null}function Ke(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==me.clone&&(!e||ni(t,e))&&n++;return n}function Xl(t){var e=0,n=0,o=dt();if(t)do{var i=rn(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function kv(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function Tt(t,e){if(!t||!t.getBoundingClientRect)return dt();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=pe(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return dt();if(o||e)return n;o=!0}}while(n=n.parentNode);return dt()}function Dv(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Er(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Vn;function ql(t,e){return function(){if(!Vn){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Vn=setTimeout(function(){Vn=void 0},e)}}}function Tv(){clearTimeout(Vn),Vn=void 0}function Kl(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Zl(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Jl(t,e,n){var o={};return Array.from(t.children).forEach(function(i){var r,a,l,u;if(!(!nt(i,e.draggable,t,!1)||i.animated||i===n)){var c=De(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,c.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,c.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,c.right),o.bottom=Math.max((u=o.bottom)!==null&&u!==void 0?u:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Le="Sortable"+new Date().getTime();function Iv(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(i){if(!(pe(i,"display")==="none"||i===me.ghost)){t.push({target:i,rect:De(i)});var r=ct({},t[t.length-1].rect);if(i.thisAnimationDuration){var a=rn(i,!0);a&&(r.top-=a.f,r.left-=a.e)}i.fromRect=r}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(kv(t,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;t.forEach(function(l){var u=0,c=l.target,d=c.fromRect,f=De(c),h=c.prevFromRect,p=c.prevToRect,y=l.rect,m=rn(c,!0);m&&(f.top-=m.f,f.left-=m.e),c.toRect=f,c.thisAnimationDuration&&Er(h,f)&&!Er(d,f)&&(y.top-f.top)/(y.left-f.left)===(d.top-f.top)/(d.left-f.left)&&(u=Bv(y,h,p,i.options)),Er(f,d)||(c.prevFromRect=d,c.prevToRect=f,u||(u=i.options.animation),i.animate(c,y,f,u)),u&&(r=!0,a=Math.max(a,u),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},u),c.thisAnimationDuration=u)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,i,r,a){if(a){pe(o,"transition",""),pe(o,"transform","");var l=rn(this.el),u=l&&l.a,c=l&&l.d,d=(i.left-r.left)/(u||1),f=(i.top-r.top)/(c||1);o.animatingX=!!d,o.animatingY=!!f,pe(o,"transform","translate3d("+d+"px,"+f+"px,0)"),this.forRepaintDummy=Mv(o),pe(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),pe(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){pe(o,"transition",""),pe(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function Mv(t){return t.offsetWidth}function Bv(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var an=[],Sr={initializeByDefault:!0},Ln={mount:function(e){for(var n in Sr)Sr.hasOwnProperty(n)&&!(n in e)&&(e[n]=Sr[n]);an.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),an.push(e)},pluginEvent:function(e,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";an.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](ct({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](ct({sortable:n},o)))})},initializePlugins:function(e,n,o,i){an.forEach(function(l){var u=l.pluginName;if(!(!e.options[u]&&!l.initializeByDefault)){var c=new l(e,n,e.options);c.sortable=e,c.options=e.options,e[u]=c,bt(o,c.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var o={};return an.forEach(function(i){typeof i.eventProperties=="function"&&bt(o,i.eventProperties.call(n[i.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return an.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],o))}),i}};function $v(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,u=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,f=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,y=t.extraEventProperties;if(e=e||n&&n[Le],!!e){var m,b=e.options,N="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!_t&&!Rn?m=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(o,!0,!0)),m.to=a||n,m.from=l||n,m.item=i||n,m.clone=r,m.oldIndex=u,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=f,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var _=ct(ct({},y),Ln.getEventProperties(o,e));for(var g in _)m[g]=_[g];n&&n.dispatchEvent(m),b[N]&&b[N].call(e,m)}}var zv=["evt"],Fe=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=xv(o,zv);Ln.pluginEvent.bind(me)(e,n,ct({dragEl:ae,parentEl:Ee,ghostEl:ye,rootEl:xe,nextEl:Ft,lastDownEl:oi,cloneEl:Ce,cloneHidden:It,dragStarted:jn,putSortable:Ae,activeSortable:me.active,originalEvent:i,oldIndex:ln,oldDraggableIndex:Fn,newIndex:Ue,newDraggableIndex:Mt,hideGhostForTarget:rc,unhideGhostForTarget:sc,cloneNowHidden:function(){It=!0},cloneNowShown:function(){It=!1},dispatchSortableEvent:function(l){Re({sortable:n,name:l,originalEvent:i})}},r))};function Re(t){$v(ct({putSortable:Ae,cloneEl:Ce,targetEl:ae,rootEl:xe,oldIndex:ln,oldDraggableIndex:Fn,newIndex:Ue,newDraggableIndex:Mt},t))}var ae,Ee,ye,xe,Ft,oi,Ce,It,ln,Ue,Fn,Mt,ii,Ae,cn=!1,ri=!1,si=[],jt,ot,Nr,kr,Ql,ec,jn,dn,Gn,Wn=!1,ai=!1,li,Pe,Dr=[],Tr=!1,ci=[],di=typeof document<"u",ui=xr,tc=Rn||_t?"cssFloat":"float",Av=di&&!Fl&&!xr&&"draggable"in document.createElement("div"),nc=(function(){if(di){if(_t)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),oc=function(e,n){var o=pe(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=sn(e,0,n),a=sn(e,1,n),l=r&&pe(r),u=a&&pe(a),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+De(r).width,d=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+De(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(u.clear==="both"||u.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=i&&o[tc]==="none"||a&&o[tc]==="none"&&c+d>i)?"vertical":"horizontal"},Pv=function(e,n,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,u=o?n.right:n.bottom,c=o?n.width:n.height;return i===l||r===u||i+a/2===l+c/2},Ov=function(e,n){var o;return si.some(function(i){var r=i[Le].options.emptyInsertThreshold;if(!(!r||Cr(i))){var a=De(i),l=e>=a.left-r&&e<=a.right+r,u=n>=a.top-r&&n<=a.bottom+r;if(l&&u)return o=i}}),o},ic=function(e){function n(r,a){return function(l,u,c,d){var f=l.options.group.name&&u.options.group.name&&l.options.group.name===u.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,u,c,d),a)(l,u,c,d);var h=(a?l:u).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},i=e.group;(!i||_r(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},rc=function(){!nc&&ye&&pe(ye,"display","none")},sc=function(){!nc&&ye&&pe(ye,"display","")};di&&!Fl&&document.addEventListener("click",function(t){if(ri)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ri=!1,!1},!0);var Gt=function(e){if(ae){e=e.touches?e.touches[0]:e;var n=Ov(e.clientX,e.clientY);if(n){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Le]._onDragOver(o)}}},Rv=function(e){ae&&ae.parentNode[Le]._isOutsideThisEl(e.target)};function me(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=bt({},e),t[Le]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return oc(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:me.supportPointer!==!1&&"PointerEvent"in window&&(!Hn||xr),emptyInsertThreshold:5};Ln.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);ic(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:Av,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?be(t,"pointerdown",this._onTapStart):(be(t,"mousedown",this._onTapStart),be(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(be(t,"dragover",this),be(t,"dragenter",this)),si.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),bt(this,Iv())}me.prototype={constructor:me,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(dn=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,ae):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,d=i.filter;if(Yv(o),!ae&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Hn&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=nt(u,i.draggable,o,!1),!(u&&u.animated)&&oi!==u)){if(ln=Ke(u),Fn=Ke(u,i.draggable),typeof d=="function"){if(d.call(this,e,u,this)){Re({sortable:n,rootEl:c,name:"filter",targetEl:u,toEl:o,fromEl:o}),Fe("filter",n,{evt:e}),r&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(f){if(f=nt(c,f.trim(),o,!1),f)return Re({sortable:n,rootEl:f,name:"filter",targetEl:u,fromEl:o,toEl:o}),Fe("filter",n,{evt:e}),!0}),d)){r&&e.preventDefault();return}i.handle&&!nt(c,i.handle,o,!1)||this._prepareDragStart(e,l,u)}}},_prepareDragStart:function(e,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,u;if(o&&!ae&&o.parentNode===r){var c=De(o);if(xe=r,ae=o,Ee=ae.parentNode,Ft=ae.nextSibling,oi=o,ii=a.group,me.dragged=ae,jt={target:ae,clientX:(n||e).clientX,clientY:(n||e).clientY},Ql=jt.clientX-c.left,ec=jt.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,ae.style["will-change"]="all",u=function(){if(Fe("delayEnded",i,{evt:e}),me.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Ll&&i.nativeDraggable&&(ae.draggable=!0),i._triggerDragStart(e,n),Re({sortable:i,name:"choose",originalEvent:e}),Ye(ae,a.chosenClass,!0)},a.ignore.split(",").forEach(function(d){Yl(ae,d.trim(),Ir)}),be(l,"dragover",Gt),be(l,"mousemove",Gt),be(l,"touchmove",Gt),a.supportPointer?(be(l,"pointerup",i._onDrop),!this.nativeDraggable&&be(l,"pointercancel",i._onDrop)):(be(l,"mouseup",i._onDrop),be(l,"touchend",i._onDrop),be(l,"touchcancel",i._onDrop)),Ll&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ae.draggable=!0),Fe("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Rn||_t))){if(me.eventCanceled){this._onDrop();return}a.supportPointer?(be(l,"pointerup",i._disableDelayedDrag),be(l,"pointercancel",i._disableDelayedDrag)):(be(l,"mouseup",i._disableDelayedDrag),be(l,"touchend",i._disableDelayedDrag),be(l,"touchcancel",i._disableDelayedDrag)),be(l,"mousemove",i._delayedDragTouchMoveHandler),be(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&be(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(u,a.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ae&&Ir(ae),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;ve(e,"mouseup",this._disableDelayedDrag),ve(e,"touchend",this._disableDelayedDrag),ve(e,"touchcancel",this._disableDelayedDrag),ve(e,"pointerup",this._disableDelayedDrag),ve(e,"pointercancel",this._disableDelayedDrag),ve(e,"mousemove",this._delayedDragTouchMoveHandler),ve(e,"touchmove",this._delayedDragTouchMoveHandler),ve(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?be(document,"pointermove",this._onTouchMove):n?be(document,"touchmove",this._onTouchMove):be(document,"mousemove",this._onTouchMove):(be(ae,"dragend",this),be(xe,"dragstart",this._onDragStart));try{document.selection?hi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(cn=!1,xe&&ae){Fe("dragStarted",this,{evt:n}),this.nativeDraggable&&be(document,"dragover",Rv);var o=this.options;!e&&Ye(ae,o.dragClass,!1),Ye(ae,o.ghostClass,!0),me.active=this,e&&this._appendGhost(),Re({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ot){this._lastX=ot.clientX,this._lastY=ot.clientY,rc();for(var e=document.elementFromPoint(ot.clientX,ot.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ot.clientX,ot.clientY),e!==n);)n=e;if(ae.parentNode[Le]._isOutsideThisEl(e),n)do{if(n[Le]){var o=void 0;if(o=n[Le]._onDragOver({clientX:ot.clientX,clientY:ot.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=Gl(n));sc()}},_onTouchMove:function(e){if(jt){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=ye&&rn(ye,!0),l=ye&&a&&a.a,u=ye&&a&&a.d,c=ui&&Pe&&Xl(Pe),d=(r.clientX-jt.clientX+i.x)/(l||1)+(c?c[0]-Dr[0]:0)/(l||1),f=(r.clientY-jt.clientY+i.y)/(u||1)+(c?c[1]-Dr[1]:0)/(u||1);if(!me.active&&!cn){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(ye){a?(a.e+=d-(Nr||0),a.f+=f-(kr||0)):a={a:1,b:0,c:0,d:1,e:d,f};var h="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");pe(ye,"webkitTransform",h),pe(ye,"mozTransform",h),pe(ye,"msTransform",h),pe(ye,"transform",h),Nr=d,kr=f,ot=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ye){var e=this.options.fallbackOnBody?document.body:xe,n=De(ae,!0,ui,!0,e),o=this.options;if(ui){for(Pe=e;pe(Pe,"position")==="static"&&pe(Pe,"transform")==="none"&&Pe!==document;)Pe=Pe.parentNode;Pe!==document.body&&Pe!==document.documentElement?(Pe===document&&(Pe=dt()),n.top+=Pe.scrollTop,n.left+=Pe.scrollLeft):Pe=dt(),Dr=Xl(Pe)}ye=ae.cloneNode(!0),Ye(ye,o.ghostClass,!1),Ye(ye,o.fallbackClass,!0),Ye(ye,o.dragClass,!0),pe(ye,"transition",""),pe(ye,"transform",""),pe(ye,"box-sizing","border-box"),pe(ye,"margin",0),pe(ye,"top",n.top),pe(ye,"left",n.left),pe(ye,"width",n.width),pe(ye,"height",n.height),pe(ye,"opacity","0.8"),pe(ye,"position",ui?"absolute":"fixed"),pe(ye,"zIndex","100000"),pe(ye,"pointerEvents","none"),me.ghost=ye,e.appendChild(ye),pe(ye,"transform-origin",Ql/parseInt(ye.style.width)*100+"% "+ec/parseInt(ye.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,i=e.dataTransfer,r=o.options;if(Fe("dragStart",this,{evt:e}),me.eventCanceled){this._onDrop();return}Fe("setupClone",this),me.eventCanceled||(Ce=Zl(ae),Ce.removeAttribute("id"),Ce.draggable=!1,Ce.style["will-change"]="",this._hideClone(),Ye(Ce,this.options.chosenClass,!1),me.clone=Ce),o.cloneId=hi(function(){Fe("clone",o),!me.eventCanceled&&(o.options.removeCloneOnHide||xe.insertBefore(Ce,ae),o._hideClone(),Re({sortable:o,name:"clone"}))}),!n&&Ye(ae,r.dragClass,!0),n?(ri=!0,o._loopId=setInterval(o._emulateDragOver,50)):(ve(document,"mouseup",o._onDrop),ve(document,"touchend",o._onDrop),ve(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,ae)),be(document,"drop",o),pe(ae,"transform","translateZ(0)")),cn=!0,o._dragStartId=hi(o._dragStarted.bind(o,n,e)),be(document,"selectstart",o),jn=!0,window.getSelection().removeAllRanges(),Hn&&pe(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,i,r,a,l=this.options,u=l.group,c=me.active,d=ii===u,f=l.sort,h=Ae||c,p,y=this,m=!1;if(Tr)return;function b(k,O){Fe(k,y,ct({evt:e,isOwner:d,axis:p?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:h,target:o,completed:_,onMove:function(B,P){return fi(xe,n,ae,i,B,De(B),e,P)},changed:g},O))}function N(){b("dragOverAnimationCapture"),y.captureAnimationState(),y!==h&&h.captureAnimationState()}function _(k){return b("dragOverCompleted",{insertion:k}),k&&(d?c._hideClone():c._showClone(y),y!==h&&(Ye(ae,Ae?Ae.options.ghostClass:c.options.ghostClass,!1),Ye(ae,l.ghostClass,!0)),Ae!==y&&y!==me.active?Ae=y:y===me.active&&Ae&&(Ae=null),h===y&&(y._ignoreWhileAnimating=o),y.animateAll(function(){b("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===ae&&!ae.animated||o===n&&!o.animated)&&(dn=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(ae.parentNode[Le]._isOutsideThisEl(e.target),!k&&Gt(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function g(){Ue=Ke(ae),Mt=Ke(ae,l.draggable),Re({sortable:y,name:"change",toEl:n,newIndex:Ue,newDraggableIndex:Mt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=nt(o,l.draggable,n,!0),b("dragOver"),me.eventCanceled)return m;if(ae.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||y._ignoreWhileAnimating===o)return _(!1);if(ri=!1,c&&!l.disabled&&(d?f||(a=Ee!==xe):Ae===this||(this.lastPutMode=ii.checkPull(this,c,ae,e))&&u.checkPut(this,c,ae,e))){if(p=this._getDirection(e,o)==="vertical",i=De(ae),b("dragOverValid"),me.eventCanceled)return m;if(a)return Ee=xe,N(),this._hideClone(),b("revert"),me.eventCanceled||(Ft?xe.insertBefore(ae,Ft):xe.appendChild(ae)),_(!0);var x=Cr(n,l.draggable);if(!x||Fv(e,p,this)&&!x.animated){if(x===ae)return _(!1);if(x&&n===e.target&&(o=x),o&&(r=De(o)),fi(xe,n,ae,i,o,r,e,!!o)!==!1)return N(),x&&x.nextSibling?n.insertBefore(ae,x.nextSibling):n.appendChild(ae),Ee=n,g(),_(!0)}else if(x&&Lv(e,p,this)){var z=sn(n,0,l,!0);if(z===ae)return _(!1);if(o=z,r=De(o),fi(xe,n,ae,i,o,r,e,!1)!==!1)return N(),n.insertBefore(ae,z),Ee=n,g(),_(!0)}else if(o.parentNode===n){r=De(o);var $=0,F,Y=ae.parentNode!==n,G=!Pv(ae.animated&&ae.toRect||i,o.animated&&o.toRect||r,p),S=p?"top":"left",I=Ul(o,"top","top")||Ul(ae,"top","top"),E=I?I.scrollTop:void 0;dn!==o&&(F=r[S],Wn=!1,ai=!G&&l.invertSwap||Y),$=jv(e,o,r,p,G?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,ai,dn===o);var H;if($!==0){var w=Ke(ae);do w-=$,H=Ee.children[w];while(H&&(pe(H,"display")==="none"||H===ye))}if($===0||H===o)return _(!1);dn=o,Gn=$;var D=o.nextElementSibling,v=!1;v=$===1;var C=fi(xe,n,ae,i,o,r,e,v);if(C!==!1)return(C===1||C===-1)&&(v=C===1),Tr=!0,setTimeout(Vv,30),N(),v&&!D?n.appendChild(ae):o.parentNode.insertBefore(ae,v?D:o),I&&Kl(I,0,E-I.scrollTop),Ee=ae.parentNode,F!==void 0&&!ai&&(li=Math.abs(F-De(o)[S])),g(),_(!0)}if(n.contains(ae))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ve(document,"mousemove",this._onTouchMove),ve(document,"touchmove",this._onTouchMove),ve(document,"pointermove",this._onTouchMove),ve(document,"dragover",Gt),ve(document,"mousemove",Gt),ve(document,"touchmove",Gt)},_offUpEvents:function(){var e=this.el.ownerDocument;ve(e,"mouseup",this._onDrop),ve(e,"touchend",this._onDrop),ve(e,"pointerup",this._onDrop),ve(e,"pointercancel",this._onDrop),ve(e,"touchcancel",this._onDrop),ve(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(Ue=Ke(ae),Mt=Ke(ae,o.draggable),Fe("drop",this,{evt:e}),Ee=ae&&ae.parentNode,Ue=Ke(ae),Mt=Ke(ae,o.draggable),me.eventCanceled){this._nulling();return}cn=!1,ai=!1,Wn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Mr(this.cloneId),Mr(this._dragStartId),this.nativeDraggable&&(ve(document,"drop",this),ve(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Hn&&pe(document.body,"user-select",""),pe(ae,"transform",""),e&&(jn&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),ye&&ye.parentNode&&ye.parentNode.removeChild(ye),(xe===Ee||Ae&&Ae.lastPutMode!=="clone")&&Ce&&Ce.parentNode&&Ce.parentNode.removeChild(Ce),ae&&(this.nativeDraggable&&ve(ae,"dragend",this),Ir(ae),ae.style["will-change"]="",jn&&!cn&&Ye(ae,Ae?Ae.options.ghostClass:this.options.ghostClass,!1),Ye(ae,this.options.chosenClass,!1),Re({sortable:this,name:"unchoose",toEl:Ee,newIndex:null,newDraggableIndex:null,originalEvent:e}),xe!==Ee?(Ue>=0&&(Re({rootEl:Ee,name:"add",toEl:Ee,fromEl:xe,originalEvent:e}),Re({sortable:this,name:"remove",toEl:Ee,originalEvent:e}),Re({rootEl:Ee,name:"sort",toEl:Ee,fromEl:xe,originalEvent:e}),Re({sortable:this,name:"sort",toEl:Ee,originalEvent:e})),Ae&&Ae.save()):Ue!==ln&&Ue>=0&&(Re({sortable:this,name:"update",toEl:Ee,originalEvent:e}),Re({sortable:this,name:"sort",toEl:Ee,originalEvent:e})),me.active&&((Ue==null||Ue===-1)&&(Ue=ln,Mt=Fn),Re({sortable:this,name:"end",toEl:Ee,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Fe("nulling",this),xe=ae=Ee=ye=Ft=Ce=oi=It=jt=ot=jn=Ue=Mt=ln=Fn=dn=Gn=Ae=ii=me.dragged=me.ghost=me.clone=me.active=null;var e=this.el;ci.forEach(function(n){e.contains(n)&&(n.checked=!0)}),ci.length=Nr=kr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ae&&(this._onDragOver(e),Hv(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],nt(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||Wv(n));return e},sort:function(e,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];nt(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return nt(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var i=Ln.modifyOption(this,e,n);typeof i<"u"?o[e]=i:o[e]=n,e==="group"&&ic(o)},destroy:function(){Fe("destroy",this);var e=this.el;e[Le]=null,ve(e,"mousedown",this._onTapStart),ve(e,"touchstart",this._onTapStart),ve(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(ve(e,"dragover",this),ve(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),si.splice(si.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!It){if(Fe("hideClone",this),me.eventCanceled)return;pe(Ce,"display","none"),this.options.removeCloneOnHide&&Ce.parentNode&&Ce.parentNode.removeChild(Ce),It=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(It){if(Fe("showClone",this),me.eventCanceled)return;ae.parentNode==xe&&!this.options.group.revertClone?xe.insertBefore(Ce,ae):Ft?xe.insertBefore(Ce,Ft):xe.appendChild(Ce),this.options.group.revertClone&&this.animate(ae,Ce),pe(Ce,"display",""),It=!1}}};function Hv(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function fi(t,e,n,o,i,r,a,l){var u,c=t[Le],d=c.options.onMove,f;return window.CustomEvent&&!_t&&!Rn?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=n,u.draggedRect=o,u.related=i||e,u.relatedRect=r||De(e),u.willInsertAfter=l,u.originalEvent=a,t.dispatchEvent(u),d&&(f=d.call(c,u,a)),f}function Ir(t){t.draggable=!1}function Vv(){Tr=!1}function Lv(t,e,n){var o=De(sn(n.el,0,n.options,!0)),i=Jl(n.el,n.options,ye),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}function Fv(t,e,n){var o=De(Cr(n.el,n.options.draggable)),i=Jl(n.el,n.options,ye),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}function jv(t,e,n,o,i,r,a,l){var u=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,f=o?n.bottom:n.right,h=!1;if(!a){if(l&&li<c*i){if(!Wn&&(Gn===1?u>d+c*r/2:u<f-c*r/2)&&(Wn=!0),Wn)h=!0;else if(Gn===1?u<d+li:u>f-li)return-Gn}else if(u>d+c*(1-i)/2&&u<f-c*(1-i)/2)return Gv(e)}return h=h||a,h&&(u<d+c*r/2||u>f-c*r/2)?u>d+c/2?1:-1:0}function Gv(t){return Ke(ae)<Ke(t)?1:-1}function Wv(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Yv(t){ci.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&ci.push(o)}}function hi(t){return setTimeout(t,0)}function Mr(t){return clearTimeout(t)}di&&be(document,"touchmove",function(t){(me.active||cn)&&t.cancelable&&t.preventDefault()}),me.utils={on:be,off:ve,css:pe,find:Yl,is:function(e,n){return!!nt(e,n,e,!1)},extend:Dv,throttle:ql,closest:nt,toggleClass:Ye,clone:Zl,index:Ke,nextTick:hi,cancelNextTick:Mr,detectDirection:oc,getChild:sn,expando:Le},me.get=function(t){return t[Le]},me.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(me.utils=ct(ct({},me.utils),o.utils)),Ln.mount(o)})},me.create=function(t,e){return new me(t,e)},me.version=Nv;var Te=[],Yn,Br,$r=!1,zr,Ar,pi,Un;function Uv(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?be(document,"dragover",this._handleAutoScroll):this.options.supportPointer?be(document,"pointermove",this._handleFallbackAutoScroll):o.touches?be(document,"touchmove",this._handleFallbackAutoScroll):be(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?ve(document,"dragover",this._handleAutoScroll):(ve(document,"pointermove",this._handleFallbackAutoScroll),ve(document,"touchmove",this._handleFallbackAutoScroll),ve(document,"mousemove",this._handleFallbackAutoScroll)),ac(),gi(),Tv()},nulling:function(){pi=Br=Yn=$r=Un=zr=Ar=null,Te.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(pi=n,o||this.options.forceAutoScrollFallback||Rn||_t||Hn){Pr(n,this.options,l,o);var u=Tt(l,!0);$r&&(!Un||r!==zr||a!==Ar)&&(Un&&ac(),Un=setInterval(function(){var c=Tt(document.elementFromPoint(r,a),!0);c!==u&&(u=c,gi()),Pr(n,i.options,c,o)},10),zr=r,Ar=a)}else{if(!this.options.bubbleScroll||Tt(l,!0)===dt()){gi();return}Pr(n,this.options,Tt(l,!1),!1)}}},bt(t,{pluginName:"scroll",initializeByDefault:!0})}function gi(){Te.forEach(function(t){clearInterval(t.pid)}),Te=[]}function ac(){clearInterval(Un)}var Pr=ql(function(t,e,n,o){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,u=dt(),c=!1,d;Br!==n&&(Br=n,gi(),Yn=e.scroll,d=e.scrollFn,Yn===!0&&(Yn=Tt(n,!0)));var f=0,h=Yn;do{var p=h,y=De(p),m=y.top,b=y.bottom,N=y.left,_=y.right,g=y.width,x=y.height,z=void 0,$=void 0,F=p.scrollWidth,Y=p.scrollHeight,G=pe(p),S=p.scrollLeft,I=p.scrollTop;p===u?(z=g<F&&(G.overflowX==="auto"||G.overflowX==="scroll"||G.overflowX==="visible"),$=x<Y&&(G.overflowY==="auto"||G.overflowY==="scroll"||G.overflowY==="visible")):(z=g<F&&(G.overflowX==="auto"||G.overflowX==="scroll"),$=x<Y&&(G.overflowY==="auto"||G.overflowY==="scroll"));var E=z&&(Math.abs(_-i)<=a&&S+g<F)-(Math.abs(N-i)<=a&&!!S),H=$&&(Math.abs(b-r)<=a&&I+x<Y)-(Math.abs(m-r)<=a&&!!I);if(!Te[f])for(var w=0;w<=f;w++)Te[w]||(Te[w]={});(Te[f].vx!=E||Te[f].vy!=H||Te[f].el!==p)&&(Te[f].el=p,Te[f].vx=E,Te[f].vy=H,clearInterval(Te[f].pid),(E!=0||H!=0)&&(c=!0,Te[f].pid=setInterval((function(){o&&this.layer===0&&me.active._onTouchMove(pi);var D=Te[this.layer].vy?Te[this.layer].vy*l:0,v=Te[this.layer].vx?Te[this.layer].vx*l:0;typeof d=="function"&&d.call(me.dragged.parentNode[Le],v,D,t,pi,Te[this.layer].el)!=="continue"||Kl(Te[this.layer].el,v,D)}).bind({layer:f}),24))),f++}while(e.bubbleScroll&&h!==u&&(h=Tt(h,!1)));$r=c}},30),lc=function(e){var n=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,u=e.unhideGhostForTarget;if(n){var c=o||r;l();var d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(d.clientX,d.clientY);u(),c&&!c.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function Or(){}Or.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=sn(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:lc},bt(Or,{pluginName:"revertOnSpill"});function Rr(){}Rr.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,i=o||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop:lc},bt(Rr,{pluginName:"removeOnSpill"}),me.mount(new Uv),me.mount(Rr,Or);const cc=(t,e,n,o,i,r,a,l)=>{const u=s.ref(),c=s.reactive({}),d=s.computed(()=>{const v=[];return Object.keys(c).forEach(C=>{const k=c[C];k.dragType==="component"&&k.type!=="pkey"&&v.push(k)}),v}),f=(v=[],C)=>{const k=e?.value?.init;typeof k=="function"&&k(v,C)},h=v=>i?i(v,{componentDic:c,components:d.value,configData:u.value.config}):{},p=(v,C)=>{if(u.value?.id===v)return;const k=c[v]||C;if(k?u.value=k:v===n.id?u.value=n:u.value=null,u.value){const O=r[u.value.type];O?(f(O,u.value.config),h(u.value.type)):f([])}else f([]);C&&Se("dragClick",{id:C.id})},y=()=>t.value.$el.getBoundingClientRect(),m=v=>v===n.id?n:c[v]||{},b=v=>{const C=[];if(v===n.id)C.push({id:v,name:n.name});else{const k=c[v];if(k){C.push({id:v,name:k.name});const O=b(k.containerId);C.push(...O)}}return C},N=(v,C)=>{const k=c[C];if(k===void 0)return!1;const O=k.containerId;return v===O?!0:O===n.id?!1:N(v,O)},_=v=>o?o(v)||{}:{},g=(v,C,k,O)=>{if(l){const R=m(v);return l(k.componentType,{container:R,groupId:C,configData:k},O)}return!1},x=({name:v,type:C,dragType:k,isInput:O,componentName:R,runtimeType:B},P,L,j,K=!1)=>{const Q=_(C);if(Q.id=Wt(),Q.span=24,Q.componentType=C,z(P,Q.componentType))return;g(P,j,Q,!0);const q={id:Q.id,name:v,type:C,runtimeType:B,componentName:R||"",dragType:k||"component",containerId:P,isInput:!!O,level:c[P]?c[P].level+1:1,config:Q,isNewAdd:!K,groupId:j};return q.dragType==="container"&&(q.children=[]),c[q.id]=q,m(P).children?.splice(L,0,q),q},z=(v,C)=>!!(m(v).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(C)),$=(v,C,k=!1)=>{let O=null;const R=m(v).children,B=R?.findIndex(P=>P.id===C)||0;if(k&&R&&R.length>1){let P=B+1;B>0&&(P=B-1),O=R[P]}return R?.splice(B,1),O?.id},F=(v,C,k,O)=>{const R=m(C).children,B=v.containerId!==C;v.containerId=C,v.groupId=O,R?.splice(k,0,v),g(C,O,v.config,B)&&(H(),p(v.id))},Y=v=>{let C="";const k=m(v);return k&&(k.children&&k.children.length>0&&k.children.forEach(O=>{Y(O.id)}),C=$(k.containerId,v,!0)||"",delete c[v]),u.value&&u.value.id===v&&(u.value=null,e.value.init([])),C},G=(v,C=[])=>{const k=m(v);if(k&&k.children&&k.children.length>0){const O=[];k.children.forEach(R=>{R.groupId&&C.includes(R.groupId)&&O.push(R.id)}),O.forEach(R=>{Y(R),delete c[R]})}},S=(v,C)=>{const k=m(v);k&&(k.children&&k.children.length>0&&k.children.forEach(O=>{O.groupId===C&&Y(O.id)}),delete c[v])},I=v=>{const C=mi(m(v));C.id=Wt(),C.config.id=C.id,c[C.id]=C;const k=m(C.containerId).children,O=k?.findIndex(R=>R.id===v)||0;k?.splice(O+1,0,C)},E=()=>{n.children=[],Sc(c),u.value&&(Se("dragClick",{id:""}),u.value=null,e.value.init([]))},H=()=>{u.value&&(Se("dragClick",{id:""}),u.value=null,e.value.init([]))},w=v=>{const C=u.value,k=m(C.containerId).children,O=k?.findIndex(R=>R.id===C.id)||0;Y(C.id),s.nextTick(()=>{const R=a[v],B=_(v);B.id=C.id,B.span=C.config.span,B.componentType=v,B.table=C.config.table,B.field=C.config.field,C.config.isSubTable&&(B.isSubTable=C.config.isSubTable);const P={id:B.id,name:R.name,type:v,runtimeType:R.runtimeType,componentName:R.componentName||"",dragType:C.dragType,groupId:C.groupId,containerId:C.containerId,isInput:C.isInput,level:C.level,config:B,isNewAdd:!0};c[P.id]=P,k?.splice(O,0,P)})},D=v=>{Se("dragAddByClick",v)};return s.provide("d-drag-design-provide",{activedComponent:u,getDesignLocals:y,getComponent:m,getParentComponents:b,isMyChildComponent:N,selectComponent:p,addComponent:x,deleteComponent:Y,copyComponent:I,removeComponentFromContainer:$,addComponentToContainer:F,top:n,deleteChildren:S,deleteChildrens:G}),{activedComponent:u,clearComponents:E,changeComponent:w,schemaComponentDic:c,clearSelect:H,addComponent:x,addComponentByTable:D,designComponentList:d}},Xv=s.defineComponent({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(t,{expose:e}){const n=t,o=s.computed(()=>n.tableList.map(c=>({label:c.comment?`${c.name}(${c.comment})`:c.name,value:c.name}))),i=s.ref(),r=[{id:"layout",type:"j-layout",config:{top:48,topMove:!1,autoSize:["default"]},children:[{id:"table",type:"j-select",slot:"top",config:{label:"表名选择",loadOptions:()=>o,allowClear:!1}},{id:"fields",type:"j-table",config:{editConfig:{isAddBtn:!1,isRemoveBtn:!1},height:"100%",isMultiple:!0},children:[{id:"name",type:"span",config:{label:"字段名"}},{id:"type",type:"j-select",config:{label:"组件选择",options:n.componentList,width:200}}]}]}],a=(c,d)=>{if(c.id==="table"){const f=n.tableList.find(h=>h.name===d.value);if(f){const h=f.columns.map(p=>({value:p.name,name:p.coment?`${p.name}(${p.coment})`:p.name,type:"input",label:p.coment||p.name,selected:!p.isPrimary}));i.value.setFormData({fields:h})}}};return s.onMounted(()=>{i.value.init(r)}),e({ok:()=>{const c=i.value.getFormData(!1);return{addList:c.fields.filter(f=>f.selected),table:c.table,containerId:c.containerId,isSubTable:c.isSubTable}},closed:()=>{}}),(c,d)=>{const f=s.resolveComponent("j-form");return s.openBlock(),s.createBlock(f,{ref_key:"formRef",ref:i,"form-config":{labelWidth:"72px"},onChange:a},null,512)}}}),qv={APP_PROVIDE:"jcode_app_provide"};function Kv(t,e){return s.inject(t,e)}function Hr(){return Kv(qv.APP_PROVIDE,{t:(t,...e)=>{if(!t)return"";if(typeof t!="string")return t;let n=t||"";return e.length>0&&e.forEach((o,i)=>{n=n.replace(new RegExp(`\\{${i}\\}`,"g"),o)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:t,config:e})=>{if(t==null||t==="")return"";if(e?.dataType==="options"){let n=[t];typeof t=="string"&&t.split&&(n=t.split(","));const i=(e.options||[]).filter(r=>n.includes(r[e.valueKey||"value"])).map(r=>r[e.labelKey||"label"]);return String(i)||t}return t},getObjectList:({value:t,config:e})=>{if(t==null||t==="")return[];if(e?.dataType==="options"){let n=[t];return typeof t=="string"&&t.split&&(n=t.split(",")),(e.options||[]).filter(r=>n.includes(r[e.valueKey||"value"]))||[]}return[]}})})}const Zv=s.defineComponent({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){const{t:e}=Hr(),n=s.computed(()=>t.componentData.config?.notShowLabel?"0px":t.componentData.config?.labelWidth===void 0&&t.globalConfig.labelWidth!==void 0?`${t.globalConfig.labelWidth}px`:t.componentData.config?.labelWidth?`${t.componentData.config?.labelWidth}px`:void 0),o=s.computed(()=>{const i={...t.componentData?.config};return t.globalConfig.size===void 0&&(i.size=t.globalConfig.size),i.display=!0,i});return{labelWidth:n,inputConfig:o,t:e}}}),Jv=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n};function Qv(t,e,n,o,i,r){const a=s.resolveComponent("j-comp"),l=s.resolveComponent("el-form-item");return t.componentData.isInput?(s.openBlock(),s.createBlock(l,{key:0,"label-width":t.labelWidth,label:t.t(t.componentData.config?.notShowLabel?"":t.componentData.config?.label||""),rules:t.componentData.config?.required?[{required:!0,message:""}]:[]},{default:s.withCtx(()=>[s.createVNode(a,{type:t.componentData?.componentName||t.componentData?.type,config:t.inputConfig,modelValue:t.componentData?.config.defaultValue},null,8,["type","config","modelValue"])]),_:1},8,["label-width","label","rules"])):t.componentData?.children?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.mergeProps({key:1},t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"])):(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.normalizeProps(s.mergeProps({key:2},t.componentData?.config)),null,16))}const dc=Jv(Zv,[["render",Qv]]),e0={class:"d-form-design j-block"},t0={class:"d-form-design-left"},n0={class:"d-form-design-component-list"},o0={class:"j-component-tool"},i0={class:"j-component-tool-name"},r0={class:"d-form-design-center"},s0={class:"d-form-design-toolbar"},a0={class:"d-form-design-container"},l0={key:0,class:"d-form-design-empty"},c0={class:"d-form-design-right"},d0={class:"d-form-design-panel-title"},u0={style:{margin:"0","font-size":"14px"}},f0={class:"d-form-design-panel"},uc=$t(s.defineComponent({name:"DFormDesign",__name:"formDesign",props:{notBindTable:{type:Boolean,default:!1},components:{default:()=>[]},componentConfigs:{default:()=>({})},componentInit:{type:Function,default:void 0},containerAddComponent:{type:Function,default:void 0},componentConfigInit:{type:Function,default:void 0},componentConfigChange:{type:Function,default:void 0},componentConfigValidate:{type:Function,default:void 0},flowComponents:{default:()=>[]},flowInit:{type:Function,default:void 0},flowComponentConfigInit:{type:Function,default:void 0},flowComponentConfigChange:{type:Function,default:void 0},flowComponentConfigs:{default:()=>({})},actions:{}},setup(t,{expose:e}){const n=t,{t:o,warning:i,error:r}=Hr(),a=s.reactive({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),l=s.ref([]),u=n.components.length;for(let T=0;T<u;T++)l.value.push(T);n.componentInit&&(a.config=n.componentInit("form")||{});const c=s.ref([]),d=s.computed(()=>c.value.map(T=>({label:T.comment?`${T.name}(${T.comment})`:T.name,value:T.name}))),f=s.computed(()=>{if($.value){const T=z.value.getFormData(!1);if(T.table){const U=c.value.find(W=>W.name===T.table);if(U)return U.columns.map(W=>({value:W.name,label:W.coment?`${W.name}(${W.coment})`:W.name,coment:W.coment}))}}return[]}),h=T=>{c.value=T},p={},y=[];n.components.forEach(({children:T})=>{T.forEach(U=>{p[U.type]=U,U.dragType=U.dragType||"component",U.isInput!==!1&&(U.isInput=!0,y.push({label:U.name,value:U.type}))})});const m=T=>{T.forEach(U=>{U.type==="d-input-flow"&&(U.config=U.config||{},U.config.flowComponents=n.flowComponents,U.config.flowInit=n.flowInit,U.config.flowComponentConfigInit=W=>{n.flowComponentConfigInit&&(W.designComponents=I.value,W.component=$.value,n.flowComponentConfigInit(W))},U.config.flowComponentConfigs=n.flowComponentConfigs,U.config.flowComponentConfigChange=n.flowComponentConfigChange),U.children&&m(U.children)})},b={};Object.keys(n.componentConfigs||{}).forEach(T=>{const{hasBase:U,isInput:W,hasTwoPlaceholder:Z,hasPlaceholder:ne,hasSpan:te,hasLabel:fe,bindTable:ge,labelTitle:Ie}=p[T]||{hasBase:!1},Me=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:W,options:y}},{id:"label",type:"j-input",config:{label:Ie||"标题"},getCompConfig:({formData:_e})=>({display:fe!==!1&&!_e.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(Ie||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:_e})=>({display:fe!==!1&&!_e.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:_e})=>({display:W&&!_e.notShowLabel&&!_e.isSubTable})},{id:"placeholder",type:"j-input",config:{display:W&&!Z&&ne!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!Z,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!Z,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:_e})=>({display:te!==!1&&!_e.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:_e})=>({display:!!_e.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:W&&ge!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>d},getCompConfig:({formData:_e})=>({display:(W&&ge!==!1||ge===!0)&&(!_e.isSubTable||ge===!0)&&!_e.isNotSave&&!n.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>f},getCompConfig:({formData:_e})=>({display:W&&ge!==!1&&!_e.isNotSave&&!n.notBindTable})},{id:"csType",type:"j-select",config:{label:"字段类型",allowClear:!1,options:[{label:"短文本",value:"string"},{label:"长文本",value:"text"},{label:"整数",value:"int"},{label:"小数",value:"decimal"},{label:"时间日期",value:"DateTime"}]},getCompConfig:({formData:_e})=>({display:W&&ge!==!1&&!_e.isNotSave&&n.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:_e})=>({display:W&&ge!==!1&&!_e.isNotSave&&n.notBindTable&&_e.csType==="string"})}],Ze={type:"j-collapse",config:{defaultValue:[]},children:[]};U!==!1&&(Ze.children?.push({config:{label:"基础信息"},children:[...Me]}),Ze.config?.defaultValue.push("_collapse0")),Ze.children?.push(...n.componentConfigs[T]),m(Ze.children||[]),b[T]=[Ze]});const N=T=>{const{value:U}=T||{};T.id==="componentType"&&Y(U),$.value&&n.componentConfigChange&&(T.id==="field"&&T.data?.coment&&($.value.config.label=T.data?.coment),n.componentConfigChange($.value.type,{configRef:z,configData:$.value.config,...T})),T.id==="table"&&$.value&&$.value.type==="gridtable"&&($.value.children||[]).forEach(W=>{W.isInput&&(W.config.table=U)})},_=(T,U)=>{p[T]?.isInput&&(n.notBindTable&&(U.configData.csType||z.value.setFormData({main:{csType:p[T]?.csType,fieldLen:p[T]?.fieldLen}})),d.value.length===1&&z.value.setFormData({main:{table:d.value[0].value}})),n.componentConfigInit&&n.componentConfigInit(T,{configRef:z,...U,notBindTable:n.notBindTable})},g=(T,U,W)=>{let Z=!1;const ne=p[T];return U.container.type==="gridtable"?(!U.configData.isSubTable||W)&&(U.configData.isSubTable=!0,ne.isInput&&(U.configData.table=U.container.config.table,U.configData.field=""),Z=!0):U.configData.isSubTable&&(Z=!0,U.configData.isSubTable=!1,ne.isInput&&(U.configData.table="")),n.containerAddComponent&&n.containerAddComponent(T,U),Z},x=s.ref(),z=s.ref(),{activedComponent:$,clearComponents:F,changeComponent:Y,schemaComponentDic:G,addComponentByTable:S,designComponentList:I}=cc(x,z,a,n.componentInit,_,b,p,g),E=s.computed(()=>$.value?`【${$.value.name}】`:"");s.provide("dui-design-provide",{designItemName:dc});const H=()=>{F()},w=()=>{n.componentInit&&(a.config=n.componentInit("form")||{}),F()},D=()=>{let T=0;const U=vr(a.config,a.children||[]);if(n.notBindTable){const W={};U.components.forEach(te=>{const{isInput:fe,bindTable:ge}=p[te.type]||{};fe&&ge!==!1?te.config.table&&!W.main&&(W.main={name:te.config.table,comment:"主表",type:"main",pKey:"J_Id"}):ge&&(W[te.id]={name:te.config.table||"t"+new Date().getTime()+T,comment:`子表${te.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},te.config.table=W[te.id].name,T++)}),W.main||(W.main={name:"t"+new Date().getTime()+T,comment:"主表",type:"main",pKey:"J_Id"},T++);let Z=0;U.components.forEach(te=>{const{isInput:fe,bindTable:ge}=p[te.type]||{};!te.config.isNotSave&&fe&&ge!==!1&&(te.config.csType||(te.config.csType=p[te.type]?.csType,te.config.fieldLen=p[te.type]?.fieldLen),te.config.isSubTable?te.config.table=W[te.containerId].name:te.config.table=W.main.name,te.config.field=te.config.field||`f${Math.floor(Date.now()/1e3)}${Z}`,Z++)});const ne=[];Object.keys(W).forEach(te=>{W[te].type==="chlid"&&(W[te].relationName=W.main.name,W[te].comment+=`,关联主表${W.main.name}`),ne.push(W[te])}),U.db=ne}else{const W={};c.value.forEach(Z=>{Z.columns.forEach(ne=>{W[`${Z.name}_${ne.name}`]=ne.csType})}),U.components.forEach(Z=>{Z.config.table&&Z.config.field&&(Z.config.csType=W[`${Z.config.table}_${Z.config.field}`])})}return n.notBindTable?U.db.forEach(W=>{if(!U.components.find(ne=>ne.config.table===W.name&&ne.config.field==="J_Id")){const ne=U.components.find(te=>te.config.table===W.name&&te.config.field);ne&&U.components.push({id:W.name+"_J_Id",name:W.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:W.name,field:"J_Id",label:"主键"},containerId:ne.containerId,level:ne.level})}}):c.value.forEach(W=>{W.columns.forEach(Z=>{if(Z.isPrimary&&!U.components.find(te=>te.config.table===W.name&&te.config.field===Z.name)){const te=U.components.find(fe=>fe.config.table===W.name&&fe.config.field);te&&U.components.push({id:W.name+"_"+Z.name,name:W.name+"_"+Z.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:W.name,field:Z.name,label:"主键"+Z.name,isIdentity:Z.isIdentity},containerId:te.containerId,level:te.level})}})}),U},v=T=>{const U=Fy(T,p);a.config=U.formConfig,a.children?.push(...U.componentList),Object.keys(U.componentDic).forEach(W=>{G[W]=U.componentDic[W]})},C=()=>{const T=vr(a.config,a.children||[]),U={},W={};return O(T.components,U,W)},k=T=>{const{isInput:U,bindTable:W}=p[T]||{};if(!U&&W)return!0},O=(T,U,W)=>{if(!n.notBindTable)for(const Z of T){const{isInput:ne,bindTable:te}=p[Z.type]||{};if(!Z.config.isNotSave&&Z.type!=="pkey"){if(ne&&te!==!1){if(Xn(Z.config.table))return r&&r(`请【${Z.config.label}】绑定数据表!`),!1;if(!Z.config.isSubTable){if(W[Z.config.table]&&k(W[Z.config.table].type))return r&&r(`【${Z.config.label}】和【${W[Z.config.table].config.label}】重复绑定【${Z.config.table}】表!`),!1;Z.config.table&&(W[Z.config.table]=Z)}}else if(te){if(Xn(Z.config.table))return r&&r(`【${Z.config.label}】请绑定数据表!`),!1;if(W[Z.config.table])return r&&r(`【${Z.config.label}】和【${W[Z.config.table].config.label}】重复绑定【${Z.config.table}】表!`),!1;Z.config.table&&(W[Z.config.table]=Z)}}}for(const Z of T){if(!n.notBindTable){const{isInput:ne,bindTable:te}=p[Z.type]||{};if(!Z.config.isNotSave&&ne&&te!==!1){if(Xn(Z.config.field))return r&&r(`请【${Z.config.label}】绑定表字段!`),!1;if(U[`${Z.config.table}-${Z.config.field}`])return r&&r(`【${Z.config.label}】和【${U[`${Z.config.table}-${Z.config.field}`].config.label}】重复绑定【${Z.config.field}】字段!`),!1;U[`${Z.config.table}-${Z.config.field}`]=Z}}if(n.componentConfigValidate&&!n.componentConfigValidate(Z.type,{configData:Z.config,errorTip:r}))return!1}return!0},R=s.ref(),B=s.ref(),P=s.reactive({width:0,height:0,formConfig:{}});let L=0;const j=T=>{if(B.value)L=0,B.value.init(T||[]);else{if(L>600){console.warn("表单组件加载超时");return}L++,setTimeout(()=>{j(T)},100)}},K=()=>{},Q=()=>{},q=()=>{const T=vr(a.config,a.children||[]);P.width=T.form.width||800,P.height=T.form.height||600,R.value.open("表单预览",T.form.layerType),s.nextTick(()=>{const{formConfig:U,componentList:W}=Ly(T);P.formConfig=U,j(W)})},ee=s.ref(),re=s.ref(),oe=()=>{ee.value.open("快速添加组件")},ce=()=>{const{addList:T,table:U}=re.value?.ok()||{addList:[]};if(T.length<=0)i&&i("请选择字段!");else{if($.value?.config.componentType==="gridtable"||$.value?.config.isSubTable)if($.value.config.table){if($.value.config.table!==U){i&&i("请设置相同的表和子表!");return}}else{let W=$.value;$.value.config.isSubTable&&(W=G[$.value.containerId]),W.config.table=U,(W.children||[]).forEach(Z=>{Z.isInput&&(Z.config.table=U)}),z.value.setFormData({main:{table:U}})}T.forEach(W=>{const Z=br(p[W.type]);Z.config={table:U,field:W.value,label:W.label},S(Z)}),ee.value.close()}},ie=()=>{re.value?.closed()};return e({setTables:T=>{h(T)},getSchema:()=>D(),setSchema:T=>v(T),reset:()=>w(),validate:()=>C()}),(T,U)=>{const W=s.resolveComponent("j-icon"),Z=s.resolveComponent("d-drag-tool"),ne=s.resolveComponent("el-collapse-item"),te=s.resolveComponent("el-collapse"),fe=s.resolveComponent("j-button"),ge=s.resolveComponent("d-drag-form-list"),Ie=s.resolveComponent("el-row"),Me=s.resolveComponent("d-drag-container"),Ze=s.resolveComponent("j-form"),_e=s.resolveComponent("j-layer");return s.openBlock(),s.createElementBlock("div",e0,[s.createElementVNode("div",t0,[U[1]||(U[1]=s.createElementVNode("div",{class:"d-form-design-panel-title"},"组件库",-1)),s.createElementVNode("div",n0,[s.createVNode(te,{modelValue:l.value,"onUpdate:modelValue":U[0]||(U[0]=xt=>l.value=xt)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.components,(xt,Ct)=>(s.openBlock(),s.createBlock(ne,{key:Ct,title:xt.name,name:Ct},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(xt.children,(Et,Vr)=>(s.openBlock(),s.createBlock(Z,{key:Vr,config:Et},{default:s.withCtx(()=>[s.createElementVNode("div",o0,[s.createVNode(W,{class:"j-component-tool-icon",icon:Et.icon,size:14},null,8,["icon"]),s.createElementVNode("div",i0,s.toDisplayString(s.unref(o)(Et.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),s.createElementVNode("div",r0,[s.createElementVNode("div",s0,[s.withDirectives(s.createVNode(fe,{type:"primary",label:"快速添加组件",onClick:oe},null,512),[[s.vShow,!t.notBindTable]]),s.createVNode(fe,{type:"primary",label:"清空",onClick:H,danger:""}),s.createVNode(fe,{label:"预览",onClick:q})]),s.createElementVNode("div",a0,[s.createVNode(Me,{ref_key:"dragContainer",ref:x,class:"d-form-design-drag-container","is-component-container":!1,"component-data":a},{default:s.withCtx(()=>[!a.children||a.children.length===0?(s.openBlock(),s.createElementBlock("div",l0,[...U[2]||(U[2]=[s.createElementVNode("div",null,"请从左侧拖拽组件到此处",-1)])])):(s.openBlock(),s.createBlock(Ie,{key:1},{default:s.withCtx(()=>[s.createVNode(ge,{"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),s.withDirectives(s.createElementVNode("div",c0,[s.createElementVNode("div",d0,[s.createElementVNode("span",u0,s.toDisplayString(`${s.unref(o)("属性配置")}${E.value}`),1)]),s.createElementVNode("div",f0,[s.createVNode(Ze,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:z,onChange:N},null,512)])],512),[[s.vShow,s.unref($)]]),s.createVNode(_e,{ref_key:"previewFormLayerRef",ref:R,width:P.width,height:P.height,onOk:K,onClosed:Q},{default:s.withCtx(()=>[s.createVNode(Ze,{config:P.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:B,actions:t.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),s.createVNode(_e,{ref_key:"importFormLayerRef",ref:ee,width:800,height:600,"btn-text":"确认",onOk:ce,onClosed:ie},{default:s.withCtx(()=>[s.createVNode(Xv,{"component-list":y,"table-list":c.value,ref_key:"importComponentRef",ref:re},null,8,["table-list"])]),_:1},512)])}}}),[dc]),fc=(t,e)=>{const n={ver:"V3",indexPage:{...t},components:[]};return hc(e||[],n.components),n},hc=(t,e)=>{t.forEach(n=>{const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};if(n.dragType==="container"){const i=n.children||[];hc(i,e)}e.push(o)})},h0=t=>{const e=p0(t.components);return{pageConfig:t.indexPage,componentList:e}},p0=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{}};o.config&&Object.keys(o.config).forEach(r=>{i.config[r]=o.config[r]}),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{n[o]&&(n[o].children=e[o])}),e.indexPage||[]},g0=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.indexPage;const a={};r.components.forEach(l=>{const u=e[l.type];if(!u)return;a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:u.dragType||"component",componentName:u.componentName||"",runtimeType:u.runtimeType,groupId:l.groupId,config:l.config,isInput:!1,containerId:l.containerId,level:l.level};i[c.id]=c,a[l.containerId].push(c),c.dragType==="container"&&(c.children=[])}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.indexPage||[]}return{pageConfig:n,componentList:o,componentDic:i}},pc=s.defineComponent({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){return(e,n)=>(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.componentData?.componentName),s.mergeProps(t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"]))}}),m0={class:"d-index-design j-block"},y0={class:"d-index-design-left"},v0={class:"j-component-list"},b0={class:"j-component-tool"},w0={class:"j-component-tool-name"},_0={class:"d-index-design-center"},x0={class:"design-toolbar"},C0={class:"design-container"},E0={key:0,class:"j-block design-empty"},S0={class:"d-index-design-right"},N0={class:"d-index-design-panel-title"},k0={style:{margin:"0","font-size":"14px"}},D0={class:"d-index-design-panel"},gc=$t(s.defineComponent({name:"DIndexDesign",__name:"indexDesign",props:{components:{type:Array,default:()=>[]},componentConfigs:{type:Object,default:()=>({})},componentInit:Function,containerAddComponent:Function,componentConfigInit:Function,componentConfigChange:Function,flowComponents:{type:Array,default:()=>[]},flowInit:Function,flowComponentConfigInit:Function,flowComponentConfigChange:Function,flowComponentConfigs:{type:Object,default:()=>({})}},setup(t,{expose:e}){const{t:n}=Hr(),o=t,i=v=>{v.forEach(C=>{C.type==="d-input-flow"&&(C.config=C.config||{},C.config.flowComponents=o.flowComponents,C.config.flowInit=o.flowInit,C.config.flowComponentConfigInit=k=>{o.flowComponentConfigInit&&(k.designComponents=b.value,k.component=p.value,o.flowComponentConfigInit(k))},C.config.flowComponentConfigs=o.flowComponentConfigs,C.config.flowComponentConfigChange=o.flowComponentConfigChange),C.children&&i(C.children)})},r=s.reactive({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});o.componentInit&&(r.config=o.componentInit("indexPage")||{});const a={},l=[];o.components.forEach(({children:v})=>{v.forEach(C=>{a[C.type]=C,C.dragType=C.dragType||"component",l.push({label:C.name,value:C.type})})});const u={};Object.keys(o.componentConfigs).forEach(v=>{const{hasBase:C}=a[v]||{hasBase:!1},k=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],O={type:"j-collapse",config:{defaultValue:[]},children:[]};C!==!1&&(O.children?.push({config:{label:"基础信息"},children:[...k]}),O.config?.defaultValue.push("_collapse0")),O.children?.push(...o.componentConfigs[v]),i(O.children||[]),u[v]=[O]});const c=v=>{p.value&&o.componentConfigChange&&o.componentConfigChange(p.value.type,{configRef:h,configData:p.value.config,...v})},d=(v,C)=>{o.componentConfigInit&&o.componentConfigInit(v,{configRef:h,...C})},f=s.ref(),h=s.ref(),{activedComponent:p,clearComponents:y,schemaComponentDic:m,designComponentList:b}=cc(f,h,r,o.componentInit,d,u,a,o.containerAddComponent),N=s.computed(()=>p.value?`【${p.value.name}】`:""),_=s.ref([]),g=o.components.length;for(let v=0;v<g;v++)_.value.push(v);s.provide("dui-design-provide",{designItemName:pc});const x=()=>{y()},z=()=>{o.componentInit&&(r.config=o.componentInit("indexPage")||{}),y()},$=()=>(console.log("pValidate"),!0),F=()=>fc(r.config,r.children||[]),Y=v=>{const C=g0(v,a);r.config=C.pageConfig,r.children?.push(...C.componentList),Object.keys(C.componentDic).forEach(k=>{m[k]=C.componentDic[k]})},G=s.ref(),S=s.ref();s.ref(""),s.reactive({formConfig:{}});let I=0;const E=v=>{if(S.value)I=0,S.value.init(v);else{if(I>600){console.warn("组件加载超时");return}I++,setTimeout(()=>{E(v)},100)}},H=()=>{},w=()=>{},D=()=>{const v=fc(r.config,r.children||[]),{componentList:C}=h0(v);G.value.open("页面预览","full"),s.nextTick(()=>{E(C)})};return e({reset:z,validate:$,getSchema:F,setSchema:Y}),(v,C)=>{const k=s.resolveComponent("j-icon"),O=s.resolveComponent("d-drag-tool"),R=s.resolveComponent("el-collapse-item"),B=s.resolveComponent("el-collapse"),P=s.resolveComponent("j-button"),L=s.resolveComponent("el-tooltip"),j=s.resolveComponent("el-divider"),K=s.resolveComponent("el-empty"),Q=s.resolveComponent("d-drag-index-list"),q=s.resolveComponent("d-drag-container"),ee=s.resolveComponent("j-form"),re=s.resolveComponent("j-page"),oe=s.resolveComponent("j-layer");return s.openBlock(),s.createElementBlock("div",m0,[s.createElementVNode("div",y0,[C[1]||(C[1]=s.createElementVNode("div",{class:"d-index-design-panel-title"},"组件库",-1)),s.createElementVNode("div",v0,[s.createVNode(B,{modelValue:_.value,"onUpdate:modelValue":C[0]||(C[0]=ce=>_.value=ce)},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.components,(ce,ie)=>(s.openBlock(),s.createBlock(R,{key:ie,title:ce.name,name:ie},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(ce.children,(se,A)=>(s.openBlock(),s.createBlock(O,{key:A,config:se},{default:s.withCtx(()=>[s.createElementVNode("div",b0,[s.createVNode(k,{class:"j-component-tool-icon",icon:se.icon,size:14},null,8,["icon"]),s.createElementVNode("div",w0,s.toDisplayString(s.unref(n)(se.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),s.createElementVNode("div",_0,[s.createElementVNode("div",x0,[C[2]||(C[2]=s.createElementVNode("div",null,null,-1)),s.createElementVNode("div",null,[s.createVNode(L,{content:s.unref(n)("清空")},{default:s.withCtx(()=>[s.createVNode(P,{danger:"",type:"text",onClick:x,icon:"mdi:delete-outline"})]),_:1},8,["content"]),s.createVNode(j,{direction:"vertical"}),s.createVNode(L,{content:s.unref(n)("预览")},{default:s.withCtx(()=>[s.createVNode(P,{type:"text",onClick:D,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),s.createElementVNode("div",C0,[s.createVNode(q,{ref_key:"dragContainer",ref:f,class:"design-drag-container","is-component-container":!1,"component-data":r},{default:s.withCtx(()=>[!r.children||r.children.length===0?(s.openBlock(),s.createElementBlock("div",E0,[s.createVNode(K,{description:s.unref(n)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):(s.openBlock(),s.createBlock(Q,{key:1,"component-list":r.children,"global-config":r.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),s.withDirectives(s.createElementVNode("div",S0,[s.createElementVNode("div",N0,[s.createElementVNode("span",k0,s.toDisplayString(`${s.unref(n)("属性配置")}${N.value}`),1)]),s.createElementVNode("div",D0,[s.createVNode(ee,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:h,onChange:c},null,512)])],512),[[s.vShow,s.unref(p)&&u[s.unref(p).type]]]),s.createVNode(oe,{ref_key:"previewLayerRef",ref:G,"has-btns":!1,onOk:H,onClosed:w},{default:s.withCtx(()=>[s.createVNode(re,{ref_key:"previewRef",ref:S},null,512)]),_:1},512)])}}}),[pc]),T0=[ms,Di,Ti,Ii,Mi,hl,pl,vl,bl,uc,gc],I0={install:t=>{T0.forEach(e=>{t.component(e.name,e)})}};$e.DDrag=ms,$e.DDraggable=bl,$e.DFlowDesign=hl,$e.DFormDesign=uc,$e.DIndexDesign=gc,$e.DInputFlow=pl,$e.DLayout=vl,$e.default=I0,$e.dragContainer=Ti,$e.dragFormList=Ii,$e.dragIndexList=Mi,$e.dragTool=Di,Object.defineProperties($e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
26
|
+
Edge: ${t}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"},Ie=class extends Error{constructor(t,...e){var n;super((n=Sa[t])==null?void 0:n.call(Sa,...e)),this.name="VueFlowError",this.code=t,this.args=e}};function Wi(t){return"clientX"in t}function Lp(t){return"sourceEvent"in t}function at(t,e){const n=Wi(t);let o,i;return n?(o=t.clientX,i=t.clientY):"touches"in t&&t.touches.length>0?(o=t.touches[0].clientX,i=t.touches[0].clientY):"changedTouches"in t&&t.changedTouches.length>0?(o=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY):(o=0,i=0),{x:o-(e?.left??0),y:i-(e?.top??0)}}var ko=()=>{var t;return typeof navigator<"u"&&((t=navigator?.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Fp(t){var e,n;return{width:((e=t.dimensions)==null?void 0:e.width)??t.width??0,height:((n=t.dimensions)==null?void 0:n.height)??t.height??0}}function No(t,e=[1,1]){return{x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}}var Gp=()=>!0;function Yi(t){t?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function jp(t,e,n){const o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const r of e.values())Eo(i,Co(r))>0&&o.push(r);return o}var Wp=250;function Yp(t,e,n,o){var i,r;let a=[],l=Number.POSITIVE_INFINITY;const d=jp(t,n,e+Wp);for(const c of d){const u=[...((i=c.handleBounds)==null?void 0:i.source)??[],...((r=c.handleBounds)==null?void 0:r.target)??[]];for(const f of u){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:h,y:p}=Qt(c,f,f.position,!0),g=Math.sqrt((h-t.x)**2+(p-t.y)**2);g>e||(g<l?(a=[{...f,x:h,y:p}],l=g):g===l&&a.push({...f,x:h,y:p}))}}if(!a.length)return null;if(a.length>1){const c=o.type==="source"?"target":"source";return a.find(u=>u.type===c)??a[0]}return a[0]}function ka(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:d,isValidConnection:c=Gp},u,f,h,p){const g=r==="target",m=e?a.querySelector(`.${l}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:w,y:I}=at(t),y=a.elementFromPoint(w,I),v=y?.classList.contains(`${l}-flow__handle`)?y:m,C={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const $=Na(void 0,v),z=v.getAttribute("data-nodeid"),W=v.getAttribute("data-handleid"),j=v.classList.contains("connectable"),D=v.classList.contains("connectableend");if(!z||!$)return C;const O={source:g?z:o,sourceHandle:g?W:i,target:g?o:z,targetHandle:g?i:W};C.connection=O,C.isValid=j&&D&&(n===gt.Strict?g&&$==="source"||!g&&$==="target":z!==o||W!==i)&&c(O,{nodes:f,edges:u,sourceNode:h(O.source),targetNode:h(O.target)}),C.toHandle=Da(z,$,W,p,n,!0)}return C}function Na(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function Up(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function Xp(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}function Da(t,e,n,o,i,r=!1){var a,l,d;const c=o.get(t);if(!c)return null;const u=i===gt.Strict?(a=c.handleBounds)==null?void 0:a[e]:[...((l=c.handleBounds)==null?void 0:l.source)??[],...((d=c.handleBounds)==null?void 0:d.target)??[]],f=(n?u?.find(h=>h.id===n):u?.[0])??null;return f&&r?{...f,...Qt(c,f,f.position,!0)}:f}var Ui={[ce.Left]:ce.Right,[ce.Right]:ce.Left,[ce.Top]:ce.Bottom,[ce.Bottom]:ce.Top},qp=["production","prod"];function Pn(t,...e){Ta()&&console.warn(`[Vue Flow]: ${t}`,...e)}function Ta(){return!qp.includes(process.env.NODE_ENV||"")}function Ia(t,e,n,o,i){const r=e.querySelectorAll(`.vue-flow__handle.${t}`);return r?.length?Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...xo(a)}}):null}function Xi(t,e,n,o,i,r=!1,a){i.value=!1,t.selected?(r||t.selected&&e)&&(o([t]),(0,s.nextTick)(()=>{a.blur()})):n([t])}function Ne(t){return typeof(0,s.unref)(t)<"u"}function Kp(t,e,n,o){if(!t||!t.source||!t.target)return n(new Ie(ke.EDGE_INVALID,t?.id??"[ID UNKNOWN]")),!1;let i;return Ct(t)?i=t:i={...t,id:aa(t)},i=ra(i,void 0,o),Tp(i,e)?!1:i}function Zp(t,e,n,o,i){if(!e.source||!e.target)return i(new Ie(ke.EDGE_INVALID,t.id)),!1;if(!n)return i(new Ie(ke.EDGE_NOT_FOUND,t.id)),!1;const{id:r,...a}=t;return{...a,id:o?aa(e):r,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle}}function Ma(t,e,n){const o={},i=[];for(let r=0;r<t.length;++r){const a=t[r];if(!Rt(a)){n(new Ie(ke.NODE_INVALID,a?.id));continue}const l=kp(a,e(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=l}for(const r of i){const a=e(r.parentNode)||i.find(l=>l.id===r.parentNode);r.parentNode&&!a&&n(new Ie(ke.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Ba(t,e,n,o,i,r){let a=i;const l=o.get(a)||new Map;o.set(a,l.set(n,e)),a=`${i}-${t}`;const d=o.get(a)||new Map;if(o.set(a,d.set(n,e)),r){a=`${i}-${t}-${r}`;const c=o.get(a)||new Map;o.set(a,c.set(n,e))}}function qi(t,e,n){t.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=o,d={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:l},c=`${i}-${a}--${r}-${l}`;Ba("source",d,`${r}-${l}--${i}-${a}`,t,i,a),Ba("target",d,c,t,r,l)}}function za(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Ki(t,e,n,o,i,r,a,l){const d=[];for(const c of t){const u=Ct(c)?c:Kp(c,l,i,r);if(!u)continue;const f=n(u.source),h=n(u.target);if(!f||!h){i(new Ie(ke.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!f){i(new Ie(ke.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!h){i(new Ie(ke.EDGE_TARGET_MISSING,u.id,u.target));continue}if(e&&!e(u,{edges:l,nodes:a,sourceNode:f,targetNode:h})){i(new Ie(ke.EDGE_INVALID,u.id));continue}const p=o(u.id);d.push({...ra(u,p,r),sourceNode:f,targetNode:h})}return d}var Aa=Symbol("vueFlow"),Pa=Symbol("nodeId"),Oa=Symbol("nodeRef"),Jp=Symbol("edgeId"),Qp=Symbol("edgeRef"),Do=Symbol("slots");function $a(t){const{vueFlowRef:e,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:a,nodeDragThreshold:l,viewport:d,autoPanOnNodeDrag:c,autoPanSpeed:u,nodesDraggable:f,panBy:h,findNode:p,multiSelectionActive:g,nodesSelectionActive:m,selectNodesOnDrag:w,removeSelectedElements:I,addSelectedNodes:y,updateNodePositions:v,emits:C}=be(),{onStart:$,onDrag:z,onStop:W,onClick:j,el:D,disabled:O,id:H,selectable:S,dragHandle:Y}=t,b=(0,s.shallowRef)(!1);let B=[],_,x=null,T={x:void 0,y:void 0},P={x:0,y:0},L=null,M=!1,V=!1,F=0,G=!1;const X=ng(),J=({x:ee,y:ie})=>{T={x:ee,y:ie};let R=!1;if(B=B.map(E=>{const k={x:ee-E.distance.x,y:ie-E.distance.y},{computedPosition:A}=ji(E,n.value?No(k,o.value):k,C.error,a.value,E.parentNode?p(E.parentNode):void 0);return R=R||E.position.x!==A.x||E.position.y!==A.y,E.position=A,E}),V=V||R,!!R&&(v(B,!0,!0),b.value=!0,L)){const[E,k]=Gi({id:H,dragItems:B,findNode:p});z({event:L,node:E,nodes:k})}},U=()=>{if(!x)return;const[ee,ie]=ma(P,x,u.value);if(ee!==0||ie!==0){const R={x:(T.x??0)-ee/d.value.zoom,y:(T.y??0)-ie/d.value.zoom};h({x:ee,y:ie})&&J(R)}F=requestAnimationFrame(U)},Z=(ee,ie)=>{M=!0;const R=p(H);!w.value&&!g.value&&R&&(R.selected||I()),R&&(0,s.toValue)(S)&&w.value&&Xi(R,g.value,y,I,m,!1,ie);const E=X(ee.sourceEvent);if(T=E,B=Pp(r.value,f.value,E,H),B.length){const[k,A]=Gi({id:H,dragItems:B,findNode:p});$({event:ee.sourceEvent,node:k,nodes:A})}},te=(ee,ie)=>{var R;ee.sourceEvent.type==="touchmove"&&ee.sourceEvent.touches.length>1||(V=!1,l.value===0&&Z(ee,ie),T=X(ee.sourceEvent),x=((R=e.value)==null?void 0:R.getBoundingClientRect())||null,P=at(ee.sourceEvent,x))},oe=(ee,ie)=>{const R=X(ee.sourceEvent);if(!G&&M&&c.value&&(G=!0,U()),!M){const E=R.xSnapped-(T.x??0),k=R.ySnapped-(T.y??0);Math.sqrt(E*E+k*k)>l.value&&Z(ee,ie)}(T.x!==R.xSnapped||T.y!==R.ySnapped)&&B.length&&M&&(L=ee.sourceEvent,P=at(ee.sourceEvent,x),J(R))},ae=ee=>{let ie=!1;if(!M&&!b.value&&!g.value){const R=ee.sourceEvent,E=X(R),k=E.xSnapped-(T.x??0),A=E.ySnapped-(T.y??0),N=Math.sqrt(k*k+A*A);N!==0&&N<=l.value&&(j?.(R),ie=!0)}if(B.length&&!ie){V&&(v(B,!1,!1),V=!1);const[R,E]=Gi({id:H,dragItems:B,findNode:p});W({event:ee.sourceEvent,node:R,nodes:E})}B=[],b.value=!1,G=!1,M=!1,T={x:void 0,y:void 0},cancelAnimationFrame(F)};return(0,s.watch)([()=>(0,s.toValue)(O),D],([ee,ie],R,E)=>{if(ie){const k=Ze(ie);ee||(_=Sf().on("start",A=>te(A,ie)).on("drag",A=>oe(A,ie)).on("end",A=>ae(A)).filter(A=>{const N=A.target,Q=(0,s.toValue)(Y);return!A.button&&(!i.value||!Ca(N,`.${i.value}`,ie)&&(!Q||Ca(N,Q,ie)))}),k.call(_)),E(()=>{k.on(".drag",null),_&&(_.on("start",null),_.on("drag",null),_.on("end",null))})}}),b}function eg(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),updateStart:le(),update:le(),updateEnd:le()}}function tg(t,e){const n=eg();return n.doubleClick.on(o=>{var i,r;e.edgeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.edgeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.edgeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.edgeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.edgeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.edgeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;e.edgeUpdateStart(o),(r=(i=t.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;e.edgeUpdate(o),(r=(i=t.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;e.edgeUpdateEnd(o),(r=(i=t.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function ng(){const{viewport:t,snapGrid:e,snapToGrid:n,vueFlowRef:o}=be();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},{x:l,y:d}=at(Lp(i)?i.sourceEvent:i,a),c=zn({x:l,y:d},t.value),{x:u,y:f}=n.value?No(c,e.value):c;return{xSnapped:u,ySnapped:f,...c}}}function To(){return!0}function Ra({handleId:t,nodeId:e,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:l,vueFlowRef:d,connectionMode:c,connectionRadius:u,connectOnClick:f,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:g,autoPanSpeed:m,findNode:w,panBy:I,startConnection:y,updateConnection:v,endConnection:C,emits:$,viewport:z,edges:W,nodes:j,isValidConnection:D,nodeLookup:O}=be();let H=null,S=!1,Y=null;function b(_){var x;const T=(0,s.toValue)(n)==="target",P=Wi(_),L=ia(_.target),M=_.currentTarget;if(M&&(P&&_.button===0||!P)){let V=function(re){R=at(re,ae),J=Yp(zn(R,z.value,!1,[1,1]),u.value,O.value,A),E||(k(),E=!0);const ne=ka(re,{handle:J,connectionMode:c.value,fromNodeId:(0,s.toValue)(e),fromHandleId:(0,s.toValue)(t),fromType:T?"target":"source",isValidConnection:X,doc:L,lib:"vue",flowId:l,nodeLookup:O.value},W.value,j.value,w,O.value);Y=ne.handleDomNode,H=ne.connection,S=Xp(!!J,ne.isValid);const de={...K,isValid:S,to:ne.toHandle&&S?Bn({x:ne.toHandle.x,y:ne.toHandle.y},z.value):R,toHandle:ne.toHandle,toPosition:S&&ne.toHandle?ne.toHandle.position:Ui[A.position],toNode:ne.toHandle?O.value.get(ne.toHandle.nodeId):null};if(S&&J&&K?.toHandle&&de.toHandle&&K.toHandle.type===de.toHandle.type&&K.toHandle.nodeId===de.toHandle.nodeId&&K.toHandle.id===de.toHandle.id&&K.to.x===de.to.x&&K.to.y===de.to.y)return;const ye=J??ne.toHandle;if(v(ye&&S?Bn({x:ye.x,y:ye.y},z.value):R,ye,Up(!!ye,S)),K=de,!J&&!S&&!Y)return Yi(ie);H&&H.source!==H.target&&Y&&(Yi(ie),ie=Y,Y.classList.add("connecting","vue-flow__handle-connecting"),Y.classList.toggle("valid",!!S),Y.classList.toggle("vue-flow__handle-valid",!!S))},F=function(re){"touches"in re&&re.touches.length>0||((J||Y)&&H&&S&&(r?r(re,H):$.connect(H)),$.connectEnd(re),i&&a?.(re),Yi(ie),cancelAnimationFrame(U),C(re),E=!1,S=!1,H=null,Y=null,L.removeEventListener("mousemove",V),L.removeEventListener("mouseup",F),L.removeEventListener("touchmove",V),L.removeEventListener("touchend",F))};const G=w((0,s.toValue)(e));let X=(0,s.toValue)(o)||D.value||To;!X&&G&&(X=(T?G.isValidSourcePos:G.isValidTargetPos)||To);let J,U=0;const{x:Z,y:te}=at(_),oe=Na((0,s.toValue)(i),M),ae=(x=d.value)==null?void 0:x.getBoundingClientRect();if(!ae||!oe)return;const ee=Da((0,s.toValue)(e),oe,(0,s.toValue)(t),O.value,c.value);if(!ee)return;let ie,R=at(_,ae),E=!1;const k=()=>{if(!g.value)return;const[re,ne]=ma(R,ae,m.value);I({x:re,y:ne}),U=requestAnimationFrame(k)},A={...ee,nodeId:(0,s.toValue)(e),type:oe,position:ee.position},N=O.value.get((0,s.toValue)(e)),Q={inProgress:!0,isValid:null,from:Qt(N,A,ce.Left,!0),fromHandle:A,fromPosition:A.position,fromNode:N,to:R,toHandle:null,toPosition:Ui[A.position],toNode:null};y({nodeId:(0,s.toValue)(e),id:(0,s.toValue)(t),type:oe,position:M?.getAttribute("data-handlepos")||ce.Top,...R},{x:Z-ae.left,y:te-ae.top}),$.connectStart({event:_,nodeId:(0,s.toValue)(e),handleId:(0,s.toValue)(t),handleType:oe});let K=Q;L.addEventListener("mousemove",V),L.addEventListener("mouseup",F),L.addEventListener("touchmove",V),L.addEventListener("touchend",F)}}function B(_){var x,T;if(!f.value)return;const P=(0,s.toValue)(n)==="target";if(!h.value){$.clickConnectStart({event:_,nodeId:(0,s.toValue)(e),handleId:(0,s.toValue)(t)}),y({nodeId:(0,s.toValue)(e),type:(0,s.toValue)(n),id:(0,s.toValue)(t),position:ce.Top,...at(_)},void 0,!0);return}let L=(0,s.toValue)(o)||D.value||To;const M=w((0,s.toValue)(e));if(!L&&M&&(L=(P?M.isValidSourcePos:M.isValidTargetPos)||To),M&&(typeof M.connectable>"u"?p.value:M.connectable)===!1)return;const V=ia(_.target),F=ka(_,{handle:{nodeId:(0,s.toValue)(e),id:(0,s.toValue)(t),type:(0,s.toValue)(n),position:ce.Top,...at(_)},connectionMode:c.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:L,doc:V,lib:"vue",flowId:l,nodeLookup:O.value},W.value,j.value,w,O.value),G=((x=F.connection)==null?void 0:x.source)===((T=F.connection)==null?void 0:T.target);F.isValid&&F.connection&&!G&&$.connect(F.connection),$.clickConnectEnd(_),C(_,!0)}return{handlePointerDown:b,handleClick:B}}function og(){return(0,s.inject)(Pa,"")}function Ha(t){const e=t??og()??"",n=(0,s.inject)(Oa,(0,s.ref)(null)),{findNode:o,edges:i,emits:r}=be(),a=o(e);return a||r.error(new Ie(ke.NODE_NOT_FOUND,e)),{id:e,nodeEl:n,node:a,parentNode:(0,s.computed)(()=>o(a.parentNode)),connectedEdges:(0,s.computed)(()=>ua([a],i.value))}}function ig(){return{doubleClick:le(),click:le(),mouseEnter:le(),mouseMove:le(),mouseLeave:le(),contextMenu:le(),dragStart:le(),drag:le(),dragStop:le()}}function rg(t,e){const n=ig();return n.doubleClick.on(o=>{var i,r;e.nodeDoubleClick(o),(r=(i=t.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;e.nodeClick(o),(r=(i=t.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;e.nodeMouseEnter(o),(r=(i=t.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;e.nodeMouseMove(o),(r=(i=t.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;e.nodeMouseLeave(o),(r=(i=t.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;e.nodeContextMenu(o),(r=(i=t.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;e.nodeDragStart(o),(r=(i=t.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;e.nodeDrag(o),(r=(i=t.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;e.nodeDragStop(o),(r=(i=t.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function Va(){const{getSelectedNodes:t,nodeExtent:e,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:a,emits:l}=be();return(d,c=!1)=>{const u=r.value?i.value[0]:5,f=r.value?i.value[1]:5,h=c?4:1,p=d.x*u*h,g=d.y*f*h,m=[];for(const w of t.value)if(w.draggable||a&&typeof w.draggable>"u"){const{position:I}=ji(w,{x:w.computedPosition.x+p,y:w.computedPosition.y+g},l.error,e.value,w.parentNode?o(w.parentNode):void 0);m.push({id:w.id,position:I,from:w.position,distance:{x:d.x,y:d.y},dimensions:w.dimensions})}n(m,!0,!1)}}var Io=.1,sg=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2;function St(){return Pn("Viewport not initialized yet."),Promise.resolve(!1)}var ag={zoomIn:St,zoomOut:St,zoomTo:St,fitView:St,setCenter:St,fitBounds:St,project:t=>t,screenToFlowCoordinate:t=>t,flowToScreenCoordinate:t=>t,setViewport:St,setTransform:St,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function lg(t){function e(o,i){return new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?En:fo).scaleBy(Zi(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(l=>{var d;const{x:c,y:u}=oa({x:-o,y:-i},t.translateExtent),f=Kt.translate(-c,-u).scale(r);t.d3Selection&&t.d3Zoom?(d=t.d3Zoom)==null||d.interpolate(a?.interpolate==="linear"?En:fo).transform(Zi(t.d3Selection,a?.duration,a?.ease,()=>{l(!0)}),f):l(!1)})}return(0,s.computed)(()=>t.d3Zoom&&t.d3Selection&&t.dimensions.width&&t.dimensions.height?{viewportInitialized:!0,zoomIn:o=>e(1.2,o),zoomOut:o=>e(1/1.2,o),zoomTo:(o,i)=>new Promise(r=>{t.d3Selection&&t.d3Zoom?t.d3Zoom.interpolate(i?.interpolate==="linear"?En:fo).scaleTo(Zi(t.d3Selection,i?.duration,i?.ease,()=>{r(!0)}),o):r(!1)}),setViewport:(o,i)=>n(o.x,o.y,o.zoom,i),setTransform:(o,i)=>n(o.x,o.y,o.zoom,i),getViewport:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),getTransform:()=>({x:t.viewport.x,y:t.viewport.y,zoom:t.viewport.zoom}),fitView:(o={padding:Io,includeHiddenNodes:!1,duration:0})=>{var i,r;const a=[];for(const u of t.nodes)u.dimensions.width&&u.dimensions.height&&(o?.includeHiddenNodes||!u.hidden)&&(!((i=o.nodes)!=null&&i.length)||(r=o.nodes)!=null&&r.length&&o.nodes.includes(u.id))&&a.push(u);if(!a.length)return Promise.resolve(!1);const{x:l,y:d,zoom:c}=fa(ca(a),t.dimensions.width,t.dimensions.height,o.minZoom??t.minZoom,o.maxZoom??t.maxZoom,o.padding??Io);return n(l,d,c,o)},setCenter:(o,i,r)=>{const a=typeof r?.zoom<"u"?r.zoom:t.maxZoom;return n(t.dimensions.width/2-o*a,t.dimensions.height/2-i*a,a,r)},fitBounds:(o,i={padding:Io})=>{const{x:r,y:a,zoom:l}=fa(o,t.dimensions.width,t.dimensions.height,t.minZoom,t.maxZoom,i.padding??Io);return n(r,a,l,i)},project:o=>zn(o,t.viewport,t.snapToGrid,t.snapGrid),screenToFlowCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:r}=t.vueFlowRef.getBoundingClientRect();return zn({x:o.x-i,y:o.y-r},t.viewport,t.snapToGrid,t.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:o=>{if(t.vueFlowRef){const{x:i,y:r}=t.vueFlowRef.getBoundingClientRect();return Bn({x:o.x+i,y:o.y+r},t.viewport)}return{x:0,y:0}}}:ag)}function Zi(t,e=0,n=sg,o=()=>{}){const i=typeof e=="number"&&e>0;return i||o(),i?t.transition().duration(e).ease(n).on("end",o):t}function cg(t,e,n){const o=(0,s.effectScope)(!0);return o.run(()=>{const i=()=>{o.run(()=>{let m,w,I=!!(n.nodes.value.length||n.edges.value.length);m=Wt([t.modelValue,()=>{var y,v;return(v=(y=t.modelValue)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setElements(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([y,v])=>{var C;(C=t.modelValue)!=null&&C.value&&Array.isArray(t.modelValue.value)&&(m?.pause(),t.modelValue.value=[...y,...v],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},r=()=>{o.run(()=>{let m,w,I=!!n.nodes.value.length;m=Wt([t.nodes,()=>{var y,v;return(v=(y=t.nodes)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setNodes(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.nodes,()=>n.nodes.value.length],([y])=>{var v;(v=t.nodes)!=null&&v.value&&Array.isArray(t.nodes.value)&&(m?.pause(),t.nodes.value=[...y],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},a=()=>{o.run(()=>{let m,w,I=!!n.edges.value.length;m=Wt([t.edges,()=>{var y,v;return(v=(y=t.edges)==null?void 0:y.value)==null?void 0:v.length}],([y])=>{y&&Array.isArray(y)&&(w?.pause(),n.setEdges(y),!w&&!I&&y.length?I=!0:w?.resume())}),w=Wt([n.edges,()=>n.edges.value.length],([y])=>{var v;(v=t.edges)!=null&&v.value&&Array.isArray(t.edges.value)&&(m?.pause(),t.edges.value=[...y],(0,s.nextTick)(()=>{m?.resume()}))},{immediate:I}),(0,s.onScopeDispose)(()=>{m?.stop(),w?.stop()})})},l=()=>{o.run(()=>{(0,s.watch)(()=>e.maxZoom,()=>{e.maxZoom&&Ne(e.maxZoom)&&n.setMaxZoom(e.maxZoom)},{immediate:!0})})},d=()=>{o.run(()=>{(0,s.watch)(()=>e.minZoom,()=>{e.minZoom&&Ne(e.minZoom)&&n.setMinZoom(e.minZoom)},{immediate:!0})})},c=()=>{o.run(()=>{(0,s.watch)(()=>e.translateExtent,()=>{e.translateExtent&&Ne(e.translateExtent)&&n.setTranslateExtent(e.translateExtent)},{immediate:!0})})},u=()=>{o.run(()=>{(0,s.watch)(()=>e.nodeExtent,()=>{e.nodeExtent&&Ne(e.nodeExtent)&&n.setNodeExtent(e.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{(0,s.watch)(()=>e.applyDefault,()=>{Ne(e.applyDefault)&&(n.applyDefault.value=e.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const m=async w=>{let I=w;typeof e.autoConnect=="function"&&(I=await e.autoConnect(w)),I!==!1&&n.addEdges([I])};(0,s.watch)(()=>e.autoConnect,()=>{Ne(e.autoConnect)&&(n.autoConnect.value=e.autoConnect)},{immediate:!0}),(0,s.watch)(n.autoConnect,(w,I,y)=>{w?n.onConnect(m):n.hooks.value.connect.off(m),y(()=>{n.hooks.value.connect.off(m)})},{immediate:!0})})},p=()=>{const m=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const w of Object.keys(e)){const I=w;if(!m.includes(I)){const y=(0,s.toRef)(()=>e[I]),v=n[I];(0,s.isRef)(v)&&o.run(()=>{(0,s.watch)(y,C=>{Ne(C)&&(v.value=C)},{immediate:!0})})}}};i(),r(),a(),d(),l(),c(),u(),f(),h(),p()}),()=>o.stop()}function dg(){return{edgesChange:le(),nodesChange:le(),nodeDoubleClick:le(),nodeClick:le(),nodeMouseEnter:le(),nodeMouseMove:le(),nodeMouseLeave:le(),nodeContextMenu:le(),nodeDragStart:le(),nodeDrag:le(),nodeDragStop:le(),nodesInitialized:le(),miniMapNodeClick:le(),miniMapNodeDoubleClick:le(),miniMapNodeMouseEnter:le(),miniMapNodeMouseMove:le(),miniMapNodeMouseLeave:le(),connect:le(),connectStart:le(),connectEnd:le(),clickConnectStart:le(),clickConnectEnd:le(),paneReady:le(),init:le(),move:le(),moveStart:le(),moveEnd:le(),selectionDragStart:le(),selectionDrag:le(),selectionDragStop:le(),selectionContextMenu:le(),selectionStart:le(),selectionEnd:le(),viewportChangeStart:le(),viewportChange:le(),viewportChangeEnd:le(),paneScroll:le(),paneClick:le(),paneContextMenu:le(),paneMouseEnter:le(),paneMouseMove:le(),paneMouseLeave:le(),edgeContextMenu:le(),edgeMouseEnter:le(),edgeMouseMove:le(),edgeMouseLeave:le(),edgeDoubleClick:le(),edgeClick:le(),edgeUpdateStart:le(),edgeUpdate:le(),edgeUpdateEnd:le(),updateNodeInternals:le(),error:le(t=>Pn(t.message))}}function ug(t,e){const n=(0,s.getCurrentInstance)();(0,s.onBeforeMount)(()=>{for(const[i,r]of Object.entries(e.value)){const a=l=>{t(i,l)};r.setEmitter(a),vn(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),vn(r.removeHasEmitListeners)}});function o(i){var r;const a=fg(i);return!!((r=n?.vnode.props)!=null&&r[a])}}function fg(t){const[e,...n]=t.split(":");return`on${e.replace(/(?:^|-)(\w)/g,(o,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function La(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Vi.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Tn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Ot.Bezier,style:{}},connectionMode:gt.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:NaN,y:NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ko()?"Meta":"Control",zoomActivationKeyCode:ko()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:dg(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}var hg=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function pg(t,e,n){const o=lg(t),i=R=>{const E=R??[];t.hooks.updateNodeInternals.trigger(E)},r=R=>Dp(R,t.nodes,t.edges),a=R=>Np(R,t.nodes,t.edges),l=R=>ua(R,t.edges),d=({id:R,type:E,nodeId:k})=>{var A;const N=R?`-${E}-${R}`:`-${E}`;return Array.from(((A=t.connectionLookup.get(`${k}${N}`))==null?void 0:A.values())??[])},c=R=>{if(R)return e.value.get(R)},u=R=>{if(R)return n.value.get(R)},f=(R,E,k)=>{var A,N;const Q=[];for(const K of R){const re={id:K.id,type:"position",dragging:k,from:K.from};if(E&&(re.position=K.position,K.parentNode)){const ne=c(K.parentNode);re.position={x:re.position.x-(((A=ne?.computedPosition)==null?void 0:A.x)??0),y:re.position.y-(((N=ne?.computedPosition)==null?void 0:N.y)??0)}}Q.push(re)}Q?.length&&t.hooks.nodesChange.trigger(Q)},h=R=>{if(!t.vueFlowRef)return;const E=t.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!E)return;const k=window.getComputedStyle(E),{m22:A}=new window.DOMMatrixReadOnly(k.transform),N=[];for(const Q of R){const K=Q,re=c(K.id);if(re){const ne=xo(K.nodeElement);if(ne.width&&ne.height&&(re.dimensions.width!==ne.width||re.dimensions.height!==ne.height||K.forceUpdate)){const de=K.nodeElement.getBoundingClientRect();re.dimensions=ne,re.handleBounds.source=Ia("source",K.nodeElement,de,A,re.id),re.handleBounds.target=Ia("target",K.nodeElement,de,A,re.id),N.push({id:re.id,type:"dimensions",dimensions:ne})}}}!t.fitViewOnInitDone&&t.fitViewOnInit&&o.value.fitView().then(()=>{t.fitViewOnInitDone=!0}),N.length&&t.hooks.nodesChange.trigger(N)},p=(R,E)=>{const k=new Set,A=new Set;for(const K of R)Rt(K)?k.add(K.id):Ct(K)&&A.add(K.id);const N=xt(e.value,k,!0),Q=xt(n.value,A);if(t.multiSelectionActive){for(const K of k)N.push(Et(K,E));for(const K of A)Q.push(Et(K,E))}N.length&&t.hooks.nodesChange.trigger(N),Q.length&&t.hooks.edgesChange.trigger(Q)},g=R=>{if(t.multiSelectionActive){const E=R.map(k=>Et(k.id,!0));t.hooks.nodesChange.trigger(E);return}t.hooks.nodesChange.trigger(xt(e.value,new Set(R.map(E=>E.id)),!0)),t.hooks.edgesChange.trigger(xt(n.value))},m=R=>{if(t.multiSelectionActive){const E=R.map(k=>Et(k.id,!0));t.hooks.edgesChange.trigger(E);return}t.hooks.edgesChange.trigger(xt(n.value,new Set(R.map(E=>E.id)))),t.hooks.nodesChange.trigger(xt(e.value,new Set,!0))},w=R=>{p(R,!0)},I=R=>{const E=(R||t.nodes).map(k=>(k.selected=!1,Et(k.id,!1)));t.hooks.nodesChange.trigger(E)},y=R=>{const E=(R||t.edges).map(k=>(k.selected=!1,Et(k.id,!1)));t.hooks.edgesChange.trigger(E)},v=R=>{if(!R||!R.length)return p([],!1);const E=R.reduce((k,A)=>{const N=Et(A.id,!1);return Rt(A)?k.nodes.push(N):k.edges.push(N),k},{nodes:[],edges:[]});E.nodes.length&&t.hooks.nodesChange.trigger(E.nodes),E.edges.length&&t.hooks.edgesChange.trigger(E.edges)},C=R=>{var E;(E=t.d3Zoom)==null||E.scaleExtent([R,t.maxZoom]),t.minZoom=R},$=R=>{var E;(E=t.d3Zoom)==null||E.scaleExtent([t.minZoom,R]),t.maxZoom=R},z=R=>{var E;(E=t.d3Zoom)==null||E.translateExtent(R),t.translateExtent=R},W=R=>{t.nodeExtent=R,i()},j=R=>{var E;(E=t.d3Zoom)==null||E.clickDistance(R)},D=R=>{t.nodesDraggable=R,t.nodesConnectable=R,t.elementsSelectable=R},O=R=>{const E=R instanceof Function?R(t.nodes):R;!t.initialized&&!E.length||(t.nodes=Ma(E,c,t.hooks.error.trigger))},H=R=>{const E=R instanceof Function?R(t.edges):R;if(!t.initialized&&!E.length)return;const k=Ki(E,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);qi(t.connectionLookup,n.value,k),t.edges=k},S=R=>{const E=R instanceof Function?R([...t.nodes,...t.edges]):R;!t.initialized&&!E.length||(O(E.filter(Rt)),H(E.filter(Ct)))},Y=R=>{let E=R instanceof Function?R(t.nodes):R;E=Array.isArray(E)?E:[E];const k=Ma(E,c,t.hooks.error.trigger),A=[];for(const N of k)A.push(ya(N));A.length&&t.hooks.nodesChange.trigger(A)},b=R=>{let E=R instanceof Function?R(t.edges):R;E=Array.isArray(E)?E:[E];const k=Ki(E,t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges),A=[];for(const N of k)A.push(ya(N));A.length&&t.hooks.edgesChange.trigger(A)},B=(R,E=!0,k=!1)=>{const A=R instanceof Function?R(t.nodes):R,N=Array.isArray(A)?A:[A],Q=[],K=[];function re(de){const ye=l(de);for(const ve of ye)(!Ne(ve.deletable)||ve.deletable)&&K.push(wa(ve.id,ve.source,ve.target,ve.sourceHandle,ve.targetHandle))}function ne(de){const ye=[];for(const ve of t.nodes)ve.parentNode===de&&ye.push(ve);if(ye.length){for(const ve of ye)Q.push(_a(ve.id));E&&re(ye);for(const ve of ye)ne(ve.id)}}for(const de of N){const ye=typeof de=="string"?c(de):de;ye&&(Ne(ye.deletable)&&!ye.deletable||(Q.push(_a(ye.id)),E&&re([ye]),k&&ne(ye.id)))}K.length&&t.hooks.edgesChange.trigger(K),Q.length&&t.hooks.nodesChange.trigger(Q)},_=R=>{const E=R instanceof Function?R(t.edges):R,k=Array.isArray(E)?E:[E],A=[];for(const N of k){const Q=typeof N=="string"?u(N):N;Q&&(Ne(Q.deletable)&&!Q.deletable||A.push(wa(typeof N=="string"?N:N.id,Q.source,Q.target,Q.sourceHandle,Q.targetHandle)))}t.hooks.edgesChange.trigger(A)},x=(R,E,k=!0)=>{const A=u(R.id);if(!A)return!1;const N=t.edges.indexOf(A),Q=Zp(R,E,A,k,t.hooks.error.trigger);if(Q){const[K]=Ki([Q],t.isValidConnection,c,u,t.hooks.error.trigger,t.defaultEdgeOptions,t.nodes,t.edges);return t.edges=t.edges.map((re,ne)=>ne===N?K:re),qi(t.connectionLookup,n.value,[K]),K}return!1},T=(R,E,k={replace:!1})=>{const A=u(R);if(!A)return;const N=typeof E=="function"?E(A):E;A.data=k.replace?N:{...A.data,...N}},P=R=>va(R,t.nodes),L=R=>{const E=va(R,t.edges);return qi(t.connectionLookup,n.value,E),E},M=(R,E,k={replace:!1})=>{const A=c(R);if(!A)return;const N=typeof E=="function"?E(A):E;k.replace?t.nodes.splice(t.nodes.indexOf(A),1,N):Object.assign(A,N)},V=(R,E,k={replace:!1})=>{const A=c(R);if(!A)return;const N=typeof E=="function"?E(A):E;A.data=k.replace?N:{...A.data,...N}},F=(R,E,k=!1)=>{k?t.connectionClickStartHandle=R:t.connectionStartHandle=R,t.connectionEndHandle=null,t.connectionStatus=null,E&&(t.connectionPosition=E)},G=(R,E=null,k=null)=>{t.connectionStartHandle&&(t.connectionPosition=R,t.connectionEndHandle=E,t.connectionStatus=k)},X=(R,E)=>{t.connectionPosition={x:NaN,y:NaN},t.connectionEndHandle=null,t.connectionStatus=null,E?t.connectionClickStartHandle=null:t.connectionStartHandle=null},J=R=>{const E=Sp(R),k=E?null:Mn(R)?R:c(R.id);return!E&&!k?[null,null,E]:[E?R:Co(k),k,E]},U=(R,E=!0,k=t.nodes)=>{const[A,N,Q]=J(R);if(!A)return[];const K=[];for(const re of k||t.nodes){if(!Q&&(re.id===N.id||!re.computedPosition))continue;const ne=Co(re),de=Eo(ne,A);(E&&de>0||de>=ne.width*ne.height||de>=Number(A.width)*Number(A.height))&&K.push(re)}return K},Z=(R,E,k=!0)=>{const[A]=J(R);if(!A)return!1;const N=Eo(A,E);return k&&N>0||N>=Number(A.width)*Number(A.height)},te=R=>{const{viewport:E,dimensions:k,d3Zoom:A,d3Selection:N,translateExtent:Q}=t;if(!A||!N||!R.x&&!R.y)return!1;const K=Kt.translate(E.x+R.x,E.y+R.y).scale(E.zoom),re=[[0,0],[k.width,k.height]],ne=A.constrain()(K,re,Q),de=t.viewport.x!==ne.x||t.viewport.y!==ne.y||t.viewport.zoom!==ne.k;return A.transform(N,ne),de},oe=R=>{const E=R instanceof Function?R(t):R,k=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ne(E.defaultEdgeOptions)&&(t.defaultEdgeOptions=E.defaultEdgeOptions);const A=E.modelValue||E.nodes||E.edges?[]:void 0;A&&(E.modelValue&&A.push(...E.modelValue),E.nodes&&A.push(...E.nodes),E.edges&&A.push(...E.edges),S(A));const N=()=>{Ne(E.maxZoom)&&$(E.maxZoom),Ne(E.minZoom)&&C(E.minZoom),Ne(E.translateExtent)&&z(E.translateExtent)};for(const Q of Object.keys(E)){const K=Q,re=E[K];![...hg,...k].includes(K)&&Ne(re)&&(t[K]=re)}_i(()=>t.d3Zoom).not.toBeNull().then(N),t.initialized||(t.initialized=!0)};return{updateNodePositions:f,updateNodeDimensions:h,setElements:S,setNodes:O,setEdges:H,addNodes:Y,addEdges:b,removeNodes:B,removeEdges:_,findNode:c,findEdge:u,updateEdge:x,updateEdgeData:T,updateNode:M,updateNodeData:V,applyEdgeChanges:L,applyNodeChanges:P,addSelectedElements:w,addSelectedNodes:g,addSelectedEdges:m,setMinZoom:C,setMaxZoom:$,setTranslateExtent:z,setNodeExtent:W,setPaneClickDistance:j,removeSelectedElements:v,removeSelectedNodes:I,removeSelectedEdges:y,startConnection:F,updateConnection:G,endConnection:X,setInteractive:D,setState:oe,getIntersectingNodes:U,getIncomers:r,getOutgoers:a,getConnectedEdges:l,getHandleConnections:d,isNodeIntersecting:Z,panBy:te,fitView:R=>o.value.fitView(R),zoomIn:R=>o.value.zoomIn(R),zoomOut:R=>o.value.zoomOut(R),zoomTo:(R,E)=>o.value.zoomTo(R,E),setViewport:(R,E)=>o.value.setViewport(R,E),setTransform:(R,E)=>o.value.setTransform(R,E),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(R,E,k)=>o.value.setCenter(R,E,k),fitBounds:(R,E)=>o.value.fitBounds(R,E),project:R=>o.value.project(R),screenToFlowCoordinate:R=>o.value.screenToFlowCoordinate(R),flowToScreenCoordinate:R=>o.value.flowToScreenCoordinate(R),toObject:()=>{const R=[],E=[];for(const k of t.nodes){const{computedPosition:A,handleBounds:N,selected:Q,dimensions:K,isParent:re,resizing:ne,dragging:de,events:ye,...ve}=k;R.push(ve)}for(const k of t.edges){const{selected:A,sourceNode:N,targetNode:Q,events:K,...re}=k;E.push(re)}return JSON.parse(JSON.stringify({nodes:R,edges:E,position:[t.viewport.x,t.viewport.y],zoom:t.viewport.zoom,viewport:t.viewport}))},fromObject:R=>new Promise(E=>{const{nodes:k,edges:A,position:N,zoom:Q,viewport:K}=R;k&&O(k),A&&H(A);const[re,ne]=K?.x&&K?.y?[K.x,K.y]:N??[null,null];if(re&&ne){const de=K?.zoom||Q||t.viewport.zoom;return _i(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:re,y:ne,zoom:de}).then(()=>{E(!0)})})}else E(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const R=La();if(t.edges=[],t.nodes=[],t.d3Zoom&&t.d3Selection){const E=Kt.translate(R.defaultViewport.x??0,R.defaultViewport.y??0).scale($t(R.defaultViewport.zoom??1,R.minZoom,R.maxZoom)),k=t.viewportRef.getBoundingClientRect(),A=[[0,0],[k.width,k.height]],N=t.d3Zoom.constrain()(E,A,R.translateExtent);t.d3Zoom.transform(t.d3Selection,N)}oe(R)},$destroy:()=>{}}}var gg=["data-id","data-handleid","data-nodeid","data-handlepos"],en=(0,s.defineComponent)({name:"Handle",compatConfig:{MODE:3},props:{id:{default:null},type:{},position:{default:()=>ce.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=(0,s.createPropsRestProxy)(t,["position","connectable","connectableStart","connectableEnd","id"]),o=(0,s.toRef)(()=>n.type??"source"),i=(0,s.toRef)(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:l,connectionEndHandle:d,vueFlowRef:c,nodesConnectable:u,noDragClassName:f,noPanClassName:h}=be(),{id:p,node:g,nodeEl:m,connectedEdges:w}=Ha(),I=(0,s.ref)(),y=(0,s.toRef)(()=>typeof t.connectableStart<"u"?t.connectableStart:!0),v=(0,s.toRef)(()=>typeof t.connectableEnd<"u"?t.connectableEnd:!0),C=(0,s.toRef)(()=>{var H,S,Y,b,B,_;return((H=a.value)==null?void 0:H.nodeId)===p&&((S=a.value)==null?void 0:S.id)===t.id&&((Y=a.value)==null?void 0:Y.type)===o.value||((b=d.value)==null?void 0:b.nodeId)===p&&((B=d.value)==null?void 0:B.id)===t.id&&((_=d.value)==null?void 0:_.type)===o.value}),$=(0,s.toRef)(()=>{var H,S,Y;return((H=l.value)==null?void 0:H.nodeId)===p&&((S=l.value)==null?void 0:S.id)===t.id&&((Y=l.value)==null?void 0:Y.type)===o.value}),{handlePointerDown:z,handleClick:W}=Ra({nodeId:p,handleId:t.id,isValidConnection:i,type:o}),j=(0,s.computed)(()=>typeof t.connectable=="string"&&t.connectable==="single"?!w.value.some(H=>{const S=H[`${o.value}Handle`];return H[o.value]!==p?!1:S?S===t.id:!0}):typeof t.connectable=="number"?w.value.filter(H=>{const S=H[`${o.value}Handle`];return H[o.value]!==p?!1:S?S===t.id:!0}).length<t.connectable:typeof t.connectable=="function"?t.connectable(g,w.value):Ne(t.connectable)?t.connectable:u.value);(0,s.onMounted)(()=>{var H;if(!g.dimensions.width||!g.dimensions.height)return;const S=(H=g.handleBounds[o.value])==null?void 0:H.find(P=>P.id===t.id);if(!c.value||S)return;const Y=c.value.querySelector(".vue-flow__transformationpane");if(!m.value||!I.value||!Y||!t.id)return;const b=m.value.getBoundingClientRect(),B=I.value.getBoundingClientRect(),_=window.getComputedStyle(Y),{m22:x}=new window.DOMMatrixReadOnly(_.transform),T={id:t.id,position:t.position,x:(B.left-b.left)/x,y:(B.top-b.top)/x,type:o.value,nodeId:p,...xo(I.value)};g.handleBounds[o.value]=[...g.handleBounds[o.value]??[],T]});function D(H){const S=Wi(H);j.value&&y.value&&(S&&H.button===0||!S)&&z(H)}function O(H){!p||!l.value&&!y.value||j.value&&W(H)}return e({handleClick:W,handlePointerDown:z,onClick:O,onPointerDown:D}),(H,S)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"handle",ref:I,"data-id":`${(0,s.unref)(r)}-${(0,s.unref)(p)}-${t.id}-${o.value}`,"data-handleid":t.id,"data-nodeid":(0,s.unref)(p),"data-handlepos":H.position,class:(0,s.normalizeClass)(["vue-flow__handle",[`vue-flow__handle-${H.position}`,`vue-flow__handle-${t.id}`,(0,s.unref)(f),(0,s.unref)(h),o.value,{connectable:j.value,connecting:$.value,connectablestart:y.value,connectableend:v.value,connectionindicator:j.value&&(y.value&&!C.value||v.value&&C.value)}]]),onMousedown:D,onTouchstartPassive:D,onClick:O},[(0,s.renderSlot)(H.$slots,"default",{id:H.id})],42,gg))}}),Mo=function({sourcePosition:t=ce.Bottom,targetPosition:e=ce.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const l=a.label??n;return[(0,s.h)(en,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof l!="string"&&l?(0,s.h)(l):(0,s.h)(s.Fragment,[l]),(0,s.h)(en,{type:"source",position:t,connectable:o,isValidConnection:r})]};Mo.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Mo.inheritAttrs=!1,Mo.compatConfig={MODE:3};var mg=Mo,Bo=function({targetPosition:t=ce.Top,label:e,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??e;return[(0,s.h)(en,{type:"target",position:t,connectable:n,isValidConnection:o}),typeof r!="string"&&r?(0,s.h)(r):(0,s.h)(s.Fragment,[r])]};Bo.props=["targetPosition","label","isValidTargetPos","connectable","data"],Bo.inheritAttrs=!1,Bo.compatConfig={MODE:3};var vg=Bo,zo=function({sourcePosition:t=ce.Bottom,label:e,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??e;return[typeof r!="string"&&r?(0,s.h)(r):(0,s.h)(s.Fragment,[r]),(0,s.h)(en,{type:"source",position:t,connectable:n,isValidConnection:o})]};zo.props=["sourcePosition","label","isValidSourcePos","connectable","data"],zo.inheritAttrs=!1,zo.compatConfig={MODE:3};var yg=zo,_g=["transform"],wg=["width","height","x","y","rx","ry"],bg=["y"],Cg=(0,s.defineComponent)({name:"EdgeText",compatConfig:{MODE:3},props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(t){const e=(0,s.ref)({x:0,y:0,width:0,height:0}),n=(0,s.ref)(null),o=(0,s.computed)(()=>`translate(${t.x-e.value.width/2} ${t.y-e.value.height/2})`);(0,s.onMounted)(i),(0,s.watch)([()=>t.x,()=>t.y,n,()=>t.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==e.value.width||r.height!==e.value.height)&&(e.value=r)}return(r,a)=>((0,s.openBlock)(),(0,s.createElementBlock)("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?((0,s.openBlock)(),(0,s.createElementBlock)("rect",{key:0,class:"vue-flow__edge-textbg",width:`${e.value.width+2*r.labelBgPadding[0]}px`,height:`${e.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:(0,s.normalizeStyle)(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,wg)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("text",(0,s.mergeProps)(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:e.value.height/2,dy:"0.3em",style:r.labelStyle}),[(0,s.renderSlot)(r.$slots,"default",{},()=>[typeof r.label!="string"?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(r.label),{key:0})):((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createTextVNode)((0,s.toDisplayString)(r.label),1)],64))])],16,bg)],8,_g))}}),Eg=["id","d","marker-end","marker-start"],xg=["d","stroke-width"],On=(0,s.defineComponent)({name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3},props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(t,{expose:e}){const n=(0,s.ref)(null),o=(0,s.ref)(null),i=(0,s.ref)(null),r=(0,s.useAttrs)();return e({pathEl:n,interactionEl:o,labelEl:i}),(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)("path",(0,s.mergeProps)((0,s.unref)(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,Eg),a.interactionWidth?((0,s.openBlock)(),(0,s.createElementBlock)("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,xg)):(0,s.createCommentVNode)("",!0),a.label&&a.labelX&&a.labelY?((0,s.openBlock)(),(0,s.createBlock)(Cg,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):(0,s.createCommentVNode)("",!0)],64))}});function Fa({sourceX:t,sourceY:e,targetX:n,targetY:o}){const i=Math.abs(n-t)/2,r=n<t?n+i:n-i,a=Math.abs(o-e)/2;return[r,o<e?o+a:o-a,i,a]}function Ga({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const d=t*.125+i*.375+a*.375+n*.125,c=e*.125+r*.375+l*.375+o*.125;return[d,c,Math.abs(d-t),Math.abs(c-e)]}function Ao(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function ja({pos:t,x1:e,y1:n,x2:o,y2:i,c:r}){let a,l;switch(t){case ce.Left:a=e-Ao(e-o,r),l=n;break;case ce.Right:a=e+Ao(o-e,r),l=n;break;case ce.Top:a=e,l=n-Ao(n-i,r);break;case ce.Bottom:a=e,l=n+Ao(i-n,r);break}return[a,l]}function Ji(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top,curvature:l=.25}=t,[d,c]=ja({pos:o,x1:e,y1:n,x2:i,y2:r,c:l}),[u,f]=ja({pos:a,x1:i,y1:r,x2:e,y2:n,c:l}),[h,p,g,m]=Ga({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:d,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${n} C${d},${c} ${u},${f} ${i},${r}`,h,p,g,m]}function Wa({pos:t,x1:e,y1:n,x2:o,y2:i}){let r,a;switch(t){case ce.Left:case ce.Right:r=.5*(e+o),a=n;break;case ce.Top:case ce.Bottom:r=e,a=.5*(n+i);break}return[r,a]}function Ya(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top}=t,[l,d]=Wa({pos:o,x1:e,y1:n,x2:i,y2:r}),[c,u]=Wa({pos:a,x1:i,y1:r,x2:e,y2:n}),[f,h,p,g]=Ga({sourceX:e,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:d,targetControlX:c,targetControlY:u});return[`M${e},${n} C${l},${d} ${c},${u} ${i},${r}`,f,h,p,g]}var Ua={[ce.Left]:{x:-1,y:0},[ce.Right]:{x:1,y:0},[ce.Top]:{x:0,y:-1},[ce.Bottom]:{x:0,y:1}};function Sg({source:t,sourcePosition:e=ce.Bottom,target:n}){return e===ce.Left||e===ce.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Xa(t,e){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function kg({source:t,sourcePosition:e=ce.Bottom,target:n,targetPosition:o=ce.Top,center:i,offset:r}){const a=Ua[e],l=Ua[o],d={x:t.x+a.x*r,y:t.y+a.y*r},c={x:n.x+l.x*r,y:n.y+l.y*r},u=Sg({source:d,sourcePosition:e,target:c}),f=u.x!==0?"x":"y",h=u[f];let p,g,m;const w={x:0,y:0},I={x:0,y:0},[y,v,C,$]=Fa({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){g=i.x??y,m=i.y??v;const z=[{x:g,y:d.y},{x:g,y:c.y}],W=[{x:d.x,y:m},{x:c.x,y:m}];a[f]===h?p=f==="x"?z:W:p=f==="x"?W:z}else{const z=[{x:d.x,y:c.y}],W=[{x:c.x,y:d.y}];if(f==="x"?p=a.x===h?W:z:p=a.y===h?z:W,e===o){const O=Math.abs(t[f]-n[f]);if(O<=r){const H=Math.min(r-1,r-O);a[f]===h?w[f]=(d[f]>t[f]?-1:1)*H:I[f]=(c[f]>n[f]?-1:1)*H}}if(e!==o){const O=f==="x"?"y":"x",H=a[f]===l[O],S=d[O]>c[O],Y=d[O]<c[O];(a[f]===1&&(!H&&S||H&&Y)||a[f]!==1&&(!H&&Y||H&&S))&&(p=f==="x"?z:W)}const j={x:d.x+w.x,y:d.y+w.y},D={x:c.x+I.x,y:c.y+I.y};Math.max(Math.abs(j.x-p[0].x),Math.abs(D.x-p[0].x))>=Math.max(Math.abs(j.y-p[0].y),Math.abs(D.y-p[0].y))?(g=(j.x+D.x)/2,m=p[0].y):(g=p[0].x,m=(j.y+D.y)/2)}return[[t,{x:d.x+w.x,y:d.y+w.y},...p,{x:c.x+I.x,y:c.y+I.y},n],g,m,C,$]}function Ng(t,e,n,o){const i=Math.min(Xa(t,e)/2,Xa(e,n)/2,o),{x:r,y:a}=e;if(t.x===r&&r===n.x||t.y===a&&a===n.y)return`L${r} ${a}`;if(t.y===a){const d=t.x<n.x?-1:1,c=t.y<n.y?1:-1;return`L ${r+i*d},${a}Q ${r},${a} ${r},${a+i*c}`}const l=t.x<n.x?1:-1;return`L ${r},${a+i*(t.y<n.y?-1:1)}Q ${r},${a} ${r+i*l},${a}`}function Qi(t){const{sourceX:e,sourceY:n,sourcePosition:o=ce.Bottom,targetX:i,targetY:r,targetPosition:a=ce.Top,borderRadius:l=5,centerX:d,centerY:c,offset:u=20}=t,[f,h,p,g,m]=kg({source:{x:e,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:d,y:c},offset:u});return[f.reduce((w,I,y)=>{let v;return y>0&&y<f.length-1?v=Ng(f[y-1],I,f[y+1],l):v=`${y===0?"M":"L"}${I.x} ${I.y}`,w+=v,w},""),h,p,g,m]}function Dg(t){const{sourceX:e,sourceY:n,targetX:o,targetY:i}=t,[r,a,l,d]=Fa({sourceX:e,sourceY:n,targetX:o,targetY:i});return[`M ${e},${n}L ${o},${i}`,r,a,l,d]}var Tg=(0,s.defineComponent)({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Dg(t);return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),qa=(0,s.defineComponent)({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Qi({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),Ig=(0,s.defineComponent)({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(t,{attrs:e}){return()=>(0,s.h)(qa,{...t,...e,borderRadius:0})}}),Mg=(0,s.defineComponent)({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Ji({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),Bg=(0,s.defineComponent)({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(t,{attrs:e}){return()=>{const[n,o,i]=Ya({...t,sourcePosition:t.sourcePosition??ce.Bottom,targetPosition:t.targetPosition??ce.Top});return(0,s.h)(On,{path:n,labelX:o,labelY:i,...e,...t})}}}),zg={input:yg,default:mg,output:vg},Ag={default:Mg,straight:Tg,step:Ig,smoothstep:qa,simplebezier:Bg};function Pg(t,e,n){const o=(0,s.computed)(()=>g=>e.value.get(g)),i=(0,s.computed)(()=>g=>n.value.get(g)),r=(0,s.computed)(()=>{const g={...Ag,...t.edgeTypes},m=Object.keys(g);for(const w of t.edges)w.type&&!m.includes(w.type)&&(g[w.type]=w.type);return g}),a=(0,s.computed)(()=>{const g={...zg,...t.nodeTypes},m=Object.keys(g);for(const w of t.nodes)w.type&&!m.includes(w.type)&&(g[w.type]=w.type);return g}),l=(0,s.computed)(()=>t.onlyRenderVisibleElements?da(t.nodes,{x:0,y:0,width:t.dimensions.width,height:t.dimensions.height},t.viewport,!0):t.nodes),d=(0,s.computed)(()=>{if(t.onlyRenderVisibleElements){const g=[];for(const m of t.edges){const w=e.value.get(m.source),I=e.value.get(m.target);Hp({sourcePos:w.computedPosition||{x:0,y:0},targetPos:I.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:I.dimensions.width,targetHeight:I.dimensions.height,width:t.dimensions.width,height:t.dimensions.height,viewport:t.viewport})&&g.push(m)}return g}return t.edges}),c=(0,s.computed)(()=>[...l.value,...d.value]),u=(0,s.computed)(()=>{const g=[];for(const m of t.nodes)m.selected&&g.push(m);return g}),f=(0,s.computed)(()=>{const g=[];for(const m of t.edges)m.selected&&g.push(m);return g}),h=(0,s.computed)(()=>[...u.value,...f.value]),p=(0,s.computed)(()=>{const g=[];for(const m of t.nodes)m.dimensions.width&&m.dimensions.height&&m.handleBounds!==void 0&&g.push(m);return g});return{getNode:o,getEdge:i,getElements:c,getEdgeTypes:r,getNodeTypes:a,getEdges:d,getNodes:l,getSelectedElements:h,getSelectedNodes:u,getSelectedEdges:f,getNodesInitialized:p,areNodesInitialized:(0,s.computed)(()=>l.value.length>0&&p.value.length===l.value.length)}}var Og=class dn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var e;const n=(e=(0,s.getCurrentInstance)())==null?void 0:e.appContext.app;return dn.instance=n?.config.globalProperties.$vueFlowStorage??dn.instance??new dn,n&&(n.config.globalProperties.$vueFlowStorage=dn.instance),dn.instance}set(e,n){return this.flows.set(e,n)}get(e){return this.flows.get(e)}remove(e){return this.flows.delete(e)}create(e,n){const o=(0,s.reactive)(La()),i={};for(const[f,h]of Object.entries(o.hooks)){const p=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;i[p]=h.on}const r={};for(const[f,h]of Object.entries(o.hooks))r[f]=h.trigger;const a=(0,s.computed)(()=>{const f=new Map;for(const h of o.nodes)f.set(h.id,h);return f}),l=(0,s.computed)(()=>{const f=new Map;for(const h of o.edges)f.set(h.id,h);return f}),d=Pg(o,a,l),c=pg(o,a,l);c.setState({...o,...n});const u={...i,...d,...c,...zd(o),nodeLookup:a,edgeLookup:l,emits:r,id:e,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(e)}};return this.set(e,u),u}getId(){return`vue-flow-${this.currentId++}`}};function be(t){const e=Og.getInstance(),n=(0,s.getCurrentScope)(),o=typeof t=="object",i=o?t:{id:t},r=i.id,a=r??n?.vueFlowId;let l;if(n){const d=(0,s.inject)(Aa,null);typeof d<"u"&&d!==null&&(!a||d.id===a)&&(l=d)}if(l||a&&(l=e.get(a)),!l||a&&l.id!==a){const d=r??e.getId(),c=e.create(d,i);l=c,(n??(0,s.effectScope)(!0)).run(()=>{(0,s.watch)(c.applyDefault,(u,f,h)=>{const p=m=>{c.applyNodeChanges(m)},g=m=>{c.applyEdgeChanges(m)};u?(c.onNodesChange(p),c.onEdgesChange(g)):(c.hooks.value.nodesChange.off(p),c.hooks.value.edgesChange.off(g)),h(()=>{c.hooks.value.nodesChange.off(p),c.hooks.value.edgesChange.off(g)})},{immediate:!0}),vn(()=>{if(l){const u=e.get(l.id);u?u.$destroy():Pn(`No store instance found for id ${l.id} in storage.`)}})})}else o&&l.setState(i);if(n&&((0,s.provide)(Aa,l),n.vueFlowId=l.id),o){const d=(0,s.getCurrentInstance)();d?.type.name!=="VueFlow"&&l.emits.error(new Ie(ke.USEVUEFLOW_OPTIONS))}return l}function $g(t){const{emits:e,dimensions:n}=be();let o;(0,s.onMounted)(()=>{const i=()=>{var r,a;if(!t.value||!(((a=(r=t.value).checkVisibility)==null?void 0:a.call(r))??!0))return;const l=xo(t.value);(l.width===0||l.height===0)&&e.error(new Ie(ke.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:l.width||500,height:l.height||500}};i(),window.addEventListener("resize",i),t.value&&(o=new ResizeObserver(()=>i()),o.observe(t.value)),(0,s.onBeforeUnmount)(()=>{window.removeEventListener("resize",i),o&&t.value&&o.unobserve(t.value)})})}var Rg=(0,s.defineComponent)({name:"UserSelection",compatConfig:{MODE:3},props:{userSelectionRect:{}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"vue-flow__selection vue-flow__container",style:(0,s.normalizeStyle)({width:`${e.userSelectionRect.width}px`,height:`${e.userSelectionRect.height}px`,transform:`translate(${e.userSelectionRect.x}px, ${e.userSelectionRect.y}px)`})},null,4))}}),Hg=["tabIndex"],Vg=(0,s.defineComponent)({name:"NodesSelection",compatConfig:{MODE:3},setup(t){const{emits:e,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=be(),l=Va(),d=(0,s.ref)(null),c=$a({el:d,onStart(g){e.selectionDragStart(g),e.nodeDragStart(g)},onDrag(g){e.selectionDrag(g),e.nodeDrag(g)},onStop(g){e.selectionDragStop(g),e.nodeDragStop(g)}});(0,s.onMounted)(()=>{var g;r.value||(g=d.value)==null||g.focus({preventScroll:!0})});const u=(0,s.computed)(()=>ca(o.value)),f=(0,s.computed)(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function h(g){e.selectionContextMenu({event:g,nodes:o.value})}function p(g){r.value||Zt[g.key]&&(g.preventDefault(),l({x:Zt[g.key].x,y:Zt[g.key].y},g.shiftKey))}return(g,m)=>!(0,s.unref)(a)&&u.value.width&&u.value.height?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:(0,s.normalizeClass)(["vue-flow__nodesselection vue-flow__container",(0,s.unref)(i)]),style:(0,s.normalizeStyle)({transform:`translate(${(0,s.unref)(n).x}px,${(0,s.unref)(n).y}px) scale(${(0,s.unref)(n).zoom})`})},[(0,s.createElementVNode)("div",{ref_key:"el",ref:d,class:(0,s.normalizeClass)([{dragging:(0,s.unref)(c)},"vue-flow__nodesselection-rect"]),style:(0,s.normalizeStyle)(f.value),tabIndex:(0,s.unref)(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,Hg)],6)):(0,s.createCommentVNode)("",!0)}});function Lg(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}var Fg=(0,s.defineComponent)({name:"Pane",compatConfig:{MODE:3},props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(t){const{vueFlowRef:e,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:l,elementsSelectable:d,nodesSelectionActive:c,getSelectedEdges:u,getSelectedNodes:f,removeNodes:h,removeEdges:p,selectionMode:g,deleteKeyCode:m,multiSelectionKeyCode:w,multiSelectionActive:I,edgeLookup:y,nodeLookup:v,connectionLookup:C,defaultEdgeOptions:$,connectionStartHandle:z,panOnDrag:W}=be(),j=(0,s.shallowRef)(null),D=(0,s.shallowRef)(new Set),O=(0,s.shallowRef)(new Set),H=(0,s.shallowRef)(null),S=(0,s.toRef)(()=>d.value&&(t.isSelecting||r.value)),Y=(0,s.toRef)(()=>z.value!==null);let b=!1,B=!1;const _=In(m,{actInsideInputWithModifier:!1}),x=In(w);(0,s.watch)(_,X=>{X&&(h(f.value),p(u.value),c.value=!1)}),(0,s.watch)(x,X=>{I.value=X});function T(X,J){return U=>{U.target===J&&X?.(U)}}function P(X){if(b||Y.value){b=!1;return}i.paneClick(X),a(),c.value=!1}function L(X){var J;if(Array.isArray(W.value)&&((J=W.value)!=null&&J.includes(2))){X.preventDefault();return}i.paneContextMenu(X)}function M(X){i.paneScroll(X)}function V(X){var J,U,Z;if(H.value=((J=e.value)==null?void 0:J.getBoundingClientRect())??null,!d.value||!t.isSelecting||X.button!==0||X.target!==j.value||!H.value)return;(Z=(U=X.target)==null?void 0:U.setPointerCapture)==null||Z.call(U,X.pointerId);const{x:te,y:oe}=Lg(X,H.value);B=!0,b=!1,a(),l.value={width:0,height:0,startX:te,startY:oe,x:te,y:oe},i.selectionStart(X)}function F(X){var J;if(!H.value||!l.value)return;b=!0;const{x:U,y:Z}=at(X,H.value),{startX:te=0,startY:oe=0}=l.value,ae={startX:te,startY:oe,x:U<te?U:te,y:Z<oe?Z:oe,width:Math.abs(U-te),height:Math.abs(Z-oe)},ee=D.value,ie=O.value;D.value=new Set(da(n.value,ae,o.value,g.value===Vi.Partial,!0).map(E=>E.id)),O.value=new Set;const R=((J=$.value)==null?void 0:J.selectable)??!0;for(const E of D.value){const k=C.value.get(E);if(k)for(const{edgeId:A}of k.values()){const N=y.value.get(A);N&&(N.selectable??R)&&O.value.add(A)}}if(!za(ee,D.value)){const E=xt(v.value,D.value,!0);i.nodesChange(E)}if(!za(ie,O.value)){const E=xt(y.value,O.value);i.edgesChange(E)}l.value=ae,r.value=!0,c.value=!1}function G(X){var J;X.button!==0||!B||((J=X.target)==null||J.releasePointerCapture(X.pointerId),!r.value&&l.value&&X.target===j.value&&P(X),r.value=!1,l.value=null,c.value=D.value.size>0,i.selectionEnd(X),t.selectionKeyPressed&&(b=!1),B=!1)}return(X,J)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"container",ref:j,class:(0,s.normalizeClass)(["vue-flow__pane vue-flow__container",{selection:X.isSelecting}]),onClick:J[0]||(J[0]=U=>S.value?void 0:T(P,j.value)(U)),onContextmenu:J[1]||(J[1]=U=>T(L,j.value)(U)),onWheelPassive:J[2]||(J[2]=U=>T(M,j.value)(U)),onPointerenter:J[3]||(J[3]=U=>S.value?void 0:(0,s.unref)(i).paneMouseEnter(U)),onPointerdown:J[4]||(J[4]=U=>S.value?V(U):(0,s.unref)(i).paneMouseMove(U)),onPointermove:J[5]||(J[5]=U=>S.value?F(U):(0,s.unref)(i).paneMouseMove(U)),onPointerup:J[6]||(J[6]=U=>S.value?G(U):void 0),onPointerleave:J[7]||(J[7]=U=>(0,s.unref)(i).paneMouseLeave(U))},[(0,s.renderSlot)(X.$slots,"default"),(0,s.unref)(r)&&(0,s.unref)(l)?((0,s.openBlock)(),(0,s.createBlock)(Rg,{key:0,"user-selection-rect":(0,s.unref)(l)},null,8,["user-selection-rect"])):(0,s.createCommentVNode)("",!0),(0,s.unref)(c)&&(0,s.unref)(f).length?((0,s.openBlock)(),(0,s.createBlock)(Vg,{key:1})):(0,s.createCommentVNode)("",!0)],34))}}),Gg=(0,s.defineComponent)({name:"Transform",compatConfig:{MODE:3},setup(t){const{viewport:e,fitViewOnInit:n,fitViewOnInitDone:o}=be(),i=(0,s.computed)(()=>n.value?!o.value:!1),r=(0,s.computed)(()=>`translate(${e.value.x}px,${e.value.y}px) scale(${e.value.zoom})`);return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"vue-flow__transformationpane vue-flow__container",style:(0,s.normalizeStyle)({transform:r.value,opacity:i.value?0:void 0})},[(0,s.renderSlot)(a.$slots,"default")],4))}}),jg=(0,s.defineComponent)({name:"Viewport",compatConfig:{MODE:3},setup(t){const{minZoom:e,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:l,panOnScroll:d,panOnScrollMode:c,panOnScrollSpeed:u,panOnDrag:f,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:g,preventScrolling:m,noWheelClassName:w,noPanClassName:I,emits:y,connectionStartHandle:v,userSelectionActive:C,paneDragging:$,d3Zoom:z,d3Selection:W,d3ZoomHandler:j,viewport:D,viewportRef:O,paneClickDistance:H}=be();$g(O);const S=(0,s.shallowRef)(!1),Y=(0,s.shallowRef)(!1);let b=null,B=!1,_=0,x={x:0,y:0,zoom:0};const T=In(l),P=In(a),L=In(r),M=(0,s.toRef)(()=>(!P.value||P.value&&a.value===!0)&&(T.value||f.value)),V=(0,s.toRef)(()=>T.value||d.value),F=(0,s.toRef)(()=>a.value===!0&&M.value!==!0),G=(0,s.toRef)(()=>P.value&&a.value!==!0||C.value||F.value),X=(0,s.toRef)(()=>v.value!==null);(0,s.onMounted)(()=>{if(!O.value){Pn("Viewport element is missing");return}const oe=O.value,ae=oe.getBoundingClientRect(),ee=yp().clickDistance(H.value).scaleExtent([e.value,n.value]).translateExtent(i.value),ie=Ze(oe).call(ee),R=ie.on("wheel.zoom"),E=Kt.translate(o.value.x??0,o.value.y??0).scale($t(o.value.zoom??1,e.value,n.value)),k=[[0,0],[ae.width,ae.height]],A=ee.constrain()(E,k,i.value);ee.transform(ie,A),ee.wheelDelta(pa),z.value=ee,W.value=ie,j.value=R,D.value={x:A.x,y:A.y,zoom:A.k},ee.on("start",N=>{var Q;if(!N.sourceEvent)return null;_=N.sourceEvent.button,S.value=!0;const K=Z(N.transform);((Q=N.sourceEvent)==null?void 0:Q.type)==="mousedown"&&($.value=!0),x=K,y.viewportChangeStart(K),y.moveStart({event:N,flowTransform:K})}),ee.on("end",N=>{if(!N.sourceEvent)return null;if(S.value=!1,$.value=!1,J(M.value,_??0)&&!B&&y.paneContextMenu(N.sourceEvent),B=!1,U(x,N.transform)){const Q=Z(N.transform);x=Q,y.viewportChangeEnd(Q),y.moveEnd({event:N,flowTransform:Q})}}),ee.filter(N=>{var Q;const K=L.value||g.value,re=p.value&&N.ctrlKey,ne=N.button,de=N.type==="wheel";if(ne===1&&N.type==="mousedown"&&(te(N,"vue-flow__node")||te(N,"vue-flow__edge")))return!0;if(!M.value&&!K&&!V.value&&!h.value&&!p.value||C.value||X.value&&!de||!h.value&&N.type==="dblclick"||te(N,w.value)&&de||te(N,I.value)&&(!de||V.value&&de&&!L.value)||!p.value&&N.ctrlKey&&de||!K&&!V.value&&!re&&de)return!1;if(!p&&N.type==="touchstart"&&((Q=N.touches)==null?void 0:Q.length)>1)return N.preventDefault(),!1;if(!M.value&&(N.type==="mousedown"||N.type==="touchstart")||F.value&&Array.isArray(f.value)&&f.value.includes(0)&&ne===0||Array.isArray(f.value)&&!f.value.includes(ne)&&(N.type==="mousedown"||N.type==="touchstart"))return!1;const ye=Array.isArray(f.value)&&f.value.includes(ne)||a.value===!0&&Array.isArray(f.value)&&!f.value.includes(0)||!ne||ne<=1;return(!N.ctrlKey||T.value||de)&&ye}),(0,s.watch)([C,M],()=>{C.value&&!S.value?ee.on("zoom",null):C.value||ee.on("zoom",N=>{D.value={x:N.transform.x,y:N.transform.y,zoom:N.transform.k};const Q=Z(N.transform);B=J(M.value,_??0),y.viewportChange(Q),y.move({event:N,flowTransform:Q})})},{immediate:!0}),(0,s.watch)([C,V,c,L,p,m,w],()=>{V.value&&!L.value&&!C.value?ie.on("wheel.zoom",N=>{if(te(N,w.value))return!1;const Q=L.value||g.value,K=p.value&&N.ctrlKey;if(!(!m.value||V.value||Q||K))return!1;N.preventDefault(),N.stopImmediatePropagation();const re=ie.property("__zoom").k||1,ne=ko();if(!T.value&&N.ctrlKey&&p.value&&ne){const dt=ot(N),Tt=re*2**pa(N);ee.scaleTo(ie,Tt,dt,N);return}const de=N.deltaMode===1?20:1;let ye=c.value===Tn.Vertical?0:N.deltaX*de,ve=c.value===Tn.Horizontal?0:N.deltaY*de;!ne&&N.shiftKey&&c.value!==Tn.Vertical&&!ye&&ve&&(ye=ve,ve=0),ee.translateBy(ie,-(ye/re)*u.value,-(ve/re)*u.value);const me=Z(ie.property("__zoom"));b&&clearTimeout(b),Y.value?(y.move({event:N,flowTransform:me}),y.viewportChange(me),b=setTimeout(()=>{y.moveEnd({event:N,flowTransform:me}),y.viewportChangeEnd(me),Y.value=!1},150)):(Y.value=!0,y.moveStart({event:N,flowTransform:me}),y.viewportChangeStart(me))},{passive:!1}):typeof R<"u"&&ie.on("wheel.zoom",function(N,Q){const K=!m.value&&N.type==="wheel"&&!N.ctrlKey,re=L.value||g.value,ne=p.value&&N.ctrlKey;if(!re&&!d.value&&!ne&&N.type==="wheel"||K||te(N,w.value))return null;N.preventDefault(),R.call(this,N,Q)},{passive:!1})},{immediate:!0})});function J(oe,ae){return ae===2&&Array.isArray(oe)&&oe.includes(2)}function U(oe,ae){return oe.x!==ae.x&&!Number.isNaN(ae.x)||oe.y!==ae.y&&!Number.isNaN(ae.y)||oe.zoom!==ae.k&&!Number.isNaN(ae.k)}function Z(oe){return{x:oe.x,y:oe.y,zoom:oe.k}}function te(oe,ae){return oe.target.closest(`.${ae}`)}return(oe,ae)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[(0,s.createVNode)(Fg,{"is-selecting":G.value,"selection-key-pressed":(0,s.unref)(P),class:(0,s.normalizeClass)({connecting:X.value,dragging:(0,s.unref)($),draggable:(0,s.unref)(f)===!0||Array.isArray((0,s.unref)(f))&&(0,s.unref)(f).includes(0)})},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(Gg,null,{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(oe.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Wg=["id"],Yg=["id"],Ug=["id"],Xg=(0,s.defineComponent)({name:"A11yDescriptions",compatConfig:{MODE:3},setup(t){const{id:e,disableKeyboardA11y:n,ariaLiveMessage:o}=be();return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)("div",{id:`${(0,s.unref)(ea)}-${(0,s.unref)(e)}`,style:{display:"none"}}," Press enter or space to select a node. "+(0,s.toDisplayString)((0,s.unref)(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Wg),(0,s.createElementVNode)("div",{id:`${(0,s.unref)(ta)}-${(0,s.unref)(e)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Yg),(0,s.unref)(n)?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,id:`${(0,s.unref)(xp)}-${(0,s.unref)(e)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},(0,s.toDisplayString)((0,s.unref)(o)),9,Ug))],64))}});function qg(){const t=be();(0,s.watch)(()=>t.viewportHelper.value.viewportInitialized,e=>{e&&setTimeout(()=>{t.emits.init(t),t.emits.paneReady(t)},1)})}function Kg(t,e,n){return n===ce.Left?t-e:n===ce.Right?t+e:t}function Zg(t,e,n){return n===ce.Top?t-e:n===ce.Bottom?t+e:t}var er=function({radius:t=10,centerX:e=0,centerY:n=0,position:o=ce.Top,type:i}){return(0,s.h)("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Kg(e,t,o),cy:Zg(n,t,o),r:t,stroke:"transparent",fill:"transparent"})};er.props=["radius","centerX","centerY","position","type"],er.compatConfig={MODE:3};var Ka=er,Jg=(0,s.defineComponent)({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(t){const{id:e,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:l,getEdgeTypes:d,removeSelectedEdges:c,findEdge:u,findNode:f,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:g,elementsSelectable:m,edgesUpdatable:w,edgesFocusable:I,hooks:y}=be(),v=(0,s.computed)(()=>u(t.id)),{emit:C,on:$}=tg(v.value,r),z=(0,s.inject)(Do),W=(0,s.getCurrentInstance)(),j=(0,s.ref)(!1),D=(0,s.ref)(!1),O=(0,s.ref)(""),H=(0,s.ref)(null),S=(0,s.ref)("source"),Y=(0,s.ref)(null),b=(0,s.toRef)(()=>typeof v.value.selectable>"u"?m.value:v.value.selectable),B=(0,s.toRef)(()=>typeof v.value.updatable>"u"?w.value:v.value.updatable),_=(0,s.toRef)(()=>typeof v.value.focusable>"u"?I.value:v.value.focusable);(0,s.provide)(Jp,t.id),(0,s.provide)(Qp,Y);const x=(0,s.computed)(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),T=(0,s.computed)(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),P=(0,s.computed)(()=>{const E=v.value.type||"default",k=z?.[`edge-${E}`];if(k)return k;let A=v.value.template??d.value[E];if(typeof A=="string"&&W){const N=Object.keys(W.appContext.components);N&&N.includes(E)&&(A=(0,s.resolveComponent)(E,!1))}return A&&typeof A!="string"?A:(r.error(new Ie(ke.EDGE_TYPE_MISSING,A)),!1)}),{handlePointerDown:L}=Ra({nodeId:O,handleId:H,type:S,isValidConnection:h,edgeUpdaterType:S,onEdgeUpdate:F,onEdgeUpdateEnd:G});return()=>{const E=f(v.value.source),k=f(v.value.target),A="pathOptions"in v.value?v.value.pathOptions:{};if(!E&&!k)return r.error(new Ie(ke.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!E)return r.error(new Ie(ke.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!k)return r.error(new Ie(ke.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||E.hidden||k.hidden)return null;let N;o.value===gt.Strict?N=E.handleBounds.source:N=[...E.handleBounds.source||[],...E.handleBounds.target||[]];const Q=xa(N,v.value.sourceHandle);let K;o.value===gt.Strict?K=k.handleBounds.target:K=[...k.handleBounds.target||[],...k.handleBounds.source||[]];const re=xa(K,v.value.targetHandle),ne=Q?.position||ce.Bottom,de=re?.position||ce.Top,{x:ye,y:ve}=Qt(E,Q,ne),{x:me,y:dt}=Qt(k,re,de);return v.value.sourceX=ye,v.value.sourceY=ve,v.value.targetX=me,v.value.targetY=dt,(0,s.h)("g",{ref:Y,key:t.id,"data-id":t.id,class:["vue-flow__edge",`vue-flow__edge-${P.value===!1?"default":v.value.type||"default"}`,l.value,x.value,{updating:j.value,selected:v.value.selected,animated:v.value.animated,inactive:!b.value&&!y.value.edgeClick.hasListeners()}],tabIndex:_.value?0:void 0,"aria-label":v.value.ariaLabel===null?void 0:v.value.ariaLabel??`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":_.value?`${ta}-${e}`:void 0,"aria-roledescription":"edge",role:_.value?"group":"img",...v.value.domAttributes,onClick:J,onContextmenu:U,onDblclick:Z,onMouseenter:te,onMousemove:oe,onMouseleave:ae,onKeyDown:_.value?R:void 0},[D.value?null:(0,s.h)(P.value===!1?d.value.default:P.value,{id:t.id,sourceNode:E,targetNode:k,source:v.value.source,target:v.value.target,type:v.value.type,updatable:B.value,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...$},style:T.value,markerStart:`url('#${An(v.value.markerStart,e)}')`,markerEnd:`url('#${An(v.value.markerEnd,e)}')`,sourcePosition:ne,targetPosition:de,sourceX:ye,sourceY:ve,targetX:me,targetY:dt,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...A}),[B.value==="source"||B.value===!0?[(0,s.h)("g",{onMousedown:ee,onMouseenter:M,onMouseout:V},(0,s.h)(Ka,{position:ne,centerX:ye,centerY:ve,radius:i.value,type:"source","data-type":"source"}))]:null,B.value==="target"||B.value===!0?[(0,s.h)("g",{onMousedown:ie,onMouseenter:M,onMouseout:V},(0,s.h)(Ka,{position:de,centerX:me,centerY:dt,radius:i.value,type:"target","data-type":"target"}))]:null]])};function M(){j.value=!0}function V(){j.value=!1}function F(E,k){C.update({event:E,edge:v.value,connection:k})}function G(E){C.updateEnd({event:E,edge:v.value}),D.value=!1}function X(E,k){E.button===0&&(D.value=!0,O.value=k?v.value.target:v.value.source,H.value=(k?v.value.targetHandle:v.value.sourceHandle)??null,S.value=k?"target":"source",C.updateStart({event:E,edge:v.value}),L(E))}function J(E){var k;const A={event:E,edge:v.value};b.value&&(a.value=!1,v.value.selected&&p.value?(c([v.value]),(k=Y.value)==null||k.blur()):n([v.value])),C.click(A)}function U(E){C.contextMenu({event:E,edge:v.value})}function Z(E){C.doubleClick({event:E,edge:v.value})}function te(E){C.mouseEnter({event:E,edge:v.value})}function oe(E){C.mouseMove({event:E,edge:v.value})}function ae(E){C.mouseLeave({event:E,edge:v.value})}function ee(E){X(E,!0)}function ie(E){X(E,!1)}function R(E){var k;!g.value&&na.includes(E.key)&&b.value&&(E.key==="Escape"?((k=Y.value)==null||k.blur(),c([u(t.id)])):n([u(t.id)]))}}}),Qg=(0,s.defineComponent)({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var t;const{id:e,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:l,connectionLineOptions:d,connectionStatus:c,viewport:u,findNode:f}=be(),h=(t=(0,s.inject)(Do))==null?void 0:t["connection-line"],p=(0,s.computed)(()=>{var y;return f((y=o.value)==null?void 0:y.nodeId)}),g=(0,s.computed)(()=>{var y;return f((y=i.value)==null?void 0:y.nodeId)??null}),m=(0,s.computed)(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),w=(0,s.computed)(()=>d.value.markerStart?`url(#${An(d.value.markerStart,e)})`:""),I=(0,s.computed)(()=>d.value.markerEnd?`url(#${An(d.value.markerEnd,e)})`:"");return()=>{var y,v,C;if(!p.value||!o.value)return null;const $=o.value.id,z=o.value.type,W=p.value.handleBounds;let j=W?.[z]??[];if(n.value===gt.Loose){const T=W?.[z==="source"?"target":"source"]??[];j=[...j,...T]}if(!j)return null;const D=($?j.find(T=>T.id===$):j[0])??null,O=D?.position??ce.Top,{x:H,y:S}=Qt(p.value,D,O);let Y=null;g.value&&(n.value===gt.Strict?Y=((y=g.value.handleBounds[z==="source"?"target":"source"])==null?void 0:y.find(T=>{var P;return T.id===((P=i.value)==null?void 0:P.id)}))||null:Y=((v=[...g.value.handleBounds.source??[],...g.value.handleBounds.target??[]])==null?void 0:v.find(T=>{var P;return T.id===((P=i.value)==null?void 0:P.id)}))||null);const b=((C=i.value)==null?void 0:C.position)??(O?Ui[O]:null);if(!O||!b)return null;const B=a.value??d.value.type??Ot.Bezier;let _="";const x={sourceX:H,sourceY:S,sourcePosition:O,targetX:m.value.x,targetY:m.value.y,targetPosition:b};return B===Ot.Bezier?[_]=Ji(x):B===Ot.Step?[_]=Qi({...x,borderRadius:0}):B===Ot.SmoothStep?[_]=Qi(x):B===Ot.SimpleBezier?[_]=Ya(x):_=`M${H},${S} ${m.value.x},${m.value.y}`,(0,s.h)("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},(0,s.h)("g",{class:"vue-flow__connection"},h?(0,s.h)(h,{sourceX:H,sourceY:S,sourcePosition:O,targetX:m.value.x,targetY:m.value.y,targetPosition:b,sourceNode:p.value,sourceHandle:D,targetNode:g.value,targetHandle:Y,markerEnd:I.value,markerStart:w.value,connectionStatus:c.value}):(0,s.h)("path",{d:_,class:[d.value.class,c.value,"vue-flow__connection-path"],style:{...l.value,...d.value.style},"marker-end":I.value,"marker-start":w.value})))}}}),em=["id","markerWidth","markerHeight","markerUnits","orient"],tm=(0,s.defineComponent)({name:"MarkerType",compatConfig:{MODE:3},props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("marker",{id:e.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${e.width}`,markerHeight:`${e.height}`,markerUnits:e.markerUnits,orient:e.orient},[e.type===(0,s.unref)(mt).ArrowClosed?((0,s.openBlock)(),(0,s.createElementBlock)("polyline",{key:0,style:(0,s.normalizeStyle)({stroke:e.color,fill:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):(0,s.createCommentVNode)("",!0),e.type===(0,s.unref)(mt).Arrow?((0,s.openBlock)(),(0,s.createElementBlock)("polyline",{key:1,style:(0,s.normalizeStyle)({stroke:e.color,strokeWidth:e.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):(0,s.createCommentVNode)("",!0)],8,em))}}),nm={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},om=(0,s.defineComponent)({name:"MarkerDefinitions",compatConfig:{MODE:3},setup(t){const{id:e,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=be(),r=(0,s.computed)(()=>{const a=new Set,l=[],d=c=>{if(c){const u=An(c,e);a.has(u)||(typeof c=="object"?l.push({...c,id:u,color:c.color||i.value}):l.push({id:u,color:i.value,type:c}),a.add(u))}};for(const c of[o.value.markerEnd,o.value.markerStart])d(c);for(const c of n.value)for(const u of[c.markerStart,c.markerEnd])d(u);return l.sort((c,u)=>c.id.localeCompare(u.id))});return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",nm,[(0,s.createElementVNode)("defs",null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(r.value,d=>((0,s.openBlock)(),(0,s.createBlock)(tm,{id:d.id,key:d.id,type:d.type,color:d.color,width:d.width,height:d.height,markerUnits:d.markerUnits,"stroke-width":d.strokeWidth,orient:d.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),im=(0,s.defineComponent)({name:"Edges",compatConfig:{MODE:3},setup(t){const{findNode:e,getEdges:n,elevateEdgesOnSelect:o}=be();return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)(om),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(n),a=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:(0,s.normalizeStyle)({zIndex:(0,s.unref)(Vp)(a,(0,s.unref)(e),(0,s.unref)(o))})},[(0,s.createVNode)((0,s.unref)(Jg),{id:a.id},null,8,["id"])],4))),128)),(0,s.createVNode)((0,s.unref)(Qg))],64))}}),rm=(0,s.defineComponent)({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(t){const{id:e,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:l,addSelectedNodes:d,updateNodeDimensions:c,onUpdateNodeInternals:u,getNodeTypes:f,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:g,ariaLiveMessage:m,snapToGrid:w,snapGrid:I,nodeDragThreshold:y,nodesDraggable:v,elementsSelectable:C,nodesConnectable:$,nodesFocusable:z,hooks:W}=be(),j=(0,s.ref)(null);(0,s.provide)(Oa,j),(0,s.provide)(Pa,t.id);const D=(0,s.inject)(Do),O=(0,s.getCurrentInstance)(),H=Va(),{node:S,parentNode:Y}=Ha(t.id),{emit:b,on:B}=rg(S,a),_=(0,s.toRef)(()=>typeof S.draggable>"u"?v.value:S.draggable),x=(0,s.toRef)(()=>typeof S.selectable>"u"?C.value:S.selectable),T=(0,s.toRef)(()=>typeof S.connectable>"u"?$.value:S.connectable),P=(0,s.toRef)(()=>typeof S.focusable>"u"?z.value:S.focusable),L=(0,s.computed)(()=>x.value||_.value||W.value.nodeClick.hasListeners()||W.value.nodeDoubleClick.hasListeners()||W.value.nodeMouseEnter.hasListeners()||W.value.nodeMouseMove.hasListeners()||W.value.nodeMouseLeave.hasListeners()),M=(0,s.toRef)(()=>!!S.dimensions.width&&!!S.dimensions.height),V=(0,s.computed)(()=>{const k=S.type||"default",A=D?.[`node-${k}`];if(A)return A;let N=S.template||f.value[k];if(typeof N=="string"&&O){const Q=Object.keys(O.appContext.components);Q&&Q.includes(k)&&(N=(0,s.resolveComponent)(k,!1))}return N&&typeof N!="string"?N:(a.error(new Ie(ke.NODE_TYPE_MISSING,N)),!1)}),F=$a({id:t.id,el:j,disabled:()=>!_.value,selectable:x,dragHandle:()=>S.dragHandle,onStart(k){b.dragStart(k)},onDrag(k){b.drag(k)},onStop(k){b.dragStop(k)},onClick(k){R(k)}}),G=(0,s.computed)(()=>S.class instanceof Function?S.class(S):S.class),X=(0,s.computed)(()=>{const k=(S.style instanceof Function?S.style(S):S.style)||{},A=S.width instanceof Function?S.width(S):S.width,N=S.height instanceof Function?S.height(S):S.height;return!k.width&&A&&(k.width=typeof A=="string"?A:`${A}px`),!k.height&&N&&(k.height=typeof N=="string"?N:`${N}px`),k}),J=(0,s.toRef)(()=>Number(S.zIndex??X.value.zIndex??0));return u(k=>{(k.includes(t.id)||!k.length)&&Z()}),(0,s.onMounted)(()=>{(0,s.watch)(()=>S.hidden,(k=!1,A,N)=>{!k&&j.value&&(t.resizeObserver.observe(j.value),N(()=>{j.value&&t.resizeObserver.unobserve(j.value)}))},{immediate:!0,flush:"post"})}),(0,s.watch)([()=>S.type,()=>S.sourcePosition,()=>S.targetPosition],()=>{(0,s.nextTick)(()=>{c([{id:t.id,nodeElement:j.value,forceUpdate:!0}])})}),(0,s.watch)([()=>S.position.x,()=>S.position.y,()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.x},()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.y},()=>{var k;return(k=Y.value)==null?void 0:k.computedPosition.z},J,()=>S.selected,()=>S.dimensions.height,()=>S.dimensions.width,()=>{var k;return(k=Y.value)==null?void 0:k.dimensions.height},()=>{var k;return(k=Y.value)==null?void 0:k.dimensions.width}],([k,A,N,Q,K,re])=>{const ne={x:k,y:A,z:re+(p.value&&S.selected?1e3:0)};typeof N<"u"&&typeof Q<"u"?S.computedPosition=Ap({x:N,y:Q,z:K},ne):S.computedPosition=ne},{flush:"post",immediate:!0}),(0,s.watch)([()=>S.extent,h],([k,A],[N,Q])=>{(k!==N||A!==Q)&&U()}),S.extent==="parent"||typeof S.extent=="object"&&"range"in S.extent&&S.extent.range==="parent"?_i(()=>M).toBe(!0).then(U):U(),()=>S.hidden?null:(0,s.h)("div",{ref:j,"data-id":S.id,class:["vue-flow__node",`vue-flow__node-${V.value===!1?"default":S.type||"default"}`,{[n.value]:_.value,dragging:F?.value,draggable:_.value,selected:S.selected,selectable:x.value,parent:S.isParent},G.value],style:{visibility:M.value?"visible":"hidden",zIndex:S.computedPosition.z??J.value,transform:`translate(${S.computedPosition.x}px,${S.computedPosition.y}px)`,pointerEvents:L.value?"all":"none",...X.value},tabIndex:P.value?0:void 0,role:P.value?"group":void 0,"aria-describedby":g.value?void 0:`${ea}-${e}`,"aria-label":S.ariaLabel,"aria-roledescription":"node",...S.domAttributes,onMouseenter:te,onMousemove:oe,onMouseleave:ae,onContextmenu:ee,onClick:R,onDblclick:ie,onKeydown:E},[(0,s.h)(V.value===!1?f.value.default:V.value,{id:S.id,type:S.type,data:S.data,events:{...S.events,...B},selected:S.selected,resizing:S.resizing,dragging:F.value,connectable:T.value,position:S.computedPosition,dimensions:S.dimensions,isValidTargetPos:S.isValidTargetPos,isValidSourcePos:S.isValidSourcePos,parent:S.parentNode,parentNodeId:S.parentNode,zIndex:S.computedPosition.z??J.value,targetPosition:S.targetPosition,sourcePosition:S.sourcePosition,label:S.label,dragHandle:S.dragHandle,onUpdateNodeInternals:Z})]);function U(){const k=S.computedPosition,{computedPosition:A,position:N}=ji(S,w.value?No(k,I.value):k,a.error,h.value,Y.value);(S.computedPosition.x!==A.x||S.computedPosition.y!==A.y)&&(S.computedPosition={...S.computedPosition,...A}),(S.position.x!==N.x||S.position.y!==N.y)&&(S.position=N)}function Z(){j.value&&c([{id:t.id,nodeElement:j.value,forceUpdate:!0}])}function te(k){F?.value||b.mouseEnter({event:k,node:S})}function oe(k){F?.value||b.mouseMove({event:k,node:S})}function ae(k){F?.value||b.mouseLeave({event:k,node:S})}function ee(k){return b.contextMenu({event:k,node:S})}function ie(k){return b.doubleClick({event:k,node:S})}function R(k){x.value&&(!o.value||!_.value||y.value>0)&&Xi(S,r.value,d,l,i,!1,j.value),b.click({event:k,node:S})}function E(k){if(!(Li(k)||g.value))if(na.includes(k.key)&&x.value){const A=k.key==="Escape";Xi(S,r.value,d,l,i,A,j.value)}else _.value&&S.selected&&Zt[k.key]&&(k.preventDefault(),m.value=`Moved selected node ${k.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.position.x}, y: ${~~S.position.y}`,H({x:Zt[k.key].x,y:Zt[k.key].y},k.shiftKey))}}}),sm={height:"0",width:"0"},am=(0,s.defineComponent)({name:"EdgeLabelRenderer",compatConfig:{MODE:3},setup(t){const{viewportRef:e}=be(),n=(0,s.toRef)(()=>{var o;return(o=e.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",null,[((0,s.openBlock)(),(0,s.createElementBlock)("foreignObject",sm,[((0,s.openBlock)(),(0,s.createBlock)(s.Teleport,{to:n.value,disabled:!n.value},[(0,s.renderSlot)(o.$slots,"default")],8,["to","disabled"]))]))]))}});function lm(t={includeHiddenNodes:!1}){const{nodes:e}=be();return(0,s.computed)(()=>{if(e.value.length===0)return!1;for(const n of e.value)if((t.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}var cm={class:"vue-flow__nodes vue-flow__container"},dm=(0,s.defineComponent)({name:"Nodes",compatConfig:{MODE:3},setup(t){const{getNodes:e,updateNodeDimensions:n,emits:o}=be(),i=lm(),r=(0,s.ref)();return(0,s.watch)(i,a=>{a&&(0,s.nextTick)(()=>{o.nodesInitialized(e.value)})},{immediate:!0}),(0,s.onMounted)(()=>{r.value=new ResizeObserver(a=>{const l=a.map(d=>({id:d.target.getAttribute("data-id"),nodeElement:d.target,forceUpdate:!0}));(0,s.nextTick)(()=>n(l))})}),(0,s.onBeforeUnmount)(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",cm,[r.value?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)((0,s.unref)(e),(d,c,u,f)=>{const h=[d.id];if(f&&f.key===d.id&&(0,s.isMemoSame)(f,h))return f;const p=((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(rm),{id:d.id,key:d.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},l,0),128)):(0,s.createCommentVNode)("",!0)]))}});function um(){const{emits:t}=be();(0,s.onMounted)(()=>{if(Ta()){const e=document.querySelector(".vue-flow__pane");e&&window.getComputedStyle(e).zIndex!=="1"&&t.error(new Ie(ke.MISSING_STYLES))}})}var fm=(0,s.createElementVNode)("div",{class:"vue-flow__edge-labels"},null,-1),hm=(0,s.defineComponent)({name:"VueFlow",compatConfig:{MODE:3},props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(t,{expose:e,emit:n}){const o=t,i=(0,s.useSlots)(),r=wi(o,"modelValue",n),a=wi(o,"nodes",n),l=wi(o,"edges",n),d=be(o),c=cg({modelValue:r,nodes:a,edges:l},o,d);return ug(n,d.hooks),qg(),um(),(0,s.provide)(Do,i),(0,s.onUnmounted)(c),e(d),(u,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref:(0,s.unref)(d).vueFlowRef,class:"vue-flow"},[(0,s.createVNode)(jg,null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)(im),fm,(0,s.createVNode)(dm),(0,s.renderSlot)(u.$slots,"zoom-pane")]),_:3}),(0,s.renderSlot)(u.$slots,"default"),(0,s.createVNode)(Xg)],512))}}),pm=(0,s.defineComponent)({name:"Panel",compatConfig:{MODE:3},props:{position:{}},setup(t){const e=t,{userSelectionActive:n}=be(),o=(0,s.computed)(()=>`${e.position}`.split("-"));return(i,r)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["vue-flow__panel",o.value]),style:(0,s.normalizeStyle)({pointerEvents:(0,s.unref)(n)?"none":"all"})},[(0,s.renderSlot)(i.$slots,"default")],6))}}),vt=(t=>(t.Lines="lines",t.Dots="dots",t))(vt||{}),gm=function({dimensions:t,size:e,color:n}){return(0,s.h)("path",{stroke:n,"stroke-width":e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})},mm=function({radius:t,color:e}){return(0,s.h)("circle",{cx:t,cy:t,r:t,fill:e})};vt.Lines,vt.Dots;var vm={[vt.Dots]:"#81818a",[vt.Lines]:"#eee"},ym=["id","x","y","width","height","patternTransform"],_m={key:2,height:"100",width:"100"},wm=["fill"],bm=["x","y","fill"],Cm=(0,s.defineComponent)({name:"Background",compatConfig:{MODE:3},props:{id:{},variant:{default:()=>vt.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(t){const{id:e,viewport:n}=be(),o=(0,s.computed)(()=>{const a=n.value.zoom,[l,d]=Array.isArray(t.gap)?t.gap:[t.gap,t.gap],c=[l*a||1,d*a||1],u=t.size*a,[f,h]=Array.isArray(t.offset)?t.offset:[t.offset,t.offset];return{scaledGap:c,offset:[f*a||1+c[0]/2,h*a||1+c[1]/2],size:u}}),i=(0,s.toRef)(()=>`pattern-${e}${t.id?`-${t.id}`:""}`),r=(0,s.toRef)(()=>t.color||t.patternColor||vm[t.variant||vt.Dots]);return(a,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("svg",{class:"vue-flow__background vue-flow__container",style:(0,s.normalizeStyle)({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[(0,s.renderSlot)(a.$slots,"pattern-container",{id:i.value},()=>[(0,s.createElementVNode)("pattern",{id:i.value,x:(0,s.unref)(n).x%o.value.scaledGap[0],y:(0,s.unref)(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[(0,s.renderSlot)(a.$slots,"pattern",{},()=>[a.variant===(0,s.unref)(vt).Lines?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(gm),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===(0,s.unref)(vt).Dots?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(mm),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):(0,s.createCommentVNode)("",!0),a.bgColor?((0,s.openBlock)(),(0,s.createElementBlock)("svg",_m,[(0,s.createElementVNode)("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,wm)])):(0,s.createCommentVNode)("",!0)])],8,ym)]),(0,s.createElementVNode)("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,bm),(0,s.renderSlot)(a.$slots,"default",{id:i.value})],4))}}),Em={name:"ControlButton",compatConfig:{MODE:3}},xm=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Sm={type:"button",class:"vue-flow__controls-button"};function km(t,e,n,o,i,r){return(0,s.openBlock)(),(0,s.createElementBlock)("button",Sm,[(0,s.renderSlot)(t.$slots,"default")])}var Po=xm(Em,[["render",km]]),Nm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Dm=[(0,s.createElementVNode)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function Tm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Nm,Dm)}var Im={render:Tm},Mm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Bm=[(0,s.createElementVNode)("path",{d:"M0 0h32v4.2H0z"},null,-1)];function zm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Mm,Bm)}var Am={render:zm},Pm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Om=[(0,s.createElementVNode)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function $m(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Pm,Om)}var Rm={render:$m},Hm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Vm=[(0,s.createElementVNode)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function Lm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Hm,Vm)}var Fm={render:Lm},Gm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},jm=[(0,s.createElementVNode)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function Wm(t,e){return(0,s.openBlock)(),(0,s.createElementBlock)("svg",Gm,jm)}var Ym={render:Wm},Um=(0,s.defineComponent)({name:"Controls",compatConfig:{MODE:3},props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Js.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(t,{emit:e}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:a,zoomOut:l,fitView:d,viewport:c,minZoom:u,maxZoom:f}=be(),h=(0,s.toRef)(()=>n.value||o.value||i.value),p=(0,s.toRef)(()=>c.value.zoom<=u.value),g=(0,s.toRef)(()=>c.value.zoom>=f.value);function m(){a(),e("zoomIn")}function w(){l(),e("zoomOut")}function I(){d(t.fitViewParams),e("fitView")}function y(){r(!h.value),e("interactionChange",!h.value)}return(v,C)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(pm),{class:"vue-flow__controls",position:v.position},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"top"),v.showZoom?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[(0,s.renderSlot)(v.$slots,"control-zoom-in",{},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-zoomin",disabled:g.value,onClick:m},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-zoom-in",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Im))))])]),_:3},8,["disabled"])]),(0,s.renderSlot)(v.$slots,"control-zoom-out",{},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:w},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-zoom-out",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Am))))])]),_:3},8,["disabled"])])],64)):(0,s.createCommentVNode)("",!0),v.showFitView?(0,s.renderSlot)(v.$slots,"control-fit-view",{key:1},()=>[(0,s.createVNode)(Po,{class:"vue-flow__controls-fitview",onClick:I},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(v.$slots,"icon-fit-view",{},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Rm))))])]),_:3})]):(0,s.createCommentVNode)("",!0),v.showInteractive?(0,s.renderSlot)(v.$slots,"control-interactive",{key:2},()=>[v.showInteractive?((0,s.openBlock)(),(0,s.createBlock)(Po,{key:0,class:"vue-flow__controls-interactive",onClick:y},{default:(0,s.withCtx)(()=>[h.value?(0,s.renderSlot)(v.$slots,"icon-unlock",{key:0},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Ym))))]):(0,s.createCommentVNode)("",!0),h.value?(0,s.createCommentVNode)("",!0):(0,s.renderSlot)(v.$slots,"icon-lock",{key:1},()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)((0,s.unref)(Fm))))])]),_:3})):(0,s.createCommentVNode)("",!0)]):(0,s.createCommentVNode)("",!0),(0,s.renderSlot)(v.$slots,"default")]),_:3},8,["position"]))}}),Xm=["onClick"],qm={class:"d-flow-node-menus-item-name"},Km=(0,s.defineComponent)({name:"DNodeMenus",__name:"nodeMenus",props:{fromNodeId:{},handleId:{}},emits:["addNode"],setup(t,{emit:e}){const n=t,o=e,i=(0,s.inject)("d_flow_design_provide",{}),r=i.getFlowComponents?.()||[],a=l=>{o("addNode",l.type),(0,s.nextTick)(()=>{n.handleId==="line"?i.addNodeByLine?.(l.type,n.fromNodeId||""):i.addNode?.(l.type,n.fromNodeId||"",n.handleId||"")})};return(l,d)=>{const c=(0,s.resolveComponent)("j-icon");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-flow-node-menus",onClick:(0,s.withModifiers)(()=>{},["stop"])},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(r),(u,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:f,class:"d-flow-node-menus-item",onClick:h=>a(u)},[(0,s.createElementVNode)("div",{class:"d-flow-node-menus-item-icon",style:(0,s.normalizeStyle)({backgroundColor:u.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(c,{icon:u.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",qm,(0,s.toDisplayString)(u.name),1)],8,Xm))),128))])}}}),tr=Km,Zm={class:"d-flow-step-name"},Jm={key:0,style:{color:"var(--j-color-text-2)"}},Qm={style:{color:"var(--j-color-text)"}},e0=(0,s.defineComponent)({name:"DStepNode",__name:"stepNode",props:{id:{},data:{}},setup(t){const e=t,{onNodeClick:n,onEdgeClick:o,onMoveStart:i,onConnectStart:r,onNodeDragStart:a,removeNodes:l,getEdges:d,getNodes:c,onNodesChange:u}=be(),f=(0,s.inject)("d_flow_design_provide",{}),h=(0,s.computed)(()=>f.getFlowComponentMap?.value?.[e.data.type]||{}),p=()=>{l(e.id),f.onRemoveNode?.(e.id)},g=(0,s.ref)({});u(Y=>{if(e.data.isInit&&Y.findIndex(b=>b.type==="select"&&b.id===e.id&&b.id==="start"&&b.selected)!==-1){const b=c.value.find(B=>B.id==="start");b&&(b.data.isInit=!1),g.value.s1=!0}});const m=(0,s.ref)(!1),w=Y=>{Y.indexOf("t")!==-1&&!I.value||(m.value=!0,g.value[Y]=!0)},I=(0,s.computed)(()=>d.value.findIndex(Y=>Y.target===e.id)===-1),y=(0,s.ref)(!1),v=()=>{y.value=!0},C=(Y,b)=>{if(d.value.find(_=>_.source===b&&_.target===Y))return!0;const B=d.value.filter(_=>_.target===Y);for(let _=0;_<B.length;_++)if(C(B[_].source,b))return!0;return!1},$=Y=>y.value?(y.value=!1,!1):C(Y.source,Y.target)?!1:Y.source!==Y.target&&Y.sourceHandle!==Y.targetHandle&&Y.sourceHandle.indexOf("s")!==-1&&Y.targetHandle.indexOf("t")!==-1,z=()=>{H(),Object.keys(g.value).forEach(Y=>{g.value[Y]=!1})},W=()=>{z()};n(()=>{console.log("onNodeClick"),m.value?m.value=!1:z()}),o(()=>{z()}),i(()=>{z()}),r(()=>{z()}),a(()=>{z()});const j=(0,s.ref)(),D=(0,s.ref)({top:0,left:0,bottom:0,right:0}),O=(0,s.ref)({getBoundingClientRect:()=>D.value}),H=()=>{j.value?.handleClose()},S=Y=>{const{clientX:b,clientY:B}=Y;D.value=DOMRect.fromRect({x:b,y:B}),Y.preventDefault(),j.value?.handleOpen()};return(Y,b)=>{const B=(0,s.resolveComponent)("el-popover"),_=(0,s.resolveComponent)("el-tooltip"),x=(0,s.resolveComponent)("el-dropdown-item"),T=(0,s.resolveComponent)("el-dropdown-menu"),P=(0,s.resolveComponent)("el-dropdown");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"d-flow-step",onContextmenu:(0,s.withModifiers)(S,["stop"])},[(0,s.createElementVNode)("div",{class:"d-flow-step-icon",style:(0,s.normalizeStyle)({backgroundColor:h.value.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(mn,{icon:h.value.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",Zm,(0,s.toDisplayString)(h.value.name),1),t.data.type!=="start"?((0,s.openBlock)(),(0,s.createBlock)(_,{key:0,placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,s.withCtx)(()=>[I.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",Jm,[...b[4]||(b[4]=[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击",-1),(0,s.createTextVNode)("添加节点 ",-1)])])):(0,s.createCommentVNode)("",!0),b[5]||(b[5]=(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,s.createTextVNode)("连接节点 ")],-1))]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(en),{onClick:b[1]||(b[1]=L=>w("t1")),onMousedown:v,id:"t1",class:(0,s.normalizeClass)(["d-flow-step-target-handle",{"d-flow-step-target-handle-notadd":!I.value}]),type:"target",position:(0,s.unref)(ce).Left,"is-valid-connection":$},{default:(0,s.withCtx)(()=>[I.value?((0,s.openBlock)(),(0,s.createBlock)(B,{key:0,visible:g.value.t1,"onUpdate:visible":b[0]||(b[0]=L=>g.value.t1=L),placement:"left","popper-class":"d-flow-step-popper",trigger:"click","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(mn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"t1","from-node-id":t.id,onAddNode:W},null,8,["from-node-id"])]),_:1},8,["visible"])):(0,s.createCommentVNode)("",!0)]),_:1},8,["class","position"])]),_:1})):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(_,{placement:"top","show-arrow":!1,"popper-class":"d-flow-step-tooltip"},{content:(0,s.withCtx)(()=>[...b[6]||(b[6]=[(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"点击"),(0,s.createTextVNode)("添加节点 ")],-1),(0,s.createElementVNode)("div",{style:{color:"var(--j-color-text-2)"}},[(0,s.createElementVNode)("span",{style:{color:"var(--j-color-text)","font-weight":"bold"}},"拖拽"),(0,s.createTextVNode)("连接节点 ")],-1)])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(en),{onClick:b[3]||(b[3]=L=>w("s1")),onMousedown:v,id:"s1",class:"d-flow-step-source-handle",type:"source",position:(0,s.unref)(ce).Right,"is-valid-connection":$},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(B,{visible:g.value.s1,"onUpdate:visible":b[2]||(b[2]=L=>g.value.s1=L),placement:"right",trigger:"click","popper-class":"d-flow-step-popper","show-arrow":!1,"popper-options":{strategy:"fixed"}},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(mn,{class:"d-flow-step-handle-plus",icon:"mdi:plus-circle"})]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"s1","from-node-id":t.id,onAddNode:W},null,8,["from-node-id"])]),_:1},8,["visible"])]),_:1},8,["position"])]),_:1}),(0,s.createVNode)(P,{ref_key:"dropdownRef",ref:j,"popper-class":"d-flow-step-dropdown","virtual-ref":O.value,"show-arrow":!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,0]}}]},"virtual-triggering":"",trigger:"contextmenu",placement:"bottom-start"},{dropdown:(0,s.withCtx)(()=>[(0,s.createVNode)(T,null,{default:(0,s.withCtx)(()=>[t.data.type!="start"?((0,s.openBlock)(),(0,s.createBlock)(x,{key:0,onClick:p},{default:(0,s.withCtx)(()=>[...b[7]||(b[7]=[(0,s.createTextVNode)("删除",-1)])]),_:1})):(0,s.createCommentVNode)("",!0),h.value.des?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:1,style:(0,s.normalizeStyle)({width:"160px",padding:"4px 16px 0 16px","font-size":"12px","border-top":t.data.type!="start"?"1px solid var(--j-color-border)":void 0,"margin-top":t.data.type!="start"?"4px":void 0})},[b[8]||(b[8]=(0,s.createElementVNode)("div",{style:{"margin-bottom":"4px",color:"var(--j-color-text-2)"}},"关于",-1)),(0,s.createElementVNode)("div",Qm,(0,s.toDisplayString)(h.value.des),1)],4)):(0,s.createCommentVNode)("",!0)]),_:1})]),_:1},8,["virtual-ref"])],32)}}}),t0=e0,n0=(0,s.defineComponent)({name:"DEdgeWithButton",__name:"edgeWithButton",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},markerEnd:{},style:{}},setup(t){const e=t,{onEdgeMouseEnter:n,onEdgeMouseLeave:o,onNodeClick:i,onEdgeClick:r,onMoveStart:a,onConnectStart:l,onNodeDragStart:d}=be(),c=(0,s.computed)(()=>Ji(e)),u=(0,s.ref)(!1),f=(0,s.ref)(!1);n(({edge:w})=>{w.id===e.id&&(u.value=!0)}),o(()=>{u.value=!1});const h=(0,s.ref)(!1),p=()=>{h.value=!1,(0,s.nextTick)(()=>{f.value=!1})},g=()=>{f.value=!0,h.value=!0},m=()=>{p()};return i(()=>{p()}),r(()=>{p()}),a(()=>{p()}),l(()=>{p()}),d(()=>{p()}),(w,I)=>{const y=(0,s.resolveComponent)("j-icon"),v=(0,s.resolveComponent)("el-popover");return(0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)((0,s.unref)(On),{id:t.id,style:(0,s.normalizeStyle)(t.style),path:c.value[0],"marker-end":t.markerEnd},null,8,["id","style","path","marker-end"]),(0,s.createVNode)((0,s.unref)(am),null,{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({pointerEvents:"all",position:"absolute",transform:`translate(-50%, -50%) translate(${c.value[1]}px,${c.value[2]}px)`}),class:"nodrag nopan"},[(0,s.createVNode)(v,{visible:h.value,"show-arrow":!1,placement:"right","popper-class":"d-flow-step-popper"},{reference:(0,s.withCtx)(()=>[(0,s.withDirectives)((0,s.createElementVNode)("div",{onClick:(0,s.withModifiers)(g,["stop"]),class:"d-flow-edge-button"},[(0,s.createVNode)(y,{icon:"mdi:plus-circle"})],512),[[s.vShow,u.value||f.value]])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(tr,{"handle-id":"line","from-node-id":t.id,onAddNode:m},null,8,["from-node-id"])]),_:1},8,["visible"])],4)]),_:1})],64)}}}),o0=n0,i0=(0,s.defineComponent)({name:"DFlow",__name:"flow",props:{nodes:{default:()=>[]},edges:{default:()=>[]}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(hm),{"min-zoom":.2,"max-zoom":4,"default-viewport":{zoom:1},"connection-mode":(0,s.unref)(gt).Strict,nodes:t.nodes,edges:t.edges},{"edge-button":(0,s.withCtx)(o=>[(0,s.createVNode)(o0,{id:o.id,"source-x":o.sourceX,"source-y":o.sourceY,"target-x":o.targetX,"target-y":o.targetY,"source-position":o.sourcePosition,"target-position":o.targetPosition,"marker-end":o.markerEnd,style:(0,s.normalizeStyle)(o.style)},null,8,["id","source-x","source-y","target-x","target-y","source-position","target-position","marker-end","style"])]),"node-step":(0,s.withCtx)(o=>[(0,s.createVNode)(t0,(0,s.normalizeProps)((0,s.guardReactiveProps)(o)),null,16)]),default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(Um),{position:"bottom-left"}),(0,s.createVNode)((0,s.unref)(Cm))]),_:1},8,["connection-mode","nodes","edges"]))}}),r0=i0,s0={class:"d-flow-design"},a0={class:"d-flow-design-canvas"},l0={class:"d-flow-design-right"},c0={class:"d-flow-design-title"},d0={class:"d-flow-design-title-name"},u0={class:"d-flow-design-panel"},f0=(0,s.defineComponent)({name:"DFlowDesign",__name:"flowDesign",props:{components:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["nodeClick","edgeClick","paneClick","connect"],setup(t,{expose:e,emit:n}){const o=t,i=n,{addNodes:r,addEdges:a,removeEdges:l,addSelectedNodes:d,removeSelectedNodes:c,onConnect:u,onNodeClick:f,onPaneClick:h,onEdgeClick:p,getNodes:g,getEdges:m}=be(),w=(0,s.computed)(()=>{const P={};return o.components.forEach(L=>{P[L.type]=L}),P.start={name:"开始",type:"start",icon:"ant-design:play-circle-outlined",des:"执行开始节点"},P}),I={id:"start",type:"step",data:{type:"start",isInit:!1},position:{x:80,y:160}},y=(0,s.ref)([I]),v=(0,s.ref)([]),C=(P,L)=>{if(L.indexOf("t")===-1){const M=m.value.filter(V=>V.source===P.id);if(M.length>0){let V=-1e6,F=0;return M.forEach(G=>{V=Math.max(V,G.targetNode.position.y+G.targetNode.dimensions.height+32),F=G.targetNode.position.x||0}),{x:F,y:V}}return{x:P.position.x+P.dimensions.width+100,y:P.position.y}}return{x:P.position.x-100-P.dimensions.width,y:P.position.y}},$=(P,L,M)=>{const V=g.value.find(G=>G.id===L);if(!V)return;const F={id:Ft(),type:"step",data:{type:P},position:C(V,M)};if(o.flowInit){const G=o.flowInit(F.data.type);G&&Object.keys(G).forEach(X=>{F.data[X]=G[X]})}r(F),M.indexOf("t")===-1?a({id:`${L}-${F.id}`,source:L,target:F.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}):a({id:`${L}-${F.id}`,source:F.id,target:L,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),S(F.id)},z=P=>{const L=g.value.find(M=>M.id===P);L&&(L.position.x+=100+L.dimensions.width,m.value.filter(M=>M.source===P).forEach(M=>{z(M.target)}))},W=(P,L)=>{const M=m.value.find(F=>F.id===L);if(!M)return;const V={id:Ft(),type:"step",data:{type:P},position:{x:M.targetNode.position.x,y:M.targetNode.position.y}};if(o.flowInit){const F=o.flowInit(V.data.type);F&&Object.keys(F).forEach(G=>{V.data[G]=F[G]})}r(V),a({id:`${M.sourceNode.id}-${V.id}`,source:M.sourceNode.id,target:V.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),a({id:`${V.id}-${M.targetNode.id}`,source:V.id,target:M.targetNode.id,sourceHandle:"s1",targetHandle:"t1",type:"button",markerEnd:mt.Arrow}),l(L),z(M.target),S(V.id)};u(P=>{console.log("onConnect",P),P.type="button",P.markerEnd=mt.Arrow,a(P),i("connect",P)});const j=()=>o.components||[],D=(0,s.ref)(),O=(0,s.computed)(()=>D.value?w.value[D.value.data.type]:void 0);f(P=>{D.value?.id!==P.node.id&&(D.value=P.node,B()),i("nodeClick",P.node)}),h(()=>{D.value=void 0,i("paneClick")}),p(P=>{D.value=void 0,i("edgeClick",P.edge)});const H=P=>{D.value?.id===P&&(D.value=void 0)},S=P=>{D.value&&c([D.value]),D.value=g.value.find(L=>L.id===P),D.value&&(B(),setTimeout(()=>{D.value&&d([D.value])},100))},Y=(0,s.ref)(),b={};Object.keys(o.flowComponentConfigs).forEach(P=>{const L={type:"j-collapse",config:{defaultValue:[]},children:[]};o.flowComponentConfigs[P].forEach((M,V)=>{const F=`_collapse${V}`;L.config?.defaultValue.push(F),L.children?.push(M)}),b[P]=[L]});const B=()=>{const P=b[D.value?.data.type||""];P&&Y.value?(Y.value.init&&Y.value.init(P,D.value?.data),o.flowComponentConfigInit&&o.flowComponentConfigInit({configRef:Y,inputParams:o.inputParams,components:g.value,configData:D.value?.data})):Y.value&&Y.value.init&&Y.value.init([])},_=(P,L)=>{D.value&&o.flowComponentConfigChange&&o.flowComponentConfigChange(D.value.data.type,{configRef:Y,component:P,configData:D.value.data,...L,isFlowNode:!0})};return(0,s.provide)("d_flow_design_provide",{getFlowComponents:j,addNode:$,addNodeByLine:W,onRemoveNode:H,getFlowComponentMap:w}),e({getData:()=>{const P=[];return g.value.forEach(L=>{P.push({config:L.data,id:L.id,position:L.position,type:L.type})}),m.value.forEach(L=>{P.push({id:L.id,source:L.source,target:L.target,sourceHandle:L.sourceHandle,targetHandle:L.targetHandle,type:"line",config:{},position:{x:0,y:0}})}),P},setData:P=>{if(!P||P.length===0)I.data.isInit=!0,y.value=[I],S(I.id);else{I.data.isInit=!1;const L=[],M=[];P.forEach(V=>{if(V.type==="line")V.type="button",V.markerEnd=mt.Arrow,M.push(V);else{const F={id:V.id,type:V.type,data:V.config,position:V.position};L.push(F)}}),y.value=L,v.value=M}}}),(P,L)=>{const M=(0,s.resolveComponent)("j-icon"),V=(0,s.resolveComponent)("j-form");return(0,s.openBlock)(),(0,s.createElementBlock)("div",s0,[(0,s.createElementVNode)("div",a0,[(0,s.createVNode)(r0,{nodes:y.value,edges:v.value},null,8,["nodes","edges"])]),(0,s.withDirectives)((0,s.createElementVNode)("div",l0,[(0,s.createElementVNode)("div",c0,[(0,s.createElementVNode)("div",{class:"d-flow-design-title-icon",style:(0,s.normalizeStyle)({backgroundColor:O.value?.iconColor||"var(--j-color-primary)"})},[(0,s.createVNode)(M,{icon:O.value?.icon||"mdi:source-branch"},null,8,["icon"])],4),(0,s.createElementVNode)("div",d0,(0,s.toDisplayString)(O.value?.name||""),1)]),(0,s.createElementVNode)("div",u0,[(0,s.createVNode)(V,{config:{labelPosition:"top"},style:{padding:"0"},ref_key:"configRef",ref:Y,onChange:_},null,512)])],512),[[s.vShow,D.value&&b[D.value.data.type]]])])}}}),h0=f0,Za=Mt(h0),p0={class:"d-input-flow j-block"},g0=(0,s.defineComponent)({name:"DInputFlow",__name:"inputFlow",props:{modelValue:{},type:{},btnText:{default:"事件"},title:{},size:{default:"default"},width:{default:1200},height:{default:800},beforeClose:{},flowComponents:{default:()=>[]},inputParams:{default:()=>({})},flowInit:{},flowComponentConfigInit:{},flowComponentConfigs:{default:()=>({})},flowComponentConfigChange:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=(0,s.ref)(),r=(0,s.computed)({get(){return n.modelValue},set(f){o("update:modelValue",f)}}),a=(0,s.computed)(()=>(n.modelValue?.trim(),n.btnText)),l=f=>{const h=typeof f=="string"?f:void 0;try{i.value?.setData(JSON.parse(h||"[]"))}catch{i.value?.setData([])}},d=async()=>{const f=i.value?.getData();return f?JSON.stringify(f):void 0},c=f=>{if(n.beforeClose){const h=typeof f=="string"?f:void 0;return n.beforeClose(h)}return!0},u=f=>{const h=f.value;o("change",{value:typeof h=="string"?h:void 0})};return(f,h)=>{const p=(0,s.resolveComponent)("d-flow-design"),g=(0,s.resolveComponent)("j-input-button");return(0,s.openBlock)(),(0,s.createBlock)(g,(0,s.mergeProps)(f.$attrs,{type:t.type,"btn-text":a.value,title:t.title,size:t.size,width:t.width,height:t.height,"before-close":c,ok:d,open:l,"destroy-on-close":"",modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),onChange:u}),{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",p0,[(0,s.createVNode)(p,{ref_key:"flowRef",ref:i,components:t.flowComponents,"flow-init":t.flowInit,"flow-component-config-init":t.flowComponentConfigInit,"flow-component-configs":t.flowComponentConfigs,"flow-component-config-change":t.flowComponentConfigChange,"input-params":t.inputParams},null,8,["components","flow-init","flow-component-config-init","flow-component-configs","flow-component-config-change","input-params"])])]),_:1},16,["type","btn-text","title","size","width","height","modelValue"])}}}),m0=g0,Ja=Mt(m0),q=class Ke{static getElements(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(o&&!isNaN(+e[0])){const r=o.getElementById(e);return r?[r]:[]}let i=n.querySelectorAll(e);if(!i.length&&e[0]!=="."&&e[0]!=="#"&&(i=n.querySelectorAll("."+e),i.length||(i=n.querySelectorAll("#"+e)),!i.length)){const r=n.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(i)}return[e]}static getElement(e,n=document){if(typeof e=="string"){const o="getElementById"in n?n:void 0;if(!e.length)return null;if(o&&e[0]==="#")return o.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return n.querySelector(e);if(o&&!isNaN(+e[0]))return o.getElementById(e);let i=n.querySelector(e);return o&&!i&&(i=o.getElementById(e)),i||(i=n.querySelector("."+e)),i}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,n){const o=document.createElement("div");return e.forEach(i=>{i&&o.classList.add(i)}),n?.appendChild(o),o}static shouldSizeToContent(e,n=!1){return e?.grid&&(n?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,n){return!(e.y>=n.y+n.h||e.y+e.h<=n.y||e.x+e.w<=n.x||e.x>=n.x+n.w)}static isTouching(e,n){return Ke.isIntercepted(e,{x:n.x-.5,y:n.y-.5,w:n.w+1,h:n.h+1})}static areaIntercept(e,n){const o=e.x>n.x?e.x:n.x,i=e.x+e.w<n.x+n.w?e.x+e.w:n.x+n.w;if(i<=o)return 0;const r=e.y>n.y?e.y:n.y,a=e.y+e.h<n.y+n.h?e.y+e.h:n.y+n.h;return a<=r?0:(i-o)*(a-r)}static area(e){return e.w*e.h}static sort(e,n=1){return e.sort((i,r)=>{const a=n*((i.y??1e4)-(r.y??1e4));return a===0?n*((i.x??1e4)-(r.x??1e4)):a})}static find(e,n){return n?e.find(o=>o.id===n):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let n,o="px";if(typeof e=="string")if(e==="auto"||e==="")n=0;else{const i=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${e}`);o=i[2]||"px",n=parseFloat(i[1])}else n=e;return{h:n,unit:o}}static defaults(e,...n){return n.forEach(o=>{for(const i in o){if(!o.hasOwnProperty(i))return;e[i]===null||e[i]===void 0?e[i]=o[i]:typeof o[i]=="object"&&typeof e[i]=="object"&&Ke.defaults(e[i],o[i])}}),e}static same(e,n){if(typeof e!="object")return e==n;if(typeof e!=typeof n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const o in e)if(e[o]!==n[o])return!1;return!0}static copyPos(e,n,o=!1){return n.x!==void 0&&(e.x=n.x),n.y!==void 0&&(e.y=n.y),n.w!==void 0&&(e.w=n.w),n.h!==void 0&&(e.h=n.h),o&&(n.minW&&(e.minW=n.minW),n.minH&&(e.minH=n.minH),n.maxW&&(e.maxW=n.maxW),n.maxH&&(e.maxH=n.maxH)),e}static samePos(e,n){return e&&n&&e.x===n.x&&e.y===n.y&&(e.w||1)===(n.w||1)&&(e.h||1)===(n.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,n){if(!(typeof e!="object"||typeof n!="object")&&!(Array.isArray(e)||Array.isArray(n)))for(let o in e){const i=e[o],r=n[o];o[0]==="_"||i===r?delete e[o]:i&&typeof i=="object"&&r!==void 0&&(Ke.removeInternalAndSame(i,r),Object.keys(i).length||delete e[o])}}static removeInternalForSave(e,n=!0){for(let o in e)(o[0]==="_"||e[o]===null||e[o]===void 0)&&delete e[o];delete e.grid,n&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,n){let o=!1;return(...i)=>{o||(o=!0,setTimeout(()=>{e(...i),o=!1},n))}}static removePositioningStyles(e){const n=e.style;n.position&&n.removeProperty("position"),n.left&&n.removeProperty("left"),n.top&&n.removeProperty("top"),n.width&&n.removeProperty("width"),n.height&&n.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const n=getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowY)?e:Ke.getScrollElement(e.parentElement)}static updateScrollPosition(e,n,o){const i=Ke.getScrollElement(e);if(!i)return;const r=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=window.innerHeight||document.documentElement.clientHeight,d=r.bottom-Math.min(a.bottom,l),c=r.top-Math.max(a.top,0),u=i.scrollTop;c<0&&o<0?e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=Math.abs(c)>Math.abs(o)?o:c:d>0&&o>0&&(e.offsetHeight>a.height?i.scrollTop+=o:i.scrollTop+=d>o?o:d),n.top+=i.scrollTop-u}static updateScrollResize(e,n,o){const i=Ke.getScrollElement(n),r=i.clientHeight,a=i===Ke.getScrollElement()?0:i.getBoundingClientRect().top,l=e.clientY-a,d=l<o,c=l>r-o;d?i.scrollBy({behavior:"smooth",top:l-o}):c&&i.scrollBy({behavior:"smooth",top:o-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const n=["parentGrid","el","grid","subGrid","engine"],o=Ke.clone(e);for(const i in o)o.hasOwnProperty(i)&&typeof o[i]=="object"&&i.substring(0,2)!=="__"&&!n.find(r=>r===i)&&(o[i]=Ke.cloneDeep(e[i]));return o}static cloneNode(e){const n=e.cloneNode(!0);return n.removeAttribute("id"),n}static appendTo(e,n){let o;typeof n=="string"?o=Ke.getElement(n):o=n,o&&o.appendChild(e)}static addElStyles(e,n){if(n instanceof Object)for(const o in n)n.hasOwnProperty(o)&&(Array.isArray(n[o])?n[o].forEach(i=>{e.style[o]=i}):e.style[o]=n[o])}static initEvent(e,n){const o={type:n.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:n.target?n.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>o[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>o[r]=e[r]),{...o,...i}}static simulateMouseEvent(e,n,o){const i=e,r=new MouseEvent(n,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:e.target});(o||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const n=document.createElement("div");Ke.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(n);const o=n.getBoundingClientRect();return e.removeChild(n),n.remove(),{xScale:1/o.width,yScale:1/o.height,xOffset:o.left,yOffset:o.top}}static swap(e,n,o){if(!e)return;const i=e[n];e[n]=e[o],e[o]=i}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}},nr=class un{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,n=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,n&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,n){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||n.y<=e.y)}_fixCollisions(e,n=e,o,i={}){if(this.sortNodes(-1),o=o||this.collide(e,n),!o)return!1;if(e._moving&&!i.nested&&!this.float&&this.swap(e,o))return!0;let r=n;!this._loading&&this._useEntireRowArea(e,n)&&(r={x:0,w:this.column,y:n.y,h:n.h},o=this.collide(e,r,i.skip));let a=!1;const l={nested:!0,pack:!1};let d=0;for(;o=o||this.collide(e,r,i.skip);){if(d++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(o.locked||this._loading||e._moving&&!e._skipDown&&n.y>e.y&&!this.float&&(!this.collide(o,{...o,y:e.y},e)||!this.collide(o,{...o,y:n.y-o.h},e))){e._skipDown=e._skipDown||n.y>e.y;const u={...n,y:o.y+o.h,...l};c=this._loading&&q.samePos(e,u)?!0:this.moveNode(e,u),(o.locked||this._loading)&&c?q.copyPos(n,e):!o.locked&&c&&i.pack&&(this._packNodes(),n.y=o.y+o.h,q.copyPos(e,n)),a=a||c}else c=this.moveNode(o,{...o,y:n.y+n.h,skip:e,...l});if(!c)return a;o=void 0}return a}collide(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.find(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}collideAll(e,n=e,o){const i=e._id,r=o?._id;return this.nodes.filter(a=>a._id!==i&&a._id!==r&&q.isIntercepted(a,n))}directionCollideCoverage(e,n,o){if(!n.rect||!e._rect)return;const i=e._rect,r={...n.rect};r.y>i.y?(r.h+=r.y-i.y,r.y=i.y):r.h+=i.y-r.y,r.x>i.x?(r.w+=r.x-i.x,r.x=i.x):r.w+=i.x-r.x;let a,l=.5;for(let d of o){if(d.locked||!d._rect)break;const c=d._rect;let u=Number.MAX_VALUE,f=Number.MAX_VALUE;i.y<c.y?u=(r.y+r.h-c.y)/c.h:i.y+i.h>c.y+c.h&&(u=(c.y+c.h-r.y)/c.h),i.x<c.x?f=(r.x+r.w-c.x)/c.w:i.x+i.w>c.x+c.w&&(f=(c.x+c.w-r.x)/c.w);const h=Math.min(f,u);h>l&&(l=h,a=d)}return n.collide=a,a}cacheRects(e,n,o,i,r,a){return this.nodes.forEach(l=>l._rect={y:l.y*n+o,x:l.x*e+a,w:l.w*e-a-i,h:l.h*n-o-r}),this}swap(e,n){if(!n||n.locked||!e||e.locked)return!1;function o(){const r=n.x,a=n.y;return n.x=e.x,n.y=e.y,e.h!=n.h?(e.x=r,e.y=n.y+n.h):e.w!=n.w?(e.x=n.x+n.w,e.y=a):(e.x=r,e.y=a),e._dirty=n._dirty=!0,!0}let i;if(e.w===n.w&&e.h===n.h&&(e.x===n.x||e.y===n.y)&&(i=q.isTouching(e,n)))return o();if(i!==!1){if(e.w===n.w&&e.x===n.x&&(i||(i=q.isTouching(e,n)))){if(n.y<e.y){const r=e;e=n,n=r}return o()}if(i!==!1){if(e.h===n.h&&e.y===n.y&&(i||(i=q.isTouching(e,n)))){if(n.x<e.x){const r=e;e=n,n=r}return o()}return!1}}}isAreaEmpty(e,n,o,i){const r={x:e||0,y:n||0,w:o||1,h:i||1};return!this.collide(r)}compact(e="compact",n=!0){if(this.nodes.length===0)return this;n&&this.sortNodes();const o=this.batchMode;o||this.batchUpdate();const i=this._inColumnResize;i||(this._inColumnResize=!0);const r=this.nodes;return this.nodes=[],r.forEach((a,l,d)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=d[l-1])),this.addNode(a,!1,c)}),i||delete this._inColumnResize,o||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=q.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let n=e.y;for(;n>e._orig.y;)--n,this.collide(e,{x:e.x,y:n,w:e.w,h:e.h})||(e._dirty=!0,e.y=n)}):this.nodes.forEach((e,n)=>{if(!e.locked)for(;e.y>0;){const o=n===0?0:e.y-1;if(!(n===0||!this.collide(e,{x:e.x,y:o,w:e.w,h:e.h})))break;e._dirty=e.y!==o,e.y=o}}),this)}prepareNode(e,n){e._id=e._id??un._idSeq++;const o=e.id;if(o){let r=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=o+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const i={x:0,y:0,w:1,h:1};return q.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,q.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,n),e}nodeBoundFix(e,n){const o=e._orig||q.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id!=null&&this.findCacheLayout(e,this.defaultColumn)===-1){const i={...e};i.autoPosition||i.x===void 0?(delete i.x,delete i.y):i.x=Math.min(this.defaultColumn-1,i.x),i.w=Math.min(this.defaultColumn,i.w||1),this.cacheOneLayout(i,this.defaultColumn)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(n?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(n?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),q.samePos(e,o)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(n=>n._dirty&&!q.samePos(n,n._orig)):this.nodes.filter(n=>n._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const n=(e||[]).concat(this.getDirtyNodes());return this.onChange(n),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=q.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||q.samePos(e,e._orig)||(q.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,n=this.nodes,o=this.column,i){const r=i?i.y*o+(i.x+i.w):0;let a=!1;for(let l=r;!a;++l){const d=l%o,c=Math.floor(l/o);if(d+e.w>o)continue;const u={x:d,y:c,w:e.w,h:e.h};n.find(f=>q.isIntercepted(u,f))||((e.x!==d||e.y!==c)&&(e._dirty=!0),e.x=d,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,n=!1,o){const i=this.nodes.find(a=>a._id===e._id);if(i)return i;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,o)&&(delete e.autoPosition,r=!0),this.nodes.push(e),n&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,n=!0,o=!1){return this.nodes.find(i=>i._id===e._id)?(o&&this.removedNodes.push(e),n&&(e._removeDOM=!0),this.nodes=this.nodes.filter(i=>i._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,n=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(i=>i._removeDOM=!0);const o=this.nodes;return this.removedNodes=n?o:[],this.nodes=[],this._notify(o)}moveNodeCheck(e,n){if(!this.changedPosConstrain(e,n))return!1;if(n.pack=!0,!this.maxRow)return this.moveNode(e,n);let o;const i=new un({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(o={...a},o):{...a})});if(!o)return!1;const r=i.moveNode(o,n)&&i.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!n.resizing&&n.collide){const a=n.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(i.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(d=>d._id===a._id);l&&(q.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const n=new un({column:this.column,float:this.float,nodes:this.nodes.map(i=>({...i}))}),o={...e};return this.cleanupNode(o),delete o.el,delete o._id,delete o.content,delete o.grid,n.addNode(o),n.getRow()<=this.maxRow?(e._willFitPos=q.copyPos({},o),!0):!1}changedPosConstrain(e,n){return n.w=n.w||e.w,n.h=n.h||e.h,e.x!==n.x||e.y!==n.y?!0:(e.maxW&&(n.w=Math.min(n.w,e.maxW)),e.maxH&&(n.h=Math.min(n.h,e.maxH)),e.minW&&(n.w=Math.max(n.w,e.minW)),e.minH&&(n.h=Math.max(n.h,e.minH)),e.w!==n.w||e.h!==n.h)}moveNode(e,n){if(!e||!n)return!1;let o;n.pack===void 0&&!this.batchMode&&(o=n.pack=!0),typeof n.x!="number"&&(n.x=e.x),typeof n.y!="number"&&(n.y=e.y),typeof n.w!="number"&&(n.w=e.w),typeof n.h!="number"&&(n.h=e.h);const i=e.w!==n.w||e.h!==n.h,r=q.copyPos({},e,!0);if(q.copyPos(r,n),this.nodeBoundFix(r,i),q.copyPos(n,r),!n.forceCollide&&q.samePos(e,n))return!1;const a=q.copyPos({},e),l=this.collideAll(e,r,n.skip);let d=!0;if(l.length){const c=e._moving&&!n.nested;let u=c?this.directionCollideCoverage(e,n,l):l[0];if(c&&u&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const f=q.areaIntercept(n.rect,u._rect),h=q.area(n.rect),p=q.area(u._rect);f/(h<p?h:p)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,r,u,n):(d=!1,o&&delete n.pack)}return d&&!q.samePos(e,r)&&(e._dirty=!0,q.copyPos(e,r)),n.pack&&this._packNodes()._notify(),!q.samePos(e,a)}getRow(){return this.nodes.reduce((e,n)=>Math.max(e,n.y+n.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(n=>n._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,n,o){const i=this._layouts?.length||0;let r;i&&(o?o!==this.column&&(r=this._layouts[o]):this.column!==i-1&&(r=this._layouts[i-1]));const a=[];return this.sortNodes(),this.nodes.forEach(l=>{const d=r?.find(u=>u._id===l._id),c={...l,...d||{}};q.removeInternalForSave(c,!e),n&&n(l,c),a.push(c)}),a}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((n,o)=>{if(!n||o===this.column)return this;if(o<this.column)this._layouts[o]=void 0;else{const i=o/this.column;e.forEach(r=>{if(!r._orig)return;const a=n.find(l=>l._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y,a.y<0&&(a.y=0)),r.x!==r._orig.x&&(a.x=Math.round(r.x*i),a.x<0&&(a.x=0)),r.w!==r._orig.w&&(a.w=Math.round(r.w*i),a.w<1&&(a.w=1)))})}}),this)}columnChanged(e,n,o="moveScale"){if(!this.nodes.length||!n||e===n)return this;const i=o==="compact"||o==="list";i&&this.sortNodes(1),n<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],a=i?this.nodes:q.sort(this.nodes,-1);if(n>e&&this._layouts){const l=this._layouts[n]||[],d=this._layouts.length-1;!l.length&&e!==d&&this._layouts[d]?.length&&(e=d,this._layouts[d].forEach(c=>{const u=a.find(f=>f._id===c._id);u&&(!i&&!c.autoPosition&&(u.x=c.x??u.x,u.y=c.y??u.y),u.w=c.w??u.w,(c.x==null||c.y===void 0)&&(u.autoPosition=!0))})),l.forEach(c=>{const u=a.findIndex(f=>f._id===c._id);if(u!==-1){const f=a[u];if(i){f.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(f.x=c.x??f.x,f.y=c.y??f.y,f.w=c.w??f.w,r.push(f)),a.splice(u,1)}})}if(i)this.compact(o,!1);else{if(a.length)if(typeof o=="function")o(n,e,r,a);else{const l=i||o==="none"?1:n/e,d=o==="move"||o==="moveScale",c=o==="scale"||o==="moveScale";a.forEach(u=>{u.x=n===1?0:d?Math.round(u.x*l):Math.min(u.x,n-1),u.w=n===1||e===1?1:c?Math.round(u.w*l)||1:Math.min(u.w,n),r.push(u)}),a=[]}r=q.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!i),delete this._inColumnResize,this}cacheLayout(e,n,o=!1){const i=[];return e.forEach((r,a)=>{r._id===void 0&&(r._id=(r.id?this.nodes.find(l=>l.id===r.id):void 0)?._id??un._idSeq++),i[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[n]=i,this}cacheOneLayout(e,n){e._id=e._id??un._idSeq++;const o={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete o.x,delete o.y,e.autoPosition&&(o.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[n]=this._layouts[n]||[];const i=this.findCacheLayout(e,n);return i===-1?this._layouts[n].push(o):this._layouts[n][i]=o,this}findCacheLayout(e,n){return this._layouts?.[n]?.findIndex(o=>o._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let n=0;n<this._layouts.length;n++){const o=this.findCacheLayout(e,n);o!==-1&&this._layouts[n].splice(o,1)}}cleanupNode(e){for(const n in e)n[0]==="_"&&n!=="_id"&&delete e[n];return this}};nr._idSeq=0;var Ge={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},fe=class{},et=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),je=class{};function Oo(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t.changedTouches[0],e))}function Qa(t,e){t.cancelable&&t.preventDefault(),q.simulateMouseEvent(t,e)}function $o(t){je.touchHandled||(je.touchHandled=!0,Oo(t,"mousedown"))}function Ro(t){je.touchHandled&&Oo(t,"mousemove")}function Ho(t){if(!je.touchHandled)return;je.pointerLeaveTimeout&&(window.clearTimeout(je.pointerLeaveTimeout),delete je.pointerLeaveTimeout);const e=!!fe.dragElement;Oo(t,"mouseup"),e||Oo(t,"click"),je.touchHandled=!1}function Vo(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function el(t){fe.dragElement&&t.pointerType!=="mouse"&&Qa(t,"mouseenter")}function tl(t){fe.dragElement&&t.pointerType!=="mouse"&&(je.pointerLeaveTimeout=window.setTimeout(()=>{delete je.pointerLeaveTimeout,Qa(t,"mouseleave")},10))}var nl=class Ql{constructor(e,n,o){this.host=e,this.dir=n,this.option=o,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Ql.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),et&&(this.el.addEventListener("touchstart",$o),this.el.addEventListener("pointerdown",Vo)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),et&&(this.el.removeEventListener("touchstart",$o),this.el.removeEventListener("pointerdown",Vo)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),et&&(this.el.addEventListener("touchmove",Ro),this.el.addEventListener("touchend",Ho)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const n=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),et&&(this.el.removeEventListener("touchmove",Ro),this.el.removeEventListener("touchend",Ho)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,n){return this.option[e]&&this.option[e](n),this}};nl.prefix="ui-resizable-";var or=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(t,e){this._eventRegister[t]=e}off(t){delete this._eventRegister[t]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(t,e){if(!this.disabled&&this._eventRegister&&this._eventRegister[t])return this._eventRegister[t](e)}},ol=class xr extends or{constructor(e,n={}){super(),this.el=e,this.option=n,this.rectScale={x:1,y:1},this._ui=()=>{const o=this.el.parentElement.getBoundingClientRect(),i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=this.temporalRect||i;return{position:{left:(r.left-o.left)*this.rectScale.x,top:(r.top-o.top)*this.rectScale.y},size:{width:r.width*this.rectScale.x,height:r.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const n=e.handles&&e.handles!==this.option.handles,o=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(i=>this.option[i]=e[i]),n&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),fe.overResizeElement===this&&delete fe.overResizeElement),this}_mouseOver(e){fe.overResizeElement||fe.dragElement||(fe.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){fe.overResizeElement===this&&(delete fe.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new nl(this.el,e,{element:this.option.element,start:n=>this._resizeStart(n),stop:n=>this._resizeStop(n),move:n=>this._resizing(n,e)})),this}_resizeStart(e){this.sizeToContent=q.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=q.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const n=q.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(n,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",n),this}_resizing(e,n){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,n),this._applyChange();const o=q.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(o,this._ui()),this.triggerEvent("resize",o),this}_resizeStop(e){const n=q.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(n),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",n),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=xr._originStyleProp.map(o=>this.el.style[o]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,n=q.getValuesFromTransformedElement(e);return this.rectScale={x:n.xScale,y:n.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return xr._originStyleProp.forEach((e,n)=>{this.el.style[e]=this.elOriginStyleVal[n]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,n){const o=this.startEvent,i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-o.clientX,a=this.sizeToContent?0:e.clientY-o.clientY;let l,d;n.indexOf("e")>-1?i.width+=r:n.indexOf("w")>-1&&(i.width-=r,i.left+=r,l=!0),n.indexOf("s")>-1?i.height+=a:n.indexOf("n")>-1&&(i.height-=a,i.top+=a,d=!0);const c=this._constrainSize(i.width,i.height,l,d);return Math.round(i.width)!==Math.round(c.width)&&(n.indexOf("w")>-1&&(i.left+=i.width-c.width),i.width=c.width),Math.round(i.height)!==Math.round(c.height)&&(n.indexOf("n")>-1&&(i.top+=i.height-c.height),i.height=c.height),i}_constrainSize(e,n,o,i){const r=this.option,a=(o?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,d=(i?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,c=r.minHeight/this.rectScale.y||n;return{width:Math.min(a,Math.max(l,e)),height:Math.min(d,Math.max(c,n))}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const{left:n,top:o}=this.el.parentElement.getBoundingClientRect();e={left:n,top:o,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(n=>{const o=this.temporalRect[n],i=n==="width"||n==="left"?this.rectScale.x:n==="height"||n==="top"?this.rectScale.y:1;this.el.style[n]=(o-e[n])*i+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}};ol._originStyleProp=["width","height","position","left","top","opacity","zIndex"];var v0='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',il=class Sr extends or{constructor(e,n={}){super(),this.el=e,this.option=n,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const o=n?.handle?.substring(1),i=e.gridstackNode;this.dragEls=!o||e.classList.contains(o)?[e]:i?.subGrid?[e.querySelector(n.handle)||e]:Array.from(e.querySelectorAll(n.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,n){super.on(e,n)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),et&&(e.addEventListener("touchstart",$o),e.addEventListener("pointerdown",Vo))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(n=>{n.removeEventListener("mousedown",this._mouseDown),et&&(n.removeEventListener("touchstart",$o),n.removeEventListener("pointerdown",Vo))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(n=>this.option[n]=e[n]),this}_mouseDown(e){if(je.touchHandled&&e.isTrusted&&(je.touchHandled=!1),!fe.mouseHandled)return e.button!==0||!this.dragEls.find(n=>n===e.target)&&e.target.closest(v0)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete fe.dragElement,delete fe.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),et&&(e.currentTarget.addEventListener("touchmove",Ro),e.currentTarget.addEventListener("touchend",Ho)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),fe.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const n=q.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(n,this.ui()),this.triggerEvent("drag",n)}_mouseMove(e){const n=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),fe.pauseDrag){const o=Number.isInteger(fe.pauseDrag)?fe.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),o)}else this._callDrag(e);else if(Math.abs(e.x-n.x)+Math.abs(e.y-n.y)>3){this.dragging=!0,fe.dragElement=this;const o=this.el.gridstackNode?.grid;o?fe.dropElement=o.el.ddElement.ddDroppable:delete fe.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=q.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const i=q.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(i,this.ui()),this.triggerEvent("dragstart",i),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),et&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ro,!0),e.currentTarget.removeEventListener("touchend",Ho,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),fe.dropElement?.el===this.el.parentElement&&delete fe.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const n=q.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(n),this.triggerEvent("dragstop",n),fe.dropElement&&fe.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete fe.dragElement,delete fe.dropElement,delete fe.mouseHandled,e.preventDefault()}_keyEvent(e){const n=this.el.gridstackNode,o=n?.grid||fe.dropElement?.el?.gridstack;if(e.key==="Escape")n&&n._origRotate&&(n._orig=n._origRotate,delete n._origRotate),o?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(n&&o&&(e.key==="r"||e.key==="R")){if(!q.canBeRotated(n))return;n._origRotate=n._origRotate||{...n._orig},delete n._moving,o.setAnimation(!1).rotate(n.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),n._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,n.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",q.swap(n._orig,"w","h"),delete n._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=q.cloneNode(this.el)),e.parentElement||q.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=Sr.originStyleProp.map(n=>this.el.style[n]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const n=this.helper.style;return n.pointerEvents="none",n.width=this.dragOffset.width+"px",n.height=this.dragOffset.height+"px",n.willChange="left, top",n.position="fixed",this._dragFollow(e),n.transition="none",setTimeout(()=>{this.helper&&(n.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const e=this.helper,n=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",Sr.originStyleProp.forEach(o=>e.style[o]=this.dragElementOriginStyle[o]||null),setTimeout(()=>e.style.transition=n,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const n={left:0,top:0},o=this.helper.style,i=this.dragOffset;o.left=(e.clientX+i.offsetLeft-n.left)*this.dragTransform.xScale+"px",o.top=(e.clientY+i.offsetTop-n.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,n,o){let i=0,r=0;o&&(i=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const a=n.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-i,offsetTop:-e.clientY+a.top-r,width:a.width*this.dragTransform.xScale,height:a.height*this.dragTransform.yScale}}ui(){const e=this.el.parentElement.getBoundingClientRect(),n=this.helper.getBoundingClientRect();return{position:{top:(n.top-e.top)*this.dragTransform.yScale,left:(n.left-e.left)*this.dragTransform.xScale}}}};il.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];var y0=class extends or{constructor(t,e={}){super(),this.el=t,this.option=e,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),et&&(this.el.addEventListener("pointerenter",el),this.el.addEventListener("pointerleave",tl)))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),t||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),et&&(this.el.removeEventListener("pointerenter",el),this.el.removeEventListener("pointerleave",tl)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this._setupAccept(),this}_mouseEnter(t){if(!fe.dragElement||je.touchHandled&&t.isTrusted||!this._canDrop(fe.dragElement.el))return;t.preventDefault(),t.stopPropagation(),fe.dropElement&&fe.dropElement!==this&&fe.dropElement._mouseLeave(t,!0),fe.dropElement=this;const e=q.initEvent(t,{target:this.el,type:"dropover"});this.option.over&&this.option.over(e,this._ui(fe.dragElement)),this.triggerEvent("dropover",e),this.el.classList.add("ui-droppable-over")}_mouseLeave(t,e=!1){if(!fe.dragElement||fe.dropElement!==this)return;t.preventDefault(),t.stopPropagation();const n=q.initEvent(t,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(n,this._ui(fe.dragElement)),this.triggerEvent("dropout",n),fe.dropElement===this&&(delete fe.dropElement,!e)){let o,i=this.el.parentElement;for(;!o&&i;)o=i.ddElement?.ddDroppable,i=i.parentElement;o&&o._mouseEnter(t)}}drop(t){t.preventDefault();const e=q.initEvent(t,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(e,this._ui(fe.dragElement)),this.triggerEvent("drop",e)}_canDrop(t){return t&&(!this.accept||this.accept(t))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=t=>t.classList.contains(this.option.accept)||t.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(t){return{draggable:t.el,...t.ui()}}},_0=class ec{static init(e){return e.ddElement||(e.ddElement=new ec(e)),e.ddElement}constructor(e){this.el=e}on(e,n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,n),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new il(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new ol(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new y0(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},w0=class{resizable(t,e,n,o){return this._getDDElements(t,e).forEach(i=>{if(e==="disable"||e==="enable")i.ddResizable&&i.ddResizable[e]();else if(e==="destroy")i.ddResizable&&i.cleanResizable();else if(e==="option")i.setupResizable({[n]:o});else{const r=i.el.gridstackNode.grid;let a=i.el.getAttribute("gs-resize-handles")||r.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");const l=!r.opts.alwaysShowResizeHandle;i.setupResizable({...r.opts.resizable,handles:a,autoHide:l,start:e.start,stop:e.stop,resize:e.resize})}}),this}draggable(t,e,n,o){return this._getDDElements(t,e).forEach(i=>{if(e==="disable"||e==="enable")i.ddDraggable&&i.ddDraggable[e]();else if(e==="destroy")i.ddDraggable&&i.cleanDraggable();else if(e==="option")i.setupDraggable({[n]:o});else{const r=i.el.gridstackNode.grid;i.setupDraggable({...r.opts.draggable,start:e.start,stop:e.stop,drag:e.drag})}}),this}dragIn(t,e){return this._getDDElements(t).forEach(n=>n.setupDraggable(e)),this}droppable(t,e,n,o){return typeof e.accept=="function"&&!e._accept&&(e._accept=e.accept,e.accept=i=>e._accept(i)),this._getDDElements(t,e).forEach(i=>{e==="disable"||e==="enable"?i.ddDroppable&&i.ddDroppable[e]():e==="destroy"?i.ddDroppable&&i.cleanDroppable():e==="option"?i.setupDroppable({[n]:o}):i.setupDroppable(e)}),this}isDroppable(t){return!!(t?.ddElement?.ddDroppable&&!t.ddElement.ddDroppable.disabled)}isDraggable(t){return!!(t?.ddElement?.ddDraggable&&!t.ddElement.ddDraggable.disabled)}isResizable(t){return!!(t?.ddElement?.ddResizable&&!t.ddElement.ddResizable.disabled)}on(t,e,n){return this._getDDElements(t).forEach(o=>o.on(e,i=>{n(i,fe.dragElement?fe.dragElement.el:i.target,fe.dragElement?fe.dragElement.helper:null)})),this}off(t,e){return this._getDDElements(t).forEach(n=>n.off(e)),this}_getDDElements(t,e){const n=t.gridstack||e!=="destroy"&&e!=="disable",o=q.getElements(t);return o.length?o.map(i=>i.ddElement||(n?_0.init(i):null)).filter(i=>i):[]}},Oe=new w0,tn=class ue{static init(e={},n=".grid-stack"){if(typeof document>"u")return null;const o=ue.getGridElement(n);return o?(o.gridstack||(o.gridstack=new ue(o,q.cloneDeep(e))),o.gridstack):(console.error(typeof n=="string"?'GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
27
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},n=".grid-stack"){const o=[];return typeof document>"u"||(ue.getGridElements(n).forEach(i=>{i.gridstack||(i.gridstack=new ue(i,q.cloneDeep(e))),o.push(i.gridstack)}),o.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+n+`" - element missing or wrong selector ?
|
|
28
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(e,n={}){if(!e)return null;let o=e;if(o.gridstack){const i=o.gridstack;return n&&(i.opts={...i.opts,...n}),n.children!==void 0&&i.load(n.children),i}return(!e.classList.contains("grid-stack")||ue.addRemoveCB)&&(ue.addRemoveCB?o=ue.addRemoveCB(e,n,!0,!0):o=q.createDiv(["grid-stack",n.class],e)),ue.init(n,o)}static registerEngine(e){ue.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=q.createDiv([this.opts.placeholderClass,Ge.itemClass,this.opts.itemClass]);const e=q.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,n={}){this.el=e,this.opts=n,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=n=n||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),n.row&&(n.minRow=n.maxRow=n.row,delete n.row);const o=q.toNumber(e.getAttribute("gs-row"));n.column==="auto"&&delete n.column,n.alwaysShowResizeHandle!==void 0&&(n._alwaysShowResizeHandle=n.alwaysShowResizeHandle);const i=n.columnOpts;if(i){const d=i.breakpoints;!i.columnWidth&&!d?.length?delete n.columnOpts:(i.columnMax=i.columnMax||12,d?.length>1&&d.sort((c,u)=>(u.w||0)-(c.w||0)))}const r={...q.cloneDeep(Ge),column:q.toNumber(e.getAttribute("gs-column"))||Ge.column,minRow:o||q.toNumber(e.getAttribute("gs-min-row"))||Ge.minRow,maxRow:o||q.toNumber(e.getAttribute("gs-max-row"))||Ge.maxRow,staticGrid:q.toBool(e.getAttribute("gs-static"))||Ge.staticGrid,sizeToContent:q.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(n.handleClass?"."+n.handleClass:n.handle?n.handle:"")||Ge.draggable.handle},removableOptions:{accept:n.itemClass||Ge.removableOptions.accept,decline:Ge.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=q.toBool(e.getAttribute("gs-animate"))),n=q.defaults(n,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(n),n.rtl==="auto"&&(n.rtl=e.style.direction==="rtl"),n.rtl&&this.el.classList.add("grid-stack-rtl");const a=this.el.closest("."+Ge.itemClass)?.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=n.cellHeight==="auto",this._isAutoCellHeight||n.cellHeight==="initial")this.cellHeight(void 0);else{typeof n.cellHeight=="number"&&n.cellHeightUnit&&n.cellHeightUnit!==Ge.cellHeightUnit&&(n.cellHeight=n.cellHeight+n.cellHeightUnit,delete n.cellHeightUnit);const d=n.cellHeight;delete n.cellHeight,this.cellHeight(d)}n.alwaysShowResizeHandle==="mobile"&&(n.alwaysShowResizeHandle=et),this._setStaticClass();const l=n.engineClass||ue.engineClass||nr;if(this.engine=new l({column:this.getColumn(),float:n.float,maxRow:n.maxRow,onChange:d=>{d.forEach(c=>{const u=c.el;u&&(c._removeDOM?(u&&u.remove(),delete c._removeDOM):this._writePosAttr(u,c))}),this._updateContainerHeight()}}),n.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(d=>this._prepareElement(d)),delete this.engine._loading,this.batchUpdate(!1)),n.children){const d=n.children;delete n.children,d.length&&this.load(d)}this.setAnimation(),n.subGridDynamic&&!fe.pauseDrag&&(fe.pauseDrag=!0),n.draggable?.pause!==void 0&&(fe.pauseDrag=n.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let n,o=e;if(o.grid=this,o.el?n=o.el:ue.addRemoveCB?n=ue.addRemoveCB(this.el,e,!0,!1):n=this.createWidgetDivs(o),!n)return;if(o=n.gridstackNode,o&&n.parentElement===this.el&&this.engine.nodes.find(r=>r._id===o._id))return n;const i=this._readAttr(n);return q.defaults(e,i),this.engine.prepareNode(e),this.el.appendChild(n),this.makeWidget(n,e),n}createWidgetDivs(e){const n=q.createDiv(["grid-stack-item",this.opts.itemClass]),o=q.createDiv(["grid-stack-item-content"],n);return q.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,ue.renderCB(o,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(n))):ue.renderCB(o,e),n}makeSubGrid(e,n,o,i=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;n=q.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...n||r.subGridOpts||{}}),r.subGridOpts=n;let d;n.column==="auto"&&(d=!0,n.column=Math.max(r.w||1,o?.w||1),delete n.columnOpts);let c=r.el.querySelector(".grid-stack-item-content"),u,f;if(i&&(this._removeDD(r.el),f={...r,x:0,y:0},q.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),ue.addRemoveCB?u=ue.addRemoveCB(this.el,f,!0,!1):(u=q.createDiv(["grid-stack-item"]),u.appendChild(c),c=q.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),o){const p=d?n.column:r.w,g=r.h+o.h,m=r.el.style;m.transition="none",this.update(r.el,{w:p,h:g}),setTimeout(()=>m.transition=null)}const h=r.subGrid=ue.addGrid(c,n);return o?._moving&&(h._isTemp=!0),d&&(h._autoColumn=!0),i&&h.makeWidget(u,f),o&&(o._moving?window.setTimeout(()=>q.simulateMouseEvent(o._event,"mouseenter",h.el),0):h.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),h}removeAsSubGrid(e){const n=this.parentGridNode?.grid;n&&(n.batchUpdate(),n.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x+=this.parentGridNode.x,o.y+=this.parentGridNode.y,n.makeWidget(o.el,o)}),n.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>q.simulateMouseEvent(e._event,"mouseenter",n.el),0))}save(e=!0,n=!1,o=ue.saveCB,i){const r=this.engine.save(e,o,i);if(r.forEach(a=>{if(e&&a.el&&!a.subGrid&&!o)a.content=a.el.querySelector(".grid-stack-item-content")?.innerHTML,a.content||delete a.content;else if(!e&&!o&&delete a.content,a.subGrid?.el){const l=a.w||a.subGrid.getColumn(),d=a.subGrid.save(e,n,o,l);a.subGridOpts=n?d:{children:d},delete a.subGrid}delete a.el}),n){const a=q.cloneDeep(this.opts);a.marginBottom===a.marginTop&&a.marginRight===a.marginLeft&&a.marginTop===a.marginRight&&(a.margin=a.marginTop,delete a.marginTop,delete a.marginRight,delete a.marginBottom,delete a.marginLeft),a.rtl===(this.el.style.direction==="rtl")&&(a.rtl="auto"),this._isAutoCellHeight&&(a.cellHeight="auto"),this._autoColumn&&(a.column="auto");const l=a._alwaysShowResizeHandle;return delete a._alwaysShowResizeHandle,l!==void 0?a.alwaysShowResizeHandle=l:delete a.alwaysShowResizeHandle,q.removeInternalAndSame(a,Ge),a.children=r,a}return r}load(e,n=ue.addRemoveCB||!0){e=q.cloneDeep(e);const o=this.getColumn();e.forEach(u=>{u.w=u.w||u.minW||1,u.h=u.h||u.minH||1}),e=q.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let i=0;e.forEach(u=>{i=Math.max(i,(u.x||0)+u.w)}),i>this.engine.defaultColumn&&(this.engine.defaultColumn=i),i>o&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(i,o,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,i,!0));const r=ue.addRemoveCB;typeof n=="function"&&(ue.addRemoveCB=n);const a=[];this.batchUpdate();const l=!this.engine.nodes.length,d=l&&this.opts.animate;d&&this.setAnimation(!1),!l&&n&&[...this.engine.nodes].forEach(u=>{u.id&&(q.find(e,u.id)||(ue.addRemoveCB&&ue.addRemoveCB(this.el,u,!1,!1),a.push(u),this.removeWidget(u.el,!0,!1)))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(u=>q.find(e,u.id)?(c.push(u),!1):!0),e.forEach(u=>{const f=q.find(c,u.id);if(f){if(q.shouldSizeToContent(f)&&(u.h=f.h),this.engine.nodeBoundFix(u),(u.autoPosition||u.x===void 0||u.y===void 0)&&(u.w=u.w||f.w,u.h=u.h||f.h,this.engine.findEmptyPosition(u)),this.engine.nodes.push(f),q.samePos(f,u)&&this.engine.nodes.length>1&&(this.moveNode(f,{...u,forceCollide:!0}),q.copyPos(u,f)),this.update(f.el,u),u.subGridOpts?.children){const h=f.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(u.subGridOpts.children)}}else n&&this.addWidget(u)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?ue.addRemoveCB=r:delete ue.addRemoveCB,d&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const n=this.el.querySelector("."+this.opts.itemClass);if(n){const i=q.toNumber(n.getAttribute("gs-h"))||1;return Math.round(n.offsetHeight/i)}const o=parseInt(this.el.getAttribute("gs-current-row"));return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+o}const n=q.parseHeight(e);return this.opts.cellHeightUnit===n.unit&&this.opts.cellHeight===n.h?this:(this.opts.cellHeightUnit=n.unit,this.opts.cellHeight=n.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const n=this.getColumn();let o=n;const i=this._widthOrContainer(!0);if(e.columnWidth)o=Math.min(Math.round(i/e.columnWidth)||1,e.columnMax);else{o=e.columnMax;let r=0;for(;r<e.breakpoints.length&&i<=e.breakpoints[r].w;)o=e.breakpoints[r++].c||n}if(o!==n){const r=e.breakpoints?.find(a=>a.c===o);return this.column(o,r?.layout||e.layout),!0}return!1}compact(e="compact",n=!0){return this.engine.compact(e,n),this._triggerChangeEvent(),this}column(e,n="moveScale"){if(!e||e<1||this.opts.column===e)return this;const o=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,e,n),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=n,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,n=!1){const o=this.el.getBoundingClientRect();let i;n?i={top:o.top+document.documentElement.scrollTop,left:o.left}:i={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-i.left,a=e.top-i.top,l=o.width/this.getColumn(),d=o.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(a/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,n,o,i){return this.engine.isAreaEmpty(e,n,o,i)}makeWidget(e,n){const o=ue.getElement(e);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,n);const i=o.gridstackNode;this._updateContainerHeight(),i.subGridOpts&&this.makeSubGrid(o,i.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,o}on(e,n){return e.indexOf(" ")!==-1?(e.split(" ").forEach(o=>this.on(o,n)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=o=>n(o):this._gsEventHandler[e]=o=>{o.detail&&n(o,o.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=n:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(n=>this.off(n)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,n=!0,o=!0){return e?(ue.getElements(e).forEach(i=>{if(i.parentElement&&i.parentElement!==this.el)return;let r=i.gridstackNode;r||(r=this.engine.nodes.find(a=>i===a.el)),r&&(n&&ue.addRemoveCB&&ue.addRemoveCB(this.el,r,!1,!1),delete i.gridstackNode,this._removeDD(i),this.engine.removeNode(r,n,o),n&&i.parentElement&&i.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,n=!0){return this.engine.nodes.forEach(o=>{e&&ue.addRemoveCB&&ue.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(e,n),n&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,n){return n?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,n=!0,o=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&o&&i.subGrid.setStatic(e,n,o)}),n&&this._setStaticClass(),this)}updateOptions(e){const n=this.opts;return e===n?this:(e.acceptWidgets!==void 0&&(n.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==n.class&&(n.class&&this.el.classList.remove(n.class),e.class&&this.el.classList.add(e.class)),e.columnOpts?(this.opts.columnOpts=e.columnOpts,this.checkDynamicColumn()):e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(n.minRow=n.maxRow=n.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(n.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(n.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(n.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this)}update(e,n){return ue.getElements(e).forEach(o=>{const i=o?.gridstackNode;if(!i)return;const r={...q.copyPos({},i),...q.cloneDeep(n)};this.engine.nodeBoundFix(r),delete r.autoPosition;const a=["x","y","w","h"];let l;if(a.some(u=>r[u]!==void 0&&r[u]!==i[u])&&(l={},a.forEach(u=>{l[u]=r[u]!==void 0?r[u]:i[u],delete r[u]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const u=o.querySelector(".grid-stack-item-content");u&&u.textContent!==r.content&&(i.content=r.content,ue.renderCB(u,r),i.subGrid?.el&&(u.appendChild(i.subGrid.el),i.subGrid._updateContainerHeight())),delete r.content}let d=!1,c=!1;for(const u in r)u[0]!=="_"&&i[u]!==r[u]&&(i[u]=r[u],d=!0,c=c||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));if(q.sanitizeMinMax(i),l){const u=l.w!==void 0&&l.w!==i.w;this.moveNode(i,l),u&&i.subGrid?i.subGrid.onResize(this.hasAnimationCSS()?i.w:void 0):this.resizeToContentCheck(u,i),delete i._orig}(l||d)&&this._writeAttr(o,i),c&&this.prepareDragDrop(i.el),ue.updateCB&&ue.updateCB(i)}),this}moveNode(e,n){const o=e._updating;o||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,n),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const n=e.gridstackNode;if(!n)return;const o=n.grid;if(!o||e.parentElement!==o.el)return;const i=o.getCellHeight(!0);if(!i)return;let r=n.h?n.h*i:e.clientHeight,a;if(n.resizeToContentParent&&(a=e.querySelector(n.resizeToContentParent)),a||(a=e.querySelector(ue.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,d=n.h?n.h*i-l:a.clientHeight;let c;if(n.subGrid){c=n.subGrid.getRow()*n.subGrid.getCellHeight(!0);const h=n.subGrid.el.getBoundingClientRect(),p=e.getBoundingClientRect();c+=h.top-p.top}else{if(n.subGridOpts?.children?.length)return;{const h=a.firstElementChild;if(!h){console.error(`Error: GridStack.resizeToContent() widget id:${n.id} '${ue.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=h.getBoundingClientRect().height||d}}if(d===c)return;r+=c-d;let u=Math.ceil(r/i);const f=Number.isInteger(n.sizeToContent)?n.sizeToContent:0;f&&u>f&&(u=f,e.classList.add("size-to-content-max")),n.minH&&u<n.minH?u=n.minH:n.maxH&&u>n.maxH&&(u=n.maxH),u!==n.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(n,{h:u}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){ue.resizeToContentCB?ue.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,n){return ue.getElements(e).forEach(o=>{const i=o.gridstackNode;if(!q.canBeRotated(i))return;const r={w:i.h,h:i.w,minH:i.minW,minW:i.minH,maxH:i.maxW,maxW:i.maxH};if(n){const l=n.left>0?Math.floor(n.left/this.cellWidth()):0,d=n.top>0?Math.floor(n.top/this.opts.cellHeight):0;r.x=i.x+l-(i.h-(d+1)),r.y=i.y+d-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const a=i._orig;this.update(o,r),i._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const n=q.parseHeight(e);if(this.opts.marginUnit===n.unit&&this.opts.margin===n.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(n=>{delete n._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,n){const o=n?new CustomEvent(e,{bubbles:!1,detail:n}):new Event(e);let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;return i.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let n=this.getRow()+this._extraDragRow;const o=this.opts.cellHeight,i=this.opts.cellHeightUnit;if(!o)return this;if(!e&&!this.opts.minRow){const r=q.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===i){const a=Math.floor(r.h/o);n<a&&(n=a)}}return this.el.setAttribute("gs-current-row",String(n)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),n&&(this.el.style[e?"minHeight":"height"]=n*o+i),e&&q.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,n=!1,o){o=o||this._readAttr(e),e.gridstackNode=o,o.el=e,o.grid=this,o=this.engine.addNode(o,n),this._writeAttr(e,o),e.classList.add(Ge.itemClass,this.opts.itemClass);const i=q.shouldSizeToContent(o);return i?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),i&&this.resizeToContentCheck(!1,o),q.lazyLoad(o)||this.prepareDragDrop(o.el),this}_writePosAttr(e,n){return(!n._moving&&!n._resizing||this._placeholder===e)&&(e.style.top=n.y?n.y===1?"var(--gs-cell-height)":`calc(${n.y} * var(--gs-cell-height))`:null,e.style.left=n.x?n.x===1?"var(--gs-column-width)":`calc(${n.x} * var(--gs-column-width))`:null,e.style.width=n.w>1?`calc(${n.w} * var(--gs-column-width))`:null,e.style.height=n.h>1?`calc(${n.h} * var(--gs-cell-height))`:null),e.setAttribute("gs-x",String(n.x)),e.setAttribute("gs-y",String(n.y)),n.w>1?e.setAttribute("gs-w",String(n.w)):e.removeAttribute("gs-w"),n.h>1?e.setAttribute("gs-h",String(n.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,n){if(!n)return this;this._writePosAttr(e,n);const o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const i in o)n[i]?e.setAttribute(o[i],String(n[i])):e.removeAttribute(o[i]);return this}_readAttr(e,n=!0){const o={};o.x=q.toNumber(e.getAttribute("gs-x")),o.y=q.toNumber(e.getAttribute("gs-y")),o.w=q.toNumber(e.getAttribute("gs-w")),o.h=q.toNumber(e.getAttribute("gs-h")),o.autoPosition=q.toBool(e.getAttribute("gs-auto-position")),o.noResize=q.toBool(e.getAttribute("gs-no-resize")),o.noMove=q.toBool(e.getAttribute("gs-no-move")),o.locked=q.toBool(e.getAttribute("gs-locked"));const i=e.getAttribute("gs-size-to-content");i&&(i==="true"||i==="false"?o.sizeToContent=q.toBool(i):o.sizeToContent=parseInt(i,10)),o.id=e.getAttribute("gs-id"),o.maxW=q.toNumber(e.getAttribute("gs-max-w")),o.minW=q.toNumber(e.getAttribute("gs-min-w")),o.maxH=q.toNumber(e.getAttribute("gs-max-h")),o.minH=q.toNumber(e.getAttribute("gs-min-h")),n&&(o.w===1&&e.removeAttribute("gs-w"),o.h===1&&e.removeAttribute("gs-h"),o.maxW&&e.removeAttribute("gs-max-w"),o.minW&&e.removeAttribute("gs-min-w"),o.maxH&&e.removeAttribute("gs-max-h"),o.minH&&e.removeAttribute("gs-min-h"));for(const r in o){if(!o.hasOwnProperty(r))return;!o[r]&&o[r]!==0&&r!=="sizeToContent"&&delete o[r]}return o}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let n=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),n=!0):n=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(n),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,n=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,n),this.animationDelay);if(n)q.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el);else if(this.engine.nodes.some(o=>q.shouldSizeToContent(o))){const o=[...this.engine.nodes];this.batchUpdate(),o.forEach(i=>{q.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,n?[n]:this.engine.nodes)}}_updateResizeEvent(e=!1){const n=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!e&&n&&!this.resizeObserver?(this._sizeThrottle=q.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!n)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return q.getElement(e)}static getElements(e=".grid-stack-item"){return q.getElements(e)}static getGridElement(e){return ue.getElement(e)}static getGridElements(e){return q.getElements(e)}_initMargin(){let e,n=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(e=q.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,n=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(r=>{this.opts[r]===void 0?this.opts[r]=n:(e=q.parseHeight(this.opts[r]),this.opts[r]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const i=this.el.style;return i.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),i.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Oe}static setupDragIn(e,n,o,i=document){n?.pause!==void 0&&(fe.pauseDrag=n.pause),n={appendTo:"body",helper:"clone",...n||{}},(typeof e=="string"?q.getElements(e,i):e).forEach((r,a)=>{Oe.isDraggable(r)||Oe.dragIn(r,n),o?.[a]&&(r.gridstackNode=o[a])})}movable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noMove:i.noMove=!0,this.prepareDragDrop(i.el))}),this)}resizable(e,n){return this.opts.staticGrid?this:(ue.getElements(e).forEach(o=>{const i=o.gridstackNode;i&&(n?delete i.noResize:i.noResize=!0,this.prepareDragDrop(i.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableMove(e,n)}),this)}enableResize(e,n=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&n&&o.subGrid.enableResize(e,n)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&ue._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Oe.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Oe.droppable(this.el,"destroy"),this;let e,n;const o=(i,r,a)=>{a=a||r;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const h=a.getBoundingClientRect();a.style.left=h.x+(this.dragTransform.xScale-1)*(i.clientX-h.x)/this.dragTransform.xScale+"px",a.style.top=h.y+(this.dragTransform.yScale-1)*(i.clientY-h.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:d,left:c}=a.getBoundingClientRect();const u=this.el.getBoundingClientRect();c-=u.left,d-=u.top;const f={position:{top:d*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/n)),l.y=Math.max(0,Math.round(d/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Oe.off(r,"drag");return}l._willFitPos&&(q.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,i,f,l,n,e)}else this._dragOrResize(a,i,f,l,n,e)};return Oe.droppable(this.el,{accept:i=>{const r=i.gridstackNode||this._readAttr(i,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(i);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=i.matches(l)}if(a&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(i,r,a)=>{let l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,a),a=a||r,n=this.cellWidth(),e=this.getCellHeight(!0),!l){const u=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(u){try{l=JSON.parse(u)}catch{console.error("Gridstack dropover: Bad JSON format: ",u)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const d=l.w||Math.round(a.offsetWidth/n)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:d,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=d,l.h=c,l._temporaryRemoved=!0),ue._itemRemoving(l.el,!1),Oe.on(r,"drag",o),o(i,r,a),!1}).on(this.el,"dropout",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(i,r,a)=>{const l=a?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const d=!!this.placeholder.parentElement,c=r!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode,d&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const u=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,d&&u?.grid&&u.grid!==this){const h=u.grid;h.engine.removeNodeFromLayoutCache(u),h.engine.removedNodes.push(u),h._triggerRemoveEvent()._triggerChangeEvent(),h.parentGridNode&&!h.engine.nodes.length&&h.opts.subGridDynamic&&h.removeAsSubGrid()}if(!l||(d&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Oe.off(r,"drag"),a!==r?(a.remove(),r=a):r.remove(),this._removeDD(r),!d))return!1;const f=l.subGrid?.el?.gridstack;return q.copyPos(l,this._readAttr(this.placeholder)),q.removePositioningStyles(r),c&&(l.content||l.subGridOpts||ue.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...i,type:"dropped"},u&&u.grid?u:void 0,l),!1}),this}static _itemRemoving(e,n){if(!e)return;const o=e?e.gridstackNode:void 0;!o?.grid||e.classList.contains(o.grid.opts.removableOptions.decline)||(n?o._isAboutToRemove=!0:delete o._isAboutToRemove,n?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Oe.isDroppable(e)&&Oe.droppable(e,this.opts.removableOptions).on(e,"dropover",(n,o)=>ue._itemRemoving(o,!0)).on(e,"dropout",(n,o)=>ue._itemRemoving(o,!1)),this):this}prepareDragDrop(e,n=!1){const o=e?.gridstackNode;if(!o)return;const i=o.noMove||this.opts.disableDrag,r=o.noResize||this.opts.disableResize,a=this.opts.staticGrid||i&&r;if((n||a)&&(o._initDD&&(this._removeDD(e),delete o._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!n))return this;if(!o._initDD){let l,d;const c=(h,p)=>{this.triggerEvent(h,h.target),l=this.cellWidth(),d=this.getCellHeight(!0),this._onStartMoving(e,h,p,o,l,d)},u=(h,p)=>{this._dragOrResize(e,h,p,o,l,d)},f=h=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;const p=o.w!==o._orig.w,g=h.target;if(!(!g.gridstackNode||g.gridstackNode.grid!==this)){if(o.el=g,o._isAboutToRemove){const m=e.gridstackNode.grid;m._gsEventHandler[h.type]&&m._gsEventHandler[h.type](h,g),m.engine.nodes.push(o),m.removeWidget(e,!0,!0)}else q.removePositioningStyles(g),o._temporaryRemoved?(this._writePosAttr(g,o),this.engine.addNode(o)):this._writePosAttr(g,o),this.triggerEvent(h,g);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),h.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(p,o))}};Oe.draggable(e,{start:c,stop:f,drag:u}).resizable(e,{start:c,stop:f,resize:u}),o._initDD=!0}return Oe.draggable(e,i?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,n,o,i,r,a){if(this.engine.cleanNodes().beginUpdate(i),this._writePosAttr(this.placeholder,i),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=i,i.grid?.el)this.dragTransform=q.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=q.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(i.el=this.placeholder,i._lastUiPosition=o.position,i._prevYPix=o.position.top,i._moving=n.type==="dragstart",i._resizing=n.type==="resizestart",delete i._lastTried,n.type==="dropover"&&i._temporaryRemoved&&(this.engine.addNode(i),i._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),n.type==="resizestart"){const l=this.getColumn()-i.x,d=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-i.y;Oe.resizable(e,"option","minWidth",r*Math.min(i.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(i.minH||1,d)).resizable(e,"option","maxWidth",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(i.maxW||Number.MAX_SAFE_INTEGER,i.x+i.w)).resizable(e,"option","maxHeight",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,d)).resizable(e,"option","maxHeightMoveUp",a*Math.min(i.maxH||Number.MAX_SAFE_INTEGER,i.y+i.h))}}_dragOrResize(e,n,o,i,r,a){const l={...i._orig};let d,c=this.opts.marginLeft,u=this.opts.marginRight,f=this.opts.marginTop,h=this.opts.marginBottom;const p=Math.round(a*.1),g=Math.round(r*.1);if(c=Math.min(c,g),u=Math.min(u,g),f=Math.min(f,p),h=Math.min(h,p),n.type==="drag"){if(i._temporaryRemoved)return;const w=o.position.top-i._prevYPix;i._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&q.updateScrollPosition(e,o.position,w);const I=o.position.left+(o.position.left>i._lastUiPosition.left?-u:c),y=o.position.top+(o.position.top>i._lastUiPosition.top?-h:f);l.x=Math.round(I/r),l.y=Math.round(y/a);const v=this._extraDragRow;if(this.engine.collide(i,l)){const C=this.getRow();let $=Math.max(0,l.y+i.h-C);this.opts.maxRow&&C+$>this.opts.maxRow&&($=Math.max(0,this.opts.maxRow-C)),this._extraDragRow=$}else this._extraDragRow=0;if(this._extraDragRow!==v&&this._updateContainerHeight(),i.x===l.x&&i.y===l.y)return}else if(n.type==="resize"){if(l.x<0||(q.updateScrollResize(n,e,a),l.w=Math.round((o.size.width-c)/r),l.h=Math.round((o.size.height-f)/a),i.w===l.w&&i.h===l.h)||i._lastTried&&i._lastTried.w===l.w&&i._lastTried.h===l.h)return;const w=o.position.left+c,I=o.position.top+f;l.x=Math.round(w/r),l.y=Math.round(I/a),d=!0}i._event=n,i._lastTried=l;const m={x:o.position.left+c,y:o.position.top+f,w:(o.size?o.size.width:i.w*r)-c-u,h:(o.size?o.size.height:i.h*a)-f-h};if(this.engine.moveNodeCheck(i,{...l,cellWidth:r,cellHeight:a,rect:m,resizing:d})){i._lastUiPosition=o.position,this.engine.cacheRects(r,a,f,u,h,c),delete i._skipDown,d&&i.subGrid&&i.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const w=n.target;i._sidebarOrig||this._writePosAttr(w,i),this.triggerEvent(n,w)}}triggerEvent(e,n){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[e.type]&&o._gsEventHandler[e.type](e,n)}_leave(e,n){n=n||e;const o=n.gridstackNode;if(!o||(n.style.transform=n.style.transformOrigin=null,Oe.off(e,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&n?n:e;const i=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=i,this.opts.removable===!0&&ue._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}};tn.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)},tn.resizeToContentParent=".grid-stack-item-content",tn.Utils=q,tn.Engine=nr,tn.GDRev="12.4.2";var b0={class:"d-layout"},C0=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-locked","gs-no-resize","gs-no-move","gs-min-w","gs-min-h","gs-max-w","gs-max-h"],E0=(0,s.defineComponent)({name:"DLayout",__name:"layout",props:{modelValue:{default:()=>[]},column:{default:24},cellHeight:{default:60},draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},animate:{type:Boolean,default:!0},float:{type:Boolean,default:!0},removable:{type:Boolean,default:!1},removableOptions:{}},emits:["update:modelValue","added","removed","changed","dragStart","dragStop","resizeStart","resizeStop"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=(0,s.ref)();let a=null;const l=async()=>{r.value&&(await(0,s.nextTick)(),a&&a.destroy(!1),a=tn.init({column:o.column,cellHeight:o.cellHeight,disableDrag:!(o.draggable&&!o.disable),disableResize:!(o.resizable&&!o.disable),animate:o.animate,float:o.float,removable:o.removable,removableOptions:o.removableOptions},r.value),a.on("added",(h,p)=>{const g=p[0];g&&(i("added",d(g)),u())}),a.on("removed",(h,p)=>{const g=p[0];g&&(i("removed",d(g)),u())}),a.on("change",()=>{u(),i("changed",(a?.save()||[]).map(h=>d(h)))}),a.on("dragstart",(h,p)=>{p&&i("dragStart",h,d(p.gridstackNode||p))}),a.on("dragstop",(h,p)=>{p&&i("dragStop",h,d(p.gridstackNode||p))}),a.on("resizestart",(h,p)=>{p&&i("resizeStart",h,d(p.gridstackNode||p))}),a.on("resizestop",(h,p)=>{p&&i("resizeStop",h,d(p.gridstackNode||p))}))},d=h=>({id:h.id||h.el?.getAttribute("gs-id")||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1,locked:h.locked||!1,noResize:h.noResize||!1,noMove:h.noMove||!1,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}),c=async()=>{if(!a||!r.value)return;await(0,s.nextTick)();const h=a.engine.nodes;new Set(h.map(g=>g.id));const p=new Set(o.modelValue.map(g=>g.id));h.forEach(g=>{if(!p.has(g.id||"")){const m=g.el;m&&a&&a.removeWidget(m,!1)}}),o.modelValue.forEach(g=>{const m=h.find(w=>w.id===g.id);if(m)m.el&&a&&a.update(m.el,{x:g.x,y:g.y,w:g.w,h:g.h,locked:g.locked,noResize:g.noResize,noMove:g.noMove,minW:g.minW,minH:g.minH,maxW:g.maxW,maxH:g.maxH});else{if(!r.value||!a)return;const w=r.value.querySelector(`[gs-id="${g.id}"]`);w&&a.makeWidget(w)}})},u=()=>{a&&i("update:modelValue",a.save().map(h=>{const p={id:h.id||"",x:h.x||0,y:h.y||0,w:h.w||1,h:h.h||1},g=o.modelValue.find(m=>m.id===p.id);return g&&Object.keys(g).forEach(m=>{["id","x","y","w","h"].includes(m)||(p[m]=g[m])}),p}))},f=(0,s.computed)(()=>o.modelValue);return(0,s.watch)(()=>o.modelValue,async()=>{a&&(await(0,s.nextTick)(),c())},{deep:!0}),(0,s.watch)(()=>[o.column,o.cellHeight,o.draggable,o.resizable,o.disable,o.animate,o.float,o.removable],()=>{l()}),(0,s.onMounted)(()=>{l()}),(0,s.onBeforeUnmount)(()=>{a&&(a.destroy(!1),a=null)}),e({addItem:async h=>{if(a&&r.value){await(0,s.nextTick)();const p=r.value.querySelector(`[gs-id="${h.id}"]`);p&&(a.makeWidget(p),a.update(p,{x:h.x,y:h.y,w:h.w,h:h.h,locked:h.locked,noResize:h.noResize,noMove:h.noMove,minW:h.minW,minH:h.minH,maxW:h.maxW,maxH:h.maxH}))}},removeItem:h=>{if(a&&r.value){const p=r.value.querySelector(`[gs-id="${h}"]`);p&&a.removeWidget(p,!1)}},clear:()=>{a&&a.removeAll(!1)},getGrid:()=>a}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",b0,[(0,s.createElementVNode)("div",{ref_key:"gridContainerRef",ref:r},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(f.value,g=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:g.id,"gs-id":g.id,"gs-x":g.x,"gs-y":g.y,"gs-w":g.w,"gs-h":g.h,"gs-locked":g.locked,"gs-no-resize":g.noResize,"gs-no-move":g.noMove,"gs-min-w":g.minW,"gs-min-h":g.minH,"gs-max-w":g.maxW,"gs-max-h":g.maxH,class:"d-layout-item"},[(0,s.renderSlot)(h.$slots,"item",{item:g})],8,C0))),128))],512)]))}}),x0=E0,rl=Mt(x0),Be=(t,e="",n=!1)=>n?`${t}pt`:e?`${t}${e}`:`${t}px`,He=(t,e=0)=>t==null||isNaN(t)?0:Number(Number(t).toFixed(e)),S0=t=>t*3/4,k0=t=>t*4/3,N0=["onMousedown"],D0={key:2,class:"d-draggable__mask"},T0=(0,s.defineComponent)({name:"DDraggable",__name:"draggable",props:{index:{},mask:{type:Boolean,default:!0},scale:{default:1},readonly:{type:Boolean,default:!1},resize:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},step:{default:1},zIndex:{default:1},isActiveBgTransparent:{type:Boolean,default:!1},left:{default:0},top:{default:0},width:{},height:{},activeFlag:{type:Boolean,default:!1},isPt:{type:Boolean,default:!1}},emits:["focus","blur","over","out"],setup(t,{expose:e,emit:n}){const o=t,i=n,r=(0,s.ref)(),a=(0,s.ref)(),l=(0,s.ref)(0),d=(0,s.ref)(0),c=(0,s.ref)(0),u=(0,s.ref)(0),f=(0,s.ref)(null),h=(0,s.ref)(!1),p=(0,s.ref)(!1),g=(0,s.ref)(!1),m=(0,s.ref)(!1),w=(0,s.ref)([{classname:"left"},{classname:"right"},{classname:"top"},{classname:"bottom"},{classname:"top-left"},{classname:"top-right"},{classname:"bottom-left"},{classname:"bottom-right"}]),I=(0,s.computed)(()=>o.scale),y=(0,s.computed)(()=>({left:Be(I.value,"",o.isPt)})),v=(0,s.computed)(()=>({left:Be(-I.value,"",o.isPt)})),C=(0,s.computed)(()=>({left:"auto",right:Be(-I.value,"",o.isPt)})),$=(0,s.computed)(()=>({top:Be(-I.value,"",o.isPt)})),z=(0,s.computed)(()=>({top:"auto",bottom:Be(-I.value,"",o.isPt)})),W=(0,s.computed)(()=>{const X=8*I.value;return{width:Be(X,"",o.isPt),height:Be(X,"",o.isPt)}}),j=(0,s.computed)(()=>({fontSize:Be(16*I.value,"",o.isPt)})),D=(0,s.computed)(()=>Object.assign((()=>{if(m.value){const X={zIndex:9999,...y.value};return o.isActiveBgTransparent&&(m.value||p.value)&&!o.readonly&&!o.disabled&&(X.backgroundColor="color-mix(in srgb, var(--j-color-primary-bg) 60%, transparent)"),X}return{zIndex:o.zIndex}})(),{top:Be(u.value,"",o.isPt),width:Be(l.value,"",o.isPt),height:Be(d.value,"",o.isPt),padding:Be(8*I.value,"",o.isPt),...y.value,left:Be(c.value,"",o.isPt)}));(0,s.watch)(()=>o.width,X=>{l.value=He(H(X))||(f.value?.offsetWidth??0)}),(0,s.watch)(()=>o.height,X=>{d.value=He(H(X))||(f.value?.offsetHeight??0)},{deep:!0}),(0,s.watch)(()=>o.left,X=>{c.value=He(H(X))}),(0,s.watch)(()=>o.top,X=>{u.value=He(H(X))}),(0,s.watch)(l,X=>{r.value&&(r.value.style.width=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.width=Be(X,"",o.isPt)))}),(0,s.watch)(d,X=>{r.value&&(r.value.style.height=Be(X,"",o.isPt),o.resize&&f.value?.style&&(f.value.style.height=Be(X,"",o.isPt)))}),(0,s.watch)(()=>o.activeFlag,X=>{O(X)});const O=X=>{m.value=X},H=X=>X===void 0?0:o.isPt?k0(X):X,S=()=>{a.value&&a.value.firstChild&&(f.value=a.value.firstChild,l.value=He(H(o.width))||(f.value?.offsetWidth??0),d.value=He(H(o.height))||(f.value?.offsetHeight??0),c.value=He(H(o.left)),u.value=He(H(o.top)),O(o.activeFlag))},Y=X=>{c.value=X},b=X=>{u.value=X},B=X=>{const J=8*I.value/2,U={};return X.split("-").forEach(Z=>{U[Z]=Be(-J,"",o.isPt)}),U},_=X=>{p.value=X},x=X=>o.isPt?S0(X):X,T=()=>{h.value=!0,i("focus",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},P=()=>{h.value=!1,g.value=!1,i("blur",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},L=()=>{document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,P()}},M=(X,J)=>{if(o.disabled||o.readonly)return;let U,Z,te,oe,ae,ee;g.value=!0,T();let ie=X.clientX,R=X.clientY;document.onmousemove=E=>{h.value=!0,J==="right"?(U=!0,Z=!1):J==="left"?(U=!0,te=!0,ae=!0,Z=!1):J==="top"?(U=!1,Z=!0,oe=!0,ee=!0):J==="bottom"?(U=!1,Z=!0):J==="bottom-right"?(U=!0,Z=!0):J==="bottom-left"?(U=!0,Z=!0,te=!0,ae=!0):J==="top-right"?(U=!0,Z=!0,oe=!0,ee=!0):J==="top-left"&&(U=!0,Z=!0,te=!0,ae=!0,oe=!0,ee=!0);const k=E.clientX-ie,A=E.clientY-R;if(ie=E.clientX,R=E.clientY,U){let N=k*o.step;ae&&(N=-N),te&&(c.value=He(c.value-N)),l.value=He(l.value+N)}if(Z){let N=A*o.step;ee&&(N=-N),oe&&(u.value=He(u.value-N)),d.value=He(d.value+N)}},L()},V=()=>{p.value=!1,i("out",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)})},F=()=>{o.disabled||o.readonly||(p.value=!0,i("over",{index:o.index,width:x(l.value),height:x(d.value),left:x(c.value),top:x(u.value)}))},G=X=>{if(o.disabled||o.readonly)return;m.value=!0,T();let J=X.clientX,U=X.clientY;document.onmousemove=Z=>{const te=Z.clientX-J,oe=Z.clientY-U;J=Z.clientX,U=Z.clientY,c.value=He(c.value+te*o.step),u.value=He(u.value+oe*o.step)},L()};return(0,s.onMounted)(()=>{S()}),e({setActive:O,setLeft:Y,setTop:b,setOverActive:_}),(X,J)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["d-draggable",{"d-draggable--active":(m.value||p.value)&&!t.readonly&&!t.disabled},{"d-draggable--pt":t.isPt&&!t.readonly&&!t.disabled},{"d-draggable--move":h.value},{"d-draggable--click":t.disabled}]),onMousedown:(0,s.withModifiers)(G,["stop"]),onMouseover:(0,s.withModifiers)(F,["stop"]),onMouseout:(0,s.withModifiers)(V,["stop"]),style:(0,s.normalizeStyle)(D.value)},[(0,s.createElementVNode)("div",{class:"d-draggable__wrapper",ref_key:"wrapper",ref:r},[(m.value||p.value||h.value)&&!t.readonly&&!t.disabled?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...$.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...v.value}),class:"d-draggable__line d-draggable__line--top"},null,4),t.isPt?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...$.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...v.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...z.value}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...C.value}),class:"d-draggable__line d-draggable__line--top"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...z.value,transform:"none"}),class:"d-draggable__line d-draggable__line--left"},null,4),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({...y.value,...C.value,transform:"none"}),class:"d-draggable__line d-draggable__line--top"},null,4)],64)):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"d-draggable__line d-draggable__line--label",style:(0,s.normalizeStyle)(j.value)},(0,s.toDisplayString)(c.value)+","+(0,s.toDisplayString)(u.value),5))],64)):(0,s.createCommentVNode)("",!0),!t.readonly&&!t.disabled?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(w.value,(U,Z)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:Z},[m.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:(0,s.normalizeClass)(["d-draggable__range",`d-draggable__range--${U.classname}`]),style:(0,s.normalizeStyle)([W.value,B(U.classname)]),onMousedown:(0,s.withModifiers)(te=>M(te,U.classname),["stop"])},null,46,N0)):(0,s.createCommentVNode)("",!0)],64))),128)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",{class:"d-draggable__item",ref_key:"item",ref:a},[(0,s.renderSlot)(X.$slots,"default")],512),!t.disabled&&t.mask?((0,s.openBlock)(),(0,s.createElementBlock)("div",D0)):(0,s.createCommentVNode)("",!0)],512)],38))}}),I0=T0,sl=Mt(I0),M0=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.form;const a={};r.components.forEach(l=>{const d=e[l.type];a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:d?.dragType||"component",componentName:d?.componentName||"",runtimeType:d?.runtimeType,groupId:l.groupId,config:l.config,isInput:d?.isInput!==!1,containerId:l.containerId,level:l.level};d?.dragType==="container"&&(c.children=[]),i[c.id]=c,a[l.containerId].push(c)}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.form||[]}return{formConfig:n,componentList:o,componentDic:i}},al=(t,e)=>{const n={ver:"V3",form:{...t},components:[],db:{}};return ll(e||[],n.components),n},ll=(t,e)=>{t.forEach(n=>{if(n.type==="pkey")return;const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};n.dragType==="container"&&ll(n.children||[],e),e.push(o)})};function B0(t){const{toString:e}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&t instanceof Element?"element":n[e.call(t)]}function ir(t){const e=B0(t);let n;if(e==="array")n=[];else if(e==="object")n={};else return t;if(e==="array")for(let o=0,i=t.length;o<i;o++)t[o]=(t[o]===0,t[o]),t[o]&&delete t[o].$parent,n.push(ir(t[o]));else e==="object"&&Object.keys(t).forEach(o=>{t&&delete t.$parent,n[o]=ir(t[o])});return n}var z0=Pe(((t,e)=>{(function(n,o){typeof t=="object"&&typeof e<"u"?e.exports=o():typeof define=="function"&&define.amd?define(o):(n=typeof globalThis<"u"?globalThis:n||self).dayjs=o()})(t,(function(){"use strict";var n=1e3,o=6e4,i=36e5,r="millisecond",a="second",l="minute",d="hour",c="day",u="week",f="month",h="quarter",p="year",g="date",m="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(b){var B=["th","st","nd","rd"],_=b%100;return"["+b+(B[(_-20)%10]||B[_]||B[0])+"]"}},v=function(b,B,_){var x=String(b);return!x||x.length>=B?b:""+Array(B+1-x.length).join(_)+b},C={s:v,z:function(b){var B=-b.utcOffset(),_=Math.abs(B),x=Math.floor(_/60),T=_%60;return(B<=0?"+":"-")+v(x,2,"0")+":"+v(T,2,"0")},m:function b(B,_){if(B.date()<_.date())return-b(_,B);var x=12*(_.year()-B.year())+(_.month()-B.month()),T=B.clone().add(x,f),P=_-T<0,L=B.clone().add(x+(P?-1:1),f);return+(-(x+(_-T)/(P?T-L:L-T))||0)},a:function(b){return b<0?Math.ceil(b)||0:Math.floor(b)},p:function(b){return{M:f,y:p,w:u,d:c,D:g,h:d,m:l,s:a,ms:r,Q:h}[b]||String(b||"").toLowerCase().replace(/s$/,"")},u:function(b){return b===void 0}},$="en",z={};z[$]=y;var W="$isDayjsObject",j=function(b){return b instanceof S||!(!b||!b[W])},D=function b(B,_,x){var T;if(!B)return $;if(typeof B=="string"){var P=B.toLowerCase();z[P]&&(T=P),_&&(z[P]=_,T=P);var L=B.split("-");if(!T&&L.length>1)return b(L[0])}else{var M=B.name;z[M]=B,T=M}return!x&&T&&($=T),T||!x&&$},O=function(b,B){if(j(b))return b.clone();var _=typeof B=="object"?B:{};return _.date=b,_.args=arguments,new S(_)},H=C;H.l=D,H.i=j,H.w=function(b,B){return O(b,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var S=(function(){function b(_){this.$L=D(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[W]=!0}var B=b.prototype;return B.parse=function(_){this.$d=(function(x){var T=x.date,P=x.utc;if(T===null)return new Date(NaN);if(H.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var L=T.match(w);if(L){var M=L[2]-1||0,V=(L[7]||"0").substring(0,3);return P?new Date(Date.UTC(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,V)):new Date(L[1],M,L[3]||1,L[4]||0,L[5]||0,L[6]||0,V)}}return new Date(T)})(_),this.init()},B.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},B.$utils=function(){return H},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(_,x){var T=O(_);return this.startOf(x)<=T&&T<=this.endOf(x)},B.isAfter=function(_,x){return O(_)<this.startOf(x)},B.isBefore=function(_,x){return this.endOf(x)<O(_)},B.$g=function(_,x,T){return H.u(_)?this[x]:this.set(T,_)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(_,x){var T=this,P=!!H.u(x)||x,L=H.p(_),M=function(te,oe){var ae=H.w(T.$u?Date.UTC(T.$y,oe,te):new Date(T.$y,oe,te),T);return P?ae:ae.endOf(c)},V=function(te,oe){return H.w(T.toDate()[te].apply(T.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(oe)),T)},F=this.$W,G=this.$M,X=this.$D,J="set"+(this.$u?"UTC":"");switch(L){case p:return P?M(1,0):M(31,11);case f:return P?M(1,G):M(0,G+1);case u:var U=this.$locale().weekStart||0,Z=(F<U?F+7:F)-U;return M(P?X-Z:X+(6-Z),G);case c:case g:return V(J+"Hours",0);case d:return V(J+"Minutes",1);case l:return V(J+"Seconds",2);case a:return V(J+"Milliseconds",3);default:return this.clone()}},B.endOf=function(_){return this.startOf(_,!1)},B.$set=function(_,x){var T,P=H.p(_),L="set"+(this.$u?"UTC":""),M=(T={},T[c]=L+"Date",T[g]=L+"Date",T[f]=L+"Month",T[p]=L+"FullYear",T[d]=L+"Hours",T[l]=L+"Minutes",T[a]=L+"Seconds",T[r]=L+"Milliseconds",T)[P],V=P===c?this.$D+(x-this.$W):x;if(P===f||P===p){var F=this.clone().set(g,1);F.$d[M](V),F.init(),this.$d=F.set(g,Math.min(this.$D,F.daysInMonth())).$d}else M&&this.$d[M](V);return this.init(),this},B.set=function(_,x){return this.clone().$set(_,x)},B.get=function(_){return this[H.p(_)]()},B.add=function(_,x){var T,P=this;_=Number(_);var L=H.p(x),M=function(G){var X=O(P);return H.w(X.date(X.date()+Math.round(G*_)),P)};if(L===f)return this.set(f,this.$M+_);if(L===p)return this.set(p,this.$y+_);if(L===c)return M(1);if(L===u)return M(7);var V=(T={},T[l]=o,T[d]=i,T[a]=n,T)[L]||1,F=this.$d.getTime()+_*V;return H.w(F,this)},B.subtract=function(_,x){return this.add(-1*_,x)},B.format=function(_){var x=this,T=this.$locale();if(!this.isValid())return T.invalidDate||m;var P=_||"YYYY-MM-DDTHH:mm:ssZ",L=H.z(this),M=this.$H,V=this.$m,F=this.$M,G=T.weekdays,X=T.months,J=T.meridiem,U=function(oe,ae,ee,ie){return oe&&(oe[ae]||oe(x,P))||ee[ae].slice(0,ie)},Z=function(oe){return H.s(M%12||12,oe,"0")},te=J||function(oe,ae,ee){var ie=oe<12?"AM":"PM";return ee?ie.toLowerCase():ie};return P.replace(I,(function(oe,ae){return ae||(function(ee){switch(ee){case"YY":return String(x.$y).slice(-2);case"YYYY":return H.s(x.$y,4,"0");case"M":return F+1;case"MM":return H.s(F+1,2,"0");case"MMM":return U(T.monthsShort,F,X,3);case"MMMM":return U(X,F);case"D":return x.$D;case"DD":return H.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return U(T.weekdaysMin,x.$W,G,2);case"ddd":return U(T.weekdaysShort,x.$W,G,3);case"dddd":return G[x.$W];case"H":return String(M);case"HH":return H.s(M,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(M,V,!0);case"A":return te(M,V,!1);case"m":return String(V);case"mm":return H.s(V,2,"0");case"s":return String(x.$s);case"ss":return H.s(x.$s,2,"0");case"SSS":return H.s(x.$ms,3,"0");case"Z":return L}return null})(oe)||L.replace(":","")}))},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(_,x,T){var P,L=this,M=H.p(x),V=O(_),F=(V.utcOffset()-this.utcOffset())*o,G=this-V,X=function(){return H.m(L,V)};switch(M){case p:P=X()/12;break;case f:P=X();break;case h:P=X()/3;break;case u:P=(G-F)/6048e5;break;case c:P=(G-F)/864e5;break;case d:P=G/i;break;case l:P=G/o;break;case a:P=G/n;break;default:P=G}return T?P:H.a(P)},B.daysInMonth=function(){return this.endOf(f).$D},B.$locale=function(){return z[this.$L]},B.locale=function(_,x){if(!_)return this.$L;var T=this.clone(),P=D(_,x,!0);return P&&(T.$L=P),T},B.clone=function(){return H.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},b})(),Y=S.prototype;return O.prototype=Y,[["$ms",r],["$s",a],["$m",l],["$H",d],["$W",c],["$M",f],["$y",p],["$D",g]].forEach((function(b){Y[b[1]]=function(B){return this.$g(B,b[0],b[1])}})),O.extend=function(b,B){return b.$i||(b(B,S,O),b.$i=!0),O},O.locale=D,O.isDayjs=j,O.unix=function(b){return O(1e3*b)},O.en=z[$],O.Ls=z,O.p={},O}))})),wy=bt(z0(),1);function cl(t){const e="j-loading-spin",n=document.querySelector(`.${e}`);if(t){if(!n){document.body.style.overflow="hidden";const o=new DocumentFragment,i=document.createElement("div");i.className=e;const r=document.createElement("span");r.className="j-loading-spin-dot";for(let a=0;a<4;a++){const l=document.createElement("i");r.appendChild(l)}i.appendChild(r),o.appendChild(i),document.body.appendChild(o)}}else n&&n.parentNode&&(document.body.style.overflow="",n.parentNode.removeChild(n))}var by=(()=>{let t=null,e=0;return n=>{n?(e++,t&&clearTimeout(t),cl(!0),t=null):(e=Math.max(0,e-1),e===0&&(t&&clearTimeout(t),t=setTimeout(()=>{cl(!1),t=null},400)))}})(),A0=Pe(((t,e)=>{e.exports={}})),Xe=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o():typeof define=="function"&&define.amd?define([],o):n.CryptoJS=o()})(t,function(){var n=n||(function(o,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof require=="function")try{r=A0()}catch{}var a=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||(function(){function y(){}return function(v){var C;return y.prototype=v,C=new y,y.prototype=null,C}})(),d={},c=d.lib={},u=c.Base=(function(){return{extend:function(y){var v=l(this);return y&&v.mixIn(y),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var v in y)y.hasOwnProperty(v)&&(this[v]=y[v]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=u.extend({init:function(y,v){y=this.words=y||[],v!=i?this.sigBytes=v:this.sigBytes=y.length*4},toString:function(y){return(y||p).stringify(this)},concat:function(y){var v=this.words,C=y.words,$=this.sigBytes,z=y.sigBytes;if(this.clamp(),$%4)for(var W=0;W<z;W++){var j=C[W>>>2]>>>24-W%4*8&255;v[$+W>>>2]|=j<<24-($+W)%4*8}else for(var D=0;D<z;D+=4)v[$+D>>>2]=C[D>>>2];return this.sigBytes+=z,this},clamp:function(){var y=this.words,v=this.sigBytes;y[v>>>2]&=4294967295<<32-v%4*8,y.length=o.ceil(v/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var v=[],C=0;C<y;C+=4)v.push(a());return new f.init(v,y)}}),h=d.enc={},p=h.Hex={stringify:function(y){for(var v=y.words,C=y.sigBytes,$=[],z=0;z<C;z++){var W=v[z>>>2]>>>24-z%4*8&255;$.push((W>>>4).toString(16)),$.push((W&15).toString(16))}return $.join("")},parse:function(y){for(var v=y.length,C=[],$=0;$<v;$+=2)C[$>>>3]|=parseInt(y.substr($,2),16)<<24-$%8*4;return new f.init(C,v/2)}},g=h.Latin1={stringify:function(y){for(var v=y.words,C=y.sigBytes,$=[],z=0;z<C;z++){var W=v[z>>>2]>>>24-z%4*8&255;$.push(String.fromCharCode(W))}return $.join("")},parse:function(y){for(var v=y.length,C=[],$=0;$<v;$++)C[$>>>2]|=(y.charCodeAt($)&255)<<24-$%4*8;return new f.init(C,v)}},m=h.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var v,C=this._data,$=C.words,z=C.sigBytes,W=this.blockSize,j=z/(W*4);y?j=o.ceil(j):j=o.max((j|0)-this._minBufferSize,0);var D=j*W,O=o.min(D*4,z);if(D){for(var H=0;H<D;H+=W)this._doProcessBlock($,H);v=$.splice(0,D),C.sigBytes-=O}return new f.init(v,O)},clone:function(){var y=u.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});c.Hasher=w.extend({cfg:u.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){return y&&this._append(y),this._doFinalize()},blockSize:16,_createHelper:function(y){return function(v,C){return new y.init(C).finalize(v)}},_createHmacHelper:function(y){return function(v,C){return new I.HMAC.init(y,C).finalize(v)}}});var I=d.algo={};return d})(Math);return n})})),dl=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.WordArray,r=o.enc;r.Base64={stringify:function(l){var d=l.words,c=l.sigBytes,u=this._map;l.clamp();for(var f=[],h=0;h<c;h+=3)for(var p=d[h>>>2]>>>24-h%4*8&255,g=d[h+1>>>2]>>>24-(h+1)%4*8&255,m=d[h+2>>>2]>>>24-(h+2)%4*8&255,w=p<<16|g<<8|m,I=0;I<4&&h+I*.75<c;I++)f.push(u.charAt(w>>>6*(3-I)&63));var y=u.charAt(64);if(y)for(;f.length%4;)f.push(y);return f.join("")},parse:function(l){var d=l.length,c=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var f=0;f<c.length;f++)u[c.charCodeAt(f)]=f}var h=c.charAt(64);if(h){var p=l.indexOf(h);p!==-1&&(d=p)}return a(l,d,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(l,d,c){for(var u=[],f=0,h=0;h<d;h++)if(h%4){var p=c[l.charCodeAt(h-1)]<<h%4*2|c[l.charCodeAt(h)]>>>6-h%4*2;u[f>>>2]|=p<<24-f%4*8,f++}return i.create(u,f)}})(),n.enc.Base64})})),ul=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,d=i.algo,c=[];(function(){for(var m=0;m<64;m++)c[m]=o.abs(o.sin(m+1))*4294967296|0})();var u=d.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,w){for(var I=0;I<16;I++){var y=w+I,v=m[y];m[y]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360}var C=this._hash.words,$=m[w+0],z=m[w+1],W=m[w+2],j=m[w+3],D=m[w+4],O=m[w+5],H=m[w+6],S=m[w+7],Y=m[w+8],b=m[w+9],B=m[w+10],_=m[w+11],x=m[w+12],T=m[w+13],P=m[w+14],L=m[w+15],M=C[0],V=C[1],F=C[2],G=C[3];M=f(M,V,F,G,$,7,c[0]),G=f(G,M,V,F,z,12,c[1]),F=f(F,G,M,V,W,17,c[2]),V=f(V,F,G,M,j,22,c[3]),M=f(M,V,F,G,D,7,c[4]),G=f(G,M,V,F,O,12,c[5]),F=f(F,G,M,V,H,17,c[6]),V=f(V,F,G,M,S,22,c[7]),M=f(M,V,F,G,Y,7,c[8]),G=f(G,M,V,F,b,12,c[9]),F=f(F,G,M,V,B,17,c[10]),V=f(V,F,G,M,_,22,c[11]),M=f(M,V,F,G,x,7,c[12]),G=f(G,M,V,F,T,12,c[13]),F=f(F,G,M,V,P,17,c[14]),V=f(V,F,G,M,L,22,c[15]),M=h(M,V,F,G,z,5,c[16]),G=h(G,M,V,F,H,9,c[17]),F=h(F,G,M,V,_,14,c[18]),V=h(V,F,G,M,$,20,c[19]),M=h(M,V,F,G,O,5,c[20]),G=h(G,M,V,F,B,9,c[21]),F=h(F,G,M,V,L,14,c[22]),V=h(V,F,G,M,D,20,c[23]),M=h(M,V,F,G,b,5,c[24]),G=h(G,M,V,F,P,9,c[25]),F=h(F,G,M,V,j,14,c[26]),V=h(V,F,G,M,Y,20,c[27]),M=h(M,V,F,G,T,5,c[28]),G=h(G,M,V,F,W,9,c[29]),F=h(F,G,M,V,S,14,c[30]),V=h(V,F,G,M,x,20,c[31]),M=p(M,V,F,G,O,4,c[32]),G=p(G,M,V,F,Y,11,c[33]),F=p(F,G,M,V,_,16,c[34]),V=p(V,F,G,M,P,23,c[35]),M=p(M,V,F,G,z,4,c[36]),G=p(G,M,V,F,D,11,c[37]),F=p(F,G,M,V,S,16,c[38]),V=p(V,F,G,M,B,23,c[39]),M=p(M,V,F,G,T,4,c[40]),G=p(G,M,V,F,$,11,c[41]),F=p(F,G,M,V,j,16,c[42]),V=p(V,F,G,M,H,23,c[43]),M=p(M,V,F,G,b,4,c[44]),G=p(G,M,V,F,x,11,c[45]),F=p(F,G,M,V,L,16,c[46]),V=p(V,F,G,M,W,23,c[47]),M=g(M,V,F,G,$,6,c[48]),G=g(G,M,V,F,S,10,c[49]),F=g(F,G,M,V,P,15,c[50]),V=g(V,F,G,M,O,21,c[51]),M=g(M,V,F,G,x,6,c[52]),G=g(G,M,V,F,j,10,c[53]),F=g(F,G,M,V,B,15,c[54]),V=g(V,F,G,M,z,21,c[55]),M=g(M,V,F,G,Y,6,c[56]),G=g(G,M,V,F,L,10,c[57]),F=g(F,G,M,V,H,15,c[58]),V=g(V,F,G,M,T,21,c[59]),M=g(M,V,F,G,D,6,c[60]),G=g(G,M,V,F,_,10,c[61]),F=g(F,G,M,V,W,15,c[62]),V=g(V,F,G,M,b,21,c[63]),C[0]=C[0]+M|0,C[1]=C[1]+V|0,C[2]=C[2]+F|0,C[3]=C[3]+G|0},_doFinalize:function(){var m=this._data,w=m.words,I=this._nDataBytes*8,y=m.sigBytes*8;w[y>>>5]|=128<<24-y%32;var v=o.floor(I/4294967296),C=I;w[(y+64>>>9<<4)+15]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,w[(y+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,m.sigBytes=(w.length+1)*4,this._process();for(var $=this._hash,z=$.words,W=0;W<4;W++){var j=z[W];z[W]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360}return $},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,w,I,y,v,C,$){var z=m+(w&I|~w&y)+v+$;return(z<<C|z>>>32-C)+w}function h(m,w,I,y,v,C,$){var z=m+(w&y|I&~y)+v+$;return(z<<C|z>>>32-C)+w}function p(m,w,I,y,v,C,$){var z=m+(w^I^y)+v+$;return(z<<C|z>>>32-C)+w}function g(m,w,I,y,v,C,$){var z=m+(I^(w|~y))+v+$;return(z<<C|z>>>32-C)+w}i.MD5=l._createHelper(u),i.HmacMD5=l._createHmacHelper(u)})(Math),n.MD5})})),P0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib,r=i.WordArray,a=i.Hasher,l=o.algo,d=[],c=l.SHA1=a.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,f){for(var h=this._hash.words,p=h[0],g=h[1],m=h[2],w=h[3],I=h[4],y=0;y<80;y++){if(y<16)d[y]=u[f+y]|0;else{var v=d[y-3]^d[y-8]^d[y-14]^d[y-16];d[y]=v<<1|v>>>31}var C=(p<<5|p>>>27)+I+d[y];y<20?C+=(g&m|~g&w)+1518500249:y<40?C+=(g^m^w)+1859775393:y<60?C+=(g&m|g&w|m&w)-1894007588:C+=(g^m^w)-899497514,I=w,w=m,m=g<<30|g>>>2,g=p,p=C}h[0]=h[0]+p|0,h[1]=h[1]+g|0,h[2]=h[2]+m|0,h[3]=h[3]+w|0,h[4]=h[4]+I|0},_doFinalize:function(){var u=this._data,f=u.words,h=this._nDataBytes*8,p=u.sigBytes*8;return f[p>>>5]|=128<<24-p%32,f[(p+64>>>9<<4)+14]=Math.floor(h/4294967296),f[(p+64>>>9<<4)+15]=h,u.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var u=a.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=a._createHelper(c),o.HmacSHA1=a._createHmacHelper(c)})(),n.SHA1})})),O0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){(function(){var o=n,i=o.lib.Base,r=o.enc.Utf8,a=o.algo;a.HMAC=i.extend({init:function(l,d){l=this._hasher=new l.init,typeof d=="string"&&(d=r.parse(d));var c=l.blockSize,u=c*4;d.sigBytes>u&&(d=l.finalize(d)),d.clamp();for(var f=this._oKey=d.clone(),h=this._iKey=d.clone(),p=f.words,g=h.words,m=0;m<c;m++)p[m]^=1549556828,g[m]^=909522486;f.sigBytes=h.sigBytes=u,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var d=this._hasher,c=d.finalize(l);return d.reset(),d.finalize(this._oKey.clone().concat(c))}})})()})})),fl=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),P0(),O0()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib,r=i.Base,a=i.WordArray,l=o.algo,d=l.MD5,c=l.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:d,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,f){for(var h,p=this.cfg,g=p.hasher.create(),m=a.create(),w=m.words,I=p.keySize,y=p.iterations;w.length<I;){h&&g.update(h),h=g.update(u).finalize(f),g.reset();for(var v=1;v<y;v++)h=g.finalize(h),g.reset();m.concat(h)}return m.sigBytes=I*4,m}});o.EvpKDF=function(u,f,h){return c.create(h).compute(u,f)}})(),n.EvpKDF})})),hl=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),fl()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],o):o(n.CryptoJS)})(t,function(n){n.lib.Cipher||(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,d=r.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var u=c.Base64,f=i.algo.EvpKDF,h=r.Cipher=d.extend({cfg:a.extend(),createEncryptor:function(D,O){return this.create(this._ENC_XFORM_MODE,D,O)},createDecryptor:function(D,O){return this.create(this._DEC_XFORM_MODE,D,O)},init:function(D,O,H){this.cfg=this.cfg.extend(H),this._xformMode=D,this._key=O,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){return D&&this._append(D),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function D(O){return typeof O=="string"?j:$}return function(O){return{encrypt:function(H,S,Y){return D(S).encrypt(O,H,S,Y)},decrypt:function(H,S,Y){return D(S).decrypt(O,H,S,Y)}}}})()});r.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var p=i.mode={},g=r.BlockCipherMode=a.extend({createEncryptor:function(D,O){return this.Encryptor.create(D,O)},createDecryptor:function(D,O){return this.Decryptor.create(D,O)},init:function(D,O){this._cipher=D,this._iv=O}}),m=p.CBC=(function(){var D=g.extend();D.Encryptor=D.extend({processBlock:function(H,S){var Y=this._cipher,b=Y.blockSize;O.call(this,H,S,b),Y.encryptBlock(H,S),this._prevBlock=H.slice(S,S+b)}}),D.Decryptor=D.extend({processBlock:function(H,S){var Y=this._cipher,b=Y.blockSize,B=H.slice(S,S+b);Y.decryptBlock(H,S),O.call(this,H,S,b),this._prevBlock=B}});function O(H,S,Y){var b,B=this._iv;B?(b=B,this._iv=o):b=this._prevBlock;for(var _=0;_<Y;_++)H[S+_]^=b[_]}return D})(),w=i.pad={},I=w.Pkcs7={pad:function(D,O){for(var H=O*4,S=H-D.sigBytes%H,Y=S<<24|S<<16|S<<8|S,b=[],B=0;B<S;B+=4)b.push(Y);var _=l.create(b,S);D.concat(_)},unpad:function(D){var O=D.words[D.sigBytes-1>>>2]&255;D.sigBytes-=O}};r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:I}),reset:function(){var D;h.reset.call(this);var O=this.cfg,H=O.iv,S=O.mode;this._xformMode==this._ENC_XFORM_MODE?D=S.createEncryptor:(D=S.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,H&&H.words):(this._mode=D.call(S,this,H&&H.words),this._mode.__creator=D)},_doProcessBlock:function(D,O){this._mode.processBlock(D,O)},_doFinalize:function(){var D,O=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(O.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),O.unpad(D)),D},blockSize:128/32});var y=r.CipherParams=a.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),v=i.format={},C=v.OpenSSL={stringify:function(D){var O,H=D.ciphertext,S=D.salt;return S?O=l.create([1398893684,1701076831]).concat(S).concat(H):O=H,O.toString(u)},parse:function(D){var O,H=u.parse(D),S=H.words;return S[0]==1398893684&&S[1]==1701076831&&(O=l.create(S.slice(2,4)),S.splice(0,4),H.sigBytes-=16),y.create({ciphertext:H,salt:O})}},$=r.SerializableCipher=a.extend({cfg:a.extend({format:C}),encrypt:function(D,O,H,S){S=this.cfg.extend(S);var Y=D.createEncryptor(H,S),b=Y.finalize(O),B=Y.cfg;return y.create({ciphertext:b,key:H,iv:B.iv,algorithm:D,mode:B.mode,padding:B.padding,blockSize:D.blockSize,formatter:S.format})},decrypt:function(D,O,H,S){return S=this.cfg.extend(S),O=this._parse(O,S.format),D.createDecryptor(H,S).finalize(O.ciphertext)},_parse:function(D,O){return typeof D=="string"?O.parse(D,this):D}}),z=i.kdf={},W=z.OpenSSL={execute:function(D,O,H,S,Y){if(S||(S=l.random(64/8)),Y)var b=f.create({keySize:O+H,hasher:Y}).compute(D,S);else var b=f.create({keySize:O+H}).compute(D,S);var B=l.create(b.words.slice(O),H*4);return b.sigBytes=O*4,y.create({key:b,iv:B,salt:S})}},j=r.PasswordBasedCipher=$.extend({cfg:$.cfg.extend({kdf:W}),encrypt:function(D,O,H,S){S=this.cfg.extend(S);var Y=S.kdf.execute(H,D.keySize,D.ivSize,S.salt,S.hasher);S.iv=Y.iv;var b=$.encrypt.call(this,D,O,Y.key,S);return b.mixIn(Y),b},decrypt:function(D,O,H,S){S=this.cfg.extend(S),O=this._parse(O,S.format);var Y=S.kdf.execute(H,D.keySize,D.ivSize,O.salt,S.hasher);return S.iv=Y.iv,$.decrypt.call(this,D,O,Y.key,S)}})})()})})),$0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),dl(),ul(),fl(),hl()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.BlockCipher,r=o.algo,a=[],l=[],d=[],c=[],u=[],f=[],h=[],p=[],g=[],m=[];(function(){for(var y=[],v=0;v<256;v++)v<128?y[v]=v<<1:y[v]=v<<1^283;for(var C=0,$=0,v=0;v<256;v++){var z=$^$<<1^$<<2^$<<3^$<<4;z=z>>>8^z&255^99,a[C]=z,l[z]=C;var W=y[C],j=y[W],D=y[j],O=y[z]*257^z*16843008;d[C]=O<<24|O>>>8,c[C]=O<<16|O>>>16,u[C]=O<<8|O>>>24,f[C]=O;var O=D*16843009^j*65537^W*257^C*16843008;h[z]=O<<24|O>>>8,p[z]=O<<16|O>>>16,g[z]=O<<8|O>>>24,m[z]=O,C?(C=W^y[y[y[D^W]]],$^=y[y[$]]):C=$=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],I=r.AES=i.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,C=v.words,$=v.sigBytes/4,z=((this._nRounds=$+6)+1)*4,W=this._keySchedule=[],j=0;j<z;j++)j<$?W[j]=C[j]:(y=W[j-1],j%$?$>6&&j%$==4&&(y=a[y>>>24]<<24|a[y>>>16&255]<<16|a[y>>>8&255]<<8|a[y&255]):(y=y<<8|y>>>24,y=a[y>>>24]<<24|a[y>>>16&255]<<16|a[y>>>8&255]<<8|a[y&255],y^=w[j/$|0]<<24),W[j]=W[j-$]^y);for(var D=this._invKeySchedule=[],O=0;O<z;O++){var j=z-O;if(O%4)var y=W[j];else var y=W[j-4];O<4||j<=4?D[O]=y:D[O]=h[a[y>>>24]]^p[a[y>>>16&255]]^g[a[y>>>8&255]]^m[a[y&255]]}}},encryptBlock:function(y,v){this._doCryptBlock(y,v,this._keySchedule,d,c,u,f,a)},decryptBlock:function(y,v){var C=y[v+1];y[v+1]=y[v+3],y[v+3]=C,this._doCryptBlock(y,v,this._invKeySchedule,h,p,g,m,l);var C=y[v+1];y[v+1]=y[v+3],y[v+3]=C},_doCryptBlock:function(y,v,C,$,z,W,j,D){for(var O=this._nRounds,H=y[v]^C[0],S=y[v+1]^C[1],Y=y[v+2]^C[2],b=y[v+3]^C[3],B=4,_=1;_<O;_++){var x=$[H>>>24]^z[S>>>16&255]^W[Y>>>8&255]^j[b&255]^C[B++],T=$[S>>>24]^z[Y>>>16&255]^W[b>>>8&255]^j[H&255]^C[B++],P=$[Y>>>24]^z[b>>>16&255]^W[H>>>8&255]^j[S&255]^C[B++],L=$[b>>>24]^z[H>>>16&255]^W[S>>>8&255]^j[Y&255]^C[B++];H=x,S=T,Y=P,b=L}var x=(D[H>>>24]<<24|D[S>>>16&255]<<16|D[Y>>>8&255]<<8|D[b&255])^C[B++],T=(D[S>>>24]<<24|D[Y>>>16&255]<<16|D[b>>>8&255]<<8|D[H&255])^C[B++],P=(D[Y>>>24]<<24|D[b>>>16&255]<<16|D[H>>>8&255]<<8|D[S&255])^C[B++],L=(D[b>>>24]<<24|D[H>>>16&255]<<16|D[S>>>8&255]<<8|D[Y&255])^C[B++];y[v]=x,y[v+1]=T,y[v+2]=P,y[v+3]=L},keySize:256/32});o.AES=i._createHelper(I)})(),n.AES})})),R0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return n.enc.Utf8})})),H0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),hl()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],o):o(n.CryptoJS)})(t,function(n){return n.pad.Pkcs7})})),V0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.WordArray,l=r.Hasher,d=i.algo,c=[],u=[];(function(){function p(I){for(var y=o.sqrt(I),v=2;v<=y;v++)if(!(I%v))return!1;return!0}function g(I){return(I-(I|0))*4294967296|0}for(var m=2,w=0;w<64;)p(m)&&(w<8&&(c[w]=g(o.pow(m,1/2))),u[w]=g(o.pow(m,1/3)),w++),m++})();var f=[],h=d.SHA256=l.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(p,g){for(var m=this._hash.words,w=m[0],I=m[1],y=m[2],v=m[3],C=m[4],$=m[5],z=m[6],W=m[7],j=0;j<64;j++){if(j<16)f[j]=p[g+j]|0;else{var D=f[j-15],O=(D<<25|D>>>7)^(D<<14|D>>>18)^D>>>3,H=f[j-2],S=(H<<15|H>>>17)^(H<<13|H>>>19)^H>>>10;f[j]=O+f[j-7]+S+f[j-16]}var Y=C&$^~C&z,b=w&I^w&y^I&y,B=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),_=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),x=W+_+Y+u[j]+f[j],T=B+b;W=z,z=$,$=C,C=v+x|0,v=y,y=I,I=w,w=x+T|0}m[0]=m[0]+w|0,m[1]=m[1]+I|0,m[2]=m[2]+y|0,m[3]=m[3]+v|0,m[4]=m[4]+C|0,m[5]=m[5]+$|0,m[6]=m[6]+z|0,m[7]=m[7]+W|0},_doFinalize:function(){var p=this._data,g=p.words,m=this._nDataBytes*8,w=p.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+64>>>9<<4)+14]=o.floor(m/4294967296),g[(w+64>>>9<<4)+15]=m,p.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});i.SHA256=l._createHelper(h),i.HmacSHA256=l._createHmacHelper(h)})(Math),n.SHA256})})),L0=Pe(((t,e)=>{(function(n,o){typeof t=="object"?e.exports=t=o(Xe()):typeof define=="function"&&define.amd?define(["./core"],o):o(n.CryptoJS)})(t,function(n){return(function(o){var i=n,r=i.lib,a=r.Base,l=r.WordArray,d=i.x64={};d.Word=a.extend({init:function(c,u){this.high=c,this.low=u}}),d.WordArray=a.extend({init:function(c,u){c=this.words=c||[],u!=o?this.sigBytes=u:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,u=c.length,f=[],h=0;h<u;h++){var p=c[h];f.push(p.high),f.push(p.low)}return l.create(f,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),u=c.words=this.words.slice(0),f=u.length,h=0;h<f;h++)u[h]=u[h].clone();return c}})})(),n})})),F0=Pe(((t,e)=>{(function(n,o,i){typeof t=="object"?e.exports=t=o(Xe(),L0()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],o):o(n.CryptoJS)})(t,function(n){return(function(){var o=n,i=o.lib.Hasher,r=o.x64,a=r.Word,l=r.WordArray,d=o.algo;function c(){return a.create.apply(a,arguments)}var u=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],f=[];(function(){for(var p=0;p<80;p++)f[p]=c()})();var h=d.SHA512=i.extend({_doReset:function(){this._hash=new l.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(p,g){for(var m=this._hash.words,w=m[0],I=m[1],y=m[2],v=m[3],C=m[4],$=m[5],z=m[6],W=m[7],j=w.high,D=w.low,O=I.high,H=I.low,S=y.high,Y=y.low,b=v.high,B=v.low,_=C.high,x=C.low,T=$.high,P=$.low,L=z.high,M=z.low,V=W.high,F=W.low,G=j,X=D,J=O,U=H,Z=S,te=Y,oe=b,ae=B,ee=_,ie=x,R=T,E=P,k=L,A=M,N=V,Q=F,K=0;K<80;K++){var re,ne,de=f[K];if(K<16)ne=de.high=p[g+K*2]|0,re=de.low=p[g+K*2+1]|0;else{var ye=f[K-15],ve=ye.high,me=ye.low,dt=(ve>>>1|me<<31)^(ve>>>8|me<<24)^ve>>>7,Tt=(me>>>1|ve<<31)^(me>>>8|ve<<24)^(me>>>7|ve<<25),ti=f[K-2],cn=ti.high,Un=ti.low,ly=(cn>>>19|Un<<13)^(cn<<3|Un>>>29)^cn>>>6,jl=(Un>>>19|cn<<13)^(Un<<3|cn>>>29)^(Un>>>6|cn<<26),Wl=f[K-7],cy=Wl.high,dy=Wl.low,Yl=f[K-16],uy=Yl.high,Ul=Yl.low;re=Tt+dy,ne=dt+cy+(re>>>0<Tt>>>0?1:0),re=re+jl,ne=ne+ly+(re>>>0<jl>>>0?1:0),re=re+Ul,ne=ne+uy+(re>>>0<Ul>>>0?1:0),de.high=ne,de.low=re}var fy=ee&R^~ee&k,Xl=ie&E^~ie&A,hy=G&J^G&Z^J&Z,py=X&U^X&te^U&te,gy=(G>>>28|X<<4)^(G<<30|X>>>2)^(G<<25|X>>>7),ql=(X>>>28|G<<4)^(X<<30|G>>>2)^(X<<25|G>>>7),my=(ee>>>14|ie<<18)^(ee>>>18|ie<<14)^(ee<<23|ie>>>9),vy=(ie>>>14|ee<<18)^(ie>>>18|ee<<14)^(ie<<23|ee>>>9),Kl=u[K],yy=Kl.high,Zl=Kl.low,Ue=Q+vy,It=N+my+(Ue>>>0<Q>>>0?1:0),Ue=Ue+Xl,It=It+fy+(Ue>>>0<Xl>>>0?1:0),Ue=Ue+Zl,It=It+yy+(Ue>>>0<Zl>>>0?1:0),Ue=Ue+re,It=It+ne+(Ue>>>0<re>>>0?1:0),Jl=ql+py,_y=gy+hy+(Jl>>>0<ql>>>0?1:0);N=k,Q=A,k=R,A=E,R=ee,E=ie,ie=ae+Ue|0,ee=oe+It+(ie>>>0<ae>>>0?1:0)|0,oe=Z,ae=te,Z=J,te=U,J=G,U=X,X=Ue+Jl|0,G=It+_y+(X>>>0<Ue>>>0?1:0)|0}D=w.low=D+X,w.high=j+G+(D>>>0<X>>>0?1:0),H=I.low=H+U,I.high=O+J+(H>>>0<U>>>0?1:0),Y=y.low=Y+te,y.high=S+Z+(Y>>>0<te>>>0?1:0),B=v.low=B+ae,v.high=b+oe+(B>>>0<ae>>>0?1:0),x=C.low=x+ie,C.high=_+ee+(x>>>0<ie>>>0?1:0),P=$.low=P+E,$.high=T+R+(P>>>0<E>>>0?1:0),M=z.low=M+A,z.high=L+k+(M>>>0<A>>>0?1:0),F=W.low=F+Q,W.high=V+N+(F>>>0<Q>>>0?1:0)},_doFinalize:function(){var p=this._data,g=p.words,m=this._nDataBytes*8,w=p.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+128>>>10<<5)+30]=Math.floor(m/4294967296),g[(w+128>>>10<<5)+31]=m,p.sigBytes=g.length*4,this._process(),this._hash.toX32()},clone:function(){var p=i.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});o.SHA512=i._createHelper(h),o.HmacSHA512=i._createHmacHelper(h)})(),n.SHA512})})),G0=bt($0(),1),j0=bt(R0(),1),Cy=bt(H0(),1),Ey=bt(dl(),1),xy=bt(ul(),1),Sy=bt(V0(),1),ky=bt(F0(),1),{decrypt:Ny,encrypt:Dy}=G0.default,Ty=j0.default.parse;function W0(t,e,n){return(e=q0(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)({}).hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},yt.apply(null,arguments)}function pl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pl(Object(n),!0).forEach(function(o){W0(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Y0(t,e){if(t==null)return{};var n,o,i=U0(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function U0(t,e){if(t==null)return{};var n={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;n[o]=t[o]}return n}function X0(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function q0(t){var e=X0(t,"string");return typeof e=="symbol"?e:e+""}function rr(t){"@babel/helpers - typeof";return rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(t)}var K0="1.15.7";function _t(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var wt=_t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),$n=_t(/Edge/i),gl=_t(/firefox/i),Rn=_t(/safari/i)&&!_t(/chrome/i)&&!_t(/android/i),sr=_t(/iP(ad|od|hone)/i),ml=_t(/chrome/i)&&_t(/android/i),vl={capture:!1,passive:!1};function we(t,e,n){t.addEventListener(e,n,!wt&&vl)}function _e(t,e,n){t.removeEventListener(e,n,!wt&&vl)}function Lo(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function yl(t){return t.host&&t!==document&&t.host.nodeType&&t.host!==t?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Lo(t,e):Lo(t,e))||o&&t===n)return t;if(t===n)break}while(t=yl(t))}return null}var _l=/\s+/g;function We(t,e,n){t&&e&&(t.classList?t.classList[n?"add":"remove"](e):t.className=((" "+t.className+" ").replace(_l," ").replace(" "+e+" "," ")+(n?" "+e:"")).replace(_l," "))}function he(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function nn(t,e){var n="";if(typeof t=="string")n=t;else do{var o=he(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function wl(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function ct(){var t=document.scrollingElement;return t||document.documentElement}function De(t,e,n,o,i){if(!(!t.getBoundingClientRect&&t!==window)){var r,a,l,d,c,u,f;if(t!==window&&t.parentNode&&t!==ct()?(r=t.getBoundingClientRect(),a=r.top,l=r.left,d=r.bottom,c=r.right,u=r.height,f=r.width):(a=0,l=0,d=window.innerHeight,c=window.innerWidth,u=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!wt))do if(i&&i.getBoundingClientRect&&(he(i,"transform")!=="none"||n&&he(i,"position")!=="static")){var h=i.getBoundingClientRect();a-=h.top+parseInt(he(i,"border-top-width")),l-=h.left+parseInt(he(i,"border-left-width")),d=a+r.height,c=l+r.width;break}while(i=i.parentNode);if(o&&t!==window){var p=nn(i||t),g=p&&p.a,m=p&&p.d;p&&(a/=m,l/=g,f/=g,u/=m,d=a+u,c=l+f)}return{top:a,left:l,bottom:d,right:c,width:f,height:u}}}function bl(t,e,n){for(var o=kt(t,!0),i=De(t)[e];o;){var r=De(o)[n],a=void 0;if(n==="top"||n==="left"?a=i>=r:a=i<=r,!a)return o;if(o===ct())break;o=kt(o,!1)}return!1}function on(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if(a[r].style.display!=="none"&&a[r]!==pe.ghost&&(o||a[r]!==pe.dragged)&&tt(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function ar(t,e){for(var n=t.lastElementChild;n&&(n===pe.ghost||he(n,"display")==="none"||e&&!Lo(n,e));)n=n.previousElementSibling;return n||null}function qe(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==pe.clone&&(!e||Lo(t,e))&&n++;return n}function Cl(t){var e=0,n=0,o=ct();if(t)do{var i=nn(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Z0(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function kt(t,e){if(!t||!t.getBoundingClientRect)return ct();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=he(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return ct();if(o||e)return n;o=!0}}while(n=n.parentNode);return ct()}function J0(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function lr(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Hn;function El(t,e){return function(){if(!Hn){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Hn=setTimeout(function(){Hn=void 0},e)}}}function Q0(){clearTimeout(Hn),Hn=void 0}function xl(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Sl(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function kl(t,e,n){var o={};return Array.from(t.children).forEach(function(i){var r,a,l,d;if(!(!tt(i,e.draggable,t,!1)||i.animated||i===n)){var c=De(i);o.left=Math.min((r=o.left)!==null&&r!==void 0?r:1/0,c.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,c.top),o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-1/0,c.right),o.bottom=Math.max((d=o.bottom)!==null&&d!==void 0?d:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Ve="Sortable"+new Date().getTime();function ev(){var t=[],e;return{captureAnimationState:function(){t=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(o){if(!(he(o,"display")==="none"||o===pe.ghost)){t.push({target:o,rect:De(o)});var i=lt({},t[t.length-1].rect);if(o.thisAnimationDuration){var r=nn(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(Z0(t,{target:o}),1)},animateAll:function(o){var i=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var r=!1,a=0;t.forEach(function(l){var d=0,c=l.target,u=c.fromRect,f=De(c),h=c.prevFromRect,p=c.prevToRect,g=l.rect,m=nn(c,!0);m&&(f.top-=m.f,f.left-=m.e),c.toRect=f,c.thisAnimationDuration&&lr(h,f)&&!lr(u,f)&&(g.top-f.top)/(g.left-f.left)===(u.top-f.top)/(u.left-f.left)&&(d=nv(g,h,p,i.options)),lr(f,u)||(c.prevFromRect=u,c.prevToRect=f,d||(d=i.options.animation),i.animate(c,g,f,d)),d&&(r=!0,a=Math.max(a,d),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},d),c.thisAnimationDuration=d)}),clearTimeout(e),r?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,i,r,a){if(a){he(o,"transition",""),he(o,"transform","");var l=nn(this.el),d=l&&l.a,c=l&&l.d,u=(i.left-r.left)/(d||1),f=(i.top-r.top)/(c||1);o.animatingX=!!u,o.animatingY=!!f,he(o,"transform","translate3d("+u+"px,"+f+"px,0)"),this.forRepaintDummy=tv(o),he(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),he(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){he(o,"transition",""),he(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function tv(t){return t.offsetWidth}function nv(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var rn=[],cr={initializeByDefault:!0},Vn={mount:function(e){for(var n in cr)cr.hasOwnProperty(n)&&!(n in e)&&(e[n]=cr[n]);rn.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),rn.push(e)},pluginEvent:function(e,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=e+"Global";rn.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][r]&&n[a.pluginName][r](lt({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](lt({sortable:n},o)))})},initializePlugins:function(e,n,o,i){rn.forEach(function(l){var d=l.pluginName;if(!(!e.options[d]&&!l.initializeByDefault)){var c=new l(e,n,e.options);c.sortable=e,c.options=e.options,e[d]=c,yt(o,c.defaults)}});for(var r in e.options)if(e.options.hasOwnProperty(r)){var a=this.modifyOption(e,r,e.options[r]);typeof a<"u"&&(e.options[r]=a)}},getEventProperties:function(e,n){var o={};return rn.forEach(function(i){typeof i.eventProperties=="function"&&yt(o,i.eventProperties.call(n[i.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return rn.forEach(function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(i=r.optionListeners[n].call(e[r.pluginName],o))}),i}};function ov(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,d=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,f=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,g=t.extraEventProperties;if(e=e||n&&n[Ve],!!e){var m,w=e.options,I="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!wt&&!$n?m=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(m=document.createEvent("Event"),m.initEvent(o,!0,!0)),m.to=a||n,m.from=l||n,m.item=i||n,m.clone=r,m.oldIndex=d,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=f,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var y=lt(lt({},g),Vn.getEventProperties(o,e));for(var v in y)m[v]=y[v];n&&n.dispatchEvent(m),w[I]&&w[I].call(e,m)}}var iv=["evt"],Le=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=Y0(o,iv);Vn.pluginEvent.bind(pe)(e,n,lt({dragEl:se,parentEl:xe,ghostEl:ge,rootEl:Ce,nextEl:Ht,lastDownEl:Fo,cloneEl:Ee,cloneHidden:Nt,dragStarted:Fn,putSortable:ze,activeSortable:pe.active,originalEvent:i,oldIndex:sn,oldDraggableIndex:Ln,newIndex:Ye,newDraggableIndex:Dt,hideGhostForTarget:zl,unhideGhostForTarget:Al,cloneNowHidden:function(){Nt=!0},cloneNowShown:function(){Nt=!1},dispatchSortableEvent:function(l){$e({sortable:n,name:l,originalEvent:i})}},r))};function $e(t){ov(lt({putSortable:ze,cloneEl:Ee,targetEl:se,rootEl:Ce,oldIndex:sn,oldDraggableIndex:Ln,newIndex:Ye,newDraggableIndex:Dt},t))}var se,xe,ge,Ce,Ht,Fo,Ee,Nt,sn,Ye,Ln,Dt,Go,ze,an=!1,jo=!1,Wo=[],Vt,nt,dr,ur,Nl,Dl,Fn,ln,Gn,jn=!1,Yo=!1,Uo,Ae,fr=[],hr=!1,Xo=[],qo=typeof document<"u",Ko=sr,Tl=$n||wt?"cssFloat":"float",rv=qo&&!ml&&!sr&&"draggable"in document.createElement("div"),Il=(function(){if(qo){if(wt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),Ml=function(e,n){var o=he(e),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=on(e,0,n),a=on(e,1,n),l=r&&he(r),d=a&&he(a),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+De(r).width,u=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+De(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&l.float&&l.float!=="none"){var f=l.float==="left"?"left":"right";return a&&(d.clear==="both"||d.clear===f)?"vertical":"horizontal"}return r&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=i&&o[Tl]==="none"||a&&o[Tl]==="none"&&c+u>i)?"vertical":"horizontal"},sv=function(e,n,o){var i=o?e.left:e.top,r=o?e.right:e.bottom,a=o?e.width:e.height,l=o?n.left:n.top,d=o?n.right:n.bottom,c=o?n.width:n.height;return i===l||r===d||i+a/2===l+c/2},av=function(e,n){var o;return Wo.some(function(i){var r=i[Ve].options.emptyInsertThreshold;if(!(!r||ar(i))){var a=De(i),l=e>=a.left-r&&e<=a.right+r,d=n>=a.top-r&&n<=a.bottom+r;if(l&&d)return o=i}}),o},Bl=function(e){function n(r,a){return function(l,d,c,u){var f=l.options.group.name&&d.options.group.name&&l.options.group.name===d.options.group.name;if(r==null&&(a||f))return!0;if(r==null||r===!1)return!1;if(a&&r==="clone")return r;if(typeof r=="function")return n(r(l,d,c,u),a)(l,d,c,u);var h=(a?l:d).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},i=e.group;(!i||rr(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,e.group=o},zl=function(){!Il&&ge&&he(ge,"display","none")},Al=function(){!Il&&ge&&he(ge,"display","")};qo&&!ml&&document.addEventListener("click",function(t){if(jo)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),jo=!1,!1},!0);var Lt=function(e){if(se){e=e.touches?e.touches[0]:e;var n=av(e.clientX,e.clientY);if(n){var o={};for(var i in e)e.hasOwnProperty(i)&&(o[i]=e[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[Ve]._onDragOver(o)}}},lv=function(e){se&&se.parentNode[Ve]._isOutsideThisEl(e.target)};function pe(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=yt({},e),t[Ve]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ml(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,l){a.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:pe.supportPointer!==!1&&"PointerEvent"in window&&(!Rn||sr),emptyInsertThreshold:5};Vn.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);Bl(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:rv,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?we(t,"pointerdown",this._onTapStart):(we(t,"mousedown",this._onTapStart),we(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(we(t,"dragover",this),we(t,"dragenter",this)),Wo.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),yt(this,ev())}pe.prototype={constructor:pe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ln=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,se):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,d=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||d,u=i.filter;if(mv(o),!se&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Rn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=tt(d,i.draggable,o,!1),!(d&&d.animated)&&Fo!==d)){if(sn=qe(d),Ln=qe(d,i.draggable),typeof u=="function"){if(u.call(this,e,d,this)){$e({sortable:n,rootEl:c,name:"filter",targetEl:d,toEl:o,fromEl:o}),Le("filter",n,{evt:e}),r&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(f){if(f=tt(c,f.trim(),o,!1),f)return $e({sortable:n,rootEl:f,name:"filter",targetEl:d,fromEl:o,toEl:o}),Le("filter",n,{evt:e}),!0}),u)){r&&e.preventDefault();return}i.handle&&!tt(c,i.handle,o,!1)||this._prepareDragStart(e,l,d)}}},_prepareDragStart:function(e,n,o){var i=this,r=i.el,a=i.options,l=r.ownerDocument,d;if(o&&!se&&o.parentNode===r){var c=De(o);if(Ce=r,se=o,xe=se.parentNode,Ht=se.nextSibling,Fo=o,Go=a.group,pe.dragged=se,Vt={target:se,clientX:(n||e).clientX,clientY:(n||e).clientY},Nl=Vt.clientX-c.left,Dl=Vt.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,se.style["will-change"]="all",d=function(){if(Le("delayEnded",i,{evt:e}),pe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!gl&&i.nativeDraggable&&(se.draggable=!0),i._triggerDragStart(e,n),$e({sortable:i,name:"choose",originalEvent:e}),We(se,a.chosenClass,!0)},a.ignore.split(",").forEach(function(u){wl(se,u.trim(),pr)}),we(l,"dragover",Lt),we(l,"mousemove",Lt),we(l,"touchmove",Lt),a.supportPointer?(we(l,"pointerup",i._onDrop),!this.nativeDraggable&&we(l,"pointercancel",i._onDrop)):(we(l,"mouseup",i._onDrop),we(l,"touchend",i._onDrop),we(l,"touchcancel",i._onDrop)),gl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,se.draggable=!0),Le("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!($n||wt))){if(pe.eventCanceled){this._onDrop();return}a.supportPointer?(we(l,"pointerup",i._disableDelayedDrag),we(l,"pointercancel",i._disableDelayedDrag)):(we(l,"mouseup",i._disableDelayedDrag),we(l,"touchend",i._disableDelayedDrag),we(l,"touchcancel",i._disableDelayedDrag)),we(l,"mousemove",i._delayedDragTouchMoveHandler),we(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&we(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(d,a.delay)}else d()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){se&&pr(se),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;_e(e,"mouseup",this._disableDelayedDrag),_e(e,"touchend",this._disableDelayedDrag),_e(e,"touchcancel",this._disableDelayedDrag),_e(e,"pointerup",this._disableDelayedDrag),_e(e,"pointercancel",this._disableDelayedDrag),_e(e,"mousemove",this._delayedDragTouchMoveHandler),_e(e,"touchmove",this._delayedDragTouchMoveHandler),_e(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?we(document,"pointermove",this._onTouchMove):n?we(document,"touchmove",this._onTouchMove):we(document,"mousemove",this._onTouchMove):(we(se,"dragend",this),we(Ce,"dragstart",this._onDragStart));try{document.selection?Jo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(an=!1,Ce&&se){Le("dragStarted",this,{evt:n}),this.nativeDraggable&&we(document,"dragover",lv);var o=this.options;!e&&We(se,o.dragClass,!1),We(se,o.ghostClass,!0),pe.active=this,e&&this._appendGhost(),$e({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(nt){this._lastX=nt.clientX,this._lastY=nt.clientY,zl();for(var e=document.elementFromPoint(nt.clientX,nt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(nt.clientX,nt.clientY),e!==n);)n=e;if(se.parentNode[Ve]._isOutsideThisEl(e),n)do{if(n[Ve]){var o=void 0;if(o=n[Ve]._onDragOver({clientX:nt.clientX,clientY:nt.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=yl(n));Al()}},_onTouchMove:function(e){if(Vt){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=e.touches?e.touches[0]:e,a=ge&&nn(ge,!0),l=ge&&a&&a.a,d=ge&&a&&a.d,c=Ko&&Ae&&Cl(Ae),u=(r.clientX-Vt.clientX+i.x)/(l||1)+(c?c[0]-fr[0]:0)/(l||1),f=(r.clientY-Vt.clientY+i.y)/(d||1)+(c?c[1]-fr[1]:0)/(d||1);if(!pe.active&&!an){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(ge){a?(a.e+=u-(dr||0),a.f+=f-(ur||0)):a={a:1,b:0,c:0,d:1,e:u,f};var h="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");he(ge,"webkitTransform",h),he(ge,"mozTransform",h),he(ge,"msTransform",h),he(ge,"transform",h),dr=u,ur=f,nt=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ge){var e=this.options.fallbackOnBody?document.body:Ce,n=De(se,!0,Ko,!0,e),o=this.options;if(Ko){for(Ae=e;he(Ae,"position")==="static"&&he(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=ct()),n.top+=Ae.scrollTop,n.left+=Ae.scrollLeft):Ae=ct(),fr=Cl(Ae)}ge=se.cloneNode(!0),We(ge,o.ghostClass,!1),We(ge,o.fallbackClass,!0),We(ge,o.dragClass,!0),he(ge,"transition",""),he(ge,"transform",""),he(ge,"box-sizing","border-box"),he(ge,"margin",0),he(ge,"top",n.top),he(ge,"left",n.left),he(ge,"width",n.width),he(ge,"height",n.height),he(ge,"opacity","0.8"),he(ge,"position",Ko?"absolute":"fixed"),he(ge,"zIndex","100000"),he(ge,"pointerEvents","none"),pe.ghost=ge,e.appendChild(ge),he(ge,"transform-origin",Nl/parseInt(ge.style.width)*100+"% "+Dl/parseInt(ge.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,i=e.dataTransfer,r=o.options;if(Le("dragStart",this,{evt:e}),pe.eventCanceled){this._onDrop();return}Le("setupClone",this),pe.eventCanceled||(Ee=Sl(se),Ee.removeAttribute("id"),Ee.draggable=!1,Ee.style["will-change"]="",this._hideClone(),We(Ee,this.options.chosenClass,!1),pe.clone=Ee),o.cloneId=Jo(function(){Le("clone",o),!pe.eventCanceled&&(o.options.removeCloneOnHide||Ce.insertBefore(Ee,se),o._hideClone(),$e({sortable:o,name:"clone"}))}),!n&&We(se,r.dragClass,!0),n?(jo=!0,o._loopId=setInterval(o._emulateDragOver,50)):(_e(document,"mouseup",o._onDrop),_e(document,"touchend",o._onDrop),_e(document,"touchcancel",o._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(o,i,se)),we(document,"drop",o),he(se,"transform","translateZ(0)")),an=!0,o._dragStartId=Jo(o._dragStarted.bind(o,n,e)),we(document,"selectstart",o),Fn=!0,window.getSelection().removeAllRanges(),Rn&&he(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,i,r,a,l=this.options,d=l.group,c=pe.active,u=Go===d,f=l.sort,h=ze||c,p,g=this,m=!1;if(hr)return;function w(T,P){Le(T,g,lt({evt:e,isOwner:u,axis:p?"vertical":"horizontal",revert:a,dragRect:i,targetRect:r,canSort:f,fromSortable:h,target:o,completed:y,onMove:function(M,V){return Zo(Ce,n,se,i,M,De(M),e,V)},changed:v},P))}function I(){w("dragOverAnimationCapture"),g.captureAnimationState(),g!==h&&h.captureAnimationState()}function y(T){return w("dragOverCompleted",{insertion:T}),T&&(u?c._hideClone():c._showClone(g),g!==h&&(We(se,ze?ze.options.ghostClass:c.options.ghostClass,!1),We(se,l.ghostClass,!0)),ze!==g&&g!==pe.active?ze=g:g===pe.active&&ze&&(ze=null),h===g&&(g._ignoreWhileAnimating=o),g.animateAll(function(){w("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===se&&!se.animated||o===n&&!o.animated)&&(ln=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(se.parentNode[Ve]._isOutsideThisEl(e.target),!T&&Lt(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){Ye=qe(se),Dt=qe(se,l.draggable),$e({sortable:g,name:"change",toEl:n,newIndex:Ye,newDraggableIndex:Dt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=tt(o,l.draggable,n,!0),w("dragOver"),pe.eventCanceled)return m;if(se.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||g._ignoreWhileAnimating===o)return y(!1);if(jo=!1,c&&!l.disabled&&(u?f||(a=xe!==Ce):ze===this||(this.lastPutMode=Go.checkPull(this,c,se,e))&&d.checkPut(this,c,se,e))){if(p=this._getDirection(e,o)==="vertical",i=De(se),w("dragOverValid"),pe.eventCanceled)return m;if(a)return xe=Ce,I(),this._hideClone(),w("revert"),pe.eventCanceled||(Ht?Ce.insertBefore(se,Ht):Ce.appendChild(se)),y(!0);var C=ar(n,l.draggable);if(!C||fv(e,p,this)&&!C.animated){if(C===se)return y(!1);if(C&&n===e.target&&(o=C),o&&(r=De(o)),Zo(Ce,n,se,i,o,r,e,!!o)!==!1)return I(),C&&C.nextSibling?n.insertBefore(se,C.nextSibling):n.appendChild(se),xe=n,v(),y(!0)}else if(C&&uv(e,p,this)){var $=on(n,0,l,!0);if($===se)return y(!1);if(o=$,r=De(o),Zo(Ce,n,se,i,o,r,e,!1)!==!1)return I(),n.insertBefore(se,$),xe=n,v(),y(!0)}else if(o.parentNode===n){r=De(o);var z=0,W,j=se.parentNode!==n,D=!sv(se.animated&&se.toRect||i,o.animated&&o.toRect||r,p),O=p?"top":"left",H=bl(o,"top","top")||bl(se,"top","top"),S=H?H.scrollTop:void 0;ln!==o&&(W=r[O],jn=!1,Yo=!D&&l.invertSwap||j),z=hv(e,o,r,p,D?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Yo,ln===o);var Y;if(z!==0){var b=qe(se);do b-=z,Y=xe.children[b];while(Y&&(he(Y,"display")==="none"||Y===ge))}if(z===0||Y===o)return y(!1);ln=o,Gn=z;var B=o.nextElementSibling,_=!1;_=z===1;var x=Zo(Ce,n,se,i,o,r,e,_);if(x!==!1)return(x===1||x===-1)&&(_=x===1),hr=!0,setTimeout(dv,30),I(),_&&!B?n.appendChild(se):o.parentNode.insertBefore(se,_?B:o),H&&xl(H,0,S-H.scrollTop),xe=se.parentNode,W!==void 0&&!Yo&&(Uo=Math.abs(W-De(o)[O])),v(),y(!0)}if(n.contains(se))return y(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){_e(document,"mousemove",this._onTouchMove),_e(document,"touchmove",this._onTouchMove),_e(document,"pointermove",this._onTouchMove),_e(document,"dragover",Lt),_e(document,"mousemove",Lt),_e(document,"touchmove",Lt)},_offUpEvents:function(){var e=this.el.ownerDocument;_e(e,"mouseup",this._onDrop),_e(e,"touchend",this._onDrop),_e(e,"pointerup",this._onDrop),_e(e,"pointercancel",this._onDrop),_e(e,"touchcancel",this._onDrop),_e(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(Ye=qe(se),Dt=qe(se,o.draggable),Le("drop",this,{evt:e}),xe=se&&se.parentNode,Ye=qe(se),Dt=qe(se,o.draggable),pe.eventCanceled){this._nulling();return}an=!1,Yo=!1,jn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),gr(this.cloneId),gr(this._dragStartId),this.nativeDraggable&&(_e(document,"drop",this),_e(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Rn&&he(document.body,"user-select",""),he(se,"transform",""),e&&(Fn&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),ge&&ge.parentNode&&ge.parentNode.removeChild(ge),(Ce===xe||ze&&ze.lastPutMode!=="clone")&&Ee&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),se&&(this.nativeDraggable&&_e(se,"dragend",this),pr(se),se.style["will-change"]="",Fn&&!an&&We(se,ze?ze.options.ghostClass:this.options.ghostClass,!1),We(se,this.options.chosenClass,!1),$e({sortable:this,name:"unchoose",toEl:xe,newIndex:null,newDraggableIndex:null,originalEvent:e}),Ce!==xe?(Ye>=0&&($e({rootEl:xe,name:"add",toEl:xe,fromEl:Ce,originalEvent:e}),$e({sortable:this,name:"remove",toEl:xe,originalEvent:e}),$e({rootEl:xe,name:"sort",toEl:xe,fromEl:Ce,originalEvent:e}),$e({sortable:this,name:"sort",toEl:xe,originalEvent:e})),ze&&ze.save()):Ye!==sn&&Ye>=0&&($e({sortable:this,name:"update",toEl:xe,originalEvent:e}),$e({sortable:this,name:"sort",toEl:xe,originalEvent:e})),pe.active&&((Ye==null||Ye===-1)&&(Ye=sn,Dt=Ln),$e({sortable:this,name:"end",toEl:xe,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Le("nulling",this),Ce=se=xe=ge=Ht=Ee=Fo=Nt=Vt=nt=Fn=Ye=Dt=sn=Ln=ln=Gn=ze=Go=pe.dragged=pe.ghost=pe.clone=pe.active=null;var e=this.el;Xo.forEach(function(n){e.contains(n)&&(n.checked=!0)}),Xo.length=dr=ur=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":se&&(this._onDragOver(e),cv(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,i=0,r=o.length,a=this.options;i<r;i++)n=o[i],tt(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||gv(n));return e},sort:function(e,n){var o={},i=this.el;this.toArray().forEach(function(r,a){var l=i.children[a];tt(l,this.options.draggable,i,!1)&&(o[r]=l)},this),n&&this.captureAnimationState(),e.forEach(function(r){o[r]&&(i.removeChild(o[r]),i.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return tt(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var i=Vn.modifyOption(this,e,n);typeof i<"u"?o[e]=i:o[e]=n,e==="group"&&Bl(o)},destroy:function(){Le("destroy",this);var e=this.el;e[Ve]=null,_e(e,"mousedown",this._onTapStart),_e(e,"touchstart",this._onTapStart),_e(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(_e(e,"dragover",this),_e(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Wo.splice(Wo.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Nt){if(Le("hideClone",this),pe.eventCanceled)return;he(Ee,"display","none"),this.options.removeCloneOnHide&&Ee.parentNode&&Ee.parentNode.removeChild(Ee),Nt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Nt){if(Le("showClone",this),pe.eventCanceled)return;se.parentNode==Ce&&!this.options.group.revertClone?Ce.insertBefore(Ee,se):Ht?Ce.insertBefore(Ee,Ht):Ce.appendChild(Ee),this.options.group.revertClone&&this.animate(se,Ee),he(Ee,"display",""),Nt=!1}}};function cv(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Zo(t,e,n,o,i,r,a,l){var d,c=t[Ve],u=c.options.onMove,f;return window.CustomEvent&&!wt&&!$n?d=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(d=document.createEvent("Event"),d.initEvent("move",!0,!0)),d.to=e,d.from=t,d.dragged=n,d.draggedRect=o,d.related=i||e,d.relatedRect=r||De(e),d.willInsertAfter=l,d.originalEvent=a,t.dispatchEvent(d),u&&(f=u.call(c,d,a)),f}function pr(t){t.draggable=!1}function dv(){hr=!1}function uv(t,e,n){var o=De(on(n.el,0,n.options,!0)),i=kl(n.el,n.options,ge),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}function fv(t,e,n){var o=De(ar(n.el,n.options.draggable)),i=kl(n.el,n.options,ge),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}function hv(t,e,n,o,i,r,a,l){var d=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,f=o?n.bottom:n.right,h=!1;if(!a){if(l&&Uo<c*i){if(!jn&&(Gn===1?d>u+c*r/2:d<f-c*r/2)&&(jn=!0),jn)h=!0;else if(Gn===1?d<u+Uo:d>f-Uo)return-Gn}else if(d>u+c*(1-i)/2&&d<f-c*(1-i)/2)return pv(e)}return h=h||a,h&&(d<u+c*r/2||d>f-c*r/2)?d>u+c/2?1:-1:0}function pv(t){return qe(se)<qe(t)?1:-1}function gv(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function mv(t){Xo.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&Xo.push(o)}}function Jo(t){return setTimeout(t,0)}function gr(t){return clearTimeout(t)}qo&&we(document,"touchmove",function(t){(pe.active||an)&&t.cancelable&&t.preventDefault()}),pe.utils={on:we,off:_e,css:he,find:wl,is:function(e,n){return!!tt(e,n,e,!1)},extend:J0,throttle:El,closest:tt,toggleClass:We,clone:Sl,index:qe,nextTick:Jo,cancelNextTick:gr,detectDirection:Ml,getChild:on,expando:Ve},pe.get=function(t){return t[Ve]},pe.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(pe.utils=lt(lt({},pe.utils),o.utils)),Vn.mount(o)})},pe.create=function(t,e){return new pe(t,e)},pe.version=K0;var Te=[],Wn,mr,vr=!1,yr,_r,Qo,Yn;function vv(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?we(document,"dragover",this._handleAutoScroll):this.options.supportPointer?we(document,"pointermove",this._handleFallbackAutoScroll):o.touches?we(document,"touchmove",this._handleFallbackAutoScroll):we(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?_e(document,"dragover",this._handleAutoScroll):(_e(document,"pointermove",this._handleFallbackAutoScroll),_e(document,"touchmove",this._handleFallbackAutoScroll),_e(document,"mousemove",this._handleFallbackAutoScroll)),Pl(),ei(),Q0()},nulling:function(){Qo=mr=Wn=vr=Yn=yr=_r=null,Te.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var i=this,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=document.elementFromPoint(r,a);if(Qo=n,o||this.options.forceAutoScrollFallback||$n||wt||Rn){wr(n,this.options,l,o);var d=kt(l,!0);vr&&(!Yn||r!==yr||a!==_r)&&(Yn&&Pl(),Yn=setInterval(function(){var c=kt(document.elementFromPoint(r,a),!0);c!==d&&(d=c,ei()),wr(n,i.options,c,o)},10),yr=r,_r=a)}else{if(!this.options.bubbleScroll||kt(l,!0)===ct()){ei();return}wr(n,this.options,kt(l,!1),!1)}}},yt(t,{pluginName:"scroll",initializeByDefault:!0})}function ei(){Te.forEach(function(t){clearInterval(t.pid)}),Te=[]}function Pl(){clearInterval(Yn)}var wr=El(function(t,e,n,o){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,d=ct(),c=!1,u;mr!==n&&(mr=n,ei(),Wn=e.scroll,u=e.scrollFn,Wn===!0&&(Wn=kt(n,!0)));var f=0,h=Wn;do{var p=h,g=De(p),m=g.top,w=g.bottom,I=g.left,y=g.right,v=g.width,C=g.height,$=void 0,z=void 0,W=p.scrollWidth,j=p.scrollHeight,D=he(p),O=p.scrollLeft,H=p.scrollTop;p===d?($=v<W&&(D.overflowX==="auto"||D.overflowX==="scroll"||D.overflowX==="visible"),z=C<j&&(D.overflowY==="auto"||D.overflowY==="scroll"||D.overflowY==="visible")):($=v<W&&(D.overflowX==="auto"||D.overflowX==="scroll"),z=C<j&&(D.overflowY==="auto"||D.overflowY==="scroll"));var S=$&&(Math.abs(y-i)<=a&&O+v<W)-(Math.abs(I-i)<=a&&!!O),Y=z&&(Math.abs(w-r)<=a&&H+C<j)-(Math.abs(m-r)<=a&&!!H);if(!Te[f])for(var b=0;b<=f;b++)Te[b]||(Te[b]={});(Te[f].vx!=S||Te[f].vy!=Y||Te[f].el!==p)&&(Te[f].el=p,Te[f].vx=S,Te[f].vy=Y,clearInterval(Te[f].pid),(S!=0||Y!=0)&&(c=!0,Te[f].pid=setInterval(function(){o&&this.layer===0&&pe.active._onTouchMove(Qo);var B=Te[this.layer].vy?Te[this.layer].vy*l:0,_=Te[this.layer].vx?Te[this.layer].vx*l:0;typeof u=="function"&&u.call(pe.dragged.parentNode[Ve],_,B,t,Qo,Te[this.layer].el)!=="continue"||xl(Te[this.layer].el,_,B)}.bind({layer:f}),24))),f++}while(e.bubbleScroll&&h!==d&&(h=kt(h,!1)));vr=c}},30),Ol=function(e){var n=e.originalEvent,o=e.putSortable,i=e.dragEl,r=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,d=e.unhideGhostForTarget;if(n){var c=o||r;l();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,f=document.elementFromPoint(u.clientX,u.clientY);d(),c&&!c.el.contains(f)&&(a("spill"),this.onSpill({dragEl:i,putSortable:o}))}};function br(){}br.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var i=on(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:Ol},yt(br,{pluginName:"revertOnSpill"});function Cr(){}Cr.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:Ol},yt(Cr,{pluginName:"removeOnSpill"}),pe.mount(new vv),pe.mount(Cr,br);var yv=class{events=new Map;on(t,e){this.events.has(t)||this.events.set(t,new Set),this.events.get(t).add(e)}once(t,e){const n=(...o)=>{e(...o),this.off(t,n)};this.on(t,n)}emit(t,...e){const n=this.events.get(t);if(n)for(const o of n)return o(...e)}off(t,e){if(!e){this.events.delete(t);return}const n=this.events.get(t);n&&(n.delete(e),n.size===0&&this.events.delete(t))}clear(){this.events.clear()}},Iy=new yv,$l=(t,e,n,o,i,r,a,l)=>{const d=(0,s.ref)(),c=(0,s.reactive)({}),u=(0,s.computed)(()=>{const _=[];return Object.keys(c).forEach(x=>{const T=c[x];T.dragType==="component"&&T.type!=="pkey"&&_.push(T)}),_}),f=(_=[],x)=>{const T=e?.value?.init;typeof T=="function"&&T(_,x)},h=_=>i?i(_,{componentDic:c,components:u.value,configData:d.value.config}):{},p=(_,x)=>{if(d.value?.id===_)return;const T=c[_]||x;if(T?d.value=T:_===n.id?d.value=n:d.value=null,d.value){const P=r[d.value.type];P?(f(P,d.value.config),h(d.value.type)):f([])}else f([]);x&&Se("dragClick",{id:x.id})},g=()=>t.value.$el.getBoundingClientRect(),m=_=>_===n.id?n:c[_]||{},w=_=>{const x=[];if(_===n.id)x.push({id:_,name:n.name});else{const T=c[_];if(T){x.push({id:_,name:T.name});const P=w(T.containerId);x.push(...P)}}return x},I=(_,x)=>{const T=c[x];if(T===void 0)return!1;const P=T.containerId;return _===P?!0:P===n.id?!1:I(_,P)},y=_=>o?o(_)||{}:{},v=(_,x,T,P)=>{if(l){const L=m(_);return l(T.componentType,{container:L,groupId:x,configData:T},P)}return!1},C=({name:_,type:x,dragType:T,isInput:P,componentName:L,runtimeType:M},V,F,G,X=!1)=>{const J=y(x);if(J.id=Ft(),J.span=24,J.componentType=x,$(V,J.componentType))return;v(V,G,J,!0);const U={id:J.id,name:_,type:x,runtimeType:M,componentName:L||"",dragType:T||"component",containerId:V,isInput:!!P,level:c[V]?c[V].level+1:1,config:J,isNewAdd:!X,groupId:G};return U.dragType==="container"&&(U.children=[]),c[U.id]=U,m(V).children?.splice(F,0,U),U},$=(_,x)=>!!(m(_).config.componentType==="gridtable"&&["divider","label","text","textEditor","viewTable","card","collapse","tabs","qrcode","barcode","tableLayout"].includes(x)),z=(_,x,T=!1)=>{let P=null;const L=m(_).children,M=L?.findIndex(V=>V.id===x)||0;if(T&&L&&L.length>1){let V=M+1;M>0&&(V=M-1),P=L[V]}return L?.splice(M,1),P?.id},W=(_,x,T,P)=>{const L=m(x).children,M=_.containerId!==x;_.containerId=x,_.groupId=P,L?.splice(T,0,_),v(x,P,_.config,M)&&(Y(),p(_.id))},j=_=>{let x="";const T=m(_);return T&&(T.children&&T.children.length>0&&T.children.forEach(P=>{j(P.id)}),x=z(T.containerId,_,!0)||"",delete c[_]),d.value&&d.value.id===_&&(d.value=null,e.value.init([])),x},D=(_,x=[])=>{const T=m(_);if(T&&T.children&&T.children.length>0){const P=[];T.children.forEach(L=>{L.groupId&&x.includes(L.groupId)&&P.push(L.id)}),P.forEach(L=>{j(L),delete c[L]})}},O=(_,x)=>{const T=m(_);T&&(T.children&&T.children.length>0&&T.children.forEach(P=>{P.groupId===x&&j(P.id)}),delete c[_])},H=_=>{const x=ni(m(_));x.id=Ft(),x.config.id=x.id,c[x.id]=x;const T=m(x.containerId).children,P=T?.findIndex(L=>L.id===_)||0;T?.splice(P+1,0,x)},S=()=>{n.children=[],ac(c),d.value&&(Se("dragClick",{id:""}),d.value=null,e.value.init([]))},Y=()=>{d.value&&(Se("dragClick",{id:""}),d.value=null,e.value.init([]))},b=_=>{const x=d.value,T=m(x.containerId).children,P=T?.findIndex(L=>L.id===x.id)||0;j(x.id),(0,s.nextTick)(()=>{const L=a[_],M=y(_);M.id=x.id,M.span=x.config.span,M.componentType=_,M.table=x.config.table,M.field=x.config.field,x.config.isSubTable&&(M.isSubTable=x.config.isSubTable);const V={id:M.id,name:L.name,type:_,runtimeType:L.runtimeType,componentName:L.componentName||"",dragType:x.dragType,groupId:x.groupId,containerId:x.containerId,isInput:x.isInput,level:x.level,config:M,isNewAdd:!0};c[V.id]=V,T?.splice(P,0,V)})},B=_=>{Se("dragAddByClick",_)};return(0,s.provide)("d-drag-design-provide",{activedComponent:d,getDesignLocals:g,getComponent:m,getParentComponents:w,isMyChildComponent:I,selectComponent:p,addComponent:C,deleteComponent:j,copyComponent:H,removeComponentFromContainer:z,addComponentToContainer:W,top:n,deleteChildren:O,deleteChildrens:D}),{activedComponent:d,clearComponents:S,changeComponent:b,schemaComponentDic:c,clearSelect:Y,addComponent:C,addComponentByTable:B,designComponentList:u}},_v=(0,s.defineComponent)({__name:"importComponent",props:{componentList:{type:Array,default:()=>[]},tableList:{type:Array,default:()=>[]}},setup(t,{expose:e}){const n=t,o=(0,s.computed)(()=>n.tableList.map(c=>({label:c.comment?`${c.name}(${c.comment})`:c.name,value:c.name}))),i=(0,s.ref)(),r=[{id:"layout",type:"j-layout",config:{top:48,topMove:!1,autoSize:["default"]},children:[{id:"table",type:"j-select",slot:"top",config:{label:"表名选择",loadOptions:()=>o,allowClear:!1}},{id:"fields",type:"j-table",config:{editConfig:{isAddBtn:!1,isRemoveBtn:!1},height:"100%",isMultiple:!0},children:[{id:"name",type:"span",config:{label:"字段名"}},{id:"type",type:"j-select",config:{label:"组件选择",options:n.componentList,width:200}}]}]}],a=(c,u)=>{if(c.id==="table"){const f=n.tableList.find(h=>h.name===u.value);if(f){const h=f.columns.map(p=>({value:p.name,name:p.coment?`${p.name}(${p.coment})`:p.name,type:"input",label:p.coment||p.name,selected:!p.isPrimary}));i.value.setFormData({fields:h})}}};return(0,s.onMounted)(()=>{i.value.init(r)}),e({ok:()=>{const c=i.value.getFormData(!1);return{addList:c.fields.filter(u=>u.selected),table:c.table,containerId:c.containerId,isSubTable:c.isSubTable}},closed:()=>{}}),(c,u)=>{const f=(0,s.resolveComponent)("j-form");return(0,s.openBlock)(),(0,s.createBlock)(f,{ref_key:"formRef",ref:i,"form-config":{labelWidth:"72px"},onChange:a},null,512)}}}),wv=_v,bv={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",COMP_PROVIDE:"jcode_comp_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide",PAGE_PROVIDE:"jcode_page_provide"};function Cv(t,e){return(0,s.inject)(t,e)}function Er(){return Cv(bv.APP_PROVIDE,{t:(t,...e)=>{if(!t)return"";if(typeof t!="string")return t;let n=t||"";return e.length>0&&e.forEach((o,i)=>{n=n.replace(new RegExp(`\\{${i}\\}`,"g"),o)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:t,config:e})=>{if(t==null||t==="")return"";if(e?.dataType==="options"){let n=[t];typeof t=="string"&&t.split&&(n=t.split(","));const o=(e.options||[]).filter(i=>n.includes(i[e.valueKey||"value"])).map(i=>i[e.labelKey||"label"]);return String(o)||t}return t},getObjectList:({value:t,config:e})=>{if(t==null||t==="")return[];if(e?.dataType==="options"){let n=[t];return typeof t=="string"&&t.split&&(n=t.split(",")),(e.options||[]).filter(o=>n.includes(o[e.valueKey||"value"]))||[]}return[]}})})}var Ev=(0,s.defineComponent)({props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){const{t:e}=Er();return{labelWidth:(0,s.computed)(()=>t.componentData.config?.notShowLabel?"0px":t.componentData.config?.labelWidth===void 0&&t.globalConfig.labelWidth!==void 0?`${t.globalConfig.labelWidth}px`:t.componentData.config?.labelWidth?`${t.componentData.config?.labelWidth}px`:void 0),inputConfig:(0,s.computed)(()=>{const n={...t.componentData?.config};return t.globalConfig.size===void 0&&(n.size=t.globalConfig.size),n.display=!0,n}),t:e}}}),xv=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n};function Sv(t,e,n,o,i,r){const a=(0,s.resolveComponent)("j-comp"),l=(0,s.resolveComponent)("el-form-item");return t.componentData.isInput?((0,s.openBlock)(),(0,s.createBlock)(l,{key:0,"label-width":t.labelWidth,label:t.t(t.componentData.config?.notShowLabel?"":t.componentData.config?.label||""),rules:t.componentData.config?.required?[{required:!0,message:""}]:[]},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(a,{type:t.componentData?.componentName||t.componentData?.type,config:t.inputConfig,modelValue:t.componentData?.config.defaultValue},null,8,["type","config","modelValue"])]),_:1},8,["label-width","label","rules"])):t.componentData?.children?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.mergeProps)({key:1},t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"])):((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.normalizeProps)((0,s.mergeProps)({key:2},t.componentData?.config)),null,16))}var Rl=xv(Ev,[["render",Sv]]),kv={class:"d-form-design j-block"},Nv={class:"d-form-design-left"},Dv={class:"d-form-design-component-list"},Tv={class:"j-component-tool"},Iv={class:"j-component-tool-name"},Mv={class:"d-form-design-center"},Bv={class:"d-form-design-container"},zv={key:0,class:"d-form-design-empty"},Av={class:"d-form-design-right"},Pv={class:"d-form-design-panel-title"},Ov={style:{margin:"0","font-size":"14px"}},$v={class:"d-form-design-panel"},Rv=(0,s.defineComponent)({name:"DFormDesign",__name:"formDesign",props:{notBindTable:{type:Boolean,default:!1},components:{default:()=>[]},componentConfigs:{default:()=>({})},componentInit:{type:Function,default:void 0},containerAddComponent:{type:Function,default:void 0},componentConfigInit:{type:Function,default:void 0},componentConfigChange:{type:Function,default:void 0},componentConfigValidate:{type:Function,default:void 0},flowComponents:{default:()=>[]},flowInit:{type:Function,default:void 0},flowComponentConfigInit:{type:Function,default:void 0},flowComponentConfigChange:{type:Function,default:void 0},flowComponentConfigs:{default:()=>({})},actions:{}},setup(t,{expose:e}){const n=t,{t:o,warning:i,error:r}=Er(),a=(0,s.reactive)({name:"表单",id:"form",type:"form",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}}),l=(0,s.ref)([]),d=n.components.length;for(let E=0;E<d;E++)l.value.push(E);n.componentInit&&(a.config=n.componentInit("form")||{});const c=(0,s.ref)([]),u=(0,s.computed)(()=>c.value.map(E=>({label:E.comment?`${E.name}(${E.comment})`:E.name,value:E.name}))),f=(0,s.computed)(()=>{if(z.value){const E=$.value.getFormData(!1);if(E.table){const k=c.value.find(A=>A.name===E.table);if(k)return k.columns.map(A=>({value:A.name,label:A.coment?`${A.name}(${A.coment})`:A.name,coment:A.coment}))}}return[]}),h=E=>{c.value=E},p={},g=[];n.components.forEach(({children:E})=>{E.forEach(k=>{p[k.type]=k,k.dragType=k.dragType||"component",k.isInput!==!1&&(k.isInput=!0,g.push({label:k.name,value:k.type}))})});const m=E=>{E.forEach(k=>{k.type==="d-input-flow"&&(k.config=k.config||{},k.config.flowComponents=n.flowComponents,k.config.flowInit=n.flowInit,k.config.flowComponentConfigInit=A=>{n.flowComponentConfigInit&&(A.designComponents=H.value,A.component=z.value,n.flowComponentConfigInit(A))},k.config.flowComponentConfigs=n.flowComponentConfigs,k.config.flowComponentConfigChange=n.flowComponentConfigChange),k.children&&m(k.children)})},w={};Object.keys(n.componentConfigs||{}).forEach(E=>{const{hasBase:k,isInput:A,hasTwoPlaceholder:N,hasPlaceholder:Q,hasSpan:K,hasLabel:re,bindTable:ne,labelTitle:de}=p[E]||{hasBase:!1},ye=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"componentType",type:"j-select",config:{label:"类型",allowClear:!1,display:A,options:g}},{id:"label",type:"j-input",config:{label:de||"标题"},getCompConfig:({formData:me})=>({display:re!==!1&&!me.notShowLabel})},{id:"notShowLabel",type:"j-switch",config:{label:"不显示"+(de||"标题"),activeValue:!0,inactiveValue:!1},getCompConfig:({formData:me})=>({display:re!==!1&&!me.isSubTable})},{id:"labelWidth",type:"j-number",config:{label:"标题宽度"},getCompConfig:({formData:me})=>({display:A&&!me.notShowLabel&&!me.isSubTable})},{id:"placeholder",type:"j-input",config:{display:A&&!N&&Q!==!1,label:"占位提示"}},{id:"startPlaceholder",type:"j-input",config:{display:!!N,label:"开始占位"}},{id:"endPlaceholder",type:"j-input",config:{display:!!N,label:"结束占位"}},{id:"span",type:"j-slider",config:{label:"表单栅栏",min:6,max:24,showTooltip:!0,step:6,showStops:!0,defautValue:24},getCompConfig:({formData:me})=>({display:K!==!1&&!me.isSubTable})},{id:"width",type:"j-number",config:{label:"单元格宽度",min:1},getCompConfig:({formData:me})=>({display:!!me.isSubTable})},{id:"isNotSave",type:"j-switch",config:{label:"不存表",display:A&&ne!==!1,activeValue:!0,inactiveValue:!1}},{id:"table",type:"j-select",config:{label:"数据表",loadOptions:()=>u},getCompConfig:({formData:me})=>({display:(A&&ne!==!1||ne===!0)&&(!me.isSubTable||ne===!0)&&!me.isNotSave&&!n.notBindTable})},{id:"field",type:"j-select",config:{label:"表字段",loadOptions:()=>f},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&!n.notBindTable})},{id:"csType",type:"j-select",config:{label:"字段类型",allowClear:!1,options:[{label:"短文本",value:"string"},{label:"长文本",value:"text"},{label:"整数",value:"int"},{label:"小数",value:"decimal"},{label:"时间日期",value:"DateTime"}]},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&n.notBindTable})},{id:"fieldLen",type:"j-number",config:{label:"字段长度"},getCompConfig:({formData:me})=>({display:A&&ne!==!1&&!me.isNotSave&&n.notBindTable&&me.csType==="string"})}],ve={type:"j-collapse",config:{defaultValue:[]},children:[]};k!==!1&&(ve.children?.push({config:{label:"基础信息"},children:[...ye]}),ve.config?.defaultValue.push("_collapse0")),ve.children?.push(...n.componentConfigs[E]),m(ve.children||[]),w[E]=[ve]});const I=E=>{const{value:k}=E||{};E.id==="componentType"&&j(k),z.value&&n.componentConfigChange&&(E.id==="field"&&E.data?.coment&&(z.value.config.label=E.data?.coment),n.componentConfigChange(z.value.type,{configRef:$,configData:z.value.config,...E})),E.id==="table"&&z.value&&z.value.type==="gridtable"&&(z.value.children||[]).forEach(A=>{A.isInput&&(A.config.table=k)})},y=(E,k)=>{p[E]?.isInput&&(n.notBindTable&&(k.configData.csType||$.value.setFormData({main:{csType:p[E]?.csType,fieldLen:p[E]?.fieldLen}})),u.value.length===1&&$.value.setFormData({main:{table:u.value[0].value}})),n.componentConfigInit&&n.componentConfigInit(E,{configRef:$,...k,notBindTable:n.notBindTable})},v=(E,k,A)=>{let N=!1;const Q=p[E];return k.container.type==="gridtable"?(!k.configData.isSubTable||A)&&(k.configData.isSubTable=!0,Q.isInput&&(k.configData.table=k.container.config.table,k.configData.field=""),N=!0):k.configData.isSubTable&&(N=!0,k.configData.isSubTable=!1,Q.isInput&&(k.configData.table="")),n.containerAddComponent&&n.containerAddComponent(E,k),N},C=(0,s.ref)(),$=(0,s.ref)(),{activedComponent:z,clearComponents:W,changeComponent:j,schemaComponentDic:D,addComponentByTable:O,designComponentList:H}=$l(C,$,a,n.componentInit,y,w,p,v),S=(0,s.computed)(()=>z.value?`【${z.value.name}】`:"");(0,s.provide)("dui-design-provide",{designItemName:Rl});const Y=()=>{n.componentInit&&(a.config=n.componentInit("form")||{}),W()},b=()=>{let E=0;const k=al(a.config,a.children||[]);if(n.notBindTable){const A={};k.components.forEach(K=>{const{isInput:re,bindTable:ne}=p[K.type]||{hasBase:!1};re&&ne!==!1?K.config.table&&!A.main&&(A.main={name:K.config.table,comment:"主表",type:"main",pKey:"J_Id"}):ne&&(A[K.id]={name:K.config.table||"t"+new Date().getTime()+E,comment:`子表${K.config.label}`,type:"chlid",field:"J_PId",relationField:"J_Id",pKey:"J_Id"},K.config.table=A[K.id].name,E++)}),A.main||(A.main={name:"t"+new Date().getTime()+E,comment:"主表",type:"main",pKey:"J_Id"},E++);let N=0;k.components.forEach(K=>{const{isInput:re,bindTable:ne}=p[K.type]||{hasBase:!1};!K.config.isNotSave&&re&&ne!==!1&&(K.config.csType||(K.config.csType=p[K.type]?.csType,K.config.fieldLen=p[K.type]?.fieldLen),K.config.isSubTable?K.config.table=A[K.containerId].name:K.config.table=A.main.name,K.config.field=K.config.field||`f${Math.floor(Date.now()/1e3)}${N}`,N++)});const Q=[];Object.keys(A).forEach(K=>{A[K].type==="chlid"&&(A[K].relationName=A.main.name,A[K].comment+=`,关联主表${A.main.name}`),Q.push(A[K])}),k.db=Q}else{const A={};c.value.forEach(N=>{N.columns.forEach(Q=>{A[`${N.name}_${Q.name}`]=Q.csType})}),k.components.forEach(N=>{N.config.table&&N.config.field&&(N.config.csType=A[`${N.config.table}_${N.config.field}`])})}return n.notBindTable?k.db.forEach(A=>{if(!k.components.find(N=>N.config.table===A.name&&N.config.field==="J_Id")){const N=k.components.find(Q=>Q.config.table===A.name&&Q.config.field);N&&k.components.push({id:A.name+"_J_Id",name:A.name+"_J_Id",type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:A.name,field:"J_Id",label:"主键"},containerId:N.containerId,level:N.level})}}):c.value.forEach(A=>{A.columns.forEach(N=>{if(N.isPrimary&&!k.components.find(Q=>Q.config.table===A.name&&Q.config.field===N.name)){const Q=k.components.find(K=>K.config.table===A.name&&K.config.field);Q&&k.components.push({id:A.name+"_"+N.name,name:A.name+"_"+N.name,type:"pkey",runtimeType:"j-input",groupId:"",config:{display:!1,table:A.name,field:N.name,label:"主键"+N.name,isIdentity:N.isIdentity},containerId:Q.containerId,level:Q.level})}})}),k},B=E=>{const k=M0(E,p);a.config=k.formConfig,a.children?.push(...k.componentList),Object.keys(k.componentDic).forEach(A=>{D[A]=k.componentDic[A]})},_=()=>T(al(a.config,a.children||[]).components,{},{}),x=E=>{const{isInput:k,bindTable:A}=p[E]||{hasBase:!1};if(!k&&A)return!0},T=(E,k,A)=>{if(!n.notBindTable)for(const N of E){const{isInput:Q,bindTable:K}=p[N.type]||{hasBase:!1};if(!N.config.isNotSave&&N.type!=="pkey"){if(Q&&K!==!1){if(Xn(N.config.table))return r&&r(`请【${N.config.label}】绑定数据表!`),!1;if(!N.config.isSubTable){if(A[N.config.table]&&x(A[N.config.table].type))return r&&r(`【${N.config.label}】和【${A[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(A[N.config.table]=N)}}else if(K){if(Xn(N.config.table))return r&&r(`【${N.config.label}】请绑定数据表!`),!1;if(A[N.config.table])return r&&r(`【${N.config.label}】和【${A[N.config.table].config.label}】重复绑定【${N.config.table}】表!`),!1;N.config.table&&(A[N.config.table]=N)}}}for(const N of E){if(!n.notBindTable){const{isInput:Q,bindTable:K}=p[N.type]||{hasBase:!1};if(!N.config.isNotSave&&Q&&K!==!1){if(Xn(N.config.field))return r&&r(`请【${N.config.label}】绑定表字段!`),!1;if(k[`${N.config.table}-${N.config.field}`])return r&&r(`【${N.config.label}】和【${k[`${N.config.table}-${N.config.field}`].config.label}】重复绑定【${N.config.field}】字段!`),!1;k[`${N.config.table}-${N.config.field}`]=N}}if(n.componentConfigValidate&&!n.componentConfigValidate(N.type,{configData:N.config,errorTip:r}))return!1}return!0},P=(0,s.ref)(),L=(0,s.ref)(),M=(0,s.reactive)({width:0,height:0,formConfig:{}});let V=0;const F=E=>{if(L.value)V=0,L.value.init(E||[]);else{if(V>600){console.warn("表单组件加载超时");return}V++,setTimeout(()=>{F(E)},100)}},G=()=>{},X=()=>{},J=(0,s.ref)(),U=(0,s.ref)(),Z=()=>{const{addList:E,table:k}=U.value?.ok()||{addList:[]};if(E.length<=0)i&&i("请选择字段!");else{if(z.value?.config.componentType==="gridtable"||z.value?.config.isSubTable)if(z.value.config.table){if(z.value.config.table!==k){i&&i("请设置相同的表和子表!");return}}else{let A=z.value;z.value.config.isSubTable&&(A=D[z.value.containerId]),A.config.table=k,(A.children||[]).forEach(N=>{N.isInput&&(N.config.table=k)}),$.value.setFormData({main:{table:k}})}E.forEach(A=>{const N=ir(p[A.type]);N.config={table:k,field:A.value,label:A.label},O(N)}),J.value.close()}},te=()=>{U.value?.closed()};return e({setTables:E=>{h(E)},getSchema:()=>b(),setSchema:E=>B(E),reset:()=>Y(),validate:()=>_()}),(E,k)=>{const A=(0,s.resolveComponent)("j-icon"),N=(0,s.resolveComponent)("d-drag-tool"),Q=(0,s.resolveComponent)("el-collapse-item"),K=(0,s.resolveComponent)("el-collapse"),re=(0,s.resolveComponent)("d-drag-form-list"),ne=(0,s.resolveComponent)("el-row"),de=(0,s.resolveComponent)("d-drag-container"),ye=(0,s.resolveComponent)("j-form"),ve=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)("div",kv,[(0,s.createElementVNode)("div",Nv,[(0,s.createElementVNode)("div",Dv,[(0,s.createVNode)(K,{modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=me=>l.value=me)},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.components,(me,dt)=>((0,s.openBlock)(),(0,s.createBlock)(Q,{key:dt,title:me.name,name:dt},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(me.children,(Tt,ti)=>((0,s.openBlock)(),(0,s.createBlock)(N,{key:ti,config:Tt},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Tv,[(0,s.createVNode)(A,{class:"j-component-tool-icon",icon:Tt.icon,size:14},null,8,["icon"]),(0,s.createElementVNode)("div",Iv,(0,s.toDisplayString)((0,s.unref)(o)(Tt.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,s.createElementVNode)("div",Mv,[(0,s.createElementVNode)("div",Bv,[(0,s.createVNode)(de,{ref_key:"dragContainer",ref:C,class:"d-form-design-drag-container","is-component-container":!1,"component-data":a},{default:(0,s.withCtx)(()=>[!a.children||a.children.length===0?((0,s.openBlock)(),(0,s.createElementBlock)("div",zv,[...k[1]||(k[1]=[(0,s.createElementVNode)("div",null,"请从左侧拖拽组件到此处",-1)])])):((0,s.openBlock)(),(0,s.createBlock)(ne,{key:1},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(re,{"component-list":a.children,"global-config":a.config},null,8,["component-list","global-config"])]),_:1}))]),_:1},8,["component-data"])])]),(0,s.withDirectives)((0,s.createElementVNode)("div",Av,[(0,s.createElementVNode)("div",Pv,[(0,s.createElementVNode)("span",Ov,(0,s.toDisplayString)(`${(0,s.unref)(o)("属性配置")}${S.value}`),1)]),(0,s.createElementVNode)("div",$v,[(0,s.createVNode)(ye,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:$,onChange:I},null,512)])],512),[[s.vShow,(0,s.unref)(z)]]),(0,s.createVNode)(ve,{ref_key:"previewFormLayerRef",ref:P,width:M.width,height:M.height,onOk:G,onClosed:X},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(ye,{config:M.formConfig,"is-preview":!0,ref_key:"previewFormRef",ref:L,actions:t.actions},null,8,["config","actions"])]),_:1},8,["width","height"]),(0,s.createVNode)(ve,{ref_key:"importFormLayerRef",ref:J,width:800,height:600,"btn-text":"确认",onOk:Z,onClosed:te},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(wv,{"component-list":g,"table-list":c.value,ref_key:"importComponentRef",ref:U},null,8,["table-list"])]),_:1},512)])}}}),Hv=Rv,Hl=Mt(Hv,[Rl]),Vl=(t,e)=>{const n={ver:"V3",indexPage:{...t},components:[]};return Ll(e||[],n.components),n},Ll=(t,e)=>{t.forEach(n=>{const o={id:n.id,name:n.name,type:n.type,runtimeType:n.runtimeType||n.componentName||n.type,groupId:n.groupId||"",config:n.config,containerId:n.containerId,level:n.level};n.dragType==="container"&&Ll(n.children||[],e),e.push(o)})},Vv=t=>{const e=Lv(t.components);return{pageConfig:t.indexPage,componentList:e}},Lv=t=>{const e={},n={};return t.forEach(o=>{e[o.containerId]=e[o.containerId]||[];const i={id:o.id,type:o.runtimeType,slot:o.groupId,config:{}};o.config&&Object.keys(o.config).forEach(r=>{i.config[r]=o.config[r]}),e[o.containerId].push(i),n[o.id]=i}),Object.keys(e).forEach(o=>{n[o]&&(n[o].children=e[o])}),e.indexPage||[]},Fv=(t,e)=>{let n={},o=[];const i={};if(t.ver==="V3"){const r=t;n=r.indexPage;const a={};r.components.forEach(l=>{const d=e[l.type];if(!d)return;a[l.containerId]=a[l.containerId]||[];const c={id:l.id,name:l.name,type:l.type,dragType:d.dragType||"component",componentName:d.componentName||"",runtimeType:d.runtimeType,groupId:l.groupId,config:l.config,isInput:!1,containerId:l.containerId,level:l.level};i[c.id]=c,a[l.containerId].push(c),c.dragType==="container"&&(c.children=[])}),Object.keys(a).forEach(l=>{i[l]&&(i[l].children=a[l])}),o=a.indexPage||[]}return{pageConfig:n,componentList:o,componentDic:i}},Gv=(0,s.defineComponent)({name:"DIndexDesignItem",__name:"indexDesignItem",props:{componentData:{type:Object,default:()=>({})},globalConfig:{type:Object,default:()=>({})}},setup(t){return(e,n)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.componentData?.componentName),(0,s.mergeProps)(t.componentData?.config,{"global-config":t.globalConfig,"component-data":t.componentData}),null,16,["global-config","component-data"]))}}),Fl=Gv,jv={class:"d-index-design j-block"},Wv={class:"d-index-design-left"},Yv={class:"j-component-list"},Uv={class:"j-component-tool"},Xv={class:"j-component-tool-name"},qv={class:"d-index-design-center"},Kv={class:"design-toolbar"},Zv={class:"design-container"},Jv={key:0,class:"j-block design-empty"},Qv={class:"d-index-design-right"},ey={class:"d-index-design-panel-title"},ty={style:{margin:"0","font-size":"14px"}},ny={class:"d-index-design-panel"},oy=(0,s.defineComponent)({name:"DIndexDesign",__name:"indexDesign",props:{components:{type:Array,default:()=>[]},componentConfigs:{type:Object,default:()=>({})},componentInit:Function,containerAddComponent:Function,componentConfigInit:Function,componentConfigChange:Function,flowComponents:{type:Array,default:()=>[]},flowInit:Function,flowComponentConfigInit:Function,flowComponentConfigChange:Function,flowComponentConfigs:{type:Object,default:()=>({})}},setup(t,{expose:e}){const{t:n}=Er(),o=t,i=_=>{_.forEach(x=>{x.type==="d-input-flow"&&(x.config=x.config||{},x.config.flowComponents=o.flowComponents,x.config.flowInit=o.flowInit,x.config.flowComponentConfigInit=T=>{o.flowComponentConfigInit&&(T.designComponents=w.value,T.component=p.value,o.flowComponentConfigInit(T))},x.config.flowComponentConfigs=o.flowComponentConfigs,x.config.flowComponentConfigChange=o.flowComponentConfigChange),x.children&&i(x.children)})},r=(0,s.reactive)({name:"页面",id:"indexPage",type:"indexPage",level:0,children:[],dragType:"container",componentName:"",containerId:"",isInput:!1,config:{}});o.componentInit&&(r.config=o.componentInit("indexPage")||{});const a={},l=[];o.components.forEach(({children:_})=>{_.forEach(x=>{a[x.type]=x,x.dragType=x.dragType||"component",l.push({label:x.name,value:x.type})})});const d={};Object.keys(o.componentConfigs).forEach(_=>{const{hasBase:x}=a[_]||{hasBase:!1},T=[{id:"id",type:"j-input",config:{label:"ID",readonly:!0}},{id:"label",type:"j-input",config:{label:"名称"}}],P={type:"j-collapse",config:{defaultValue:[]},children:[]};x!==!1&&(P.children?.push({config:{label:"基础信息"},children:[...T]}),P.config?.defaultValue.push("_collapse0")),P.children?.push(...o.componentConfigs[_]),i(P.children||[]),d[_]=[P]});const c=_=>{p.value&&o.componentConfigChange&&o.componentConfigChange(p.value.type,{configRef:h,configData:p.value.config,..._})},u=(_,x)=>{o.componentConfigInit&&o.componentConfigInit(_,{configRef:h,...x})},f=(0,s.ref)(),h=(0,s.ref)(),{activedComponent:p,clearComponents:g,schemaComponentDic:m,designComponentList:w}=$l(f,h,r,o.componentInit,u,d,a,o.containerAddComponent),I=(0,s.computed)(()=>p.value?`【${p.value.name}】`:""),y=(0,s.ref)([]),v=o.components.length;for(let _=0;_<v;_++)y.value.push(_);(0,s.provide)("dui-design-provide",{designItemName:Fl});const C=()=>{g()},$=()=>{o.componentInit&&(r.config=o.componentInit("indexPage")||{}),g()},z=()=>(console.log("pValidate"),!0),W=()=>Vl(r.config,r.children||[]),j=_=>{const x=Fv(_,a);r.config=x.pageConfig,r.children?.push(...x.componentList),Object.keys(x.componentDic).forEach(T=>{m[T]=x.componentDic[T]})},D=(0,s.ref)(),O=(0,s.ref)();(0,s.ref)(""),(0,s.reactive)({formConfig:{}});let H=0;const S=_=>{if(O.value)H=0,O.value.init(_);else{if(H>600){console.warn("组件加载超时");return}H++,setTimeout(()=>{S(_)},100)}},Y=()=>{},b=()=>{},B=()=>{const{componentList:_}=Vv(Vl(r.config,r.children||[]));D.value.open("页面预览","full"),(0,s.nextTick)(()=>{S(_)})};return e({reset:$,validate:z,getSchema:W,setSchema:j}),(_,x)=>{const T=(0,s.resolveComponent)("j-icon"),P=(0,s.resolveComponent)("d-drag-tool"),L=(0,s.resolveComponent)("el-collapse-item"),M=(0,s.resolveComponent)("el-collapse"),V=(0,s.resolveComponent)("j-button"),F=(0,s.resolveComponent)("el-tooltip"),G=(0,s.resolveComponent)("el-divider"),X=(0,s.resolveComponent)("el-empty"),J=(0,s.resolveComponent)("d-drag-index-list"),U=(0,s.resolveComponent)("d-drag-container"),Z=(0,s.resolveComponent)("j-form"),te=(0,s.resolveComponent)("j-page"),oe=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)("div",jv,[(0,s.createElementVNode)("div",Wv,[x[1]||(x[1]=(0,s.createElementVNode)("div",{class:"d-index-design-panel-title"},"组件库",-1)),(0,s.createElementVNode)("div",Yv,[(0,s.createVNode)(M,{modelValue:y.value,"onUpdate:modelValue":x[0]||(x[0]=ae=>y.value=ae)},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(t.components,(ae,ee)=>((0,s.openBlock)(),(0,s.createBlock)(L,{key:ee,title:ae.name,name:ee},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(ae.children,(ie,R)=>((0,s.openBlock)(),(0,s.createBlock)(P,{key:R,config:ie},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Uv,[(0,s.createVNode)(T,{class:"j-component-tool-icon",icon:ie.icon,size:14},null,8,["icon"]),(0,s.createElementVNode)("div",Xv,(0,s.toDisplayString)((0,s.unref)(n)(ie.name)),1)])]),_:2},1032,["config"]))),128))]),_:2},1032,["title","name"]))),128))]),_:1},8,["modelValue"])])]),(0,s.createElementVNode)("div",qv,[(0,s.createElementVNode)("div",Kv,[x[2]||(x[2]=(0,s.createElementVNode)("div",null,null,-1)),(0,s.createElementVNode)("div",null,[(0,s.createVNode)(F,{content:(0,s.unref)(n)("清空")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(V,{danger:"",type:"text",onClick:C,icon:"mdi:delete-outline"})]),_:1},8,["content"]),(0,s.createVNode)(G,{direction:"vertical"}),(0,s.createVNode)(F,{content:(0,s.unref)(n)("预览")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(V,{type:"text",onClick:B,icon:"mdi:play-circle-outline"})]),_:1},8,["content"])])]),(0,s.createElementVNode)("div",Zv,[(0,s.createVNode)(U,{ref_key:"dragContainer",ref:f,class:"design-drag-container","is-component-container":!1,"component-data":r},{default:(0,s.withCtx)(()=>[!r.children||r.children.length===0?((0,s.openBlock)(),(0,s.createElementBlock)("div",Jv,[(0,s.createVNode)(X,{description:(0,s.unref)(n)("请从左侧拖拽组件到此处"),"image-size":100},null,8,["description"])])):((0,s.openBlock)(),(0,s.createBlock)(J,{key:1,"component-list":r.children,"global-config":r.config},null,8,["component-list","global-config"]))]),_:1},8,["component-data"])])]),(0,s.withDirectives)((0,s.createElementVNode)("div",Qv,[(0,s.createElementVNode)("div",ey,[(0,s.createElementVNode)("span",ty,(0,s.toDisplayString)(`${(0,s.unref)(n)("属性配置")}${I.value}`),1)]),(0,s.createElementVNode)("div",ny,[(0,s.createVNode)(Z,{config:{labelPosition:"top",size:"small"},collapseAnimate:!1,style:{padding:"0"},ref_key:"configRef",ref:h,onChange:c},null,512)])],512),[[s.vShow,(0,s.unref)(p)&&d[(0,s.unref)(p).type]]]),(0,s.createVNode)(oe,{ref_key:"previewLayerRef",ref:D,"has-btns":!1,onOk:Y,onClosed:b},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(te,{ref_key:"previewRef",ref:O},null,512)]),_:1},512)])}}}),iy=oy,Gl=Mt(iy,[Fl]),ry=[ns,pi,gi,mi,vi,Za,Ja,rl,sl,Hl,Gl],sy=t=>{ry.forEach(e=>{t.component(e.name,e)})},ay={install:sy};Me.DDrag=ns,Me.DDraggable=sl,Me.DFlowDesign=Za,Me.DFormDesign=Hl,Me.DIndexDesign=Gl,Me.DInputFlow=Ja,Me.DLayout=rl,Me.default=ay,Me.dragContainer=gi,Me.dragFormList=mi,Me.dragIndexList=vi,Me.dragTool=pi});
|