@witlink/workflow 1.0.16 → 1.0.18

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.
@@ -1,10 +1,10 @@
1
- (function(pt,ie){typeof exports=="object"&&typeof module<"u"?ie(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],ie):(pt=typeof globalThis<"u"?globalThis:pt||self,ie(pt["witlink-workflow"]={},pt.es,pt.Vue,pt.pinia,pt.vueI18n,pt.Axios,pt.antDesignVue,pt.components))})(this,function(pt,ie,p,Kp,Dn,Vx,Wt,bs){"use strict";var t9=Object.defineProperty;var n9=(pt,ie,p)=>ie in pt?t9(pt,ie,{enumerable:!0,configurable:!0,writable:!0,value:p}):pt[ie]=p;var Yp=(pt,ie,p)=>n9(pt,typeof ie!="symbol"?ie+"":ie,p);let xs=Dn.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function Xx(t){t&&(xs=t)}function Gx(t,e){const n=xs.global.t;if(n)return n(t,e)}function Yx(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}const Kx=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qx=Object.prototype.toString,Zx=t=>qx.call(t)==="[object Object]",Jx=()=>{};function Qx(...t){if(t.length!==1)return p.toRef(...t);const e=t[0];return typeof e=="function"?p.readonly(p.customRef(()=>({get:e,set:Jx}))):p.ref(e)}function eE(t,e){function n(...r){return new Promise((i,o)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(o)})}return n}const qp=t=>t();function tE(t=qp,e={}){const{initialState:n="active"}=e,r=Qx(n==="active");function i(){r.value=!1}function o(){r.value=!0}const a=(...s)=>{r.value&&t(...s)};return{isActive:p.readonly(r),pause:i,resume:o,eventFilter:a}}function Qu(t){return Array.isArray(t)?t:[t]}function nE(t){return p.getCurrentInstance()}function rE(t,e,n={}){const{eventFilter:r=qp,...i}=n;return p.watch(t,eE(r,e),i)}function iE(t,e,n={}){const{eventFilter:r,initialState:i="active",...o}=n,{eventFilter:a,pause:s,resume:l,isActive:u}=tE(r,{initialState:i});return{stop:rE(t,e,{...o,eventFilter:a}),pause:s,resume:l,isActive:u}}function oE(t,e=!0,n){nE()?p.onMounted(t,n):e?t():p.nextTick(t)}function aE(t,e,n){return p.watch(t,e,{...n,immediate:!0})}const ec=Kx?window:void 0;function sE(t){var e;const n=p.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Zp(...t){const e=[],n=()=>{e.forEach(s=>s()),e.length=0},r=(s,l,u,c)=>(s.addEventListener(l,u,c),()=>s.removeEventListener(l,u,c)),i=p.computed(()=>{const s=Qu(p.toValue(t[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),o=aE(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>sE(u)))!=null?l:[ec].filter(u=>u!=null),Qu(p.toValue(i.value?t[1]:t[0])),Qu(p.unref(i.value?t[2]:t[1])),p.toValue(i.value?t[3]:t[2])]},([s,l,u,c])=>{if(n(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Zx(c)?{...c}:c;e.push(...s.flatMap(f=>l.flatMap(h=>u.map(v=>r(f,h,v,d)))))},{flush:"post"}),a=()=>{o(),n()};return Yx(n),a}const Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ws="__vueuse_ssr_handlers__",lE=uE();function uE(){return ws in Es||(Es[ws]=Es[ws]||{}),Es[ws]}function cE(t,e){return lE[t]||e}function dE(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}const fE={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},Jp="vueuse-storage";function Qp(t,e,n,r={}){var i;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:l=!0,mergeDefaults:u=!1,shallow:c,window:d=ec,eventFilter:f,onError:h=K=>{console.error(K)},initOnMounted:v}=r,g=(c?p.shallowRef:p.ref)(typeof e=="function"?e():e),m=p.computed(()=>p.toValue(t));if(!n)try{n=cE("getDefaultStorage",()=>{var K;return(K=ec)==null?void 0:K.localStorage})()}catch(K){h(K)}if(!n)return g;const y=p.toValue(e),x=dE(y),E=(i=r.serializer)!=null?i:fE[x],{pause:b,resume:T}=iE(g,()=>S(g.value),{flush:o,deep:a,eventFilter:f});p.watch(m,()=>C(),{flush:o}),d&&s&&oE(()=>{n instanceof Storage?Zp(d,"storage",C,{passive:!0}):Zp(d,Jp,G),v&&C()}),v||C();function A(K,J){if(d){const R={key:m.value,oldValue:K,newValue:J,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",R):new CustomEvent(Jp,{detail:R}))}}function S(K){try{const J=n.getItem(m.value);if(K==null)A(J,null),n.removeItem(m.value);else{const R=E.write(K);J!==R&&(n.setItem(m.value,R),A(J,R))}}catch(J){h(J)}}function M(K){const J=K?K.newValue:n.getItem(m.value);if(J==null)return l&&y!=null&&n.setItem(m.value,E.write(y)),y;if(!K&&u){const R=E.read(J);return typeof u=="function"?u(R,y):x==="object"&&!Array.isArray(R)?{...y,...R}:R}else return typeof J!="string"?J:E.read(J)}function C(K){if(!(K&&K.storageArea!==n)){if(K&&K.key==null){g.value=y;return}if(!(K&&K.key!==m.value)){b();try{(K==null?void 0:K.newValue)!==E.write(g.value)&&(g.value=M(K))}catch(J){h(J)}finally{K?p.nextTick(T):T()}}}}function G(K){C(K.detail)}return g}const ra=new Map;function pE(t){const e=p.getCurrentScope();function n(s){var l;const u=ra.get(t)||new Set;u.add(s),ra.set(t,u);const c=()=>i(s);return(l=e==null?void 0:e.cleanups)==null||l.push(c),c}function r(s){function l(...u){i(l),s(...u)}return n(l)}function i(s){const l=ra.get(t);l&&(l.delete(s),l.size||o())}function o(){ra.delete(t)}function a(s,l){var u;(u=ra.get(t))==null||u.forEach(c=>c(s,l))}return{on:n,once:r,off:i,emit:a,reset:o}}const tc=Vx.create({baseURL:"/cisapi",timeout:3e4});function hE(t){const n=Qp("Access-Token",{}).value;let r;return typeof n=="string"?r=n:n&&(r=n.value),r&&(t.headers={...t.headers,"Access-Token":r}),t}function gE(t){const e=t.data;if(!(e instanceof Blob)&&(!e||e.code===void 0))Wt.message.error(e+"");else if(!(e instanceof Blob)&&e.code<0){let n=Gx("err."+e.code);n===`err.${e.code}`&&(n=e.message?e.message:"unknow error"),Wt.message.error(n)}return t}function vE(t){if(t.response){const e=t.response.data;t.response.status===403?Wt.message.error(e.message):t.response.status===401&&Wt.message.error("Authorization verification failed")}else Wt.message.error(t+"");return Promise.reject(t)}tc.interceptors.request.use(hE,t=>Promise.reject(t)),tc.interceptors.response.use(gE,vE);function rn(t){return tc(t).then(e=>e.data)}const Gt={getLangInfo:t=>rn({url:"/system/api/auth/lang-info",method:"get",params:t}),getBusTypeTree:t=>rn({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:t}),getBusTypeTreeData:t=>rn({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:t}),getBpmnList:t=>rn({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:t}),switchBpmnStatus:t=>rn({url:"/workorder/api/flow/bpmn/switch",method:"post",params:t}),delBpmn:t=>rn({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:t}),getBpmnDetail:t=>rn({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:t}),getBpmnXml:t=>rn({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:t}),getLinkList:t=>rn({url:"/workorder/api/flow/link/public-search-list",method:"get",params:t}),getBranchTree:t=>rn({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:t}),getUserList:t=>rn({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:t}),getRoleList:t=>rn({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:t}),bpmnInsert:t=>rn({url:"/workorder/api/flow/bpmn/insert",method:"post",data:t}),bpmnUpdate:t=>rn({url:"/workorder/api/flow/bpmn/update",method:"post",data:t}),getTemplateList:t=>rn({url:"/workorder/api/form-template/search-page",method:"get",params:t})},nc=Kp.defineStore("wfApp",{state:()=>({lang:Qp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(t){const e=this.lang;e&&(xs.global.locale.value=e,this.localeMap[e]||Gt.getLangInfo({isoCode:e}).then(n=>{if(n.code===0){const r=n.result.detail;this.localeMap[e]=r,xs.global.mergeLocaleMessage(e,r),t&&(this.setLang(""),setTimeout(()=>{this.setLang(e)}))}}))},setLang(t){this.lang=t},setTheme(t){t&&(this.theme=t)},setupLangWatcher(){this.getLangInfo(!0),p.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),mE=p.defineComponent({__name:"index",setup(t){const e="wf",n=nc();return(r,i)=>{const o=ie.App,a=ie.ConfigProvider;return p.openBlock(),p.createBlock(a,{prefixCls:p.unref(e),theme:{token:p.unref(n).theme}},{default:p.withCtx(()=>[p.createVNode(o,null,{default:p.withCtx(()=>[p.renderSlot(r.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function eh(t,e={immediate:!0}){const n=Dn.useI18n(),{t:r}=n,i=p.ref({}),o=[].concat(t);function a(){const u=o.map(c=>{const d=rc[c];if(bs.isPromise(d))return d;if(d)return Promise.resolve([c,d]);const f=rn({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:c}}).then(h=>(rc[c]=h,[c,h]));return rc[c]=f,f});return Promise.all(u).then(c=>{c.forEach(d=>{const[f,h]=d;h&&h.code===0&&(i.value[f]=h.result)})})}p.watchEffect(()=>{const u=i.value;Object.keys(u).forEach(d=>{const f=u[d];for(const h in f){const v=`dct.${d}${h}`,g=r(v);f[h].text=g!==v?g:f[h].text}})}),e.immediate&&a();function s(u,c){const d=i.value[u];if(d&&c){const f=d[c];return f&&f.text?f.text:"-"}return"-"}function l(u){const c=i.value[u];return c?Object.keys(c).map(f=>({label:c[f].text,value:f})):[]}return[i,{fetchDict:a,toList:l,getDictLabel:s}]}const yE=p.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(t){const e=t,[n]=eh(e.type,{immediate:!0}),r=p.ref();p.watchEffect(()=>{let o="-";const a=n.value[e.type];if(a&&!bs.isNullOrUndef(e.value))if(bs.isString(e.value))o=e.value.split(",").filter(l=>l).map(l=>{var u;return(u=a[l])==null?void 0:u.text}).join("、")||"-";else{const s=a[e.value];o=(s==null?void 0:s.text)||"-"}r.value=o});const i=p.computed(()=>{if(e.dictClass)return`${e.dictClass} status${e.value}`});return(o,a)=>{const s=ie.Tooltip;return t.showTooltip?(p.openBlock(),p.createBlock(s,{key:0,placement:"topLeft",title:p.unref(r)},{default:p.withCtx(()=>[p.createElementVNode("span",{class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7)]),_:1},8,["title"])):(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7))}}}),ic="el",_E="is-",Ri=(t,e,n,r,i)=>{let o=`${t}-${e}`;return n&&(o+=`-${n}`),r&&(o+=`__${r}`),i&&(o+=`--${i}`),o},bE=Symbol("namespaceContextKey"),xE=t=>{const e=p.getCurrentInstance()?p.inject(bE,p.ref(ic)):p.ref(ic);return p.computed(()=>p.unref(e)||ic)},th=(t,e)=>{const n=xE();return{namespace:n,b:(g="")=>Ri(n.value,t,g,"",""),e:g=>g?Ri(n.value,t,"",g,""):"",m:g=>g?Ri(n.value,t,"","",g):"",be:(g,m)=>g&&m?Ri(n.value,t,g,m,""):"",em:(g,m)=>g&&m?Ri(n.value,t,"",g,m):"",bm:(g,m)=>g&&m?Ri(n.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?Ri(n.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${_E}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}};/**
1
+ (function(pt,ie){typeof exports=="object"&&typeof module<"u"?ie(exports,require("ant-design-vue/es"),require("vue"),require("pinia"),require("vue-i18n"),require("axios"),require("ant-design-vue"),require("@witlink/components")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es","vue","pinia","vue-i18n","axios","ant-design-vue","@witlink/components"],ie):(pt=typeof globalThis<"u"?globalThis:pt||self,ie(pt["witlink-workflow"]={},pt.es,pt.Vue,pt.pinia,pt.vueI18n,pt.Axios,pt.antDesignVue,pt.components))})(this,function(pt,ie,p,Kp,Dn,Vx,Ht,bs){"use strict";var t9=Object.defineProperty;var n9=(pt,ie,p)=>ie in pt?t9(pt,ie,{enumerable:!0,configurable:!0,writable:!0,value:p}):pt[ie]=p;var Yp=(pt,ie,p)=>n9(pt,typeof ie!="symbol"?ie+"":ie,p);let xs=Dn.createI18n({locale:"en_US",fallbackLocale:"en_US",legacy:!1,messages:{},silentTranslationWarn:!0});function Xx(t){t&&(xs=t)}function Gx(t,e){const n=xs.global.t;if(n)return n(t,e)}function Yx(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}const Kx=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qx=Object.prototype.toString,Zx=t=>qx.call(t)==="[object Object]",Jx=()=>{};function Qx(...t){if(t.length!==1)return p.toRef(...t);const e=t[0];return typeof e=="function"?p.readonly(p.customRef(()=>({get:e,set:Jx}))):p.ref(e)}function eE(t,e){function n(...r){return new Promise((i,o)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(i).catch(o)})}return n}const qp=t=>t();function tE(t=qp,e={}){const{initialState:n="active"}=e,r=Qx(n==="active");function i(){r.value=!1}function o(){r.value=!0}const a=(...s)=>{r.value&&t(...s)};return{isActive:p.readonly(r),pause:i,resume:o,eventFilter:a}}function ec(t){return Array.isArray(t)?t:[t]}function nE(t){return p.getCurrentInstance()}function rE(t,e,n={}){const{eventFilter:r=qp,...i}=n;return p.watch(t,eE(r,e),i)}function iE(t,e,n={}){const{eventFilter:r,initialState:i="active",...o}=n,{eventFilter:a,pause:s,resume:l,isActive:u}=tE(r,{initialState:i});return{stop:rE(t,e,{...o,eventFilter:a}),pause:s,resume:l,isActive:u}}function oE(t,e=!0,n){nE()?p.onMounted(t,n):e?t():p.nextTick(t)}function aE(t,e,n){return p.watch(t,e,{...n,immediate:!0})}const tc=Kx?window:void 0;function sE(t){var e;const n=p.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Zp(...t){const e=[],n=()=>{e.forEach(s=>s()),e.length=0},r=(s,l,u,c)=>(s.addEventListener(l,u,c),()=>s.removeEventListener(l,u,c)),i=p.computed(()=>{const s=ec(p.toValue(t[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),o=aE(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>sE(u)))!=null?l:[tc].filter(u=>u!=null),ec(p.toValue(i.value?t[1]:t[0])),ec(p.unref(i.value?t[2]:t[1])),p.toValue(i.value?t[3]:t[2])]},([s,l,u,c])=>{if(n(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const d=Zx(c)?{...c}:c;e.push(...s.flatMap(f=>l.flatMap(h=>u.map(v=>r(f,h,v,d)))))},{flush:"post"}),a=()=>{o(),n()};return Yx(n),a}const Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ws="__vueuse_ssr_handlers__",lE=uE();function uE(){return ws in Es||(Es[ws]=Es[ws]||{}),Es[ws]}function cE(t,e){return lE[t]||e}function dE(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}const fE={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},Jp="vueuse-storage";function Qp(t,e,n,r={}){var i;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:l=!0,mergeDefaults:u=!1,shallow:c,window:d=tc,eventFilter:f,onError:h=K=>{console.error(K)},initOnMounted:v}=r,g=(c?p.shallowRef:p.ref)(typeof e=="function"?e():e),m=p.computed(()=>p.toValue(t));if(!n)try{n=cE("getDefaultStorage",()=>{var K;return(K=tc)==null?void 0:K.localStorage})()}catch(K){h(K)}if(!n)return g;const y=p.toValue(e),x=dE(y),E=(i=r.serializer)!=null?i:fE[x],{pause:b,resume:T}=iE(g,()=>S(g.value),{flush:o,deep:a,eventFilter:f});p.watch(m,()=>C(),{flush:o}),d&&s&&oE(()=>{n instanceof Storage?Zp(d,"storage",C,{passive:!0}):Zp(d,Jp,G),v&&C()}),v||C();function A(K,J){if(d){const R={key:m.value,oldValue:K,newValue:J,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",R):new CustomEvent(Jp,{detail:R}))}}function S(K){try{const J=n.getItem(m.value);if(K==null)A(J,null),n.removeItem(m.value);else{const R=E.write(K);J!==R&&(n.setItem(m.value,R),A(J,R))}}catch(J){h(J)}}function M(K){const J=K?K.newValue:n.getItem(m.value);if(J==null)return l&&y!=null&&n.setItem(m.value,E.write(y)),y;if(!K&&u){const R=E.read(J);return typeof u=="function"?u(R,y):x==="object"&&!Array.isArray(R)?{...y,...R}:R}else return typeof J!="string"?J:E.read(J)}function C(K){if(!(K&&K.storageArea!==n)){if(K&&K.key==null){g.value=y;return}if(!(K&&K.key!==m.value)){b();try{(K==null?void 0:K.newValue)!==E.write(g.value)&&(g.value=M(K))}catch(J){h(J)}finally{K?p.nextTick(T):T()}}}}function G(K){C(K.detail)}return g}const ra=new Map;function pE(t){const e=p.getCurrentScope();function n(s){var l;const u=ra.get(t)||new Set;u.add(s),ra.set(t,u);const c=()=>i(s);return(l=e==null?void 0:e.cleanups)==null||l.push(c),c}function r(s){function l(...u){i(l),s(...u)}return n(l)}function i(s){const l=ra.get(t);l&&(l.delete(s),l.size||o())}function o(){ra.delete(t)}function a(s,l){var u;(u=ra.get(t))==null||u.forEach(c=>c(s,l))}return{on:n,once:r,off:i,emit:a,reset:o}}const nc=Vx.create({baseURL:"/cisapi",timeout:3e4});function hE(t){const e=Ss(),r=Qp("Access-Token",{}).value;let i;return typeof r=="string"?i=r:r&&(i=r.value),i&&(t.headers={...t.headers,"Access-Token":i,isoCode:e.lang}),t}function gE(t){const e=t.data;if(!(e instanceof Blob)&&(!e||e.code===void 0))Ht.message.error(e+"");else if(!(e instanceof Blob)&&e.code<0){let n=Gx("err."+e.code);n===`err.${e.code}`&&(n=e.message?e.message:"unknow error"),Ht.message.error(n)}return t}function vE(t){if(t.response){const e=t.response.data;t.response.status===403?Ht.message.error(e.message):t.response.status===401&&Ht.message.error("Authorization verification failed")}else Ht.message.error(t+"");return Promise.reject(t)}nc.interceptors.request.use(hE,t=>Promise.reject(t)),nc.interceptors.response.use(gE,vE);function rn(t){return nc(t).then(e=>e.data)}const Gt={getLangInfo:t=>rn({url:"/system/api/auth/lang-info",method:"get",params:t}),getBusTypeTree:t=>rn({url:"/workorder/api/flow/type/public-tree-root",method:"get",params:t}),getBusTypeTreeData:t=>rn({url:"/workorder/api/flow/type/public-tree-child",method:"get",params:t}),getBpmnList:t=>rn({url:"/workorder/api/flow/bpmn/search-list",method:"get",params:t}),switchBpmnStatus:t=>rn({url:"/workorder/api/flow/bpmn/switch",method:"post",params:t}),delBpmn:t=>rn({url:"/workorder/api/flow/bpmn/delete",method:"delete",params:t}),getBpmnDetail:t=>rn({url:"/workorder/api/flow/bpmn/detail-view",method:"get",params:t}),getBpmnXml:t=>rn({url:"/workorder/api/flow/bpmn/update-load",method:"get",params:t}),getLinkList:t=>rn({url:"/workorder/api/flow/link/public-search-list",method:"get",params:t}),getBranchTree:t=>rn({url:"/system/api/sys/branch/public-search-list-bpmn",method:"get",params:t}),getUserList:t=>rn({url:"/system/api/sys/user/public-search-list-bpmn",method:"get",params:t}),getRoleList:t=>rn({url:"/system/api/sys/role/public-search-list-bpmn",method:"get",params:t}),bpmnInsert:t=>rn({url:"/workorder/api/flow/bpmn/insert",method:"post",data:t}),bpmnUpdate:t=>rn({url:"/workorder/api/flow/bpmn/update",method:"post",data:t}),getTemplateList:t=>rn({url:"/workorder/api/form-template/search-page",method:"get",params:t})},Ss=Kp.defineStore("wfApp",{state:()=>({lang:Qp("locale",""),theme:{colorPrimary:"#165dff",colorInfo:"#165dff",borderRadius:4},localeMap:{}}),actions:{getLangInfo(t){const e=this.lang;e&&(xs.global.locale.value=e,this.localeMap[e]||Gt.getLangInfo({isoCode:e}).then(n=>{if(n.code===0){const r=n.result.detail;this.localeMap[e]=r,xs.global.mergeLocaleMessage(e,r),t&&(this.setLang(""),setTimeout(()=>{this.setLang(e)}))}}))},setLang(t){this.lang=t},setTheme(t){t&&(this.theme=t)},setupLangWatcher(){this.getLangInfo(!0),p.watch(()=>this.lang,()=>this.getLangInfo(!0))}}}),mE=p.defineComponent({__name:"index",setup(t){const e="wf",n=Ss();return(r,i)=>{const o=ie.App,a=ie.ConfigProvider;return p.openBlock(),p.createBlock(a,{prefixCls:p.unref(e),theme:{token:p.unref(n).theme}},{default:p.withCtx(()=>[p.createVNode(o,null,{default:p.withCtx(()=>[p.renderSlot(r.$slots,"default")]),_:3})]),_:3},8,["prefixCls","theme"])}}}),rc={};function eh(t,e={immediate:!0}){const n=Dn.useI18n(),{t:r}=n,i=p.ref({}),o=[].concat(t);function a(){const u=o.map(c=>{const d=rc[c];if(bs.isPromise(d))return d;if(d)return Promise.resolve([c,d]);const f=rn({method:"get",url:"/system/api/sys/dictionary/public-dict-combo-ex",params:{tableType:c}}).then(h=>(rc[c]=h,[c,h]));return rc[c]=f,f});return Promise.all(u).then(c=>{c.forEach(d=>{const[f,h]=d;h&&h.code===0&&(i.value[f]=h.result)})})}p.watchEffect(()=>{const u=i.value;Object.keys(u).forEach(d=>{const f=u[d];for(const h in f){const v=`dct.${d}${h}`,g=r(v);f[h].text=g!==v?g:f[h].text}})}),e.immediate&&a();function s(u,c){const d=i.value[u];if(d&&c){const f=d[c];return f&&f.text?f.text:"-"}return"-"}function l(u){const c=i.value[u];return c?Object.keys(c).map(f=>({label:c[f].text,value:f})):[]}return[i,{fetchDict:a,toList:l,getDictLabel:s}]}const yE=p.defineComponent({__name:"index",props:{type:{type:String,default:""},value:[Number,String],style:{type:Object,default(){return{}}},dictClass:{type:String},showTooltip:{type:Boolean,default:!1}},setup(t){const e=t,[n]=eh(e.type,{immediate:!0}),r=p.ref();p.watchEffect(()=>{let o="-";const a=n.value[e.type];if(a&&!bs.isNullOrUndef(e.value))if(bs.isString(e.value))o=e.value.split(",").filter(l=>l).map(l=>{var u;return(u=a[l])==null?void 0:u.text}).join("、")||"-";else{const s=a[e.value];o=(s==null?void 0:s.text)||"-"}r.value=o});const i=p.computed(()=>{if(e.dictClass)return`${e.dictClass} status${e.value}`});return(o,a)=>{const s=ie.Tooltip;return t.showTooltip?(p.openBlock(),p.createBlock(s,{key:0,placement:"topLeft",title:p.unref(r)},{default:p.withCtx(()=>[p.createElementVNode("span",{class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7)]),_:1},8,["title"])):(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(p.unref(i)),style:p.normalizeStyle(t.style)},p.toDisplayString(p.unref(r)),7))}}}),ic="el",_E="is-",Ri=(t,e,n,r,i)=>{let o=`${t}-${e}`;return n&&(o+=`-${n}`),r&&(o+=`__${r}`),i&&(o+=`--${i}`),o},bE=Symbol("namespaceContextKey"),xE=t=>{const e=p.getCurrentInstance()?p.inject(bE,p.ref(ic)):p.ref(ic);return p.computed(()=>p.unref(e)||ic)},th=(t,e)=>{const n=xE();return{namespace:n,b:(g="")=>Ri(n.value,t,g,"",""),e:g=>g?Ri(n.value,t,"",g,""):"",m:g=>g?Ri(n.value,t,"","",g):"",be:(g,m)=>g&&m?Ri(n.value,t,g,m,""):"",em:(g,m)=>g&&m?Ri(n.value,t,"",g,m):"",bm:(g,m)=>g&&m?Ri(n.value,t,g,"",m):"",bem:(g,m,y)=>g&&m&&y?Ri(n.value,t,g,m,y):"",is:(g,...m)=>{const y=m.length>=1?m[0]:!0;return g&&y?`${_E}${g}`:""},cssVar:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${y}`]=g[y]);return m},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const m={};for(const y in g)g[y]&&(m[`--${n.value}-${t}-${y}`]=g[y]);return m},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}};/**
2
2
  * @vue/shared v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const EE=Object.prototype.hasOwnProperty,nh=(t,e)=>EE.call(t,e),oc=t=>typeof t=="string",ac=t=>t!==null&&typeof t=="object";var rh=typeof global=="object"&&global&&global.Object===Object&&global,wE=typeof self=="object"&&self&&self.Object===Object&&self,Ut=rh||wE||Function("return this")(),on=Ut.Symbol,ih=Object.prototype,SE=ih.hasOwnProperty,CE=ih.toString,ia=on?on.toStringTag:void 0;function AE(t){var e=SE.call(t,ia),n=t[ia];try{t[ia]=void 0;var r=!0}catch{}var i=CE.call(t);return r&&(e?t[ia]=n:delete t[ia]),i}var OE=Object.prototype,TE=OE.toString;function NE(t){return TE.call(t)}var ME="[object Null]",DE="[object Undefined]",oh=on?on.toStringTag:void 0;function dn(t){return t==null?t===void 0?DE:ME:oh&&oh in Object(t)?AE(t):NE(t)}function It(t){return t!=null&&typeof t=="object"}var PE="[object Symbol]";function Pn(t){return typeof t=="symbol"||It(t)&&dn(t)==PE}var RE=NaN;function ah(t){return typeof t=="number"?t:Pn(t)?RE:+t}function Pt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var We=Array.isArray,sh=on?on.prototype:void 0,lh=sh?sh.toString:void 0;function Rn(t){if(typeof t=="string")return t;if(We(t))return Pt(t,Rn)+"";if(Pn(t))return lh?lh.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ss(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Rn(n),r=Rn(r)):(n=ah(n),r=ah(r)),i=t(n,r)}return i}}var LE=Ss(function(t,e){return t+e},0),IE=/\s/;function uh(t){for(var e=t.length;e--&&IE.test(t.charAt(e)););return e}var kE=/^\s+/;function ch(t){return t&&t.slice(0,uh(t)+1).replace(kE,"")}function Rt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var dh=NaN,BE=/^[-+]0x[0-9a-f]+$/i,jE=/^0b[01]+$/i,FE=/^0o[0-7]+$/i,$E=parseInt;function Vn(t){if(typeof t=="number")return t;if(Pn(t))return dh;if(Rt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Rt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ch(t);var n=jE.test(t);return n||FE.test(t)?$E(t.slice(2),n?2:8):BE.test(t)?dh:+t}var HE=1/0,zE=17976931348623157e292;function Ur(t){if(!t)return t===0?t:0;if(t=Vn(t),t===HE||t===-1/0){var e=t<0?-1:1;return e*zE}return t===t?t:0}function Ke(t){var e=Ur(t),n=e%1;return e===e?n?e-n:e:0}var WE="Expected a function";function UE(t,e){if(typeof e!="function")throw new TypeError(WE);return t=Ke(t),function(){if(--t<1)return e.apply(this,arguments)}}function wn(t){return t}var VE="[object AsyncFunction]",XE="[object Function]",GE="[object GeneratorFunction]",YE="[object Proxy]";function lr(t){if(!Rt(t))return!1;var e=dn(t);return e==XE||e==GE||e==VE||e==YE}var Cs=Ut["__core-js_shared__"],fh=function(){var t=/[^.]+$/.exec(Cs&&Cs.keys&&Cs.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function KE(t){return!!fh&&fh in t}var qE=Function.prototype,ZE=qE.toString;function Li(t){if(t!=null){try{return ZE.call(t)}catch{}try{return t+""}catch{}}return""}var JE=/[\\^$.*+?()[\]{}|]/g,QE=/^\[object .+?Constructor\]$/,ew=Function.prototype,tw=Object.prototype,nw=ew.toString,rw=tw.hasOwnProperty,iw=RegExp("^"+nw.call(rw).replace(JE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ph(t){if(!Rt(t)||KE(t))return!1;var e=lr(t)?iw:QE;return e.test(Li(t))}function ow(t,e){return t==null?void 0:t[e]}function Ii(t,e){var n=ow(t,e);return ph(n)?n:void 0}var oa=Ii(Ut,"WeakMap"),As=oa&&new oa,hh=As?function(t,e){return As.set(t,e),t}:wn,gh=Object.create,so=function(){function t(){}return function(e){if(!Rt(e))return{};if(gh)return gh(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function aa(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=so(t.prototype),r=t.apply(n,e);return Rt(r)?r:n}}var aw=1;function sw(t,e,n){var r=e&aw,i=aa(t);function o(){var a=this&&this!==Ut&&this instanceof o?i:t;return a.apply(r?n:this,arguments)}return o}function Ln(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var lw=Math.max;function vh(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,u=lw(o-a,0),c=Array(l+u),d=!r;++s<l;)c[s]=e[s];for(;++i<a;)(d||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var uw=Math.max;function mh(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,u=e.length,c=uw(o-s,0),d=Array(c+u),f=!r;++i<c;)d[i]=t[i];for(var h=i;++l<u;)d[h+l]=e[l];for(;++a<s;)(f||i<o)&&(d[h+n[a]]=t[i++]);return d}function cw(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function Os(){}var dw=4294967295;function ot(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=dw,this.__views__=[]}ot.prototype=so(Os.prototype),ot.prototype.constructor=ot;function lo(){}var sc=As?function(t){return As.get(t)}:lo,uo={},fw=Object.prototype,pw=fw.hasOwnProperty;function Ts(t){for(var e=t.name+"",n=uo[e],r=pw.call(uo,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Xn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Xn.prototype=so(Os.prototype),Xn.prototype.constructor=Xn;function Sn(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function yh(t){if(t instanceof ot)return t.clone();var e=new Xn(t.__wrapped__,t.__chain__);return e.__actions__=Sn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var hw=Object.prototype,gw=hw.hasOwnProperty;function O(t){if(It(t)&&!We(t)&&!(t instanceof ot)){if(t instanceof Xn)return t;if(gw.call(t,"__wrapped__"))return yh(t)}return new Xn(t)}O.prototype=Os.prototype,O.prototype.constructor=O;function lc(t){var e=Ts(t),n=O[e];if(typeof n!="function"||!(e in ot.prototype))return!1;if(t===n)return!0;var r=sc(n);return!!r&&t===r[0]}var vw=800,mw=16,yw=Date.now;function _h(t){var e=0,n=0;return function(){var r=yw(),i=mw-(r-n);if(n=r,i>0){if(++e>=vw)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bh=_h(hh),_w=/\{\n\/\* \[wrapped with (.+)\] \*/,bw=/,? & /;function xw(t){var e=t.match(_w);return e?e[1].split(bw):[]}var Ew=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ww(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ew,`{
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const EE=Object.prototype.hasOwnProperty,nh=(t,e)=>EE.call(t,e),oc=t=>typeof t=="string",ac=t=>t!==null&&typeof t=="object";var rh=typeof global=="object"&&global&&global.Object===Object&&global,wE=typeof self=="object"&&self&&self.Object===Object&&self,Ut=rh||wE||Function("return this")(),on=Ut.Symbol,ih=Object.prototype,SE=ih.hasOwnProperty,CE=ih.toString,ia=on?on.toStringTag:void 0;function AE(t){var e=SE.call(t,ia),n=t[ia];try{t[ia]=void 0;var r=!0}catch{}var i=CE.call(t);return r&&(e?t[ia]=n:delete t[ia]),i}var OE=Object.prototype,TE=OE.toString;function NE(t){return TE.call(t)}var ME="[object Null]",DE="[object Undefined]",oh=on?on.toStringTag:void 0;function dn(t){return t==null?t===void 0?DE:ME:oh&&oh in Object(t)?AE(t):NE(t)}function It(t){return t!=null&&typeof t=="object"}var PE="[object Symbol]";function Pn(t){return typeof t=="symbol"||It(t)&&dn(t)==PE}var RE=NaN;function ah(t){return typeof t=="number"?t:Pn(t)?RE:+t}function Pt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var We=Array.isArray,sh=on?on.prototype:void 0,lh=sh?sh.toString:void 0;function Rn(t){if(typeof t=="string")return t;if(We(t))return Pt(t,Rn)+"";if(Pn(t))return lh?lh.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Cs(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Rn(n),r=Rn(r)):(n=ah(n),r=ah(r)),i=t(n,r)}return i}}var LE=Cs(function(t,e){return t+e},0),IE=/\s/;function uh(t){for(var e=t.length;e--&&IE.test(t.charAt(e)););return e}var kE=/^\s+/;function ch(t){return t&&t.slice(0,uh(t)+1).replace(kE,"")}function Rt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var dh=NaN,BE=/^[-+]0x[0-9a-f]+$/i,jE=/^0b[01]+$/i,FE=/^0o[0-7]+$/i,$E=parseInt;function Vn(t){if(typeof t=="number")return t;if(Pn(t))return dh;if(Rt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Rt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ch(t);var n=jE.test(t);return n||FE.test(t)?$E(t.slice(2),n?2:8):BE.test(t)?dh:+t}var HE=1/0,zE=17976931348623157e292;function Ur(t){if(!t)return t===0?t:0;if(t=Vn(t),t===HE||t===-1/0){var e=t<0?-1:1;return e*zE}return t===t?t:0}function Ke(t){var e=Ur(t),n=e%1;return e===e?n?e-n:e:0}var WE="Expected a function";function UE(t,e){if(typeof e!="function")throw new TypeError(WE);return t=Ke(t),function(){if(--t<1)return e.apply(this,arguments)}}function wn(t){return t}var VE="[object AsyncFunction]",XE="[object Function]",GE="[object GeneratorFunction]",YE="[object Proxy]";function lr(t){if(!Rt(t))return!1;var e=dn(t);return e==XE||e==GE||e==VE||e==YE}var As=Ut["__core-js_shared__"],fh=function(){var t=/[^.]+$/.exec(As&&As.keys&&As.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function KE(t){return!!fh&&fh in t}var qE=Function.prototype,ZE=qE.toString;function Li(t){if(t!=null){try{return ZE.call(t)}catch{}try{return t+""}catch{}}return""}var JE=/[\\^$.*+?()[\]{}|]/g,QE=/^\[object .+?Constructor\]$/,ew=Function.prototype,tw=Object.prototype,nw=ew.toString,rw=tw.hasOwnProperty,iw=RegExp("^"+nw.call(rw).replace(JE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ph(t){if(!Rt(t)||KE(t))return!1;var e=lr(t)?iw:QE;return e.test(Li(t))}function ow(t,e){return t==null?void 0:t[e]}function Ii(t,e){var n=ow(t,e);return ph(n)?n:void 0}var oa=Ii(Ut,"WeakMap"),Os=oa&&new oa,hh=Os?function(t,e){return Os.set(t,e),t}:wn,gh=Object.create,so=function(){function t(){}return function(e){if(!Rt(e))return{};if(gh)return gh(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function aa(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=so(t.prototype),r=t.apply(n,e);return Rt(r)?r:n}}var aw=1;function sw(t,e,n){var r=e&aw,i=aa(t);function o(){var a=this&&this!==Ut&&this instanceof o?i:t;return a.apply(r?n:this,arguments)}return o}function Ln(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var lw=Math.max;function vh(t,e,n,r){for(var i=-1,o=t.length,a=n.length,s=-1,l=e.length,u=lw(o-a,0),c=Array(l+u),d=!r;++s<l;)c[s]=e[s];for(;++i<a;)(d||i<o)&&(c[n[i]]=t[i]);for(;u--;)c[s++]=t[i++];return c}var uw=Math.max;function mh(t,e,n,r){for(var i=-1,o=t.length,a=-1,s=n.length,l=-1,u=e.length,c=uw(o-s,0),d=Array(c+u),f=!r;++i<c;)d[i]=t[i];for(var h=i;++l<u;)d[h+l]=e[l];for(;++a<s;)(f||i<o)&&(d[h+n[a]]=t[i++]);return d}function cw(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}function Ts(){}var dw=4294967295;function ot(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=dw,this.__views__=[]}ot.prototype=so(Ts.prototype),ot.prototype.constructor=ot;function lo(){}var sc=Os?function(t){return Os.get(t)}:lo,uo={},fw=Object.prototype,pw=fw.hasOwnProperty;function Ns(t){for(var e=t.name+"",n=uo[e],r=pw.call(uo,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Xn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Xn.prototype=so(Ts.prototype),Xn.prototype.constructor=Xn;function Sn(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function yh(t){if(t instanceof ot)return t.clone();var e=new Xn(t.__wrapped__,t.__chain__);return e.__actions__=Sn(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var hw=Object.prototype,gw=hw.hasOwnProperty;function O(t){if(It(t)&&!We(t)&&!(t instanceof ot)){if(t instanceof Xn)return t;if(gw.call(t,"__wrapped__"))return yh(t)}return new Xn(t)}O.prototype=Ts.prototype,O.prototype.constructor=O;function lc(t){var e=Ns(t),n=O[e];if(typeof n!="function"||!(e in ot.prototype))return!1;if(t===n)return!0;var r=sc(n);return!!r&&t===r[0]}var vw=800,mw=16,yw=Date.now;function _h(t){var e=0,n=0;return function(){var r=yw(),i=mw-(r-n);if(n=r,i>0){if(++e>=vw)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bh=_h(hh),_w=/\{\n\/\* \[wrapped with (.+)\] \*/,bw=/,? & /;function xw(t){var e=t.match(_w);return e?e[1].split(bw):[]}var Ew=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ww(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ew,`{
6
6
  /* [wrapped with `+e+`] */
7
- `)}function uc(t){return function(){return t}}var Ns=function(){try{var t=Ii(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Sw=Ns?function(t,e){return Ns(t,"toString",{configurable:!0,enumerable:!1,value:uc(e),writable:!0})}:wn,cc=_h(Sw);function Gn(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function Ms(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function xh(t){return t!==t}function Cw(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function co(t,e,n){return e===e?Cw(t,e,n):Ms(t,xh,n)}function Ds(t,e){var n=t==null?0:t.length;return!!n&&co(t,e,0)>-1}var Aw=1,Ow=2,Tw=8,Nw=16,Mw=32,Dw=64,Pw=128,Rw=256,Lw=512,Iw=[["ary",Pw],["bind",Aw],["bindKey",Ow],["curry",Tw],["curryRight",Nw],["flip",Lw],["partial",Mw],["partialRight",Dw],["rearg",Rw]];function kw(t,e){return Gn(Iw,function(n){var r="_."+n[0];e&n[1]&&!Ds(t,r)&&t.push(r)}),t.sort()}function Eh(t,e,n){var r=e+"";return cc(t,ww(r,kw(xw(r),n)))}var Bw=4,jw=8,wh=32,Sh=64;function Ch(t,e,n,r,i,o,a,s,l,u){var c=e&jw,d=c?a:void 0,f=c?void 0:a,h=c?o:void 0,v=c?void 0:o;e|=c?wh:Sh,e&=~(c?Sh:wh),e&Bw||(e&=-4);var g=[t,e,i,h,d,v,f,s,l,u],m=n.apply(void 0,g);return lc(t)&&bh(m,g),m.placeholder=r,Eh(m,t,e)}function fo(t){var e=t;return e.placeholder}var Fw=9007199254740991,$w=/^(?:0|[1-9]\d*)$/;function Vr(t,e){var n=typeof t;return e=e??Fw,!!e&&(n=="number"||n!="symbol"&&$w.test(t))&&t>-1&&t%1==0&&t<e}var Hw=Math.min;function zw(t,e){for(var n=t.length,r=Hw(e.length,n),i=Sn(t);r--;){var o=e[r];t[r]=Vr(o,n)?i[o]:void 0}return t}var Ah="__lodash_placeholder__";function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];(a===e||a===Ah)&&(t[n]=Ah,o[i++]=n)}return o}var Ww=1,Uw=2,Vw=8,Xw=16,Gw=128,Yw=512;function Ps(t,e,n,r,i,o,a,s,l,u){var c=e&Gw,d=e&Ww,f=e&Uw,h=e&(Vw|Xw),v=e&Yw,g=f?void 0:aa(t);function m(){for(var y=arguments.length,x=Array(y),E=y;E--;)x[E]=arguments[E];if(h)var b=fo(m),T=cw(x,b);if(r&&(x=vh(x,r,i,h)),o&&(x=mh(x,o,a,h)),y-=T,h&&y<u){var A=ai(x,b);return Ch(t,e,Ps,m.placeholder,n,x,A,s,l,u-y)}var S=d?n:this,M=f?S[t]:t;return y=x.length,s?x=zw(x,s):v&&y>1&&x.reverse(),c&&l<y&&(x.length=l),this&&this!==Ut&&this instanceof m&&(M=g||aa(M)),M.apply(S,x)}return m}function Kw(t,e,n){var r=aa(t);function i(){for(var o=arguments.length,a=Array(o),s=o,l=fo(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:ai(a,l);if(o-=u.length,o<n)return Ch(t,e,Ps,i.placeholder,void 0,a,u,void 0,void 0,n-o);var c=this&&this!==Ut&&this instanceof i?r:t;return Ln(c,this,a)}return i}var qw=1;function Zw(t,e,n,r){var i=e&qw,o=aa(t);function a(){for(var s=-1,l=arguments.length,u=-1,c=r.length,d=Array(c+l),f=this&&this!==Ut&&this instanceof a?o:t;++u<c;)d[u]=r[u];for(;l--;)d[u++]=arguments[++s];return Ln(f,i?n:this,d)}return a}var Oh="__lodash_placeholder__",dc=1,Jw=2,Qw=4,Th=8,sa=128,Nh=256,eS=Math.min;function tS(t,e){var n=t[1],r=e[1],i=n|r,o=i<(dc|Jw|sa),a=r==sa&&n==Th||r==sa&&n==Nh&&t[7].length<=e[8]||r==(sa|Nh)&&e[7].length<=e[8]&&n==Th;if(!(o||a))return t;r&dc&&(t[2]=e[2],i|=n&dc?0:Qw);var s=e[3];if(s){var l=t[3];t[3]=l?vh(l,s,e[4]):s,t[4]=l?ai(t[3],Oh):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?mh(l,s,e[6]):s,t[6]=l?ai(t[5],Oh):e[6]),s=e[7],s&&(t[7]=s),r&sa&&(t[8]=t[8]==null?e[8]:eS(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}var nS="Expected a function",Mh=1,rS=2,Dh=8,Ph=16,Rh=32,iS=64,Lh=Math.max;function Xr(t,e,n,r,i,o,a,s){var l=e&rS;if(!l&&typeof t!="function")throw new TypeError(nS);var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),a=a===void 0?a:Lh(Ke(a),0),s=s===void 0?s:Ke(s),u-=i?i.length:0,e&iS){var c=r,d=i;r=i=void 0}var f=l?void 0:sc(t),h=[t,e,n,r,i,c,d,o,a,s];if(f&&tS(h,f),t=h[0],e=h[1],n=h[2],r=h[3],i=h[4],s=h[9]=h[9]===void 0?l?0:t.length:Lh(h[9]-u,0),!s&&e&(Dh|Ph)&&(e&=-25),!e||e==Mh)var v=sw(t,e,n);else e==Dh||e==Ph?v=Kw(t,e,s):(e==Rh||e==(Mh|Rh))&&!i.length?v=Zw(t,e,n,r):v=Ps.apply(void 0,h);var g=f?hh:bh;return Eh(g(v,h),t,e)}var oS=128;function Ih(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,Xr(t,oS,void 0,void 0,void 0,void 0,e)}function Gr(t,e,n){e=="__proto__"&&Ns?Ns(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){return t===e||t!==t&&e!==e}var aS=Object.prototype,sS=aS.hasOwnProperty;function la(t,e,n){var r=t[e];(!(sS.call(t,e)&&ur(r,n))||n===void 0&&!(e in t))&&Gr(t,e,n)}function Nr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?Gr(n,s,l):la(n,s,l)}return n}var kh=Math.max;function Bh(t,e,n){return e=kh(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=kh(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),Ln(t,this,s)}}function Je(t,e){return cc(Bh(t,e,wn),t+"")}var lS=9007199254740991;function Rs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lS}function Cn(t){return t!=null&&Rs(t.length)&&!lr(t)}function fn(t,e,n){if(!Rt(n))return!1;var r=typeof e;return(r=="number"?Cn(n)&&Vr(e,n.length):r=="string"&&e in n)?ur(n[e],t):!1}function po(t){return Je(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&fn(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var uS=Object.prototype;function ua(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||uS;return t===n}function fc(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var cS="[object Arguments]";function jh(t){return It(t)&&dn(t)==cS}var Fh=Object.prototype,dS=Fh.hasOwnProperty,fS=Fh.propertyIsEnumerable,ki=jh(function(){return arguments}())?jh:function(t){return It(t)&&dS.call(t,"callee")&&!fS.call(t,"callee")};function pc(){return!1}var $h=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Hh=$h&&typeof module=="object"&&module&&!module.nodeType&&module,pS=Hh&&Hh.exports===$h,zh=pS?Ut.Buffer:void 0,hS=zh?zh.isBuffer:void 0,si=hS||pc,gS="[object Arguments]",vS="[object Array]",mS="[object Boolean]",yS="[object Date]",_S="[object Error]",bS="[object Function]",xS="[object Map]",ES="[object Number]",wS="[object Object]",SS="[object RegExp]",CS="[object Set]",AS="[object String]",OS="[object WeakMap]",TS="[object ArrayBuffer]",NS="[object DataView]",MS="[object Float32Array]",DS="[object Float64Array]",PS="[object Int8Array]",RS="[object Int16Array]",LS="[object Int32Array]",IS="[object Uint8Array]",kS="[object Uint8ClampedArray]",BS="[object Uint16Array]",jS="[object Uint32Array]",Nt={};Nt[MS]=Nt[DS]=Nt[PS]=Nt[RS]=Nt[LS]=Nt[IS]=Nt[kS]=Nt[BS]=Nt[jS]=!0,Nt[gS]=Nt[vS]=Nt[TS]=Nt[mS]=Nt[NS]=Nt[yS]=Nt[_S]=Nt[bS]=Nt[xS]=Nt[ES]=Nt[wS]=Nt[SS]=Nt[CS]=Nt[AS]=Nt[OS]=!1;function FS(t){return It(t)&&Rs(t.length)&&!!Nt[dn(t)]}function In(t){return function(e){return t(e)}}var Wh=typeof pt=="object"&&pt&&!pt.nodeType&&pt,ca=Wh&&typeof module=="object"&&module&&!module.nodeType&&module,$S=ca&&ca.exports===Wh,hc=$S&&rh.process,Yn=function(){try{var t=ca&&ca.require&&ca.require("util").types;return t||hc&&hc.binding&&hc.binding("util")}catch{}}(),Uh=Yn&&Yn.isTypedArray,ho=Uh?In(Uh):FS,HS=Object.prototype,zS=HS.hasOwnProperty;function Vh(t,e){var n=We(t),r=!n&&ki(t),i=!n&&!r&&si(t),o=!n&&!r&&!i&&ho(t),a=n||r||i||o,s=a?fc(t.length,String):[],l=s.length;for(var u in t)(e||zS.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Vr(u,l)))&&s.push(u);return s}function Xh(t,e){return function(n){return t(e(n))}}var WS=Xh(Object.keys,Object),US=Object.prototype,VS=US.hasOwnProperty;function gc(t){if(!ua(t))return WS(t);var e=[];for(var n in Object(t))VS.call(t,n)&&n!="constructor"&&e.push(n);return e}function Vt(t){return Cn(t)?Vh(t):gc(t)}var XS=Object.prototype,GS=XS.hasOwnProperty,ut=po(function(t,e){if(ua(e)||Cn(e)){Nr(e,Vt(e),t);return}for(var n in e)GS.call(e,n)&&la(t,n,e[n])});function YS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var KS=Object.prototype,qS=KS.hasOwnProperty;function ZS(t){if(!Rt(t))return YS(t);var e=ua(t),n=[];for(var r in t)r=="constructor"&&(e||!qS.call(t,r))||n.push(r);return n}function An(t){return Cn(t)?Vh(t,!0):ZS(t)}var JS=po(function(t,e){Nr(e,An(e),t)}),vc=po(function(t,e,n,r){Nr(e,An(e),t,r)}),QS=po(function(t,e,n,r){Nr(e,Vt(e),t,r)}),eC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tC=/^\w*$/;function mc(t,e){if(We(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Pn(t)?!0:tC.test(t)||!eC.test(t)||e!=null&&t in Object(e)}var da=Ii(Object,"create");function nC(){this.__data__=da?da(null):{},this.size=0}function rC(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var iC="__lodash_hash_undefined__",oC=Object.prototype,aC=oC.hasOwnProperty;function sC(t){var e=this.__data__;if(da){var n=e[t];return n===iC?void 0:n}return aC.call(e,t)?e[t]:void 0}var lC=Object.prototype,uC=lC.hasOwnProperty;function cC(t){var e=this.__data__;return da?e[t]!==void 0:uC.call(e,t)}var dC="__lodash_hash_undefined__";function fC(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=da&&e===void 0?dC:e,this}function Bi(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bi.prototype.clear=nC,Bi.prototype.delete=rC,Bi.prototype.get=sC,Bi.prototype.has=cC,Bi.prototype.set=fC;function pC(){this.__data__=[],this.size=0}function Ls(t,e){for(var n=t.length;n--;)if(ur(t[n][0],e))return n;return-1}var hC=Array.prototype,gC=hC.splice;function vC(t){var e=this.__data__,n=Ls(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():gC.call(e,n,1),--this.size,!0}function mC(t){var e=this.__data__,n=Ls(e,t);return n<0?void 0:e[n][1]}function yC(t){return Ls(this.__data__,t)>-1}function _C(t,e){var n=this.__data__,r=Ls(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Yr.prototype.clear=pC,Yr.prototype.delete=vC,Yr.prototype.get=mC,Yr.prototype.has=yC,Yr.prototype.set=_C;var fa=Ii(Ut,"Map");function bC(){this.size=0,this.__data__={hash:new Bi,map:new(fa||Yr),string:new Bi}}function xC(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Is(t,e){var n=t.__data__;return xC(e)?n[typeof e=="string"?"string":"hash"]:n.map}function EC(t){var e=Is(this,t).delete(t);return this.size-=e?1:0,e}function wC(t){return Is(this,t).get(t)}function SC(t){return Is(this,t).has(t)}function CC(t,e){var n=Is(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Kr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Kr.prototype.clear=bC,Kr.prototype.delete=EC,Kr.prototype.get=wC,Kr.prototype.has=SC,Kr.prototype.set=CC;var AC="Expected a function";function ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(AC);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ks.Cache||Kr),n}ks.Cache=Kr;var OC=500;function TC(t){var e=ks(t,function(r){return n.size===OC&&n.clear(),r}),n=e.cache;return e}var NC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,MC=/\\(\\)?/g,Gh=TC(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NC,function(n,r,i,o){e.push(i?o.replace(MC,"$1"):r||n)}),e});function _t(t){return t==null?"":Rn(t)}function li(t,e){return We(t)?t:mc(t,e)?[t]:Gh(_t(t))}function Mr(t){if(typeof t=="string"||Pn(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ji(t,e){e=li(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Mr(e[n++])];return n&&n==r?t:void 0}function ui(t,e,n){var r=t==null?void 0:ji(t,e);return r===void 0?n:r}function yc(t,e){for(var n=-1,r=e.length,i=Array(r),o=t==null;++n<r;)i[n]=o?void 0:ui(t,e[n]);return i}function ci(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Yh=on?on.isConcatSpreadable:void 0;function DC(t){return We(t)||ki(t)||!!(Yh&&t&&t[Yh])}function Yt(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=DC),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Yt(s,e-1,n,r,i):ci(i,s):r||(i[i.length]=s)}return i}function Kh(t){var e=t==null?0:t.length;return e?Yt(t,1):[]}function qr(t){return cc(Bh(t,void 0,Kh),t+"")}var PC=qr(yc),Bs=Xh(Object.getPrototypeOf,Object),RC="[object Object]",LC=Function.prototype,IC=Object.prototype,qh=LC.toString,kC=IC.hasOwnProperty,BC=qh.call(Object);function pa(t){if(!It(t)||dn(t)!=RC)return!1;var e=Bs(t);if(e===null)return!0;var n=kC.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&qh.call(n)==BC}var jC="[object DOMException]",FC="[object Error]";function _c(t){if(!It(t))return!1;var e=dn(t);return e==FC||e==jC||typeof t.message=="string"&&typeof t.name=="string"&&!pa(t)}var Zh=Je(function(t,e){try{return Ln(t,void 0,e)}catch(n){return _c(n)?n:new Error(n)}}),$C="Expected a function";function Jh(t,e){var n;if(typeof e!="function")throw new TypeError($C);return t=Ke(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var HC=1,zC=32,js=Je(function(t,e,n){var r=HC;if(n.length){var i=ai(n,fo(js));r|=zC}return Xr(t,r,e,n,i)});js.placeholder={};var WC=qr(function(t,e){return Gn(e,function(n){n=Mr(n),Gr(t,n,js(t[n],t))}),t}),UC=1,VC=2,XC=32,bc=Je(function(t,e,n){var r=UC|VC;if(n.length){var i=ai(n,fo(bc));r|=XC}return Xr(e,r,t,n,i)});bc.placeholder={};function Kn(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function di(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:Kn(t,e,n)}var GC="\\ud800-\\udfff",YC="\\u0300-\\u036f",KC="\\ufe20-\\ufe2f",qC="\\u20d0-\\u20ff",ZC=YC+KC+qC,JC="\\ufe0e\\ufe0f",QC="\\u200d",eA=RegExp("["+QC+GC+ZC+JC+"]");function go(t){return eA.test(t)}function tA(t){return t.split("")}var Qh="\\ud800-\\udfff",nA="\\u0300-\\u036f",rA="\\ufe20-\\ufe2f",iA="\\u20d0-\\u20ff",oA=nA+rA+iA,aA="\\ufe0e\\ufe0f",sA="["+Qh+"]",xc="["+oA+"]",Ec="\\ud83c[\\udffb-\\udfff]",lA="(?:"+xc+"|"+Ec+")",eg="[^"+Qh+"]",tg="(?:\\ud83c[\\udde6-\\uddff]){2}",ng="[\\ud800-\\udbff][\\udc00-\\udfff]",uA="\\u200d",rg=lA+"?",ig="["+aA+"]?",cA="(?:"+uA+"(?:"+[eg,tg,ng].join("|")+")"+ig+rg+")*",dA=ig+rg+cA,fA="(?:"+[eg+xc+"?",xc,tg,ng,sA].join("|")+")",pA=RegExp(Ec+"(?="+Ec+")|"+fA+dA,"g");function hA(t){return t.match(pA)||[]}function cr(t){return go(t)?hA(t):tA(t)}function og(t){return function(e){e=_t(e);var n=go(e)?cr(e):void 0,r=n?n[0]:e.charAt(0),i=n?di(n,1).join(""):e.slice(1);return r[t]()+i}}var wc=og("toUpperCase");function ag(t){return wc(_t(t).toLowerCase())}function Sc(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Cc(t){return function(e){return t==null?void 0:t[e]}}var gA={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vA=Cc(gA),mA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yA="\\u0300-\\u036f",_A="\\ufe20-\\ufe2f",bA="\\u20d0-\\u20ff",xA=yA+_A+bA,EA="["+xA+"]",wA=RegExp(EA,"g");function sg(t){return t=_t(t),t&&t.replace(mA,vA).replace(wA,"")}var SA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CA(t){return t.match(SA)||[]}var AA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function OA(t){return AA.test(t)}var lg="\\ud800-\\udfff",TA="\\u0300-\\u036f",NA="\\ufe20-\\ufe2f",MA="\\u20d0-\\u20ff",DA=TA+NA+MA,ug="\\u2700-\\u27bf",cg="a-z\\xdf-\\xf6\\xf8-\\xff",PA="\\xac\\xb1\\xd7\\xf7",RA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LA="\\u2000-\\u206f",IA=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dg="A-Z\\xc0-\\xd6\\xd8-\\xde",kA="\\ufe0e\\ufe0f",fg=PA+RA+LA+IA,pg="['’]",hg="["+fg+"]",BA="["+DA+"]",gg="\\d+",jA="["+ug+"]",vg="["+cg+"]",mg="[^"+lg+fg+gg+ug+cg+dg+"]",FA="\\ud83c[\\udffb-\\udfff]",$A="(?:"+BA+"|"+FA+")",HA="[^"+lg+"]",yg="(?:\\ud83c[\\udde6-\\uddff]){2}",_g="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+dg+"]",zA="\\u200d",bg="(?:"+vg+"|"+mg+")",WA="(?:"+vo+"|"+mg+")",xg="(?:"+pg+"(?:d|ll|m|re|s|t|ve))?",Eg="(?:"+pg+"(?:D|LL|M|RE|S|T|VE))?",wg=$A+"?",Sg="["+kA+"]?",UA="(?:"+zA+"(?:"+[HA,yg,_g].join("|")+")"+Sg+wg+")*",VA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",XA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",GA=Sg+wg+UA,YA="(?:"+[jA,yg,_g].join("|")+")"+GA,KA=RegExp([vo+"?"+vg+"+"+xg+"(?="+[hg,vo,"$"].join("|")+")",WA+"+"+Eg+"(?="+[hg,vo+bg,"$"].join("|")+")",vo+"?"+bg+"+"+xg,vo+"+"+Eg,XA,VA,gg,YA].join("|"),"g");function qA(t){return t.match(KA)||[]}function Cg(t,e,n){return t=_t(t),e=n?void 0:e,e===void 0?OA(t)?qA(t):CA(t):t.match(e)||[]}var ZA="['’]",JA=RegExp(ZA,"g");function mo(t){return function(e){return Sc(Cg(sg(e).replace(JA,"")),t,"")}}var QA=mo(function(t,e,n){return e=e.toLowerCase(),t+(n?ag(e):e)});function eO(){if(!arguments.length)return[];var t=arguments[0];return We(t)?t:[t]}var tO=Ut.isFinite,nO=Math.min;function Ac(t){var e=Math[t];return function(n,r){if(n=Vn(n),r=r==null?0:nO(Ke(r),292),r&&tO(n)){var i=(_t(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(_t(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var rO=Ac("ceil");function Ag(t){var e=O(t);return e.__chain__=!0,e}var iO=Math.ceil,oO=Math.max;function aO(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=oO(Ke(e),0);var r=t==null?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(iO(r/e));i<r;)a[o++]=Kn(t,i,i+=e);return a}function Fi(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}function sO(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=Vn(n),n=n===n?n:0),e!==void 0&&(e=Vn(e),e=e===e?e:0),Fi(Vn(t),e,n)}function lO(){this.__data__=new Yr,this.size=0}function uO(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function cO(t){return this.__data__.get(t)}function dO(t){return this.__data__.has(t)}var fO=200;function pO(t,e){var n=this.__data__;if(n instanceof Yr){var r=n.__data__;if(!fa||r.length<fO-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kr(r)}return n.set(t,e),this.size=n.size,this}function dr(t){var e=this.__data__=new Yr(t);this.size=e.size}dr.prototype.clear=lO,dr.prototype.delete=uO,dr.prototype.get=cO,dr.prototype.has=dO,dr.prototype.set=pO;function Og(t,e){return t&&Nr(e,Vt(e),t)}function hO(t,e){return t&&Nr(e,An(e),t)}var Tg=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Ng=Tg&&typeof module=="object"&&module&&!module.nodeType&&module,gO=Ng&&Ng.exports===Tg,Mg=gO?Ut.Buffer:void 0,Dg=Mg?Mg.allocUnsafe:void 0;function Pg(t,e){if(e)return t.slice();var n=t.length,r=Dg?Dg(n):new t.constructor(n);return t.copy(r),r}function fi(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Oc(){return[]}var vO=Object.prototype,mO=vO.propertyIsEnumerable,Rg=Object.getOwnPropertySymbols,Tc=Rg?function(t){return t==null?[]:(t=Object(t),fi(Rg(t),function(e){return mO.call(t,e)}))}:Oc;function yO(t,e){return Nr(t,Tc(t),e)}var _O=Object.getOwnPropertySymbols,Lg=_O?function(t){for(var e=[];t;)ci(e,Tc(t)),t=Bs(t);return e}:Oc;function bO(t,e){return Nr(t,Lg(t),e)}function Ig(t,e,n){var r=e(t);return We(t)?r:ci(r,n(t))}function Nc(t){return Ig(t,Vt,Tc)}function Mc(t){return Ig(t,An,Lg)}var Dc=Ii(Ut,"DataView"),Pc=Ii(Ut,"Promise"),yo=Ii(Ut,"Set"),kg="[object Map]",xO="[object Object]",Bg="[object Promise]",jg="[object Set]",Fg="[object WeakMap]",$g="[object DataView]",EO=Li(Dc),wO=Li(fa),SO=Li(Pc),CO=Li(yo),AO=Li(oa),an=dn;(Dc&&an(new Dc(new ArrayBuffer(1)))!=$g||fa&&an(new fa)!=kg||Pc&&an(Pc.resolve())!=Bg||yo&&an(new yo)!=jg||oa&&an(new oa)!=Fg)&&(an=function(t){var e=dn(t),n=e==xO?t.constructor:void 0,r=n?Li(n):"";if(r)switch(r){case EO:return $g;case wO:return kg;case SO:return Bg;case CO:return jg;case AO:return Fg}return e});var OO=Object.prototype,TO=OO.hasOwnProperty;function NO(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&TO.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Fs=Ut.Uint8Array;function Rc(t){var e=new t.constructor(t.byteLength);return new Fs(e).set(new Fs(t)),e}function MO(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var DO=/\w*$/;function PO(t){var e=new t.constructor(t.source,DO.exec(t));return e.lastIndex=t.lastIndex,e}var Hg=on?on.prototype:void 0,zg=Hg?Hg.valueOf:void 0;function RO(t){return zg?Object(zg.call(t)):{}}function Wg(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var LO="[object Boolean]",IO="[object Date]",kO="[object Map]",BO="[object Number]",jO="[object RegExp]",FO="[object Set]",$O="[object String]",HO="[object Symbol]",zO="[object ArrayBuffer]",WO="[object DataView]",UO="[object Float32Array]",VO="[object Float64Array]",XO="[object Int8Array]",GO="[object Int16Array]",YO="[object Int32Array]",KO="[object Uint8Array]",qO="[object Uint8ClampedArray]",ZO="[object Uint16Array]",JO="[object Uint32Array]";function QO(t,e,n){var r=t.constructor;switch(e){case zO:return Rc(t);case LO:case IO:return new r(+t);case WO:return MO(t,n);case UO:case VO:case XO:case GO:case YO:case KO:case qO:case ZO:case JO:return Wg(t,n);case kO:return new r;case BO:case $O:return new r(t);case jO:return PO(t);case FO:return new r;case HO:return RO(t)}}function Ug(t){return typeof t.constructor=="function"&&!ua(t)?so(Bs(t)):{}}var e1="[object Map]";function t1(t){return It(t)&&an(t)==e1}var Vg=Yn&&Yn.isMap,Xg=Vg?In(Vg):t1,n1="[object Set]";function r1(t){return It(t)&&an(t)==n1}var Gg=Yn&&Yn.isSet,Yg=Gg?In(Gg):r1,i1=1,o1=2,a1=4,Kg="[object Arguments]",s1="[object Array]",l1="[object Boolean]",u1="[object Date]",c1="[object Error]",qg="[object Function]",d1="[object GeneratorFunction]",f1="[object Map]",p1="[object Number]",Zg="[object Object]",h1="[object RegExp]",g1="[object Set]",v1="[object String]",m1="[object Symbol]",y1="[object WeakMap]",_1="[object ArrayBuffer]",b1="[object DataView]",x1="[object Float32Array]",E1="[object Float64Array]",w1="[object Int8Array]",S1="[object Int16Array]",C1="[object Int32Array]",A1="[object Uint8Array]",O1="[object Uint8ClampedArray]",T1="[object Uint16Array]",N1="[object Uint32Array]",At={};At[Kg]=At[s1]=At[_1]=At[b1]=At[l1]=At[u1]=At[x1]=At[E1]=At[w1]=At[S1]=At[C1]=At[f1]=At[p1]=At[Zg]=At[h1]=At[g1]=At[v1]=At[m1]=At[A1]=At[O1]=At[T1]=At[N1]=!0,At[c1]=At[qg]=At[y1]=!1;function qn(t,e,n,r,i,o){var a,s=e&i1,l=e&o1,u=e&a1;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Rt(t))return t;var c=We(t);if(c){if(a=NO(t),!s)return Sn(t,a)}else{var d=an(t),f=d==qg||d==d1;if(si(t))return Pg(t,s);if(d==Zg||d==Kg||f&&!i){if(a=l||f?{}:Ug(t),!s)return l?bO(t,hO(a,t)):yO(t,Og(a,t))}else{if(!At[d])return i?t:{};a=QO(t,d,s)}}o||(o=new dr);var h=o.get(t);if(h)return h;o.set(t,a),Yg(t)?t.forEach(function(m){a.add(qn(m,e,n,m,t,o))}):Xg(t)&&t.forEach(function(m,y){a.set(y,qn(m,e,n,y,t,o))});var v=u?l?Mc:Nc:l?An:Vt,g=c?void 0:v(t);return Gn(g||t,function(m,y){g&&(y=m,m=t[y]),la(a,y,qn(m,e,n,y,t,o))}),a}var M1=4;function D1(t){return qn(t,M1)}var P1=1,R1=4;function Pe(t){return qn(t,P1|R1)}var L1=1,I1=4;function k1(t,e){return e=typeof e=="function"?e:void 0,qn(t,L1|I1,e)}var B1=4;function j1(t,e){return e=typeof e=="function"?e:void 0,qn(t,B1,e)}function F1(){return new Xn(this.value(),this.__chain__)}function $1(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function H1(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return ci(We(n)?Sn(n):[n],Yt(e,1))}var z1="__lodash_hash_undefined__";function W1(t){return this.__data__.set(t,z1),this}function U1(t){return this.__data__.has(t)}function $i(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Kr;++e<n;)this.add(t[e])}$i.prototype.add=$i.prototype.push=W1,$i.prototype.has=U1;function Lc(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ha(t,e){return t.has(e)}var V1=1,X1=2;function Jg(t,e,n,r,i,o){var a=n&V1,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&X1?new $i:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var v=t[d],g=e[d];if(r)var m=a?r(g,v,d,e,t,o):r(v,g,d,t,e,o);if(m!==void 0){if(m)continue;f=!1;break}if(h){if(!Lc(e,function(y,x){if(!ha(h,x)&&(v===y||i(v,y,n,r,o)))return h.push(x)})){f=!1;break}}else if(!(v===g||i(v,g,n,r,o))){f=!1;break}}return o.delete(t),o.delete(e),f}function Ic(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function $s(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var G1=1,Y1=2,K1="[object Boolean]",q1="[object Date]",Z1="[object Error]",J1="[object Map]",Q1="[object Number]",eT="[object RegExp]",tT="[object Set]",nT="[object String]",rT="[object Symbol]",iT="[object ArrayBuffer]",oT="[object DataView]",Qg=on?on.prototype:void 0,kc=Qg?Qg.valueOf:void 0;function aT(t,e,n,r,i,o,a){switch(n){case oT:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case iT:return!(t.byteLength!=e.byteLength||!o(new Fs(t),new Fs(e)));case K1:case q1:case Q1:return ur(+t,+e);case Z1:return t.name==e.name&&t.message==e.message;case eT:case nT:return t==e+"";case J1:var s=Ic;case tT:var l=r&G1;if(s||(s=$s),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;r|=Y1,a.set(t,e);var c=Jg(s(t),s(e),r,i,o,a);return a.delete(t),c;case rT:if(kc)return kc.call(t)==kc.call(e)}return!1}var sT=1,lT=Object.prototype,uT=lT.hasOwnProperty;function cT(t,e,n,r,i,o){var a=n&sT,s=Nc(t),l=s.length,u=Nc(e),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:uT.call(e,f)))return!1}var h=o.get(t),v=o.get(e);if(h&&v)return h==e&&v==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=a;++d<l;){f=s[d];var y=t[f],x=e[f];if(r)var E=a?r(x,y,f,e,t,o):r(y,x,f,t,e,o);if(!(E===void 0?y===x||i(y,x,n,r,o):E)){g=!1;break}m||(m=f=="constructor")}if(g&&!m){var b=t.constructor,T=e.constructor;b!=T&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(g=!1)}return o.delete(t),o.delete(e),g}var dT=1,ev="[object Arguments]",tv="[object Array]",Hs="[object Object]",fT=Object.prototype,nv=fT.hasOwnProperty;function pT(t,e,n,r,i,o){var a=We(t),s=We(e),l=a?tv:an(t),u=s?tv:an(e);l=l==ev?Hs:l,u=u==ev?Hs:u;var c=l==Hs,d=u==Hs,f=l==u;if(f&&si(t)){if(!si(e))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new dr),a||ho(t)?Jg(t,e,n,r,i,o):aT(t,e,l,n,r,i,o);if(!(n&dT)){var h=c&&nv.call(t,"__wrapped__"),v=d&&nv.call(e,"__wrapped__");if(h||v){var g=h?t.value():t,m=v?e.value():e;return o||(o=new dr),i(g,m,n,r,o)}}return f?(o||(o=new dr),cT(t,e,n,r,i,o)):!1}function ga(t,e,n,r,i){return t===e?!0:t==null||e==null||!It(t)&&!It(e)?t!==t&&e!==e:pT(t,e,n,r,ga,i)}var hT=1,gT=2;function Bc(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],u=t[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new dr;if(r)var f=r(u,c,l,t,e,d);if(!(f===void 0?ga(c,u,hT|gT,r,d):f))return!1}}return!0}function rv(t){return t===t&&!Rt(t)}function jc(t){for(var e=Vt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,rv(i)]}return e}function iv(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function ov(t){var e=jc(t);return e.length==1&&e[0][2]?iv(e[0][0],e[0][1]):function(n){return n===t||Bc(n,t,e)}}function vT(t,e){return t!=null&&e in Object(t)}function av(t,e,n){e=li(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Mr(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&Rs(i)&&Vr(a,i)&&(We(t)||ki(t)))}function Fc(t,e){return t!=null&&av(t,e,vT)}var mT=1,yT=2;function sv(t,e){return mc(t)&&rv(e)?iv(Mr(t),e):function(n){var r=ui(n,t);return r===void 0&&r===e?Fc(n,t):ga(e,r,mT|yT)}}function $c(t){return function(e){return e==null?void 0:e[t]}}function _T(t){return function(e){return ji(e,t)}}function lv(t){return mc(t)?$c(Mr(t)):_T(t)}function Ue(t){return typeof t=="function"?t:t==null?wn:typeof t=="object"?We(t)?sv(t[0],t[1]):ov(t):lv(t)}var bT="Expected a function";function xT(t){var e=t==null?0:t.length,n=Ue;return t=e?Pt(t,function(r){if(typeof r[1]!="function")throw new TypeError(bT);return[n(r[0]),r[1]]}):[],Je(function(r){for(var i=-1;++i<e;){var o=t[i];if(Ln(o[0],this,r))return Ln(o[1],this,r)}})}function uv(t,e,n){var r=n.length;if(t==null)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(a===void 0&&!(i in t)||!o(a))return!1}return!0}function ET(t){var e=Vt(t);return function(n){return uv(n,t,e)}}var wT=1;function ST(t){return ET(qn(t,wT))}function CT(t,e){return e==null||uv(t,e,Vt(e))}function AT(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function cv(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var Hc=cv();function Dr(t,e){return t&&Hc(t,e,Vt)}function dv(t,e){return function(n,r){if(n==null)return n;if(!Cn(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var pi=dv(Dr);function OT(t,e,n,r){return pi(t,function(i,o,a){e(r,i,n(i),a)}),r}function zs(t,e){return function(n,r){var i=We(n)?AT:OT,o=e?e():{};return i(n,t,Ue(r),o)}}var TT=Object.prototype,NT=TT.hasOwnProperty,MT=zs(function(t,e,n){NT.call(t,n)?++t[n]:Gr(t,n,1)});function DT(t,e){var n=so(t);return e==null?n:Og(n,e)}var PT=8;function zc(t,e,n){e=n?void 0:e;var r=Xr(t,PT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=zc.placeholder,r}zc.placeholder={};var RT=16;function Wc(t,e,n){e=n?void 0:e;var r=Xr(t,RT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=Wc.placeholder,r}Wc.placeholder={};var Ws=function(){return Ut.Date.now()},LT="Expected a function",IT=Math.max,kT=Math.min;function Us(t,e,n){var r,i,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(LT);e=Vn(e)||0,Rt(n)&&(c=!!n.leading,d="maxWait"in n,o=d?IT(Vn(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function h(A){var S=r,M=i;return r=i=void 0,u=A,a=t.apply(M,S),a}function v(A){return u=A,s=setTimeout(y,e),c?h(A):a}function g(A){var S=A-l,M=A-u,C=e-S;return d?kT(C,o-M):C}function m(A){var S=A-l,M=A-u;return l===void 0||S>=e||S<0||d&&M>=o}function y(){var A=Ws();if(m(A))return x(A);s=setTimeout(y,g(A))}function x(A){return s=void 0,f&&r?h(A):(r=i=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function b(){return s===void 0?a:x(Ws())}function T(){var A=Ws(),S=m(A);if(r=arguments,i=this,l=A,S){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(y,e),h(l)}return s===void 0&&(s=setTimeout(y,e)),a}return T.cancel=E,T.flush=b,T}function BT(t,e){return t==null||t!==t?e:t}var fv=Object.prototype,jT=fv.hasOwnProperty,FT=Je(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&fn(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=An(o),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(c===void 0||ur(c,fv[u])&&!jT.call(t,u))&&(t[u]=o[u])}return t});function Uc(t,e,n){(n!==void 0&&!ur(t[e],n)||n===void 0&&!(e in t))&&Gr(t,e,n)}function Bt(t){return It(t)&&Cn(t)}function Vc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function pv(t){return Nr(t,An(t))}function $T(t,e,n,r,i,o,a){var s=Vc(t,n),l=Vc(e,n),u=a.get(l);if(u){Uc(t,n,u);return}var c=o?o(s,l,n+"",t,e,a):void 0,d=c===void 0;if(d){var f=We(l),h=!f&&si(l),v=!f&&!h&&ho(l);c=l,f||h||v?We(s)?c=s:Bt(s)?c=Sn(s):h?(d=!1,c=Pg(l,!0)):v?(d=!1,c=Wg(l,!0)):c=[]:pa(l)||ki(l)?(c=s,ki(s)?c=pv(s):(!Rt(s)||lr(s))&&(c=Ug(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),Uc(t,n,c)}function Vs(t,e,n,r,i){t!==e&&Hc(e,function(o,a){if(i||(i=new dr),Rt(o))$T(t,e,a,n,Vs,r,i);else{var s=r?r(Vc(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),Uc(t,a,s)}},An)}function hv(t,e,n,r,i,o){return Rt(t)&&Rt(e)&&(o.set(e,t),Vs(t,e,void 0,hv,o),o.delete(e)),t}var gv=po(function(t,e,n,r){Vs(t,e,n,r)}),HT=Je(function(t){return t.push(void 0,hv),Ln(gv,void 0,t)}),zT="Expected a function";function vv(t,e,n){if(typeof t!="function")throw new TypeError(zT);return setTimeout(function(){t.apply(void 0,n)},e)}var WT=Je(function(t,e){return vv(t,1,e)}),UT=Je(function(t,e,n){return vv(t,Vn(e)||0,n)});function Xc(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var VT=200;function va(t,e,n,r){var i=-1,o=Ds,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Pt(e,In(n))),r?(o=Xc,a=!1):e.length>=VT&&(o=ha,a=!1,e=new $i(e));e:for(;++i<s;){var c=t[i],d=n==null?c:n(c);if(c=r||c!==0?c:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(c)}else o(e,d,r)||l.push(c)}return l}var XT=Je(function(t,e){return Bt(t)?va(t,Yt(e,1,Bt,!0)):[]});function kn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var GT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),Ue(n)):[]}),YT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),void 0,n):[]}),KT=Ss(function(t,e){return t/e},1);function qT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),Kn(t,e<0?0:e,r)):[]}function ZT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,0,e<0?0:e)):[]}function Xs(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Kn(t,r?0:o,r?o+1:i):Kn(t,r?o+1:0,r?i:o)}function JT(t,e){return t&&t.length?Xs(t,Ue(e),!0,!0):[]}function QT(t,e){return t&&t.length?Xs(t,Ue(e),!0):[]}function Pr(t){return typeof t=="function"?t:wn}function gt(t,e){var n=We(t)?Gn:pi;return n(t,Pr(e))}function eN(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var mv=cv(!0);function Gc(t,e){return t&&mv(t,e,Vt)}var yv=dv(Gc,!0);function tN(t,e){var n=We(t)?eN:yv;return n(t,Pr(e))}function nN(t,e,n){t=_t(t),e=Rn(e);var r=t.length;n=n===void 0?r:Fi(Ke(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function rN(t,e){return Pt(e,function(n){return[n,t[n]]})}function iN(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=[r,r]}),n}var oN="[object Map]",aN="[object Set]";function _v(t){return function(e){var n=an(e);return n==oN?Ic(e):n==aN?iN(e):rN(e,t(e))}}var Zr=_v(Vt),sN=_v(An),lN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uN=Cc(lN),bv=/[&<>"']/g,cN=RegExp(bv.source);function xv(t){return t=_t(t),t&&cN.test(t)?t.replace(bv,uN):t}var Ev=/[\\^$.*+?()[\]{}|]/g,dN=RegExp(Ev.source);function fN(t){return t=_t(t),t&&dN.test(t)?t.replace(Ev,"\\$&"):t}function wv(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function pN(t,e){var n=!0;return pi(t,function(r,i,o){return n=!!e(r,i,o),n}),n}function hN(t,e,n){var r=We(t)?wv:pN;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var gN=4294967295;function Sv(t){return t?Fi(Ke(t),0,gN):0}function vN(t,e,n,r){var i=t.length;for(n=Ke(n),n<0&&(n=-n>i?0:i+n),r=r===void 0||r>i?i:Ke(r),r<0&&(r+=i),r=n>r?0:Sv(r);n<r;)t[n++]=e;return t}function mN(t,e,n,r){var i=t==null?0:t.length;return i?(n&&typeof n!="number"&&fn(t,e,n)&&(n=0,r=i),vN(t,e,n,r)):[]}function Cv(t,e){var n=[];return pi(t,function(r,i,o){e(r,i,o)&&n.push(r)}),n}function yN(t,e){var n=We(t)?fi:Cv;return n(t,Ue(e))}function Av(t){return function(e,n,r){var i=Object(e);if(!Cn(e)){var o=Ue(n);e=Vt(e),n=function(s){return o(i[s],s,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var _N=Math.max;function Yc(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=_N(r+i,0)),Ms(t,Ue(e),i)}var hi=Av(Yc);function Ov(t,e,n){var r;return n(t,function(i,o,a){if(e(i,o,a))return r=o,!1}),r}function bN(t,e){return Ov(t,Ue(e),Dr)}var xN=Math.max,EN=Math.min;function Tv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r-1;return n!==void 0&&(i=Ke(n),i=n<0?xN(r+i,0):EN(i,r-1)),Ms(t,Ue(e),i,!0)}var wN=Av(Tv);function SN(t,e){return Ov(t,Ue(e),Gc)}function CN(t){return t&&t.length?t[0]:void 0}function Nv(t,e){var n=-1,r=Cn(t)?Array(t.length):[];return pi(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Bn(t,e){var n=We(t)?Pt:Nv;return n(t,Ue(e))}function AN(t,e){return Yt(Bn(t,e),1)}var ON=1/0;function TN(t,e){return Yt(Bn(t,e),ON)}function NN(t,e,n){return n=n===void 0?1:Ke(n),Yt(Bn(t,e),n)}var MN=1/0;function DN(t){var e=t==null?0:t.length;return e?Yt(t,MN):[]}function PN(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:Ke(e),Yt(t,e)):[]}var RN=512;function LN(t){return Xr(t,RN)}var IN=Ac("floor"),kN="Expected a function",BN=8,jN=32,FN=128,$N=256;function Mv(t){return qr(function(e){var n=e.length,r=n,i=Xn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(kN);if(i&&!a&&Ts(o)=="wrapper")var a=new Xn([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Ts(o),l=s=="wrapper"?sc(o):void 0;l&&lc(l[0])&&l[1]==(FN|BN|jN|$N)&&!l[4].length&&l[9]==1?a=a[Ts(l[0])].apply(a,l[3]):a=o.length==1&&lc(o)?a[s]():a.thru(o)}return function(){var u=arguments,c=u[0];if(a&&u.length==1&&We(c))return a.plant(c).value();for(var d=0,f=n?e[d].apply(this,u):c;++d<n;)f=e[d].call(this,f);return f}})}var HN=Mv(),zN=Mv(!0);function WN(t,e){return t==null?t:Hc(t,Pr(e),An)}function UN(t,e){return t==null?t:mv(t,Pr(e),An)}function VN(t,e){return t&&Dr(t,Pr(e))}function XN(t,e){return t&&Gc(t,Pr(e))}function Dv(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r}function Gs(t,e){return fi(e,function(n){return lr(t[n])})}function GN(t){return t==null?[]:Gs(t,Vt(t))}function YN(t){return t==null?[]:Gs(t,An(t))}var KN=Object.prototype,qN=KN.hasOwnProperty,ZN=zs(function(t,e,n){qN.call(t,n)?t[n].push(e):Gr(t,n,[e])});function Kc(t,e){return t>e}function Ys(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Vn(e),n=Vn(n)),t(e,n)}}var JN=Ys(Kc),QN=Ys(function(t,e){return t>=e}),eM=Object.prototype,tM=eM.hasOwnProperty;function nM(t,e){return t!=null&&tM.call(t,e)}function Ks(t,e){return t!=null&&av(t,e,nM)}var rM=Math.max,iM=Math.min;function oM(t,e,n){return t>=iM(e,n)&&t<rM(e,n)}function aM(t,e,n){return e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),t=Vn(t),oM(t,e,n)}var sM="[object String]";function qs(t){return typeof t=="string"||!We(t)&&It(t)&&dn(t)==sM}function qc(t,e){return Pt(e,function(n){return t[n]})}function _o(t){return t==null?[]:qc(t,Vt(t))}var lM=Math.max;function uM(t,e,n,r){t=Cn(t)?t:_o(t),n=n&&!r?Ke(n):0;var i=t.length;return n<0&&(n=lM(i+n,0)),qs(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&co(t,e,n)>-1}var cM=Math.max;function Pv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=cM(r+i,0)),co(t,e,i)}function dM(t){var e=t==null?0:t.length;return e?Kn(t,0,-1):[]}var fM=Math.min;function Zc(t,e,n){for(var r=n?Xc:Ds,i=t[0].length,o=t.length,a=o,s=Array(o),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=Pt(c,In(e))),l=fM(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new $i(a&&c):void 0}c=t[0];var d=-1,f=s[0];e:for(;++d<i&&u.length<l;){var h=c[d],v=e?e(h):h;if(h=n||h!==0?h:0,!(f?ha(f,v):r(u,v,n))){for(a=o;--a;){var g=s[a];if(!(g?ha(g,v):r(t[a],v,n)))continue e}f&&f.push(v),u.push(h)}}return u}function Jc(t){return Bt(t)?t:[]}var pM=Je(function(t){var e=Pt(t,Jc);return e.length&&e[0]===t[0]?Zc(e):[]}),hM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e===kn(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Zc(n,Ue(e)):[]}),gM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?Zc(n,void 0,e):[]});function vM(t,e,n,r){return Dr(t,function(i,o,a){e(r,n(i),o,a)}),r}function Rv(t,e){return function(n,r){return vM(n,t,e(r),{})}}var mM=Object.prototype,yM=mM.toString,_M=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=yM.call(e)),t[e]=n},uc(wn)),Lv=Object.prototype,bM=Lv.hasOwnProperty,xM=Lv.toString,EM=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=xM.call(e)),bM.call(t,e)?t[e].push(n):t[e]=[n]},Ue);function Iv(t,e){return e.length<2?t:ji(t,Kn(e,0,-1))}function ma(t,e,n){e=li(e,t),t=Iv(t,e);var r=t==null?t:t[Mr(kn(e))];return r==null?void 0:Ln(r,t,n)}var wM=Je(ma),SM=Je(function(t,e,n){var r=-1,i=typeof e=="function",o=Cn(t)?Array(t.length):[];return pi(t,function(a){o[++r]=i?Ln(e,a,n):ma(a,e,n)}),o}),CM="[object ArrayBuffer]";function AM(t){return It(t)&&dn(t)==CM}var kv=Yn&&Yn.isArrayBuffer,OM=kv?In(kv):AM,TM="[object Boolean]";function Zs(t){return t===!0||t===!1||It(t)&&dn(t)==TM}var NM="[object Date]";function MM(t){return It(t)&&dn(t)==NM}var Bv=Yn&&Yn.isDate,DM=Bv?In(Bv):MM;function PM(t){return It(t)&&t.nodeType===1&&!pa(t)}var RM="[object Map]",LM="[object Set]",IM=Object.prototype,kM=IM.hasOwnProperty;function Js(t){if(t==null)return!0;if(Cn(t)&&(We(t)||typeof t=="string"||typeof t.splice=="function"||si(t)||ho(t)||ki(t)))return!t.length;var e=an(t);if(e==RM||e==LM)return!t.size;if(ua(t))return!gc(t).length;for(var n in t)if(kM.call(t,n))return!1;return!0}function Qc(t,e){return ga(t,e)}function BM(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?ga(t,e,void 0,n):!!r}var jM=Ut.isFinite;function FM(t){return typeof t=="number"&&jM(t)}function jv(t){return typeof t=="number"&&t==Ke(t)}function $M(t,e){return t===e||Bc(t,e,jc(e))}function HM(t,e,n){return n=typeof n=="function"?n:void 0,Bc(t,e,jc(e),n)}var zM="[object Number]";function Fv(t){return typeof t=="number"||It(t)&&dn(t)==zM}function WM(t){return Fv(t)&&t!=+t}var UM=Cs?lr:pc,VM="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function XM(t){if(UM(t))throw new Error(VM);return ph(t)}function pn(t){return t==null}function GM(t){return t===null}var YM="[object RegExp]";function KM(t){return It(t)&&dn(t)==YM}var $v=Yn&&Yn.isRegExp,ed=$v?In($v):KM,qM=9007199254740991;function ZM(t){return jv(t)&&t>=-9007199254740991&&t<=qM}function Hi(t){return t===void 0}var JM="[object WeakMap]";function QM(t){return It(t)&&an(t)==JM}var eD="[object WeakSet]";function tD(t){return It(t)&&dn(t)==eD}var nD=1;function rD(t){return Ue(typeof t=="function"?t:qn(t,nD))}var iD=Array.prototype,oD=iD.join;function aD(t,e){return t==null?"":oD.call(t,e)}var sD=mo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),lD=zs(function(t,e,n){Gr(t,n,e)});function uD(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}var cD=Math.max,dD=Math.min;function fD(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r;return n!==void 0&&(i=Ke(n),i=i<0?cD(r+i,0):dD(i,r-1)),e===e?uD(t,e,i):Ms(t,xh,i,!0)}var pD=mo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),hD=og("toLowerCase");function td(t,e){return t<e}var gD=Ys(td),vD=Ys(function(t,e){return t<=e});function Hv(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,e(r,i,o),r)}),n}function mD(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,i,e(r,i,o))}),n}var yD=1;function _D(t){return ov(qn(t,yD))}var bD=1;function xD(t,e){return sv(t,qn(e,bD))}function Qs(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(a!=null&&(s===void 0?a===a&&!Pn(a):n(a,s)))var s=a,l=o}return l}function ED(t){return t&&t.length?Qs(t,wn,Kc):void 0}function wD(t,e){return t&&t.length?Qs(t,Ue(e),Kc):void 0}function nd(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==void 0&&(n=n===void 0?o:n+o)}return n}var SD=NaN;function zv(t,e){var n=t==null?0:t.length;return n?nd(t,e)/n:SD}function CD(t){return zv(t,wn)}function AD(t,e){return zv(t,Ue(e))}var zi=po(function(t,e,n){Vs(t,e,n)}),OD=Je(function(t,e){return function(n){return ma(n,t,e)}}),TD=Je(function(t,e){return function(n){return ma(t,n,e)}});function ND(t){return t&&t.length?Qs(t,wn,td):void 0}function MD(t,e){return t&&t.length?Qs(t,Ue(e),td):void 0}function DD(t,e,n){var r=Vt(e),i=Gs(e,r),o=!(Rt(n)&&"chain"in n)||!!n.chain,a=lr(t);return Gn(i,function(s){var l=e[s];t[s]=l,a&&(t.prototype[s]=function(){var u=this.__chain__;if(o||u){var c=t(this.__wrapped__),d=c.__actions__=Sn(this.__actions__);return d.push({func:l,args:arguments,thisArg:t}),c.__chain__=u,c}return l.apply(t,ci([this.value()],arguments))})}),t}var PD=Ss(function(t,e){return t*e},1),RD="Expected a function";function el(t){if(typeof t!="function")throw new TypeError(RD);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function LD(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var ID="[object Map]",kD="[object Set]",rd=on?on.iterator:void 0;function Wv(t){if(!t)return[];if(Cn(t))return qs(t)?cr(t):Sn(t);if(rd&&t[rd])return LD(t[rd]());var e=an(t),n=e==ID?Ic:e==kD?$s:_o;return n(t)}function BD(){this.__values__===void 0&&(this.__values__=Wv(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function Uv(t,e){var n=t.length;if(n)return e+=e<0?n:0,Vr(e,n)?t[e]:void 0}function jD(t,e){return t&&t.length?Uv(t,Ke(e)):void 0}function FD(t){return t=Ke(t),Je(function(e){return Uv(e,t)})}function id(t,e){return e=li(e,t),t=Iv(t,e),t==null||delete t[Mr(kn(e))]}function $D(t){return pa(t)?void 0:t}var HD=1,zD=2,WD=4,UD=qr(function(t,e){var n={};if(t==null)return n;var r=!1;e=Pt(e,function(o){return o=li(o,t),r||(r=o.length>1),o}),Nr(t,Mc(t),n),r&&(n=qn(n,HD|zD|WD,$D));for(var i=e.length;i--;)id(n,e[i]);return n});function ya(t,e,n,r){if(!Rt(t))return t;e=li(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Mr(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var c=s[l];u=r?r(c,l,s):void 0,u===void 0&&(u=Rt(c)?c:Vr(e[i+1])?[]:{})}la(s,l,u),s=s[l]}return t}function Vv(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ji(t,a);n(s,a)&&ya(o,li(a,t),s)}return o}function Xv(t,e){if(t==null)return{};var n=Pt(Mc(t),function(r){return[r]});return e=Ue(e),Vv(t,n,function(r,i){return e(r,i[0])})}function VD(t,e){return Xv(t,el(Ue(e)))}function XD(t){return Jh(2,t)}function GD(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Gv(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=Pn(t),a=e!==void 0,s=e===null,l=e===e,u=Pn(e);if(!s&&!u&&!o&&t>e||o&&a&&l&&!s&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}function YD(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=Gv(i[r],o[r]);if(l){if(r>=s)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Yv(t,e,n){e.length?e=Pt(e,function(o){return We(o)?function(a){return ji(a,o.length===1?o[0]:o)}:o}):e=[wn];var r=-1;e=Pt(e,In(Ue));var i=Nv(t,function(o,a,s){var l=Pt(e,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return GD(i,function(o,a){return YD(o,a,n)})}function KD(t,e,n,r){return t==null?[]:(We(e)||(e=e==null?[]:[e]),n=r?void 0:n,We(n)||(n=n==null?[]:[n]),Yv(t,e,n))}function od(t){return qr(function(e){return e=Pt(e,In(Ue)),Je(function(n){var r=this;return t(e,function(i){return Ln(i,r,n)})})})}var qD=od(Pt),ZD=Je,JD=Math.min,QD=ZD(function(t,e){e=e.length==1&&We(e[0])?Pt(e[0],In(Ue)):Pt(Yt(e,1),In(Ue));var n=e.length;return Je(function(r){for(var i=-1,o=JD(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ln(t,this,r)})}),eP=od(wv),tP=od(Lc),nP=9007199254740991,rP=Math.floor;function ad(t,e){var n="";if(!t||e<1||e>nP)return n;do e%2&&(n+=t),e=rP(e/2),e&&(t+=t);while(e);return n}var iP=$c("length"),Kv="\\ud800-\\udfff",oP="\\u0300-\\u036f",aP="\\ufe20-\\ufe2f",sP="\\u20d0-\\u20ff",lP=oP+aP+sP,uP="\\ufe0e\\ufe0f",cP="["+Kv+"]",sd="["+lP+"]",ld="\\ud83c[\\udffb-\\udfff]",dP="(?:"+sd+"|"+ld+")",qv="[^"+Kv+"]",Zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Jv="[\\ud800-\\udbff][\\udc00-\\udfff]",fP="\\u200d",Qv=dP+"?",em="["+uP+"]?",pP="(?:"+fP+"(?:"+[qv,Zv,Jv].join("|")+")"+em+Qv+")*",hP=em+Qv+pP,gP="(?:"+[qv+sd+"?",sd,Zv,Jv,cP].join("|")+")",tm=RegExp(ld+"(?="+ld+")|"+gP+hP,"g");function vP(t){for(var e=tm.lastIndex=0;tm.test(t);)++e;return e}function bo(t){return go(t)?vP(t):iP(t)}var mP=Math.ceil;function tl(t,e){e=e===void 0?" ":Rn(e);var n=e.length;if(n<2)return n?ad(e,t):e;var r=ad(e,mP(t/bo(e)));return go(e)?di(cr(r),0,t).join(""):r.slice(0,t)}var yP=Math.ceil,_P=Math.floor;function bP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return tl(_P(i),n)+t+tl(yP(i),n)}function xP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?t+tl(e-r,n):t}function EP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?tl(e-r,n)+t:t}var wP=/^\s+/,SP=Ut.parseInt;function CP(t,e,n){return n||e==null?e=0:e&&(e=+e),SP(_t(t).replace(wP,""),e||0)}var AP=32,nl=Je(function(t,e){var n=ai(e,fo(nl));return Xr(t,AP,void 0,e,n)});nl.placeholder={};var OP=64,ud=Je(function(t,e){var n=ai(e,fo(ud));return Xr(t,OP,void 0,e,n)});ud.placeholder={};var TP=zs(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function NP(t,e){return Vv(t,e,function(n,r){return Fc(t,r)})}var gi=qr(function(t,e){return t==null?{}:NP(t,e)});function MP(t){for(var e,n=this;n instanceof Os;){var r=yh(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function DP(t){return function(e){return t==null?void 0:ji(t,e)}}function PP(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var RP=Array.prototype,nm=RP.splice;function cd(t,e,n,r){var i=r?PP:co,o=-1,a=e.length,s=t;for(t===e&&(e=Sn(e)),n&&(s=Pt(t,In(n)));++o<a;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==t&&nm.call(s,l,1),nm.call(t,l,1);return t}function rm(t,e){return t&&t.length&&e&&e.length?cd(t,e):t}var LP=Je(rm);function IP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,Ue(n)):t}function kP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,void 0,n):t}var BP=Array.prototype,jP=BP.splice;function im(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Vr(i)?jP.call(t,i,1):id(t,i)}}return t}var FP=qr(function(t,e){var n=t==null?0:t.length,r=yc(t,e);return im(t,Pt(e,function(i){return Vr(i,n)?+i:i}).sort(Gv)),r}),$P=Math.floor,HP=Math.random;function dd(t,e){return t+$P(HP()*(e-t+1))}var zP=parseFloat,WP=Math.min,UP=Math.random;function VP(t,e,n){if(n&&typeof n!="boolean"&&fn(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=Ur(t),e===void 0?(e=t,t=0):e=Ur(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=UP();return WP(t+i*(e-t+zP("1e-"+((i+"").length-1))),e)}return dd(t,e)}var XP=Math.ceil,GP=Math.max;function YP(t,e,n,r){for(var i=-1,o=GP(XP((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}function om(t){return function(e,n,r){return r&&typeof r!="number"&&fn(e,n,r)&&(n=r=void 0),e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),r=r===void 0?e<n?1:-1:Ur(r),YP(e,n,r,t)}}var KP=om(),qP=om(!0),ZP=256,JP=qr(function(t,e){return Xr(t,ZP,void 0,void 0,void 0,e)});function am(t,e,n,r,i){return i(t,function(o,a,s){n=r?(r=!1,o):e(n,o,a,s)}),n}function sm(t,e,n){var r=We(t)?Sc:am,i=arguments.length<3;return r(t,Ue(e),n,i,pi)}function QP(t,e,n,r){var i=t==null?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function eR(t,e,n){var r=We(t)?QP:am,i=arguments.length<3;return r(t,Ue(e),n,i,yv)}function tR(t,e){var n=We(t)?fi:Cv;return n(t,el(Ue(e)))}function nR(t,e){var n=[];if(!(t&&t.length))return n;var r=-1,i=[],o=t.length;for(e=Ue(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return im(t,i),n}function rR(t,e,n){return(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e),ad(_t(t),e)}function iR(){var t=arguments,e=_t(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var oR="Expected a function";function aR(t,e){if(typeof t!="function")throw new TypeError(oR);return e=e===void 0?e:Ke(e),Je(t,e)}function sR(t,e,n){e=li(e,t);var r=-1,i=e.length;for(i||(i=1,t=void 0);++r<i;){var o=t==null?void 0:t[Mr(e[r])];o===void 0&&(r=i,o=n),t=lr(o)?o.call(t):o}return t}var lR=Array.prototype,uR=lR.reverse;function fd(t){return t==null?t:uR.call(t)}var cR=Ac("round");function lm(t){var e=t.length;return e?t[dd(0,e-1)]:void 0}function dR(t){return lm(_o(t))}function fR(t){var e=We(t)?lm:dR;return e(t)}function rl(t,e){var n=-1,r=t.length,i=r-1;for(e=e===void 0?r:e;++n<e;){var o=dd(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function pR(t,e){return rl(Sn(t),Fi(e,0,t.length))}function hR(t,e){var n=_o(t);return rl(n,Fi(e,0,n.length))}function gR(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e);var r=We(t)?pR:hR;return r(t,e)}function um(t,e,n){return t==null?t:ya(t,e,n)}function vR(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:ya(t,e,n,r)}function mR(t){return rl(Sn(t))}function yR(t){return rl(_o(t))}function _R(t){var e=We(t)?mR:yR;return e(t)}var bR="[object Map]",xR="[object Set]";function ER(t){if(t==null)return 0;if(Cn(t))return qs(t)?bo(t):t.length;var e=an(t);return e==bR||e==xR?t.size:gc(t).length}function wR(t,e,n){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&fn(t,e,n)?(e=0,n=r):(e=e==null?0:Ke(e),n=n===void 0?r:Ke(n)),Kn(t,e,n)):[]}var SR=mo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});function CR(t,e){var n;return pi(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}function AR(t,e,n){var r=We(t)?Lc:CR;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var OR=Je(function(t,e){if(t==null)return[];var n=e.length;return n>1&&fn(t,e[0],e[1])?e=[]:n>2&&fn(e[0],e[1],e[2])&&(e=[e[0]]),Yv(t,Yt(e,1),[])}),TR=4294967295,NR=TR-1,MR=Math.floor,DR=Math.min;function pd(t,e,n,r){var i=0,o=t==null?0:t.length;if(o===0)return 0;e=n(e);for(var a=e!==e,s=e===null,l=Pn(e),u=e===void 0;i<o;){var c=MR((i+o)/2),d=n(t[c]),f=d!==void 0,h=d===null,v=d===d,g=Pn(d);if(a)var m=r||v;else u?m=v&&(r||f):s?m=v&&f&&(r||!h):l?m=v&&f&&!h&&(r||!g):h||g?m=!1:m=r?d<=e:d<e;m?i=c+1:o=c}return DR(o,NR)}var PR=4294967295,RR=PR>>>1;function il(t,e,n){var r=0,i=t==null?r:t.length;if(typeof e=="number"&&e===e&&i<=RR){for(;r<i;){var o=r+i>>>1,a=t[o];a!==null&&!Pn(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return pd(t,e,wn,n)}function LR(t,e){return il(t,e)}function IR(t,e,n){return pd(t,e,Ue(n))}function kR(t,e){var n=t==null?0:t.length;if(n){var r=il(t,e);if(r<n&&ur(t[r],e))return r}return-1}function BR(t,e){return il(t,e,!0)}function jR(t,e,n){return pd(t,e,Ue(n),!0)}function FR(t,e){var n=t==null?0:t.length;if(n){var r=il(t,e,!0)-1;if(ur(t[r],e))return r}return-1}function cm(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!ur(s,l)){var l=s;o[i++]=a===0?0:a}}return o}function $R(t){return t&&t.length?cm(t):[]}function HR(t,e){return t&&t.length?cm(t,Ue(e)):[]}var zR=4294967295;function WR(t,e,n){return n&&typeof n!="number"&&fn(t,e,n)&&(e=n=void 0),n=n===void 0?zR:n>>>0,n?(t=_t(t),t&&(typeof e=="string"||e!=null&&!ed(e))&&(e=Rn(e),!e&&go(t))?di(cr(t),0,n):t.split(e,n)):[]}var UR="Expected a function",VR=Math.max;function XR(t,e){if(typeof t!="function")throw new TypeError(UR);return e=e==null?0:VR(Ke(e),0),Je(function(n){var r=n[e],i=di(n,0,e);return r&&ci(i,r),Ln(t,this,i)})}var GR=mo(function(t,e,n){return t+(n?" ":"")+wc(e)});function YR(t,e,n){return t=_t(t),n=n==null?0:Fi(Ke(n),0,t.length),e=Rn(e),t.slice(n,n+e.length)==e}function KR(){return{}}function qR(){return""}function ZR(){return!0}var JR=Ss(function(t,e){return t-e},0);function QR(t){return t&&t.length?nd(t,wn):0}function e2(t,e){return t&&t.length?nd(t,Ue(e)):0}function t2(t){var e=t==null?0:t.length;return e?Kn(t,1,e):[]}function n2(t,e,n){return t&&t.length?(e=n||e===void 0?1:Ke(e),Kn(t,0,e<0?0:e)):[]}function r2(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,e<0?0:e,r)):[]}function i2(t,e){return t&&t.length?Xs(t,Ue(e),!1,!0):[]}function o2(t,e){return t&&t.length?Xs(t,Ue(e)):[]}function a2(t,e){return e(t),t}var dm=Object.prototype,s2=dm.hasOwnProperty;function fm(t,e,n,r){return t===void 0||ur(t,dm[n])&&!s2.call(r,n)?e:t}var l2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function u2(t){return"\\"+l2[t]}var pm=/<%=([\s\S]+?)%>/g,c2=/<%-([\s\S]+?)%>/g,d2=/<%([\s\S]+?)%>/g,hd={escape:c2,evaluate:d2,interpolate:pm,variable:"",imports:{_:{escape:xv}}},f2="Invalid `variable` option passed into `_.template`",p2=/\b__p \+= '';/g,h2=/\b(__p \+=) '' \+/g,g2=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v2=/[()=,{}\[\]\/\s]/,m2=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ol=/($^)/,y2=/['\n\r\u2028\u2029\\]/g,_2=Object.prototype,hm=_2.hasOwnProperty;function b2(t,e,n){var r=hd.imports._.templateSettings||hd;n&&fn(t,e,n)&&(e=void 0),t=_t(t),e=vc({},e,r,fm);var i=vc({},e.imports,r.imports,fm),o=Vt(i),a=qc(i,o),s,l,u=0,c=e.interpolate||ol,d="__p += '",f=RegExp((e.escape||ol).source+"|"+c.source+"|"+(c===pm?m2:ol).source+"|"+(e.evaluate||ol).source+"|$","g"),h=hm.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
7
+ `)}function uc(t){return function(){return t}}var Ms=function(){try{var t=Ii(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Sw=Ms?function(t,e){return Ms(t,"toString",{configurable:!0,enumerable:!1,value:uc(e),writable:!0})}:wn,cc=_h(Sw);function Gn(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function Ds(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function xh(t){return t!==t}function Cw(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function co(t,e,n){return e===e?Cw(t,e,n):Ds(t,xh,n)}function Ps(t,e){var n=t==null?0:t.length;return!!n&&co(t,e,0)>-1}var Aw=1,Ow=2,Tw=8,Nw=16,Mw=32,Dw=64,Pw=128,Rw=256,Lw=512,Iw=[["ary",Pw],["bind",Aw],["bindKey",Ow],["curry",Tw],["curryRight",Nw],["flip",Lw],["partial",Mw],["partialRight",Dw],["rearg",Rw]];function kw(t,e){return Gn(Iw,function(n){var r="_."+n[0];e&n[1]&&!Ps(t,r)&&t.push(r)}),t.sort()}function Eh(t,e,n){var r=e+"";return cc(t,ww(r,kw(xw(r),n)))}var Bw=4,jw=8,wh=32,Sh=64;function Ch(t,e,n,r,i,o,a,s,l,u){var c=e&jw,d=c?a:void 0,f=c?void 0:a,h=c?o:void 0,v=c?void 0:o;e|=c?wh:Sh,e&=~(c?Sh:wh),e&Bw||(e&=-4);var g=[t,e,i,h,d,v,f,s,l,u],m=n.apply(void 0,g);return lc(t)&&bh(m,g),m.placeholder=r,Eh(m,t,e)}function fo(t){var e=t;return e.placeholder}var Fw=9007199254740991,$w=/^(?:0|[1-9]\d*)$/;function Vr(t,e){var n=typeof t;return e=e??Fw,!!e&&(n=="number"||n!="symbol"&&$w.test(t))&&t>-1&&t%1==0&&t<e}var Hw=Math.min;function zw(t,e){for(var n=t.length,r=Hw(e.length,n),i=Sn(t);r--;){var o=e[r];t[r]=Vr(o,n)?i[o]:void 0}return t}var Ah="__lodash_placeholder__";function ai(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];(a===e||a===Ah)&&(t[n]=Ah,o[i++]=n)}return o}var Ww=1,Uw=2,Vw=8,Xw=16,Gw=128,Yw=512;function Rs(t,e,n,r,i,o,a,s,l,u){var c=e&Gw,d=e&Ww,f=e&Uw,h=e&(Vw|Xw),v=e&Yw,g=f?void 0:aa(t);function m(){for(var y=arguments.length,x=Array(y),E=y;E--;)x[E]=arguments[E];if(h)var b=fo(m),T=cw(x,b);if(r&&(x=vh(x,r,i,h)),o&&(x=mh(x,o,a,h)),y-=T,h&&y<u){var A=ai(x,b);return Ch(t,e,Rs,m.placeholder,n,x,A,s,l,u-y)}var S=d?n:this,M=f?S[t]:t;return y=x.length,s?x=zw(x,s):v&&y>1&&x.reverse(),c&&l<y&&(x.length=l),this&&this!==Ut&&this instanceof m&&(M=g||aa(M)),M.apply(S,x)}return m}function Kw(t,e,n){var r=aa(t);function i(){for(var o=arguments.length,a=Array(o),s=o,l=fo(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:ai(a,l);if(o-=u.length,o<n)return Ch(t,e,Rs,i.placeholder,void 0,a,u,void 0,void 0,n-o);var c=this&&this!==Ut&&this instanceof i?r:t;return Ln(c,this,a)}return i}var qw=1;function Zw(t,e,n,r){var i=e&qw,o=aa(t);function a(){for(var s=-1,l=arguments.length,u=-1,c=r.length,d=Array(c+l),f=this&&this!==Ut&&this instanceof a?o:t;++u<c;)d[u]=r[u];for(;l--;)d[u++]=arguments[++s];return Ln(f,i?n:this,d)}return a}var Oh="__lodash_placeholder__",dc=1,Jw=2,Qw=4,Th=8,sa=128,Nh=256,eS=Math.min;function tS(t,e){var n=t[1],r=e[1],i=n|r,o=i<(dc|Jw|sa),a=r==sa&&n==Th||r==sa&&n==Nh&&t[7].length<=e[8]||r==(sa|Nh)&&e[7].length<=e[8]&&n==Th;if(!(o||a))return t;r&dc&&(t[2]=e[2],i|=n&dc?0:Qw);var s=e[3];if(s){var l=t[3];t[3]=l?vh(l,s,e[4]):s,t[4]=l?ai(t[3],Oh):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?mh(l,s,e[6]):s,t[6]=l?ai(t[5],Oh):e[6]),s=e[7],s&&(t[7]=s),r&sa&&(t[8]=t[8]==null?e[8]:eS(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=i,t}var nS="Expected a function",Mh=1,rS=2,Dh=8,Ph=16,Rh=32,iS=64,Lh=Math.max;function Xr(t,e,n,r,i,o,a,s){var l=e&rS;if(!l&&typeof t!="function")throw new TypeError(nS);var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),a=a===void 0?a:Lh(Ke(a),0),s=s===void 0?s:Ke(s),u-=i?i.length:0,e&iS){var c=r,d=i;r=i=void 0}var f=l?void 0:sc(t),h=[t,e,n,r,i,c,d,o,a,s];if(f&&tS(h,f),t=h[0],e=h[1],n=h[2],r=h[3],i=h[4],s=h[9]=h[9]===void 0?l?0:t.length:Lh(h[9]-u,0),!s&&e&(Dh|Ph)&&(e&=-25),!e||e==Mh)var v=sw(t,e,n);else e==Dh||e==Ph?v=Kw(t,e,s):(e==Rh||e==(Mh|Rh))&&!i.length?v=Zw(t,e,n,r):v=Rs.apply(void 0,h);var g=f?hh:bh;return Eh(g(v,h),t,e)}var oS=128;function Ih(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,Xr(t,oS,void 0,void 0,void 0,void 0,e)}function Gr(t,e,n){e=="__proto__"&&Ms?Ms(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ur(t,e){return t===e||t!==t&&e!==e}var aS=Object.prototype,sS=aS.hasOwnProperty;function la(t,e,n){var r=t[e];(!(sS.call(t,e)&&ur(r,n))||n===void 0&&!(e in t))&&Gr(t,e,n)}function Nr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?Gr(n,s,l):la(n,s,l)}return n}var kh=Math.max;function Bh(t,e,n){return e=kh(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=kh(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),Ln(t,this,s)}}function Je(t,e){return cc(Bh(t,e,wn),t+"")}var lS=9007199254740991;function Ls(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=lS}function Cn(t){return t!=null&&Ls(t.length)&&!lr(t)}function fn(t,e,n){if(!Rt(n))return!1;var r=typeof e;return(r=="number"?Cn(n)&&Vr(e,n.length):r=="string"&&e in n)?ur(n[e],t):!1}function po(t){return Je(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&fn(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var uS=Object.prototype;function ua(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||uS;return t===n}function fc(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var cS="[object Arguments]";function jh(t){return It(t)&&dn(t)==cS}var Fh=Object.prototype,dS=Fh.hasOwnProperty,fS=Fh.propertyIsEnumerable,ki=jh(function(){return arguments}())?jh:function(t){return It(t)&&dS.call(t,"callee")&&!fS.call(t,"callee")};function pc(){return!1}var $h=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Hh=$h&&typeof module=="object"&&module&&!module.nodeType&&module,pS=Hh&&Hh.exports===$h,zh=pS?Ut.Buffer:void 0,hS=zh?zh.isBuffer:void 0,si=hS||pc,gS="[object Arguments]",vS="[object Array]",mS="[object Boolean]",yS="[object Date]",_S="[object Error]",bS="[object Function]",xS="[object Map]",ES="[object Number]",wS="[object Object]",SS="[object RegExp]",CS="[object Set]",AS="[object String]",OS="[object WeakMap]",TS="[object ArrayBuffer]",NS="[object DataView]",MS="[object Float32Array]",DS="[object Float64Array]",PS="[object Int8Array]",RS="[object Int16Array]",LS="[object Int32Array]",IS="[object Uint8Array]",kS="[object Uint8ClampedArray]",BS="[object Uint16Array]",jS="[object Uint32Array]",Nt={};Nt[MS]=Nt[DS]=Nt[PS]=Nt[RS]=Nt[LS]=Nt[IS]=Nt[kS]=Nt[BS]=Nt[jS]=!0,Nt[gS]=Nt[vS]=Nt[TS]=Nt[mS]=Nt[NS]=Nt[yS]=Nt[_S]=Nt[bS]=Nt[xS]=Nt[ES]=Nt[wS]=Nt[SS]=Nt[CS]=Nt[AS]=Nt[OS]=!1;function FS(t){return It(t)&&Ls(t.length)&&!!Nt[dn(t)]}function In(t){return function(e){return t(e)}}var Wh=typeof pt=="object"&&pt&&!pt.nodeType&&pt,ca=Wh&&typeof module=="object"&&module&&!module.nodeType&&module,$S=ca&&ca.exports===Wh,hc=$S&&rh.process,Yn=function(){try{var t=ca&&ca.require&&ca.require("util").types;return t||hc&&hc.binding&&hc.binding("util")}catch{}}(),Uh=Yn&&Yn.isTypedArray,ho=Uh?In(Uh):FS,HS=Object.prototype,zS=HS.hasOwnProperty;function Vh(t,e){var n=We(t),r=!n&&ki(t),i=!n&&!r&&si(t),o=!n&&!r&&!i&&ho(t),a=n||r||i||o,s=a?fc(t.length,String):[],l=s.length;for(var u in t)(e||zS.call(t,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Vr(u,l)))&&s.push(u);return s}function Xh(t,e){return function(n){return t(e(n))}}var WS=Xh(Object.keys,Object),US=Object.prototype,VS=US.hasOwnProperty;function gc(t){if(!ua(t))return WS(t);var e=[];for(var n in Object(t))VS.call(t,n)&&n!="constructor"&&e.push(n);return e}function Vt(t){return Cn(t)?Vh(t):gc(t)}var XS=Object.prototype,GS=XS.hasOwnProperty,ut=po(function(t,e){if(ua(e)||Cn(e)){Nr(e,Vt(e),t);return}for(var n in e)GS.call(e,n)&&la(t,n,e[n])});function YS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var KS=Object.prototype,qS=KS.hasOwnProperty;function ZS(t){if(!Rt(t))return YS(t);var e=ua(t),n=[];for(var r in t)r=="constructor"&&(e||!qS.call(t,r))||n.push(r);return n}function An(t){return Cn(t)?Vh(t,!0):ZS(t)}var JS=po(function(t,e){Nr(e,An(e),t)}),vc=po(function(t,e,n,r){Nr(e,An(e),t,r)}),QS=po(function(t,e,n,r){Nr(e,Vt(e),t,r)}),eC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tC=/^\w*$/;function mc(t,e){if(We(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Pn(t)?!0:tC.test(t)||!eC.test(t)||e!=null&&t in Object(e)}var da=Ii(Object,"create");function nC(){this.__data__=da?da(null):{},this.size=0}function rC(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var iC="__lodash_hash_undefined__",oC=Object.prototype,aC=oC.hasOwnProperty;function sC(t){var e=this.__data__;if(da){var n=e[t];return n===iC?void 0:n}return aC.call(e,t)?e[t]:void 0}var lC=Object.prototype,uC=lC.hasOwnProperty;function cC(t){var e=this.__data__;return da?e[t]!==void 0:uC.call(e,t)}var dC="__lodash_hash_undefined__";function fC(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=da&&e===void 0?dC:e,this}function Bi(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Bi.prototype.clear=nC,Bi.prototype.delete=rC,Bi.prototype.get=sC,Bi.prototype.has=cC,Bi.prototype.set=fC;function pC(){this.__data__=[],this.size=0}function Is(t,e){for(var n=t.length;n--;)if(ur(t[n][0],e))return n;return-1}var hC=Array.prototype,gC=hC.splice;function vC(t){var e=this.__data__,n=Is(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():gC.call(e,n,1),--this.size,!0}function mC(t){var e=this.__data__,n=Is(e,t);return n<0?void 0:e[n][1]}function yC(t){return Is(this.__data__,t)>-1}function _C(t,e){var n=this.__data__,r=Is(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Yr.prototype.clear=pC,Yr.prototype.delete=vC,Yr.prototype.get=mC,Yr.prototype.has=yC,Yr.prototype.set=_C;var fa=Ii(Ut,"Map");function bC(){this.size=0,this.__data__={hash:new Bi,map:new(fa||Yr),string:new Bi}}function xC(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ks(t,e){var n=t.__data__;return xC(e)?n[typeof e=="string"?"string":"hash"]:n.map}function EC(t){var e=ks(this,t).delete(t);return this.size-=e?1:0,e}function wC(t){return ks(this,t).get(t)}function SC(t){return ks(this,t).has(t)}function CC(t,e){var n=ks(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Kr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Kr.prototype.clear=bC,Kr.prototype.delete=EC,Kr.prototype.get=wC,Kr.prototype.has=SC,Kr.prototype.set=CC;var AC="Expected a function";function Bs(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(AC);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Bs.Cache||Kr),n}Bs.Cache=Kr;var OC=500;function TC(t){var e=Bs(t,function(r){return n.size===OC&&n.clear(),r}),n=e.cache;return e}var NC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,MC=/\\(\\)?/g,Gh=TC(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(NC,function(n,r,i,o){e.push(i?o.replace(MC,"$1"):r||n)}),e});function _t(t){return t==null?"":Rn(t)}function li(t,e){return We(t)?t:mc(t,e)?[t]:Gh(_t(t))}function Mr(t){if(typeof t=="string"||Pn(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ji(t,e){e=li(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Mr(e[n++])];return n&&n==r?t:void 0}function ui(t,e,n){var r=t==null?void 0:ji(t,e);return r===void 0?n:r}function yc(t,e){for(var n=-1,r=e.length,i=Array(r),o=t==null;++n<r;)i[n]=o?void 0:ui(t,e[n]);return i}function ci(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Yh=on?on.isConcatSpreadable:void 0;function DC(t){return We(t)||ki(t)||!!(Yh&&t&&t[Yh])}function Yt(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=DC),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Yt(s,e-1,n,r,i):ci(i,s):r||(i[i.length]=s)}return i}function Kh(t){var e=t==null?0:t.length;return e?Yt(t,1):[]}function qr(t){return cc(Bh(t,void 0,Kh),t+"")}var PC=qr(yc),js=Xh(Object.getPrototypeOf,Object),RC="[object Object]",LC=Function.prototype,IC=Object.prototype,qh=LC.toString,kC=IC.hasOwnProperty,BC=qh.call(Object);function pa(t){if(!It(t)||dn(t)!=RC)return!1;var e=js(t);if(e===null)return!0;var n=kC.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&qh.call(n)==BC}var jC="[object DOMException]",FC="[object Error]";function _c(t){if(!It(t))return!1;var e=dn(t);return e==FC||e==jC||typeof t.message=="string"&&typeof t.name=="string"&&!pa(t)}var Zh=Je(function(t,e){try{return Ln(t,void 0,e)}catch(n){return _c(n)?n:new Error(n)}}),$C="Expected a function";function Jh(t,e){var n;if(typeof e!="function")throw new TypeError($C);return t=Ke(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var HC=1,zC=32,Fs=Je(function(t,e,n){var r=HC;if(n.length){var i=ai(n,fo(Fs));r|=zC}return Xr(t,r,e,n,i)});Fs.placeholder={};var WC=qr(function(t,e){return Gn(e,function(n){n=Mr(n),Gr(t,n,Fs(t[n],t))}),t}),UC=1,VC=2,XC=32,bc=Je(function(t,e,n){var r=UC|VC;if(n.length){var i=ai(n,fo(bc));r|=XC}return Xr(e,r,t,n,i)});bc.placeholder={};function Kn(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function di(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:Kn(t,e,n)}var GC="\\ud800-\\udfff",YC="\\u0300-\\u036f",KC="\\ufe20-\\ufe2f",qC="\\u20d0-\\u20ff",ZC=YC+KC+qC,JC="\\ufe0e\\ufe0f",QC="\\u200d",eA=RegExp("["+QC+GC+ZC+JC+"]");function go(t){return eA.test(t)}function tA(t){return t.split("")}var Qh="\\ud800-\\udfff",nA="\\u0300-\\u036f",rA="\\ufe20-\\ufe2f",iA="\\u20d0-\\u20ff",oA=nA+rA+iA,aA="\\ufe0e\\ufe0f",sA="["+Qh+"]",xc="["+oA+"]",Ec="\\ud83c[\\udffb-\\udfff]",lA="(?:"+xc+"|"+Ec+")",eg="[^"+Qh+"]",tg="(?:\\ud83c[\\udde6-\\uddff]){2}",ng="[\\ud800-\\udbff][\\udc00-\\udfff]",uA="\\u200d",rg=lA+"?",ig="["+aA+"]?",cA="(?:"+uA+"(?:"+[eg,tg,ng].join("|")+")"+ig+rg+")*",dA=ig+rg+cA,fA="(?:"+[eg+xc+"?",xc,tg,ng,sA].join("|")+")",pA=RegExp(Ec+"(?="+Ec+")|"+fA+dA,"g");function hA(t){return t.match(pA)||[]}function cr(t){return go(t)?hA(t):tA(t)}function og(t){return function(e){e=_t(e);var n=go(e)?cr(e):void 0,r=n?n[0]:e.charAt(0),i=n?di(n,1).join(""):e.slice(1);return r[t]()+i}}var wc=og("toUpperCase");function ag(t){return wc(_t(t).toLowerCase())}function Sc(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Cc(t){return function(e){return t==null?void 0:t[e]}}var gA={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},vA=Cc(gA),mA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yA="\\u0300-\\u036f",_A="\\ufe20-\\ufe2f",bA="\\u20d0-\\u20ff",xA=yA+_A+bA,EA="["+xA+"]",wA=RegExp(EA,"g");function sg(t){return t=_t(t),t&&t.replace(mA,vA).replace(wA,"")}var SA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CA(t){return t.match(SA)||[]}var AA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function OA(t){return AA.test(t)}var lg="\\ud800-\\udfff",TA="\\u0300-\\u036f",NA="\\ufe20-\\ufe2f",MA="\\u20d0-\\u20ff",DA=TA+NA+MA,ug="\\u2700-\\u27bf",cg="a-z\\xdf-\\xf6\\xf8-\\xff",PA="\\xac\\xb1\\xd7\\xf7",RA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LA="\\u2000-\\u206f",IA=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dg="A-Z\\xc0-\\xd6\\xd8-\\xde",kA="\\ufe0e\\ufe0f",fg=PA+RA+LA+IA,pg="['’]",hg="["+fg+"]",BA="["+DA+"]",gg="\\d+",jA="["+ug+"]",vg="["+cg+"]",mg="[^"+lg+fg+gg+ug+cg+dg+"]",FA="\\ud83c[\\udffb-\\udfff]",$A="(?:"+BA+"|"+FA+")",HA="[^"+lg+"]",yg="(?:\\ud83c[\\udde6-\\uddff]){2}",_g="[\\ud800-\\udbff][\\udc00-\\udfff]",vo="["+dg+"]",zA="\\u200d",bg="(?:"+vg+"|"+mg+")",WA="(?:"+vo+"|"+mg+")",xg="(?:"+pg+"(?:d|ll|m|re|s|t|ve))?",Eg="(?:"+pg+"(?:D|LL|M|RE|S|T|VE))?",wg=$A+"?",Sg="["+kA+"]?",UA="(?:"+zA+"(?:"+[HA,yg,_g].join("|")+")"+Sg+wg+")*",VA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",XA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",GA=Sg+wg+UA,YA="(?:"+[jA,yg,_g].join("|")+")"+GA,KA=RegExp([vo+"?"+vg+"+"+xg+"(?="+[hg,vo,"$"].join("|")+")",WA+"+"+Eg+"(?="+[hg,vo+bg,"$"].join("|")+")",vo+"?"+bg+"+"+xg,vo+"+"+Eg,XA,VA,gg,YA].join("|"),"g");function qA(t){return t.match(KA)||[]}function Cg(t,e,n){return t=_t(t),e=n?void 0:e,e===void 0?OA(t)?qA(t):CA(t):t.match(e)||[]}var ZA="['’]",JA=RegExp(ZA,"g");function mo(t){return function(e){return Sc(Cg(sg(e).replace(JA,"")),t,"")}}var QA=mo(function(t,e,n){return e=e.toLowerCase(),t+(n?ag(e):e)});function eO(){if(!arguments.length)return[];var t=arguments[0];return We(t)?t:[t]}var tO=Ut.isFinite,nO=Math.min;function Ac(t){var e=Math[t];return function(n,r){if(n=Vn(n),r=r==null?0:nO(Ke(r),292),r&&tO(n)){var i=(_t(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(_t(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var rO=Ac("ceil");function Ag(t){var e=O(t);return e.__chain__=!0,e}var iO=Math.ceil,oO=Math.max;function aO(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=oO(Ke(e),0);var r=t==null?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(iO(r/e));i<r;)a[o++]=Kn(t,i,i+=e);return a}function Fi(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}function sO(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=Vn(n),n=n===n?n:0),e!==void 0&&(e=Vn(e),e=e===e?e:0),Fi(Vn(t),e,n)}function lO(){this.__data__=new Yr,this.size=0}function uO(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function cO(t){return this.__data__.get(t)}function dO(t){return this.__data__.has(t)}var fO=200;function pO(t,e){var n=this.__data__;if(n instanceof Yr){var r=n.__data__;if(!fa||r.length<fO-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kr(r)}return n.set(t,e),this.size=n.size,this}function dr(t){var e=this.__data__=new Yr(t);this.size=e.size}dr.prototype.clear=lO,dr.prototype.delete=uO,dr.prototype.get=cO,dr.prototype.has=dO,dr.prototype.set=pO;function Og(t,e){return t&&Nr(e,Vt(e),t)}function hO(t,e){return t&&Nr(e,An(e),t)}var Tg=typeof pt=="object"&&pt&&!pt.nodeType&&pt,Ng=Tg&&typeof module=="object"&&module&&!module.nodeType&&module,gO=Ng&&Ng.exports===Tg,Mg=gO?Ut.Buffer:void 0,Dg=Mg?Mg.allocUnsafe:void 0;function Pg(t,e){if(e)return t.slice();var n=t.length,r=Dg?Dg(n):new t.constructor(n);return t.copy(r),r}function fi(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Oc(){return[]}var vO=Object.prototype,mO=vO.propertyIsEnumerable,Rg=Object.getOwnPropertySymbols,Tc=Rg?function(t){return t==null?[]:(t=Object(t),fi(Rg(t),function(e){return mO.call(t,e)}))}:Oc;function yO(t,e){return Nr(t,Tc(t),e)}var _O=Object.getOwnPropertySymbols,Lg=_O?function(t){for(var e=[];t;)ci(e,Tc(t)),t=js(t);return e}:Oc;function bO(t,e){return Nr(t,Lg(t),e)}function Ig(t,e,n){var r=e(t);return We(t)?r:ci(r,n(t))}function Nc(t){return Ig(t,Vt,Tc)}function Mc(t){return Ig(t,An,Lg)}var Dc=Ii(Ut,"DataView"),Pc=Ii(Ut,"Promise"),yo=Ii(Ut,"Set"),kg="[object Map]",xO="[object Object]",Bg="[object Promise]",jg="[object Set]",Fg="[object WeakMap]",$g="[object DataView]",EO=Li(Dc),wO=Li(fa),SO=Li(Pc),CO=Li(yo),AO=Li(oa),an=dn;(Dc&&an(new Dc(new ArrayBuffer(1)))!=$g||fa&&an(new fa)!=kg||Pc&&an(Pc.resolve())!=Bg||yo&&an(new yo)!=jg||oa&&an(new oa)!=Fg)&&(an=function(t){var e=dn(t),n=e==xO?t.constructor:void 0,r=n?Li(n):"";if(r)switch(r){case EO:return $g;case wO:return kg;case SO:return Bg;case CO:return jg;case AO:return Fg}return e});var OO=Object.prototype,TO=OO.hasOwnProperty;function NO(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&TO.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var $s=Ut.Uint8Array;function Rc(t){var e=new t.constructor(t.byteLength);return new $s(e).set(new $s(t)),e}function MO(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var DO=/\w*$/;function PO(t){var e=new t.constructor(t.source,DO.exec(t));return e.lastIndex=t.lastIndex,e}var Hg=on?on.prototype:void 0,zg=Hg?Hg.valueOf:void 0;function RO(t){return zg?Object(zg.call(t)):{}}function Wg(t,e){var n=e?Rc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var LO="[object Boolean]",IO="[object Date]",kO="[object Map]",BO="[object Number]",jO="[object RegExp]",FO="[object Set]",$O="[object String]",HO="[object Symbol]",zO="[object ArrayBuffer]",WO="[object DataView]",UO="[object Float32Array]",VO="[object Float64Array]",XO="[object Int8Array]",GO="[object Int16Array]",YO="[object Int32Array]",KO="[object Uint8Array]",qO="[object Uint8ClampedArray]",ZO="[object Uint16Array]",JO="[object Uint32Array]";function QO(t,e,n){var r=t.constructor;switch(e){case zO:return Rc(t);case LO:case IO:return new r(+t);case WO:return MO(t,n);case UO:case VO:case XO:case GO:case YO:case KO:case qO:case ZO:case JO:return Wg(t,n);case kO:return new r;case BO:case $O:return new r(t);case jO:return PO(t);case FO:return new r;case HO:return RO(t)}}function Ug(t){return typeof t.constructor=="function"&&!ua(t)?so(js(t)):{}}var e1="[object Map]";function t1(t){return It(t)&&an(t)==e1}var Vg=Yn&&Yn.isMap,Xg=Vg?In(Vg):t1,n1="[object Set]";function r1(t){return It(t)&&an(t)==n1}var Gg=Yn&&Yn.isSet,Yg=Gg?In(Gg):r1,i1=1,o1=2,a1=4,Kg="[object Arguments]",s1="[object Array]",l1="[object Boolean]",u1="[object Date]",c1="[object Error]",qg="[object Function]",d1="[object GeneratorFunction]",f1="[object Map]",p1="[object Number]",Zg="[object Object]",h1="[object RegExp]",g1="[object Set]",v1="[object String]",m1="[object Symbol]",y1="[object WeakMap]",_1="[object ArrayBuffer]",b1="[object DataView]",x1="[object Float32Array]",E1="[object Float64Array]",w1="[object Int8Array]",S1="[object Int16Array]",C1="[object Int32Array]",A1="[object Uint8Array]",O1="[object Uint8ClampedArray]",T1="[object Uint16Array]",N1="[object Uint32Array]",At={};At[Kg]=At[s1]=At[_1]=At[b1]=At[l1]=At[u1]=At[x1]=At[E1]=At[w1]=At[S1]=At[C1]=At[f1]=At[p1]=At[Zg]=At[h1]=At[g1]=At[v1]=At[m1]=At[A1]=At[O1]=At[T1]=At[N1]=!0,At[c1]=At[qg]=At[y1]=!1;function qn(t,e,n,r,i,o){var a,s=e&i1,l=e&o1,u=e&a1;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Rt(t))return t;var c=We(t);if(c){if(a=NO(t),!s)return Sn(t,a)}else{var d=an(t),f=d==qg||d==d1;if(si(t))return Pg(t,s);if(d==Zg||d==Kg||f&&!i){if(a=l||f?{}:Ug(t),!s)return l?bO(t,hO(a,t)):yO(t,Og(a,t))}else{if(!At[d])return i?t:{};a=QO(t,d,s)}}o||(o=new dr);var h=o.get(t);if(h)return h;o.set(t,a),Yg(t)?t.forEach(function(m){a.add(qn(m,e,n,m,t,o))}):Xg(t)&&t.forEach(function(m,y){a.set(y,qn(m,e,n,y,t,o))});var v=u?l?Mc:Nc:l?An:Vt,g=c?void 0:v(t);return Gn(g||t,function(m,y){g&&(y=m,m=t[y]),la(a,y,qn(m,e,n,y,t,o))}),a}var M1=4;function D1(t){return qn(t,M1)}var P1=1,R1=4;function Pe(t){return qn(t,P1|R1)}var L1=1,I1=4;function k1(t,e){return e=typeof e=="function"?e:void 0,qn(t,L1|I1,e)}var B1=4;function j1(t,e){return e=typeof e=="function"?e:void 0,qn(t,B1,e)}function F1(){return new Xn(this.value(),this.__chain__)}function $1(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function H1(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return ci(We(n)?Sn(n):[n],Yt(e,1))}var z1="__lodash_hash_undefined__";function W1(t){return this.__data__.set(t,z1),this}function U1(t){return this.__data__.has(t)}function $i(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Kr;++e<n;)this.add(t[e])}$i.prototype.add=$i.prototype.push=W1,$i.prototype.has=U1;function Lc(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ha(t,e){return t.has(e)}var V1=1,X1=2;function Jg(t,e,n,r,i,o){var a=n&V1,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&X1?new $i:void 0;for(o.set(t,e),o.set(e,t);++d<s;){var v=t[d],g=e[d];if(r)var m=a?r(g,v,d,e,t,o):r(v,g,d,t,e,o);if(m!==void 0){if(m)continue;f=!1;break}if(h){if(!Lc(e,function(y,x){if(!ha(h,x)&&(v===y||i(v,y,n,r,o)))return h.push(x)})){f=!1;break}}else if(!(v===g||i(v,g,n,r,o))){f=!1;break}}return o.delete(t),o.delete(e),f}function Ic(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Hs(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var G1=1,Y1=2,K1="[object Boolean]",q1="[object Date]",Z1="[object Error]",J1="[object Map]",Q1="[object Number]",eT="[object RegExp]",tT="[object Set]",nT="[object String]",rT="[object Symbol]",iT="[object ArrayBuffer]",oT="[object DataView]",Qg=on?on.prototype:void 0,kc=Qg?Qg.valueOf:void 0;function aT(t,e,n,r,i,o,a){switch(n){case oT:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case iT:return!(t.byteLength!=e.byteLength||!o(new $s(t),new $s(e)));case K1:case q1:case Q1:return ur(+t,+e);case Z1:return t.name==e.name&&t.message==e.message;case eT:case nT:return t==e+"";case J1:var s=Ic;case tT:var l=r&G1;if(s||(s=Hs),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;r|=Y1,a.set(t,e);var c=Jg(s(t),s(e),r,i,o,a);return a.delete(t),c;case rT:if(kc)return kc.call(t)==kc.call(e)}return!1}var sT=1,lT=Object.prototype,uT=lT.hasOwnProperty;function cT(t,e,n,r,i,o){var a=n&sT,s=Nc(t),l=s.length,u=Nc(e),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in e:uT.call(e,f)))return!1}var h=o.get(t),v=o.get(e);if(h&&v)return h==e&&v==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=a;++d<l;){f=s[d];var y=t[f],x=e[f];if(r)var E=a?r(x,y,f,e,t,o):r(y,x,f,t,e,o);if(!(E===void 0?y===x||i(y,x,n,r,o):E)){g=!1;break}m||(m=f=="constructor")}if(g&&!m){var b=t.constructor,T=e.constructor;b!=T&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof T=="function"&&T instanceof T)&&(g=!1)}return o.delete(t),o.delete(e),g}var dT=1,ev="[object Arguments]",tv="[object Array]",zs="[object Object]",fT=Object.prototype,nv=fT.hasOwnProperty;function pT(t,e,n,r,i,o){var a=We(t),s=We(e),l=a?tv:an(t),u=s?tv:an(e);l=l==ev?zs:l,u=u==ev?zs:u;var c=l==zs,d=u==zs,f=l==u;if(f&&si(t)){if(!si(e))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new dr),a||ho(t)?Jg(t,e,n,r,i,o):aT(t,e,l,n,r,i,o);if(!(n&dT)){var h=c&&nv.call(t,"__wrapped__"),v=d&&nv.call(e,"__wrapped__");if(h||v){var g=h?t.value():t,m=v?e.value():e;return o||(o=new dr),i(g,m,n,r,o)}}return f?(o||(o=new dr),cT(t,e,n,r,i,o)):!1}function ga(t,e,n,r,i){return t===e?!0:t==null||e==null||!It(t)&&!It(e)?t!==t&&e!==e:pT(t,e,n,r,ga,i)}var hT=1,gT=2;function Bc(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],u=t[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in t))return!1}else{var d=new dr;if(r)var f=r(u,c,l,t,e,d);if(!(f===void 0?ga(c,u,hT|gT,r,d):f))return!1}}return!0}function rv(t){return t===t&&!Rt(t)}function jc(t){for(var e=Vt(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,rv(i)]}return e}function iv(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function ov(t){var e=jc(t);return e.length==1&&e[0][2]?iv(e[0][0],e[0][1]):function(n){return n===t||Bc(n,t,e)}}function vT(t,e){return t!=null&&e in Object(t)}function av(t,e,n){e=li(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Mr(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&Ls(i)&&Vr(a,i)&&(We(t)||ki(t)))}function Fc(t,e){return t!=null&&av(t,e,vT)}var mT=1,yT=2;function sv(t,e){return mc(t)&&rv(e)?iv(Mr(t),e):function(n){var r=ui(n,t);return r===void 0&&r===e?Fc(n,t):ga(e,r,mT|yT)}}function $c(t){return function(e){return e==null?void 0:e[t]}}function _T(t){return function(e){return ji(e,t)}}function lv(t){return mc(t)?$c(Mr(t)):_T(t)}function Ue(t){return typeof t=="function"?t:t==null?wn:typeof t=="object"?We(t)?sv(t[0],t[1]):ov(t):lv(t)}var bT="Expected a function";function xT(t){var e=t==null?0:t.length,n=Ue;return t=e?Pt(t,function(r){if(typeof r[1]!="function")throw new TypeError(bT);return[n(r[0]),r[1]]}):[],Je(function(r){for(var i=-1;++i<e;){var o=t[i];if(Ln(o[0],this,r))return Ln(o[1],this,r)}})}function uv(t,e,n){var r=n.length;if(t==null)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(a===void 0&&!(i in t)||!o(a))return!1}return!0}function ET(t){var e=Vt(t);return function(n){return uv(n,t,e)}}var wT=1;function ST(t){return ET(qn(t,wT))}function CT(t,e){return e==null||uv(t,e,Vt(e))}function AT(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function cv(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var Hc=cv();function Dr(t,e){return t&&Hc(t,e,Vt)}function dv(t,e){return function(n,r){if(n==null)return n;if(!Cn(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var pi=dv(Dr);function OT(t,e,n,r){return pi(t,function(i,o,a){e(r,i,n(i),a)}),r}function Ws(t,e){return function(n,r){var i=We(n)?AT:OT,o=e?e():{};return i(n,t,Ue(r),o)}}var TT=Object.prototype,NT=TT.hasOwnProperty,MT=Ws(function(t,e,n){NT.call(t,n)?++t[n]:Gr(t,n,1)});function DT(t,e){var n=so(t);return e==null?n:Og(n,e)}var PT=8;function zc(t,e,n){e=n?void 0:e;var r=Xr(t,PT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=zc.placeholder,r}zc.placeholder={};var RT=16;function Wc(t,e,n){e=n?void 0:e;var r=Xr(t,RT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=Wc.placeholder,r}Wc.placeholder={};var Us=function(){return Ut.Date.now()},LT="Expected a function",IT=Math.max,kT=Math.min;function Vs(t,e,n){var r,i,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof t!="function")throw new TypeError(LT);e=Vn(e)||0,Rt(n)&&(c=!!n.leading,d="maxWait"in n,o=d?IT(Vn(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f);function h(A){var S=r,M=i;return r=i=void 0,u=A,a=t.apply(M,S),a}function v(A){return u=A,s=setTimeout(y,e),c?h(A):a}function g(A){var S=A-l,M=A-u,C=e-S;return d?kT(C,o-M):C}function m(A){var S=A-l,M=A-u;return l===void 0||S>=e||S<0||d&&M>=o}function y(){var A=Us();if(m(A))return x(A);s=setTimeout(y,g(A))}function x(A){return s=void 0,f&&r?h(A):(r=i=void 0,a)}function E(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function b(){return s===void 0?a:x(Us())}function T(){var A=Us(),S=m(A);if(r=arguments,i=this,l=A,S){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(y,e),h(l)}return s===void 0&&(s=setTimeout(y,e)),a}return T.cancel=E,T.flush=b,T}function BT(t,e){return t==null||t!==t?e:t}var fv=Object.prototype,jT=fv.hasOwnProperty,FT=Je(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&fn(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=An(o),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(c===void 0||ur(c,fv[u])&&!jT.call(t,u))&&(t[u]=o[u])}return t});function Uc(t,e,n){(n!==void 0&&!ur(t[e],n)||n===void 0&&!(e in t))&&Gr(t,e,n)}function Bt(t){return It(t)&&Cn(t)}function Vc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function pv(t){return Nr(t,An(t))}function $T(t,e,n,r,i,o,a){var s=Vc(t,n),l=Vc(e,n),u=a.get(l);if(u){Uc(t,n,u);return}var c=o?o(s,l,n+"",t,e,a):void 0,d=c===void 0;if(d){var f=We(l),h=!f&&si(l),v=!f&&!h&&ho(l);c=l,f||h||v?We(s)?c=s:Bt(s)?c=Sn(s):h?(d=!1,c=Pg(l,!0)):v?(d=!1,c=Wg(l,!0)):c=[]:pa(l)||ki(l)?(c=s,ki(s)?c=pv(s):(!Rt(s)||lr(s))&&(c=Ug(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),Uc(t,n,c)}function Xs(t,e,n,r,i){t!==e&&Hc(e,function(o,a){if(i||(i=new dr),Rt(o))$T(t,e,a,n,Xs,r,i);else{var s=r?r(Vc(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),Uc(t,a,s)}},An)}function hv(t,e,n,r,i,o){return Rt(t)&&Rt(e)&&(o.set(e,t),Xs(t,e,void 0,hv,o),o.delete(e)),t}var gv=po(function(t,e,n,r){Xs(t,e,n,r)}),HT=Je(function(t){return t.push(void 0,hv),Ln(gv,void 0,t)}),zT="Expected a function";function vv(t,e,n){if(typeof t!="function")throw new TypeError(zT);return setTimeout(function(){t.apply(void 0,n)},e)}var WT=Je(function(t,e){return vv(t,1,e)}),UT=Je(function(t,e,n){return vv(t,Vn(e)||0,n)});function Xc(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var VT=200;function va(t,e,n,r){var i=-1,o=Ps,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Pt(e,In(n))),r?(o=Xc,a=!1):e.length>=VT&&(o=ha,a=!1,e=new $i(e));e:for(;++i<s;){var c=t[i],d=n==null?c:n(c);if(c=r||c!==0?c:0,a&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;l.push(c)}else o(e,d,r)||l.push(c)}return l}var XT=Je(function(t,e){return Bt(t)?va(t,Yt(e,1,Bt,!0)):[]});function kn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var GT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),Ue(n)):[]}),YT=Je(function(t,e){var n=kn(e);return Bt(n)&&(n=void 0),Bt(t)?va(t,Yt(e,1,Bt,!0),void 0,n):[]}),KT=Cs(function(t,e){return t/e},1);function qT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),Kn(t,e<0?0:e,r)):[]}function ZT(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,0,e<0?0:e)):[]}function Gs(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?Kn(t,r?0:o,r?o+1:i):Kn(t,r?o+1:0,r?i:o)}function JT(t,e){return t&&t.length?Gs(t,Ue(e),!0,!0):[]}function QT(t,e){return t&&t.length?Gs(t,Ue(e),!0):[]}function Pr(t){return typeof t=="function"?t:wn}function gt(t,e){var n=We(t)?Gn:pi;return n(t,Pr(e))}function eN(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var mv=cv(!0);function Gc(t,e){return t&&mv(t,e,Vt)}var yv=dv(Gc,!0);function tN(t,e){var n=We(t)?eN:yv;return n(t,Pr(e))}function nN(t,e,n){t=_t(t),e=Rn(e);var r=t.length;n=n===void 0?r:Fi(Ke(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function rN(t,e){return Pt(e,function(n){return[n,t[n]]})}function iN(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=[r,r]}),n}var oN="[object Map]",aN="[object Set]";function _v(t){return function(e){var n=an(e);return n==oN?Ic(e):n==aN?iN(e):rN(e,t(e))}}var Zr=_v(Vt),sN=_v(An),lN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uN=Cc(lN),bv=/[&<>"']/g,cN=RegExp(bv.source);function xv(t){return t=_t(t),t&&cN.test(t)?t.replace(bv,uN):t}var Ev=/[\\^$.*+?()[\]{}|]/g,dN=RegExp(Ev.source);function fN(t){return t=_t(t),t&&dN.test(t)?t.replace(Ev,"\\$&"):t}function wv(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function pN(t,e){var n=!0;return pi(t,function(r,i,o){return n=!!e(r,i,o),n}),n}function hN(t,e,n){var r=We(t)?wv:pN;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var gN=4294967295;function Sv(t){return t?Fi(Ke(t),0,gN):0}function vN(t,e,n,r){var i=t.length;for(n=Ke(n),n<0&&(n=-n>i?0:i+n),r=r===void 0||r>i?i:Ke(r),r<0&&(r+=i),r=n>r?0:Sv(r);n<r;)t[n++]=e;return t}function mN(t,e,n,r){var i=t==null?0:t.length;return i?(n&&typeof n!="number"&&fn(t,e,n)&&(n=0,r=i),vN(t,e,n,r)):[]}function Cv(t,e){var n=[];return pi(t,function(r,i,o){e(r,i,o)&&n.push(r)}),n}function yN(t,e){var n=We(t)?fi:Cv;return n(t,Ue(e))}function Av(t){return function(e,n,r){var i=Object(e);if(!Cn(e)){var o=Ue(n);e=Vt(e),n=function(s){return o(i[s],s,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var _N=Math.max;function Yc(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=_N(r+i,0)),Ds(t,Ue(e),i)}var hi=Av(Yc);function Ov(t,e,n){var r;return n(t,function(i,o,a){if(e(i,o,a))return r=o,!1}),r}function bN(t,e){return Ov(t,Ue(e),Dr)}var xN=Math.max,EN=Math.min;function Tv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r-1;return n!==void 0&&(i=Ke(n),i=n<0?xN(r+i,0):EN(i,r-1)),Ds(t,Ue(e),i,!0)}var wN=Av(Tv);function SN(t,e){return Ov(t,Ue(e),Gc)}function CN(t){return t&&t.length?t[0]:void 0}function Nv(t,e){var n=-1,r=Cn(t)?Array(t.length):[];return pi(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Bn(t,e){var n=We(t)?Pt:Nv;return n(t,Ue(e))}function AN(t,e){return Yt(Bn(t,e),1)}var ON=1/0;function TN(t,e){return Yt(Bn(t,e),ON)}function NN(t,e,n){return n=n===void 0?1:Ke(n),Yt(Bn(t,e),n)}var MN=1/0;function DN(t){var e=t==null?0:t.length;return e?Yt(t,MN):[]}function PN(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:Ke(e),Yt(t,e)):[]}var RN=512;function LN(t){return Xr(t,RN)}var IN=Ac("floor"),kN="Expected a function",BN=8,jN=32,FN=128,$N=256;function Mv(t){return qr(function(e){var n=e.length,r=n,i=Xn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(kN);if(i&&!a&&Ns(o)=="wrapper")var a=new Xn([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Ns(o),l=s=="wrapper"?sc(o):void 0;l&&lc(l[0])&&l[1]==(FN|BN|jN|$N)&&!l[4].length&&l[9]==1?a=a[Ns(l[0])].apply(a,l[3]):a=o.length==1&&lc(o)?a[s]():a.thru(o)}return function(){var u=arguments,c=u[0];if(a&&u.length==1&&We(c))return a.plant(c).value();for(var d=0,f=n?e[d].apply(this,u):c;++d<n;)f=e[d].call(this,f);return f}})}var HN=Mv(),zN=Mv(!0);function WN(t,e){return t==null?t:Hc(t,Pr(e),An)}function UN(t,e){return t==null?t:mv(t,Pr(e),An)}function VN(t,e){return t&&Dr(t,Pr(e))}function XN(t,e){return t&&Gc(t,Pr(e))}function Dv(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r}function Ys(t,e){return fi(e,function(n){return lr(t[n])})}function GN(t){return t==null?[]:Ys(t,Vt(t))}function YN(t){return t==null?[]:Ys(t,An(t))}var KN=Object.prototype,qN=KN.hasOwnProperty,ZN=Ws(function(t,e,n){qN.call(t,n)?t[n].push(e):Gr(t,n,[e])});function Kc(t,e){return t>e}function Ks(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Vn(e),n=Vn(n)),t(e,n)}}var JN=Ks(Kc),QN=Ks(function(t,e){return t>=e}),eM=Object.prototype,tM=eM.hasOwnProperty;function nM(t,e){return t!=null&&tM.call(t,e)}function qs(t,e){return t!=null&&av(t,e,nM)}var rM=Math.max,iM=Math.min;function oM(t,e,n){return t>=iM(e,n)&&t<rM(e,n)}function aM(t,e,n){return e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),t=Vn(t),oM(t,e,n)}var sM="[object String]";function Zs(t){return typeof t=="string"||!We(t)&&It(t)&&dn(t)==sM}function qc(t,e){return Pt(e,function(n){return t[n]})}function _o(t){return t==null?[]:qc(t,Vt(t))}var lM=Math.max;function uM(t,e,n,r){t=Cn(t)?t:_o(t),n=n&&!r?Ke(n):0;var i=t.length;return n<0&&(n=lM(i+n,0)),Zs(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&co(t,e,n)>-1}var cM=Math.max;function Pv(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Ke(n);return i<0&&(i=cM(r+i,0)),co(t,e,i)}function dM(t){var e=t==null?0:t.length;return e?Kn(t,0,-1):[]}var fM=Math.min;function Zc(t,e,n){for(var r=n?Xc:Ps,i=t[0].length,o=t.length,a=o,s=Array(o),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=Pt(c,In(e))),l=fM(c.length,l),s[a]=!n&&(e||i>=120&&c.length>=120)?new $i(a&&c):void 0}c=t[0];var d=-1,f=s[0];e:for(;++d<i&&u.length<l;){var h=c[d],v=e?e(h):h;if(h=n||h!==0?h:0,!(f?ha(f,v):r(u,v,n))){for(a=o;--a;){var g=s[a];if(!(g?ha(g,v):r(t[a],v,n)))continue e}f&&f.push(v),u.push(h)}}return u}function Jc(t){return Bt(t)?t:[]}var pM=Je(function(t){var e=Pt(t,Jc);return e.length&&e[0]===t[0]?Zc(e):[]}),hM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e===kn(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Zc(n,Ue(e)):[]}),gM=Je(function(t){var e=kn(t),n=Pt(t,Jc);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?Zc(n,void 0,e):[]});function vM(t,e,n,r){return Dr(t,function(i,o,a){e(r,n(i),o,a)}),r}function Rv(t,e){return function(n,r){return vM(n,t,e(r),{})}}var mM=Object.prototype,yM=mM.toString,_M=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=yM.call(e)),t[e]=n},uc(wn)),Lv=Object.prototype,bM=Lv.hasOwnProperty,xM=Lv.toString,EM=Rv(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=xM.call(e)),bM.call(t,e)?t[e].push(n):t[e]=[n]},Ue);function Iv(t,e){return e.length<2?t:ji(t,Kn(e,0,-1))}function ma(t,e,n){e=li(e,t),t=Iv(t,e);var r=t==null?t:t[Mr(kn(e))];return r==null?void 0:Ln(r,t,n)}var wM=Je(ma),SM=Je(function(t,e,n){var r=-1,i=typeof e=="function",o=Cn(t)?Array(t.length):[];return pi(t,function(a){o[++r]=i?Ln(e,a,n):ma(a,e,n)}),o}),CM="[object ArrayBuffer]";function AM(t){return It(t)&&dn(t)==CM}var kv=Yn&&Yn.isArrayBuffer,OM=kv?In(kv):AM,TM="[object Boolean]";function Js(t){return t===!0||t===!1||It(t)&&dn(t)==TM}var NM="[object Date]";function MM(t){return It(t)&&dn(t)==NM}var Bv=Yn&&Yn.isDate,DM=Bv?In(Bv):MM;function PM(t){return It(t)&&t.nodeType===1&&!pa(t)}var RM="[object Map]",LM="[object Set]",IM=Object.prototype,kM=IM.hasOwnProperty;function Qs(t){if(t==null)return!0;if(Cn(t)&&(We(t)||typeof t=="string"||typeof t.splice=="function"||si(t)||ho(t)||ki(t)))return!t.length;var e=an(t);if(e==RM||e==LM)return!t.size;if(ua(t))return!gc(t).length;for(var n in t)if(kM.call(t,n))return!1;return!0}function Qc(t,e){return ga(t,e)}function BM(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?ga(t,e,void 0,n):!!r}var jM=Ut.isFinite;function FM(t){return typeof t=="number"&&jM(t)}function jv(t){return typeof t=="number"&&t==Ke(t)}function $M(t,e){return t===e||Bc(t,e,jc(e))}function HM(t,e,n){return n=typeof n=="function"?n:void 0,Bc(t,e,jc(e),n)}var zM="[object Number]";function Fv(t){return typeof t=="number"||It(t)&&dn(t)==zM}function WM(t){return Fv(t)&&t!=+t}var UM=As?lr:pc,VM="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function XM(t){if(UM(t))throw new Error(VM);return ph(t)}function pn(t){return t==null}function GM(t){return t===null}var YM="[object RegExp]";function KM(t){return It(t)&&dn(t)==YM}var $v=Yn&&Yn.isRegExp,ed=$v?In($v):KM,qM=9007199254740991;function ZM(t){return jv(t)&&t>=-9007199254740991&&t<=qM}function Hi(t){return t===void 0}var JM="[object WeakMap]";function QM(t){return It(t)&&an(t)==JM}var eD="[object WeakSet]";function tD(t){return It(t)&&dn(t)==eD}var nD=1;function rD(t){return Ue(typeof t=="function"?t:qn(t,nD))}var iD=Array.prototype,oD=iD.join;function aD(t,e){return t==null?"":oD.call(t,e)}var sD=mo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),lD=Ws(function(t,e,n){Gr(t,n,e)});function uD(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}var cD=Math.max,dD=Math.min;function fD(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r;return n!==void 0&&(i=Ke(n),i=i<0?cD(r+i,0):dD(i,r-1)),e===e?uD(t,e,i):Ds(t,xh,i,!0)}var pD=mo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),hD=og("toLowerCase");function td(t,e){return t<e}var gD=Ks(td),vD=Ks(function(t,e){return t<=e});function Hv(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,e(r,i,o),r)}),n}function mD(t,e){var n={};return e=Ue(e),Dr(t,function(r,i,o){Gr(n,i,e(r,i,o))}),n}var yD=1;function _D(t){return ov(qn(t,yD))}var bD=1;function xD(t,e){return sv(t,qn(e,bD))}function el(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(a!=null&&(s===void 0?a===a&&!Pn(a):n(a,s)))var s=a,l=o}return l}function ED(t){return t&&t.length?el(t,wn,Kc):void 0}function wD(t,e){return t&&t.length?el(t,Ue(e),Kc):void 0}function nd(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==void 0&&(n=n===void 0?o:n+o)}return n}var SD=NaN;function zv(t,e){var n=t==null?0:t.length;return n?nd(t,e)/n:SD}function CD(t){return zv(t,wn)}function AD(t,e){return zv(t,Ue(e))}var zi=po(function(t,e,n){Xs(t,e,n)}),OD=Je(function(t,e){return function(n){return ma(n,t,e)}}),TD=Je(function(t,e){return function(n){return ma(t,n,e)}});function ND(t){return t&&t.length?el(t,wn,td):void 0}function MD(t,e){return t&&t.length?el(t,Ue(e),td):void 0}function DD(t,e,n){var r=Vt(e),i=Ys(e,r),o=!(Rt(n)&&"chain"in n)||!!n.chain,a=lr(t);return Gn(i,function(s){var l=e[s];t[s]=l,a&&(t.prototype[s]=function(){var u=this.__chain__;if(o||u){var c=t(this.__wrapped__),d=c.__actions__=Sn(this.__actions__);return d.push({func:l,args:arguments,thisArg:t}),c.__chain__=u,c}return l.apply(t,ci([this.value()],arguments))})}),t}var PD=Cs(function(t,e){return t*e},1),RD="Expected a function";function tl(t){if(typeof t!="function")throw new TypeError(RD);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function LD(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var ID="[object Map]",kD="[object Set]",rd=on?on.iterator:void 0;function Wv(t){if(!t)return[];if(Cn(t))return Zs(t)?cr(t):Sn(t);if(rd&&t[rd])return LD(t[rd]());var e=an(t),n=e==ID?Ic:e==kD?Hs:_o;return n(t)}function BD(){this.__values__===void 0&&(this.__values__=Wv(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function Uv(t,e){var n=t.length;if(n)return e+=e<0?n:0,Vr(e,n)?t[e]:void 0}function jD(t,e){return t&&t.length?Uv(t,Ke(e)):void 0}function FD(t){return t=Ke(t),Je(function(e){return Uv(e,t)})}function id(t,e){return e=li(e,t),t=Iv(t,e),t==null||delete t[Mr(kn(e))]}function $D(t){return pa(t)?void 0:t}var HD=1,zD=2,WD=4,UD=qr(function(t,e){var n={};if(t==null)return n;var r=!1;e=Pt(e,function(o){return o=li(o,t),r||(r=o.length>1),o}),Nr(t,Mc(t),n),r&&(n=qn(n,HD|zD|WD,$D));for(var i=e.length;i--;)id(n,e[i]);return n});function ya(t,e,n,r){if(!Rt(t))return t;e=li(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Mr(e[i]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var c=s[l];u=r?r(c,l,s):void 0,u===void 0&&(u=Rt(c)?c:Vr(e[i+1])?[]:{})}la(s,l,u),s=s[l]}return t}function Vv(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ji(t,a);n(s,a)&&ya(o,li(a,t),s)}return o}function Xv(t,e){if(t==null)return{};var n=Pt(Mc(t),function(r){return[r]});return e=Ue(e),Vv(t,n,function(r,i){return e(r,i[0])})}function VD(t,e){return Xv(t,tl(Ue(e)))}function XD(t){return Jh(2,t)}function GD(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Gv(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=Pn(t),a=e!==void 0,s=e===null,l=e===e,u=Pn(e);if(!s&&!u&&!o&&t>e||o&&a&&l&&!s&&!u||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}function YD(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=Gv(i[r],o[r]);if(l){if(r>=s)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return t.index-e.index}function Yv(t,e,n){e.length?e=Pt(e,function(o){return We(o)?function(a){return ji(a,o.length===1?o[0]:o)}:o}):e=[wn];var r=-1;e=Pt(e,In(Ue));var i=Nv(t,function(o,a,s){var l=Pt(e,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return GD(i,function(o,a){return YD(o,a,n)})}function KD(t,e,n,r){return t==null?[]:(We(e)||(e=e==null?[]:[e]),n=r?void 0:n,We(n)||(n=n==null?[]:[n]),Yv(t,e,n))}function od(t){return qr(function(e){return e=Pt(e,In(Ue)),Je(function(n){var r=this;return t(e,function(i){return Ln(i,r,n)})})})}var qD=od(Pt),ZD=Je,JD=Math.min,QD=ZD(function(t,e){e=e.length==1&&We(e[0])?Pt(e[0],In(Ue)):Pt(Yt(e,1),In(Ue));var n=e.length;return Je(function(r){for(var i=-1,o=JD(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ln(t,this,r)})}),eP=od(wv),tP=od(Lc),nP=9007199254740991,rP=Math.floor;function ad(t,e){var n="";if(!t||e<1||e>nP)return n;do e%2&&(n+=t),e=rP(e/2),e&&(t+=t);while(e);return n}var iP=$c("length"),Kv="\\ud800-\\udfff",oP="\\u0300-\\u036f",aP="\\ufe20-\\ufe2f",sP="\\u20d0-\\u20ff",lP=oP+aP+sP,uP="\\ufe0e\\ufe0f",cP="["+Kv+"]",sd="["+lP+"]",ld="\\ud83c[\\udffb-\\udfff]",dP="(?:"+sd+"|"+ld+")",qv="[^"+Kv+"]",Zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Jv="[\\ud800-\\udbff][\\udc00-\\udfff]",fP="\\u200d",Qv=dP+"?",em="["+uP+"]?",pP="(?:"+fP+"(?:"+[qv,Zv,Jv].join("|")+")"+em+Qv+")*",hP=em+Qv+pP,gP="(?:"+[qv+sd+"?",sd,Zv,Jv,cP].join("|")+")",tm=RegExp(ld+"(?="+ld+")|"+gP+hP,"g");function vP(t){for(var e=tm.lastIndex=0;tm.test(t);)++e;return e}function bo(t){return go(t)?vP(t):iP(t)}var mP=Math.ceil;function nl(t,e){e=e===void 0?" ":Rn(e);var n=e.length;if(n<2)return n?ad(e,t):e;var r=ad(e,mP(t/bo(e)));return go(e)?di(cr(r),0,t).join(""):r.slice(0,t)}var yP=Math.ceil,_P=Math.floor;function bP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return nl(_P(i),n)+t+nl(yP(i),n)}function xP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?t+nl(e-r,n):t}function EP(t,e,n){t=_t(t),e=Ke(e);var r=e?bo(t):0;return e&&r<e?nl(e-r,n)+t:t}var wP=/^\s+/,SP=Ut.parseInt;function CP(t,e,n){return n||e==null?e=0:e&&(e=+e),SP(_t(t).replace(wP,""),e||0)}var AP=32,rl=Je(function(t,e){var n=ai(e,fo(rl));return Xr(t,AP,void 0,e,n)});rl.placeholder={};var OP=64,ud=Je(function(t,e){var n=ai(e,fo(ud));return Xr(t,OP,void 0,e,n)});ud.placeholder={};var TP=Ws(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function NP(t,e){return Vv(t,e,function(n,r){return Fc(t,r)})}var gi=qr(function(t,e){return t==null?{}:NP(t,e)});function MP(t){for(var e,n=this;n instanceof Ts;){var r=yh(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function DP(t){return function(e){return t==null?void 0:ji(t,e)}}function PP(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var RP=Array.prototype,nm=RP.splice;function cd(t,e,n,r){var i=r?PP:co,o=-1,a=e.length,s=t;for(t===e&&(e=Sn(e)),n&&(s=Pt(t,In(n)));++o<a;)for(var l=0,u=e[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==t&&nm.call(s,l,1),nm.call(t,l,1);return t}function rm(t,e){return t&&t.length&&e&&e.length?cd(t,e):t}var LP=Je(rm);function IP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,Ue(n)):t}function kP(t,e,n){return t&&t.length&&e&&e.length?cd(t,e,void 0,n):t}var BP=Array.prototype,jP=BP.splice;function im(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Vr(i)?jP.call(t,i,1):id(t,i)}}return t}var FP=qr(function(t,e){var n=t==null?0:t.length,r=yc(t,e);return im(t,Pt(e,function(i){return Vr(i,n)?+i:i}).sort(Gv)),r}),$P=Math.floor,HP=Math.random;function dd(t,e){return t+$P(HP()*(e-t+1))}var zP=parseFloat,WP=Math.min,UP=Math.random;function VP(t,e,n){if(n&&typeof n!="boolean"&&fn(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=Ur(t),e===void 0?(e=t,t=0):e=Ur(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=UP();return WP(t+i*(e-t+zP("1e-"+((i+"").length-1))),e)}return dd(t,e)}var XP=Math.ceil,GP=Math.max;function YP(t,e,n,r){for(var i=-1,o=GP(XP((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}function om(t){return function(e,n,r){return r&&typeof r!="number"&&fn(e,n,r)&&(n=r=void 0),e=Ur(e),n===void 0?(n=e,e=0):n=Ur(n),r=r===void 0?e<n?1:-1:Ur(r),YP(e,n,r,t)}}var KP=om(),qP=om(!0),ZP=256,JP=qr(function(t,e){return Xr(t,ZP,void 0,void 0,void 0,e)});function am(t,e,n,r,i){return i(t,function(o,a,s){n=r?(r=!1,o):e(n,o,a,s)}),n}function sm(t,e,n){var r=We(t)?Sc:am,i=arguments.length<3;return r(t,Ue(e),n,i,pi)}function QP(t,e,n,r){var i=t==null?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function eR(t,e,n){var r=We(t)?QP:am,i=arguments.length<3;return r(t,Ue(e),n,i,yv)}function tR(t,e){var n=We(t)?fi:Cv;return n(t,tl(Ue(e)))}function nR(t,e){var n=[];if(!(t&&t.length))return n;var r=-1,i=[],o=t.length;for(e=Ue(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return im(t,i),n}function rR(t,e,n){return(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e),ad(_t(t),e)}function iR(){var t=arguments,e=_t(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var oR="Expected a function";function aR(t,e){if(typeof t!="function")throw new TypeError(oR);return e=e===void 0?e:Ke(e),Je(t,e)}function sR(t,e,n){e=li(e,t);var r=-1,i=e.length;for(i||(i=1,t=void 0);++r<i;){var o=t==null?void 0:t[Mr(e[r])];o===void 0&&(r=i,o=n),t=lr(o)?o.call(t):o}return t}var lR=Array.prototype,uR=lR.reverse;function fd(t){return t==null?t:uR.call(t)}var cR=Ac("round");function lm(t){var e=t.length;return e?t[dd(0,e-1)]:void 0}function dR(t){return lm(_o(t))}function fR(t){var e=We(t)?lm:dR;return e(t)}function il(t,e){var n=-1,r=t.length,i=r-1;for(e=e===void 0?r:e;++n<e;){var o=dd(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function pR(t,e){return il(Sn(t),Fi(e,0,t.length))}function hR(t,e){var n=_o(t);return il(n,Fi(e,0,n.length))}function gR(t,e,n){(n?fn(t,e,n):e===void 0)?e=1:e=Ke(e);var r=We(t)?pR:hR;return r(t,e)}function um(t,e,n){return t==null?t:ya(t,e,n)}function vR(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:ya(t,e,n,r)}function mR(t){return il(Sn(t))}function yR(t){return il(_o(t))}function _R(t){var e=We(t)?mR:yR;return e(t)}var bR="[object Map]",xR="[object Set]";function ER(t){if(t==null)return 0;if(Cn(t))return Zs(t)?bo(t):t.length;var e=an(t);return e==bR||e==xR?t.size:gc(t).length}function wR(t,e,n){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&fn(t,e,n)?(e=0,n=r):(e=e==null?0:Ke(e),n=n===void 0?r:Ke(n)),Kn(t,e,n)):[]}var SR=mo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});function CR(t,e){var n;return pi(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}function AR(t,e,n){var r=We(t)?Lc:CR;return n&&fn(t,e,n)&&(e=void 0),r(t,Ue(e))}var OR=Je(function(t,e){if(t==null)return[];var n=e.length;return n>1&&fn(t,e[0],e[1])?e=[]:n>2&&fn(e[0],e[1],e[2])&&(e=[e[0]]),Yv(t,Yt(e,1),[])}),TR=4294967295,NR=TR-1,MR=Math.floor,DR=Math.min;function pd(t,e,n,r){var i=0,o=t==null?0:t.length;if(o===0)return 0;e=n(e);for(var a=e!==e,s=e===null,l=Pn(e),u=e===void 0;i<o;){var c=MR((i+o)/2),d=n(t[c]),f=d!==void 0,h=d===null,v=d===d,g=Pn(d);if(a)var m=r||v;else u?m=v&&(r||f):s?m=v&&f&&(r||!h):l?m=v&&f&&!h&&(r||!g):h||g?m=!1:m=r?d<=e:d<e;m?i=c+1:o=c}return DR(o,NR)}var PR=4294967295,RR=PR>>>1;function ol(t,e,n){var r=0,i=t==null?r:t.length;if(typeof e=="number"&&e===e&&i<=RR){for(;r<i;){var o=r+i>>>1,a=t[o];a!==null&&!Pn(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return pd(t,e,wn,n)}function LR(t,e){return ol(t,e)}function IR(t,e,n){return pd(t,e,Ue(n))}function kR(t,e){var n=t==null?0:t.length;if(n){var r=ol(t,e);if(r<n&&ur(t[r],e))return r}return-1}function BR(t,e){return ol(t,e,!0)}function jR(t,e,n){return pd(t,e,Ue(n),!0)}function FR(t,e){var n=t==null?0:t.length;if(n){var r=ol(t,e,!0)-1;if(ur(t[r],e))return r}return-1}function cm(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!ur(s,l)){var l=s;o[i++]=a===0?0:a}}return o}function $R(t){return t&&t.length?cm(t):[]}function HR(t,e){return t&&t.length?cm(t,Ue(e)):[]}var zR=4294967295;function WR(t,e,n){return n&&typeof n!="number"&&fn(t,e,n)&&(e=n=void 0),n=n===void 0?zR:n>>>0,n?(t=_t(t),t&&(typeof e=="string"||e!=null&&!ed(e))&&(e=Rn(e),!e&&go(t))?di(cr(t),0,n):t.split(e,n)):[]}var UR="Expected a function",VR=Math.max;function XR(t,e){if(typeof t!="function")throw new TypeError(UR);return e=e==null?0:VR(Ke(e),0),Je(function(n){var r=n[e],i=di(n,0,e);return r&&ci(i,r),Ln(t,this,i)})}var GR=mo(function(t,e,n){return t+(n?" ":"")+wc(e)});function YR(t,e,n){return t=_t(t),n=n==null?0:Fi(Ke(n),0,t.length),e=Rn(e),t.slice(n,n+e.length)==e}function KR(){return{}}function qR(){return""}function ZR(){return!0}var JR=Cs(function(t,e){return t-e},0);function QR(t){return t&&t.length?nd(t,wn):0}function e2(t,e){return t&&t.length?nd(t,Ue(e)):0}function t2(t){var e=t==null?0:t.length;return e?Kn(t,1,e):[]}function n2(t,e,n){return t&&t.length?(e=n||e===void 0?1:Ke(e),Kn(t,0,e<0?0:e)):[]}function r2(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ke(e),e=r-e,Kn(t,e<0?0:e,r)):[]}function i2(t,e){return t&&t.length?Gs(t,Ue(e),!1,!0):[]}function o2(t,e){return t&&t.length?Gs(t,Ue(e)):[]}function a2(t,e){return e(t),t}var dm=Object.prototype,s2=dm.hasOwnProperty;function fm(t,e,n,r){return t===void 0||ur(t,dm[n])&&!s2.call(r,n)?e:t}var l2={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function u2(t){return"\\"+l2[t]}var pm=/<%=([\s\S]+?)%>/g,c2=/<%-([\s\S]+?)%>/g,d2=/<%([\s\S]+?)%>/g,hd={escape:c2,evaluate:d2,interpolate:pm,variable:"",imports:{_:{escape:xv}}},f2="Invalid `variable` option passed into `_.template`",p2=/\b__p \+= '';/g,h2=/\b(__p \+=) '' \+/g,g2=/(__e\(.*?\)|\b__t\)) \+\n'';/g,v2=/[()=,{}\[\]\/\s]/,m2=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,al=/($^)/,y2=/['\n\r\u2028\u2029\\]/g,_2=Object.prototype,hm=_2.hasOwnProperty;function b2(t,e,n){var r=hd.imports._.templateSettings||hd;n&&fn(t,e,n)&&(e=void 0),t=_t(t),e=vc({},e,r,fm);var i=vc({},e.imports,r.imports,fm),o=Vt(i),a=qc(i,o),s,l,u=0,c=e.interpolate||al,d="__p += '",f=RegExp((e.escape||al).source+"|"+c.source+"|"+(c===pm?m2:al).source+"|"+(e.evaluate||al).source+"|$","g"),h=hm.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
8
8
  `:"";t.replace(f,function(m,y,x,E,b,T){return x||(x=E),d+=t.slice(u,T).replace(y2,u2),y&&(s=!0,d+=`' +
9
9
  __e(`+y+`) +
10
10
  '`),b&&(l=!0,d+=`';
@@ -21,7 +21,7 @@ __p += '`),x&&(d+=`' +
21
21
  function print() { __p += __j.call(arguments, '') }
22
22
  `:`;
23
23
  `)+d+`return __p
24
- }`;var g=Zh(function(){return Function(o,h+"return "+d).apply(void 0,a)});if(g.source=d,_c(g))throw g;return g}var x2="Expected a function";function gm(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(x2);return Rt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Us(t,e,{leading:r,maxWait:e,trailing:i})}function al(t,e){return e(t)}var E2=9007199254740991,gd=4294967295,w2=Math.min;function S2(t,e){if(t=Ke(t),t<1||t>E2)return[];var n=gd,r=w2(t,gd);e=Pr(e),t-=gd;for(var i=fc(r,e);++n<t;)e(n);return i}function C2(){return this}function vm(t,e){var n=t;return n instanceof ot&&(n=n.value()),Sc(e,function(r,i){return i.func.apply(i.thisArg,ci([r],i.args))},n)}function A2(){return vm(this.__wrapped__,this.__actions__)}function O2(t){return _t(t).toLowerCase()}function T2(t){return We(t)?Pt(t,Mr):Pn(t)?[t]:Sn(Gh(_t(t)))}var N2=9007199254740991;function M2(t){return t?Fi(Ke(t),-9007199254740991,N2):t===0?t:0}function D2(t){return _t(t).toUpperCase()}function P2(t,e,n){var r=We(t),i=r||si(t)||ho(t);if(e=Ue(e),n==null){var o=t&&t.constructor;i?n=r?new o:[]:Rt(t)?n=lr(o)?so(Bs(t)):{}:n={}}return(i?Gn:Dr)(t,function(a,s,l){return e(n,a,s,l)}),n}function mm(t,e){for(var n=t.length;n--&&co(e,t[n],0)>-1;);return n}function ym(t,e){for(var n=-1,r=t.length;++n<r&&co(e,t[n],0)>-1;);return n}function R2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return ch(t);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=cr(e),o=ym(r,i),a=mm(r,i)+1;return di(r,o,a).join("")}function L2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.slice(0,uh(t)+1);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=mm(r,cr(e))+1;return di(r,0,i).join("")}var I2=/^\s+/;function k2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.replace(I2,"");if(!t||!(e=Rn(e)))return t;var r=cr(t),i=ym(r,cr(e));return di(r,i).join("")}var B2=30,j2="...",F2=/\w*$/;function $2(t,e){var n=B2,r=j2;if(Rt(e)){var i="separator"in e?e.separator:i;n="length"in e?Ke(e.length):n,r="omission"in e?Rn(e.omission):r}t=_t(t);var o=t.length;if(go(t)){var a=cr(t);o=a.length}if(n>=o)return t;var s=n-bo(r);if(s<1)return r;var l=a?di(a,0,s).join(""):t.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),ed(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,_t(F2.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(t.indexOf(Rn(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}function H2(t){return Ih(t,1)}var z2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},W2=Cc(z2),_m=/&(?:amp|lt|gt|quot|#39);/g,U2=RegExp(_m.source);function V2(t){return t=_t(t),t&&U2.test(t)?t.replace(_m,W2):t}var X2=1/0,G2=yo&&1/$s(new yo([,-0]))[1]==X2?function(t){return new yo(t)}:lo,Y2=200;function vi(t,e,n){var r=-1,i=Ds,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=Xc;else if(o>=Y2){var u=e?null:G2(t);if(u)return $s(u);a=!1,i=ha,l=new $i}else l=e?[]:s;e:for(;++r<o;){var c=t[r],d=e?e(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var K2=Je(function(t){return vi(Yt(t,1,Bt,!0))}),q2=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),vi(Yt(t,1,Bt,!0),Ue(e))}),Z2=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,vi(Yt(t,1,Bt,!0),void 0,e)});function J2(t){return t&&t.length?vi(t):[]}function Q2(t,e){return t&&t.length?vi(t,Ue(e)):[]}function eL(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?vi(t,void 0,e):[]}var tL=0;function nL(t){var e=++tL;return _t(t)+e}function rL(t,e){return t==null?!0:id(t,e)}var iL=Math.max;function vd(t){if(!(t&&t.length))return[];var e=0;return t=fi(t,function(n){if(Bt(n))return e=iL(n.length,e),!0}),fc(e,function(n){return Pt(t,$c(n))})}function bm(t,e){if(!(t&&t.length))return[];var n=vd(t);return e==null?n:Pt(n,function(r){return Ln(e,void 0,r)})}function xm(t,e,n,r){return ya(t,e,n(ji(t,e)),r)}function oL(t,e,n){return t==null?t:xm(t,e,Pr(n))}function aL(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:xm(t,e,Pr(n),r)}var sL=mo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function lL(t){return t==null?[]:qc(t,An(t))}var uL=Je(function(t,e){return Bt(t)?va(t,e):[]});function cL(t,e){return nl(Pr(e),t)}var dL=qr(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(o){return yc(o,t)};return e>1||this.__actions__.length||!(r instanceof ot)||!Vr(n)?this.thru(i):(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:al,args:[i],thisArg:void 0}),new Xn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function fL(){return Ag(this)}function pL(){var t=this.__wrapped__;if(t instanceof ot){var e=t;return this.__actions__.length&&(e=new ot(this)),e=e.reverse(),e.__actions__.push({func:al,args:[fd],thisArg:void 0}),new Xn(e,this.__chain__)}return this.thru(fd)}function md(t,e,n){var r=t.length;if(r<2)return r?vi(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=va(o[i]||a,t[s],e,n));return vi(Yt(o,1),e,n)}var hL=Je(function(t){return md(fi(t,Bt))}),gL=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),md(fi(t,Bt),Ue(e))}),vL=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,md(fi(t,Bt),void 0,e)}),mL=Je(vd);function Em(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}function yL(t,e){return Em(t||[],e||[],la)}function _L(t,e){return Em(t||[],e||[],ya)}var bL=Je(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,bm(t,n)});const xe={chunk:aO,compact:$1,concat:H1,difference:XT,differenceBy:GT,differenceWith:YT,drop:qT,dropRight:ZT,dropRightWhile:JT,dropWhile:QT,fill:mN,findIndex:Yc,findLastIndex:Tv,flatten:Kh,flattenDeep:DN,flattenDepth:PN,fromPairs:Dv,head:CN,indexOf:Pv,initial:dM,intersection:pM,intersectionBy:hM,intersectionWith:gM,join:aD,lastIndexOf:fD,nth:jD,pull:LP,pullAll:rm,pullAllBy:IP,pullAllWith:kP,pullAt:FP,remove:nR,reverse:fd,slice:wR,sortedIndex:LR,sortedIndexBy:IR,sortedIndexOf:kR,sortedLastIndex:BR,sortedLastIndexBy:jR,sortedLastIndexOf:FR,sortedUniq:$R,sortedUniqBy:HR,tail:t2,take:n2,takeRight:r2,takeRightWhile:i2,takeWhile:o2,union:K2,unionBy:q2,unionWith:Z2,uniq:J2,uniqBy:Q2,uniqWith:eL,unzip:vd,unzipWith:bm,without:uL,xor:hL,xorBy:gL,xorWith:vL,zip:mL,zipObject:yL,zipObjectDeep:_L,zipWith:bL},St={countBy:MT,every:hN,filter:yN,find:hi,findLast:wN,flatMap:AN,flatMapDeep:TN,flatMapDepth:NN,forEach:gt,forEachRight:tN,groupBy:ZN,includes:uM,invokeMap:SM,keyBy:lD,map:Bn,orderBy:KD,partition:TP,reduce:sm,reduceRight:eR,reject:tR,sample:fR,sampleSize:gR,shuffle:_R,size:ER,some:AR,sortBy:OR},xL={now:Ws},kt={after:UE,ary:Ih,before:Jh,bind:js,bindKey:bc,curry:zc,curryRight:Wc,debounce:Us,defer:WT,delay:UT,flip:LN,memoize:ks,once:XD,overArgs:QD,partial:nl,partialRight:ud,rearg:JP,rest:aR,spread:XR,throttle:gm,unary:H2,wrap:cL},De={castArray:eO,clone:D1,cloneDeep:Pe,cloneDeepWith:k1,cloneWith:j1,conformsTo:CT,eq:ur,gt:JN,gte:QN,isArguments:ki,isArrayBuffer:OM,isArrayLike:Cn,isArrayLikeObject:Bt,isBoolean:Zs,isBuffer:si,isDate:DM,isElement:PM,isEmpty:Js,isEqual:Qc,isEqualWith:BM,isError:_c,isFinite:FM,isFunction:lr,isInteger:jv,isLength:Rs,isMap:Xg,isMatch:$M,isMatchWith:HM,isNaN:WM,isNative:XM,isNil:pn,isNull:GM,isNumber:Fv,isObjectLike:It,isPlainObject:pa,isRegExp:ed,isSafeInteger:ZM,isSet:Yg,isString:qs,isSymbol:Pn,isTypedArray:ho,isUndefined:Hi,isWeakMap:QM,isWeakSet:tD,lt:gD,lte:vD,toArray:Wv,toFinite:Ur,toLength:Sv,toNumber:Vn,toPlainObject:pv,toSafeInteger:M2,toString:_t},hn={add:LE,ceil:rO,divide:KT,floor:IN,max:ED,maxBy:wD,mean:CD,meanBy:AD,min:ND,minBy:MD,multiply:PD,round:cR,subtract:JR,sum:QR,sumBy:e2},yd={clamp:sO,inRange:aM,random:VP},$e={assign:ut,assignIn:JS,assignInWith:vc,assignWith:QS,at:PC,create:DT,defaults:FT,defaultsDeep:HT,findKey:bN,findLastKey:SN,forIn:WN,forInRight:UN,forOwn:VN,forOwnRight:XN,functions:GN,functionsIn:YN,get:ui,has:Ks,hasIn:Fc,invert:_M,invertBy:EM,invoke:wM,keysIn:An,mapKeys:Hv,mapValues:mD,merge:zi,mergeWith:gv,omit:UD,omitBy:VD,pick:gi,pickBy:Xv,result:sR,set:um,setWith:vR,toPairs:Zr,toPairsIn:sN,transform:P2,unset:rL,update:oL,updateWith:aL,values:_o,valuesIn:lL},Rr={at:dL,chain:Ag,commit:F1,next:BD,plant:MP,reverse:pL,tap:a2,toIterator:C2,value:A2,wrapperChain:fL},mt={camelCase:QA,capitalize:ag,deburr:sg,endsWith:nN,escape:xv,escapeRegExp:fN,kebabCase:sD,lowerCase:pD,lowerFirst:hD,pad:bP,padEnd:xP,padStart:EP,parseInt:CP,repeat:rR,replace:iR,snakeCase:SR,split:WR,startCase:GR,startsWith:YR,template:b2,templateSettings:hd,toLower:O2,toUpper:D2,trim:R2,trimEnd:L2,trimStart:k2,truncate:$2,unescape:V2,upperCase:sL,upperFirst:wc,words:Cg},bt={attempt:Zh,bindAll:WC,cond:xT,conforms:ST,constant:uc,defaultTo:BT,flow:HN,flowRight:zN,iteratee:rD,matches:_D,matchesProperty:xD,method:OD,methodOf:TD,noop:lo,nthArg:FD,over:qD,overEvery:eP,overSome:tP,property:lv,propertyOf:DP,range:KP,rangeRight:qP,stubArray:Oc,stubFalse:pc,stubObject:KR,stubString:qR,stubTrue:ZR,times:S2,toPath:T2,uniqueId:nL};function EL(){var t=new ot(this.__wrapped__);return t.__actions__=Sn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Sn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Sn(this.__views__),t}function wL(){if(this.__filtered__){var t=new ot(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var SL=Math.max,CL=Math.min;function AL(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=CL(e,t+a);break;case"takeRight":t=SL(t,e-a);break}}return{start:t,end:e}}var OL=1,TL=2,NL=Math.min;function ML(){var t=this.__wrapped__.value(),e=this.__dir__,n=We(t),r=e<0,i=n?t.length:0,o=AL(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,d=c.length,f=0,h=NL(l,this.__takeCount__);if(!n||!r&&i==l&&h==l)return vm(t,this.__actions__);var v=[];e:for(;l--&&f<h;){u+=e;for(var g=-1,m=t[u];++g<d;){var y=c[g],x=y.iteratee,E=y.type,b=x(m);if(E==TL)m=b;else if(!b){if(E==OL)continue e;break e}}v[f++]=m}return v}/**
24
+ }`;var g=Zh(function(){return Function(o,h+"return "+d).apply(void 0,a)});if(g.source=d,_c(g))throw g;return g}var x2="Expected a function";function gm(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(x2);return Rt(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Vs(t,e,{leading:r,maxWait:e,trailing:i})}function sl(t,e){return e(t)}var E2=9007199254740991,gd=4294967295,w2=Math.min;function S2(t,e){if(t=Ke(t),t<1||t>E2)return[];var n=gd,r=w2(t,gd);e=Pr(e),t-=gd;for(var i=fc(r,e);++n<t;)e(n);return i}function C2(){return this}function vm(t,e){var n=t;return n instanceof ot&&(n=n.value()),Sc(e,function(r,i){return i.func.apply(i.thisArg,ci([r],i.args))},n)}function A2(){return vm(this.__wrapped__,this.__actions__)}function O2(t){return _t(t).toLowerCase()}function T2(t){return We(t)?Pt(t,Mr):Pn(t)?[t]:Sn(Gh(_t(t)))}var N2=9007199254740991;function M2(t){return t?Fi(Ke(t),-9007199254740991,N2):t===0?t:0}function D2(t){return _t(t).toUpperCase()}function P2(t,e,n){var r=We(t),i=r||si(t)||ho(t);if(e=Ue(e),n==null){var o=t&&t.constructor;i?n=r?new o:[]:Rt(t)?n=lr(o)?so(js(t)):{}:n={}}return(i?Gn:Dr)(t,function(a,s,l){return e(n,a,s,l)}),n}function mm(t,e){for(var n=t.length;n--&&co(e,t[n],0)>-1;);return n}function ym(t,e){for(var n=-1,r=t.length;++n<r&&co(e,t[n],0)>-1;);return n}function R2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return ch(t);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=cr(e),o=ym(r,i),a=mm(r,i)+1;return di(r,o,a).join("")}function L2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.slice(0,uh(t)+1);if(!t||!(e=Rn(e)))return t;var r=cr(t),i=mm(r,cr(e))+1;return di(r,0,i).join("")}var I2=/^\s+/;function k2(t,e,n){if(t=_t(t),t&&(n||e===void 0))return t.replace(I2,"");if(!t||!(e=Rn(e)))return t;var r=cr(t),i=ym(r,cr(e));return di(r,i).join("")}var B2=30,j2="...",F2=/\w*$/;function $2(t,e){var n=B2,r=j2;if(Rt(e)){var i="separator"in e?e.separator:i;n="length"in e?Ke(e.length):n,r="omission"in e?Rn(e.omission):r}t=_t(t);var o=t.length;if(go(t)){var a=cr(t);o=a.length}if(n>=o)return t;var s=n-bo(r);if(s<1)return r;var l=a?di(a,0,s).join(""):t.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),ed(i)){if(t.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,_t(F2.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(t.indexOf(Rn(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}function H2(t){return Ih(t,1)}var z2={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},W2=Cc(z2),_m=/&(?:amp|lt|gt|quot|#39);/g,U2=RegExp(_m.source);function V2(t){return t=_t(t),t&&U2.test(t)?t.replace(_m,W2):t}var X2=1/0,G2=yo&&1/Hs(new yo([,-0]))[1]==X2?function(t){return new yo(t)}:lo,Y2=200;function vi(t,e,n){var r=-1,i=Ps,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=Xc;else if(o>=Y2){var u=e?null:G2(t);if(u)return Hs(u);a=!1,i=ha,l=new $i}else l=e?[]:s;e:for(;++r<o;){var c=t[r],d=e?e(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;e&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var K2=Je(function(t){return vi(Yt(t,1,Bt,!0))}),q2=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),vi(Yt(t,1,Bt,!0),Ue(e))}),Z2=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,vi(Yt(t,1,Bt,!0),void 0,e)});function J2(t){return t&&t.length?vi(t):[]}function Q2(t,e){return t&&t.length?vi(t,Ue(e)):[]}function eL(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?vi(t,void 0,e):[]}var tL=0;function nL(t){var e=++tL;return _t(t)+e}function rL(t,e){return t==null?!0:id(t,e)}var iL=Math.max;function vd(t){if(!(t&&t.length))return[];var e=0;return t=fi(t,function(n){if(Bt(n))return e=iL(n.length,e),!0}),fc(e,function(n){return Pt(t,$c(n))})}function bm(t,e){if(!(t&&t.length))return[];var n=vd(t);return e==null?n:Pt(n,function(r){return Ln(e,void 0,r)})}function xm(t,e,n,r){return ya(t,e,n(ji(t,e)),r)}function oL(t,e,n){return t==null?t:xm(t,e,Pr(n))}function aL(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:xm(t,e,Pr(n),r)}var sL=mo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function lL(t){return t==null?[]:qc(t,An(t))}var uL=Je(function(t,e){return Bt(t)?va(t,e):[]});function cL(t,e){return rl(Pr(e),t)}var dL=qr(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(o){return yc(o,t)};return e>1||this.__actions__.length||!(r instanceof ot)||!Vr(n)?this.thru(i):(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:sl,args:[i],thisArg:void 0}),new Xn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function fL(){return Ag(this)}function pL(){var t=this.__wrapped__;if(t instanceof ot){var e=t;return this.__actions__.length&&(e=new ot(this)),e=e.reverse(),e.__actions__.push({func:sl,args:[fd],thisArg:void 0}),new Xn(e,this.__chain__)}return this.thru(fd)}function md(t,e,n){var r=t.length;if(r<2)return r?vi(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],s=-1;++s<r;)s!=i&&(o[i]=va(o[i]||a,t[s],e,n));return vi(Yt(o,1),e,n)}var hL=Je(function(t){return md(fi(t,Bt))}),gL=Je(function(t){var e=kn(t);return Bt(e)&&(e=void 0),md(fi(t,Bt),Ue(e))}),vL=Je(function(t){var e=kn(t);return e=typeof e=="function"?e:void 0,md(fi(t,Bt),void 0,e)}),mL=Je(vd);function Em(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}function yL(t,e){return Em(t||[],e||[],la)}function _L(t,e){return Em(t||[],e||[],ya)}var bL=Je(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,bm(t,n)});const xe={chunk:aO,compact:$1,concat:H1,difference:XT,differenceBy:GT,differenceWith:YT,drop:qT,dropRight:ZT,dropRightWhile:JT,dropWhile:QT,fill:mN,findIndex:Yc,findLastIndex:Tv,flatten:Kh,flattenDeep:DN,flattenDepth:PN,fromPairs:Dv,head:CN,indexOf:Pv,initial:dM,intersection:pM,intersectionBy:hM,intersectionWith:gM,join:aD,lastIndexOf:fD,nth:jD,pull:LP,pullAll:rm,pullAllBy:IP,pullAllWith:kP,pullAt:FP,remove:nR,reverse:fd,slice:wR,sortedIndex:LR,sortedIndexBy:IR,sortedIndexOf:kR,sortedLastIndex:BR,sortedLastIndexBy:jR,sortedLastIndexOf:FR,sortedUniq:$R,sortedUniqBy:HR,tail:t2,take:n2,takeRight:r2,takeRightWhile:i2,takeWhile:o2,union:K2,unionBy:q2,unionWith:Z2,uniq:J2,uniqBy:Q2,uniqWith:eL,unzip:vd,unzipWith:bm,without:uL,xor:hL,xorBy:gL,xorWith:vL,zip:mL,zipObject:yL,zipObjectDeep:_L,zipWith:bL},St={countBy:MT,every:hN,filter:yN,find:hi,findLast:wN,flatMap:AN,flatMapDeep:TN,flatMapDepth:NN,forEach:gt,forEachRight:tN,groupBy:ZN,includes:uM,invokeMap:SM,keyBy:lD,map:Bn,orderBy:KD,partition:TP,reduce:sm,reduceRight:eR,reject:tR,sample:fR,sampleSize:gR,shuffle:_R,size:ER,some:AR,sortBy:OR},xL={now:Us},kt={after:UE,ary:Ih,before:Jh,bind:Fs,bindKey:bc,curry:zc,curryRight:Wc,debounce:Vs,defer:WT,delay:UT,flip:LN,memoize:Bs,once:XD,overArgs:QD,partial:rl,partialRight:ud,rearg:JP,rest:aR,spread:XR,throttle:gm,unary:H2,wrap:cL},De={castArray:eO,clone:D1,cloneDeep:Pe,cloneDeepWith:k1,cloneWith:j1,conformsTo:CT,eq:ur,gt:JN,gte:QN,isArguments:ki,isArrayBuffer:OM,isArrayLike:Cn,isArrayLikeObject:Bt,isBoolean:Js,isBuffer:si,isDate:DM,isElement:PM,isEmpty:Qs,isEqual:Qc,isEqualWith:BM,isError:_c,isFinite:FM,isFunction:lr,isInteger:jv,isLength:Ls,isMap:Xg,isMatch:$M,isMatchWith:HM,isNaN:WM,isNative:XM,isNil:pn,isNull:GM,isNumber:Fv,isObjectLike:It,isPlainObject:pa,isRegExp:ed,isSafeInteger:ZM,isSet:Yg,isString:Zs,isSymbol:Pn,isTypedArray:ho,isUndefined:Hi,isWeakMap:QM,isWeakSet:tD,lt:gD,lte:vD,toArray:Wv,toFinite:Ur,toLength:Sv,toNumber:Vn,toPlainObject:pv,toSafeInteger:M2,toString:_t},hn={add:LE,ceil:rO,divide:KT,floor:IN,max:ED,maxBy:wD,mean:CD,meanBy:AD,min:ND,minBy:MD,multiply:PD,round:cR,subtract:JR,sum:QR,sumBy:e2},yd={clamp:sO,inRange:aM,random:VP},$e={assign:ut,assignIn:JS,assignInWith:vc,assignWith:QS,at:PC,create:DT,defaults:FT,defaultsDeep:HT,findKey:bN,findLastKey:SN,forIn:WN,forInRight:UN,forOwn:VN,forOwnRight:XN,functions:GN,functionsIn:YN,get:ui,has:qs,hasIn:Fc,invert:_M,invertBy:EM,invoke:wM,keysIn:An,mapKeys:Hv,mapValues:mD,merge:zi,mergeWith:gv,omit:UD,omitBy:VD,pick:gi,pickBy:Xv,result:sR,set:um,setWith:vR,toPairs:Zr,toPairsIn:sN,transform:P2,unset:rL,update:oL,updateWith:aL,values:_o,valuesIn:lL},Rr={at:dL,chain:Ag,commit:F1,next:BD,plant:MP,reverse:pL,tap:a2,toIterator:C2,value:A2,wrapperChain:fL},mt={camelCase:QA,capitalize:ag,deburr:sg,endsWith:nN,escape:xv,escapeRegExp:fN,kebabCase:sD,lowerCase:pD,lowerFirst:hD,pad:bP,padEnd:xP,padStart:EP,parseInt:CP,repeat:rR,replace:iR,snakeCase:SR,split:WR,startCase:GR,startsWith:YR,template:b2,templateSettings:hd,toLower:O2,toUpper:D2,trim:R2,trimEnd:L2,trimStart:k2,truncate:$2,unescape:V2,upperCase:sL,upperFirst:wc,words:Cg},bt={attempt:Zh,bindAll:WC,cond:xT,conforms:ST,constant:uc,defaultTo:BT,flow:HN,flowRight:zN,iteratee:rD,matches:_D,matchesProperty:xD,method:OD,methodOf:TD,noop:lo,nthArg:FD,over:qD,overEvery:eP,overSome:tP,property:lv,propertyOf:DP,range:KP,rangeRight:qP,stubArray:Oc,stubFalse:pc,stubObject:KR,stubString:qR,stubTrue:ZR,times:S2,toPath:T2,uniqueId:nL};function EL(){var t=new ot(this.__wrapped__);return t.__actions__=Sn(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Sn(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Sn(this.__views__),t}function wL(){if(this.__filtered__){var t=new ot(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var SL=Math.max,CL=Math.min;function AL(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=CL(e,t+a);break;case"takeRight":t=SL(t,e-a);break}}return{start:t,end:e}}var OL=1,TL=2,NL=Math.min;function ML(){var t=this.__wrapped__.value(),e=this.__dir__,n=We(t),r=e<0,i=n?t.length:0,o=AL(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,d=c.length,f=0,h=NL(l,this.__takeCount__);if(!n||!r&&i==l&&h==l)return vm(t,this.__actions__);var v=[];e:for(;l--&&f<h;){u+=e;for(var g=-1,m=t[u];++g<d;){var y=c[g],x=y.iteratee,E=y.type,b=x(m);if(E==TL)m=b;else if(!b){if(E==OL)continue e;break e}}v[f++]=m}return v}/**
25
25
  * @license
26
26
  * Lodash (Custom Build) <https://lodash.com/>
27
27
  * Build: `lodash modularize exports="es" -o ./`
@@ -29,7 +29,7 @@ function print() { __p += __j.call(arguments, '') }
29
29
  * Released under MIT license <https://lodash.com/license>
30
30
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
31
31
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
32
- */var DL="4.17.21",PL=2,RL=1,LL=3,wm=4294967295,IL=Array.prototype,kL=Object.prototype,Sm=kL.hasOwnProperty,Cm=on?on.iterator:void 0,BL=Math.max,Am=Math.min,_d=function(t){return function(e,n,r){if(r==null){var i=Rt(n),o=i&&Vt(n),a=o&&o.length&&Gs(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(DD);O.after=kt.after,O.ary=kt.ary,O.assign=$e.assign,O.assignIn=$e.assignIn,O.assignInWith=$e.assignInWith,O.assignWith=$e.assignWith,O.at=$e.at,O.before=kt.before,O.bind=kt.bind,O.bindAll=bt.bindAll,O.bindKey=kt.bindKey,O.castArray=De.castArray,O.chain=Rr.chain,O.chunk=xe.chunk,O.compact=xe.compact,O.concat=xe.concat,O.cond=bt.cond,O.conforms=bt.conforms,O.constant=bt.constant,O.countBy=St.countBy,O.create=$e.create,O.curry=kt.curry,O.curryRight=kt.curryRight,O.debounce=kt.debounce,O.defaults=$e.defaults,O.defaultsDeep=$e.defaultsDeep,O.defer=kt.defer,O.delay=kt.delay,O.difference=xe.difference,O.differenceBy=xe.differenceBy,O.differenceWith=xe.differenceWith,O.drop=xe.drop,O.dropRight=xe.dropRight,O.dropRightWhile=xe.dropRightWhile,O.dropWhile=xe.dropWhile,O.fill=xe.fill,O.filter=St.filter,O.flatMap=St.flatMap,O.flatMapDeep=St.flatMapDeep,O.flatMapDepth=St.flatMapDepth,O.flatten=xe.flatten,O.flattenDeep=xe.flattenDeep,O.flattenDepth=xe.flattenDepth,O.flip=kt.flip,O.flow=bt.flow,O.flowRight=bt.flowRight,O.fromPairs=xe.fromPairs,O.functions=$e.functions,O.functionsIn=$e.functionsIn,O.groupBy=St.groupBy,O.initial=xe.initial,O.intersection=xe.intersection,O.intersectionBy=xe.intersectionBy,O.intersectionWith=xe.intersectionWith,O.invert=$e.invert,O.invertBy=$e.invertBy,O.invokeMap=St.invokeMap,O.iteratee=bt.iteratee,O.keyBy=St.keyBy,O.keys=Vt,O.keysIn=$e.keysIn,O.map=St.map,O.mapKeys=$e.mapKeys,O.mapValues=$e.mapValues,O.matches=bt.matches,O.matchesProperty=bt.matchesProperty,O.memoize=kt.memoize,O.merge=$e.merge,O.mergeWith=$e.mergeWith,O.method=bt.method,O.methodOf=bt.methodOf,O.mixin=_d,O.negate=el,O.nthArg=bt.nthArg,O.omit=$e.omit,O.omitBy=$e.omitBy,O.once=kt.once,O.orderBy=St.orderBy,O.over=bt.over,O.overArgs=kt.overArgs,O.overEvery=bt.overEvery,O.overSome=bt.overSome,O.partial=kt.partial,O.partialRight=kt.partialRight,O.partition=St.partition,O.pick=$e.pick,O.pickBy=$e.pickBy,O.property=bt.property,O.propertyOf=bt.propertyOf,O.pull=xe.pull,O.pullAll=xe.pullAll,O.pullAllBy=xe.pullAllBy,O.pullAllWith=xe.pullAllWith,O.pullAt=xe.pullAt,O.range=bt.range,O.rangeRight=bt.rangeRight,O.rearg=kt.rearg,O.reject=St.reject,O.remove=xe.remove,O.rest=kt.rest,O.reverse=xe.reverse,O.sampleSize=St.sampleSize,O.set=$e.set,O.setWith=$e.setWith,O.shuffle=St.shuffle,O.slice=xe.slice,O.sortBy=St.sortBy,O.sortedUniq=xe.sortedUniq,O.sortedUniqBy=xe.sortedUniqBy,O.split=mt.split,O.spread=kt.spread,O.tail=xe.tail,O.take=xe.take,O.takeRight=xe.takeRight,O.takeRightWhile=xe.takeRightWhile,O.takeWhile=xe.takeWhile,O.tap=Rr.tap,O.throttle=kt.throttle,O.thru=al,O.toArray=De.toArray,O.toPairs=$e.toPairs,O.toPairsIn=$e.toPairsIn,O.toPath=bt.toPath,O.toPlainObject=De.toPlainObject,O.transform=$e.transform,O.unary=kt.unary,O.union=xe.union,O.unionBy=xe.unionBy,O.unionWith=xe.unionWith,O.uniq=xe.uniq,O.uniqBy=xe.uniqBy,O.uniqWith=xe.uniqWith,O.unset=$e.unset,O.unzip=xe.unzip,O.unzipWith=xe.unzipWith,O.update=$e.update,O.updateWith=$e.updateWith,O.values=$e.values,O.valuesIn=$e.valuesIn,O.without=xe.without,O.words=mt.words,O.wrap=kt.wrap,O.xor=xe.xor,O.xorBy=xe.xorBy,O.xorWith=xe.xorWith,O.zip=xe.zip,O.zipObject=xe.zipObject,O.zipObjectDeep=xe.zipObjectDeep,O.zipWith=xe.zipWith,O.entries=$e.toPairs,O.entriesIn=$e.toPairsIn,O.extend=$e.assignIn,O.extendWith=$e.assignInWith,_d(O,O),O.add=hn.add,O.attempt=bt.attempt,O.camelCase=mt.camelCase,O.capitalize=mt.capitalize,O.ceil=hn.ceil,O.clamp=yd.clamp,O.clone=De.clone,O.cloneDeep=De.cloneDeep,O.cloneDeepWith=De.cloneDeepWith,O.cloneWith=De.cloneWith,O.conformsTo=De.conformsTo,O.deburr=mt.deburr,O.defaultTo=bt.defaultTo,O.divide=hn.divide,O.endsWith=mt.endsWith,O.eq=De.eq,O.escape=mt.escape,O.escapeRegExp=mt.escapeRegExp,O.every=St.every,O.find=St.find,O.findIndex=xe.findIndex,O.findKey=$e.findKey,O.findLast=St.findLast,O.findLastIndex=xe.findLastIndex,O.findLastKey=$e.findLastKey,O.floor=hn.floor,O.forEach=St.forEach,O.forEachRight=St.forEachRight,O.forIn=$e.forIn,O.forInRight=$e.forInRight,O.forOwn=$e.forOwn,O.forOwnRight=$e.forOwnRight,O.get=$e.get,O.gt=De.gt,O.gte=De.gte,O.has=$e.has,O.hasIn=$e.hasIn,O.head=xe.head,O.identity=wn,O.includes=St.includes,O.indexOf=xe.indexOf,O.inRange=yd.inRange,O.invoke=$e.invoke,O.isArguments=De.isArguments,O.isArray=We,O.isArrayBuffer=De.isArrayBuffer,O.isArrayLike=De.isArrayLike,O.isArrayLikeObject=De.isArrayLikeObject,O.isBoolean=De.isBoolean,O.isBuffer=De.isBuffer,O.isDate=De.isDate,O.isElement=De.isElement,O.isEmpty=De.isEmpty,O.isEqual=De.isEqual,O.isEqualWith=De.isEqualWith,O.isError=De.isError,O.isFinite=De.isFinite,O.isFunction=De.isFunction,O.isInteger=De.isInteger,O.isLength=De.isLength,O.isMap=De.isMap,O.isMatch=De.isMatch,O.isMatchWith=De.isMatchWith,O.isNaN=De.isNaN,O.isNative=De.isNative,O.isNil=De.isNil,O.isNull=De.isNull,O.isNumber=De.isNumber,O.isObject=Rt,O.isObjectLike=De.isObjectLike,O.isPlainObject=De.isPlainObject,O.isRegExp=De.isRegExp,O.isSafeInteger=De.isSafeInteger,O.isSet=De.isSet,O.isString=De.isString,O.isSymbol=De.isSymbol,O.isTypedArray=De.isTypedArray,O.isUndefined=De.isUndefined,O.isWeakMap=De.isWeakMap,O.isWeakSet=De.isWeakSet,O.join=xe.join,O.kebabCase=mt.kebabCase,O.last=kn,O.lastIndexOf=xe.lastIndexOf,O.lowerCase=mt.lowerCase,O.lowerFirst=mt.lowerFirst,O.lt=De.lt,O.lte=De.lte,O.max=hn.max,O.maxBy=hn.maxBy,O.mean=hn.mean,O.meanBy=hn.meanBy,O.min=hn.min,O.minBy=hn.minBy,O.stubArray=bt.stubArray,O.stubFalse=bt.stubFalse,O.stubObject=bt.stubObject,O.stubString=bt.stubString,O.stubTrue=bt.stubTrue,O.multiply=hn.multiply,O.nth=xe.nth,O.noop=bt.noop,O.now=xL.now,O.pad=mt.pad,O.padEnd=mt.padEnd,O.padStart=mt.padStart,O.parseInt=mt.parseInt,O.random=yd.random,O.reduce=St.reduce,O.reduceRight=St.reduceRight,O.repeat=mt.repeat,O.replace=mt.replace,O.result=$e.result,O.round=hn.round,O.sample=St.sample,O.size=St.size,O.snakeCase=mt.snakeCase,O.some=St.some,O.sortedIndex=xe.sortedIndex,O.sortedIndexBy=xe.sortedIndexBy,O.sortedIndexOf=xe.sortedIndexOf,O.sortedLastIndex=xe.sortedLastIndex,O.sortedLastIndexBy=xe.sortedLastIndexBy,O.sortedLastIndexOf=xe.sortedLastIndexOf,O.startCase=mt.startCase,O.startsWith=mt.startsWith,O.subtract=hn.subtract,O.sum=hn.sum,O.sumBy=hn.sumBy,O.template=mt.template,O.times=bt.times,O.toFinite=De.toFinite,O.toInteger=Ke,O.toLength=De.toLength,O.toLower=mt.toLower,O.toNumber=De.toNumber,O.toSafeInteger=De.toSafeInteger,O.toString=De.toString,O.toUpper=mt.toUpper,O.trim=mt.trim,O.trimEnd=mt.trimEnd,O.trimStart=mt.trimStart,O.truncate=mt.truncate,O.unescape=mt.unescape,O.uniqueId=bt.uniqueId,O.upperCase=mt.upperCase,O.upperFirst=mt.upperFirst,O.each=St.forEach,O.eachRight=St.forEachRight,O.first=xe.head,_d(O,function(){var t={};return Dr(O,function(e,n){Sm.call(O.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),O.VERSION=DL,(O.templateSettings=mt.templateSettings).imports._=O,Gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){O[t].placeholder=O}),Gn(["drop","take"],function(t,e){ot.prototype[t]=function(n){n=n===void 0?1:BL(Ke(n),0);var r=this.__filtered__&&!e?new ot(this):this.clone();return r.__filtered__?r.__takeCount__=Am(n,r.__takeCount__):r.__views__.push({size:Am(n,wm),type:t+(r.__dir__<0?"Right":"")}),r},ot.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),Gn(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==RL||n==LL;ot.prototype[t]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Ue(i),type:n}),o.__filtered__=o.__filtered__||r,o}}),Gn(["head","last"],function(t,e){var n="take"+(e?"Right":"");ot.prototype[t]=function(){return this[n](1).value()[0]}}),Gn(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");ot.prototype[t]=function(){return this.__filtered__?new ot(this):this[n](1)}}),ot.prototype.compact=function(){return this.filter(wn)},ot.prototype.find=function(t){return this.filter(t).head()},ot.prototype.findLast=function(t){return this.reverse().find(t)},ot.prototype.invokeMap=Je(function(t,e){return typeof t=="function"?new ot(this):this.map(function(n){return ma(n,t,e)})}),ot.prototype.reject=function(t){return this.filter(el(Ue(t)))},ot.prototype.slice=function(t,e){t=Ke(t);var n=this;return n.__filtered__&&(t>0||e<0)?new ot(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=Ke(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},ot.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ot.prototype.toArray=function(){return this.take(wm)},Dr(ot.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=O[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(O.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,l=a instanceof ot,u=s[0],c=l||We(a),d=function(y){var x=i.apply(O,ci([y],s));return r&&f?x[0]:x};c&&n&&typeof u=="function"&&u.length!=1&&(l=c=!1);var f=this.__chain__,h=!!this.__actions__.length,v=o&&!f,g=l&&!h;if(!o&&c){a=g?a:new ot(this);var m=t.apply(a,s);return m.__actions__.push({func:al,args:[d],thisArg:void 0}),new Xn(m,f)}return v&&g?t.apply(this,s):(m=this.thru(d),v?r?m.value()[0]:m.value():m)})}),Gn(["pop","push","shift","sort","splice","unshift"],function(t){var e=IL[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);O.prototype[t]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(We(o)?o:[],i)}return this[n](function(a){return e.apply(We(a)?a:[],i)})}}),Dr(ot.prototype,function(t,e){var n=O[e];if(n){var r=n.name+"";Sm.call(uo,r)||(uo[r]=[]),uo[r].push({name:e,func:n})}}),uo[Ps(void 0,PL).name]=[{name:"wrapper",func:void 0}],ot.prototype.clone=EL,ot.prototype.reverse=wL,ot.prototype.value=ML,O.prototype.at=Rr.at,O.prototype.chain=Rr.wrapperChain,O.prototype.commit=Rr.commit,O.prototype.next=Rr.next,O.prototype.plant=Rr.plant,O.prototype.reverse=Rr.reverse,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=Rr.value,O.prototype.first=O.prototype.head,Cm&&(O.prototype[Cm]=Rr.toIterator);const xo=t=>typeof t=="number",jL=t=>oc(t)?!Number.isNaN(Number(t)):!1;var Om;const bd=typeof window<"u",FL=t=>typeof t=="string",$L=()=>{};bd&&((Om=window==null?void 0:window.navigator)!=null&&Om.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Tm(t){return typeof t=="function"?t():p.unref(t)}function HL(t){return t}function Nm(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}function zL(t,e=!0){p.getCurrentInstance()?p.onMounted(t):e?t():p.nextTick(t)}function Mm(t){var e;const n=Tm(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Dm=bd?window:void 0;function xd(...t){let e,n,r,i;if(FL(t[0])||Array.isArray(t[0])?([n,r,i]=t,e=Dm):[e,n,r,i]=t,!e)return $L;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),l=p.watch(()=>[Mm(e),Tm(i)],([c,d])=>{a(),c&&o.push(...n.flatMap(f=>r.map(h=>s(c,f,h,d))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Nm(u),u}function WL(t,e=!1){const n=p.ref(),r=()=>n.value=!!t();return r(),zL(r,e),n}const Pm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rm="__vueuse_ssr_handlers__";Pm[Rm]=Pm[Rm]||{};var Lm=Object.getOwnPropertySymbols,UL=Object.prototype.hasOwnProperty,VL=Object.prototype.propertyIsEnumerable,XL=(t,e)=>{var n={};for(var r in t)UL.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Lm)for(var r of Lm(t))e.indexOf(r)<0&&VL.call(t,r)&&(n[r]=t[r]);return n};function GL(t,e,n={}){const r=n,{window:i=Dm}=r,o=XL(r,["window"]);let a;const s=WL(()=>i&&"ResizeObserver"in i),l=()=>{a&&(a.disconnect(),a=void 0)},u=p.watch(()=>Mm(t),d=>{l(),s.value&&i&&d&&(a=new ResizeObserver(e),a.observe(d,o))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return Nm(c),{isSupported:s,stop:c}}var Im;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Im||(Im={}));var YL=Object.defineProperty,km=Object.getOwnPropertySymbols,KL=Object.prototype.hasOwnProperty,qL=Object.prototype.propertyIsEnumerable,Bm=(t,e,n)=>e in t?YL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ZL=(t,e)=>{for(var n in e||(e={}))KL.call(e,n)&&Bm(t,n,e[n]);if(km)for(var n of km(e))qL.call(e,n)&&Bm(t,n,e[n]);return t};ZL({linear:HL},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class jm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function JL(t,e){throw new jm(`[${t}] ${e}`)}function Ed(t,e){if(process.env.NODE_ENV!=="production"){const n=oc(t)?new jm(`[${t}] ${e}`):t;console.warn(n)}}const Fm="__epPropKey",QL=t=>t,eI=t=>ac(t)&&!!t[Fm],tI=(t,e)=>{if(!ac(t)||eI(t))return t;const{values:n,required:r,default:i,type:o,validator:a}=t,l={type:o,required:!!r,validator:n||a?u=>{let c=!1,d=[];if(n&&(d=Array.from(n),nh(t,"default")&&d.push(i),c||(c=d.includes(u))),a&&(c||(c=a(u))),!c&&d.length>0){const f=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");p.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`)}return c}:void 0,[Fm]:!0};return nh(t,"default")&&(l.default=i),l},sl=t=>Dv(Object.entries(t).map(([e,n])=>[e,tI(n,e)]));var wd=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const nI="utils/dom/style";function $m(t,e="px"){if(!t)return"";if(xo(t)||jL(t))return`${t}${e}`;if(oc(t))return t;Ed(nI,"binding value must be a string or number")}const rI=(t,e)=>(t.install=n=>{for(const r of[t,...Object.values({})])n.component(r.name,r)},t),iI=sl({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),oI=t=>gi(iI,t),Eo=4,aI={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},sI=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),Sd=Symbol("scrollbarContextKey"),lI=sl({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),uI="Thumb";var Hm=wd(p.defineComponent({__name:"thumb",props:lI,setup(t){const e=t,n=p.inject(Sd),r=th("scrollbar");n||JL(uI,"can not inject scrollbar context");const i=p.ref(),o=p.ref(),a=p.ref({}),s=p.ref(!1);let l=!1,u=!1,c=bd?document.onselectstart:null;const d=p.computed(()=>aI[e.vertical?"vertical":"horizontal"]),f=p.computed(()=>sI({size:e.size,move:e.move,bar:d.value})),h=p.computed(()=>i.value[d.value.offset]**2/n.wrapElement[d.value.scrollSize]/e.ratio/o.value[d.value.offset]),v=A=>{var S;if(A.stopPropagation(),A.ctrlKey||[1,2].includes(A.button))return;(S=window.getSelection())==null||S.removeAllRanges(),m(A);const M=A.currentTarget;M&&(a.value[d.value.axis]=M[d.value.offset]-(A[d.value.client]-M.getBoundingClientRect()[d.value.direction]))},g=A=>{if(!o.value||!i.value||!n.wrapElement)return;const S=Math.abs(A.target.getBoundingClientRect()[d.value.direction]-A[d.value.client]),M=o.value[d.value.offset]/2,C=(S-M)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=C*n.wrapElement[d.value.scrollSize]/100},m=A=>{A.stopImmediatePropagation(),l=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),c=document.onselectstart,document.onselectstart=()=>!1},y=A=>{if(!i.value||!o.value||l===!1)return;const S=a.value[d.value.axis];if(!S)return;const M=(i.value.getBoundingClientRect()[d.value.direction]-A[d.value.client])*-1,C=o.value[d.value.offset]-S,G=(M-C)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=G*n.wrapElement[d.value.scrollSize]/100},x=()=>{l=!1,a.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),T(),u&&(s.value=!1)},E=()=>{u=!1,s.value=!!e.size},b=()=>{u=!0,s.value=l};p.onBeforeUnmount(()=>{T(),document.removeEventListener("mouseup",x)});const T=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return xd(p.toRef(n,"scrollbarElement"),"mousemove",E),xd(p.toRef(n,"scrollbarElement"),"mouseleave",b),(A,S)=>(p.openBlock(),p.createBlock(p.Transition,{name:p.unref(r).b("fade"),persisted:""},{default:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{ref_key:"instance",ref:i,class:p.normalizeClass([p.unref(r).e("bar"),p.unref(r).is(p.unref(d).key)]),onMousedown:g},[p.createElementVNode("div",{ref_key:"thumb",ref:o,class:p.normalizeClass(p.unref(r).e("thumb")),style:p.normalizeStyle(p.unref(f)),onMousedown:v},null,38)],34),[[p.vShow,A.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const cI=sl({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var dI=wd(p.defineComponent({__name:"bar",props:cI,setup(t,{expose:e}){const n=t,r=p.inject(Sd),i=p.ref(0),o=p.ref(0),a=p.ref(""),s=p.ref(""),l=p.ref(1),u=p.ref(1);return e({handleScroll:f=>{if(f){const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo;o.value=f.scrollTop*100/h*l.value,i.value=f.scrollLeft*100/v*u.value}},update:()=>{const f=r==null?void 0:r.wrapElement;if(!f)return;const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo,g=h**2/f.scrollHeight,m=v**2/f.scrollWidth,y=Math.max(g,n.minSize),x=Math.max(m,n.minSize);l.value=g/(h-g)/(y/(h-y)),u.value=m/(v-m)/(x/(v-x)),s.value=y+Eo<h?`${y}px`:"",a.value=x+Eo<v?`${x}px`:""}}),(f,h)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(Hm,{move:i.value,ratio:u.value,size:a.value,always:f.always},null,8,["move","ratio","size","always"]),p.createVNode(Hm,{move:o.value,ratio:l.value,size:s.value,vertical:"",always:f.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const fI=sl({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:QL([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...oI(["ariaLabel","ariaOrientation"])}),pI={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xo)},Cd="ElScrollbar",hI=p.defineComponent({name:Cd}),gI=p.defineComponent({...hI,props:fI,emits:pI,setup(t,{expose:e,emit:n}){const r=t,i=th("scrollbar");let o,a,s=0,l=0;const u=p.ref(),c=p.ref(),d=p.ref(),f=p.ref(),h=p.computed(()=>{const T={};return r.height&&(T.height=$m(r.height)),r.maxHeight&&(T.maxHeight=$m(r.maxHeight)),[r.wrapStyle,T]}),v=p.computed(()=>[r.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!r.native}]),g=p.computed(()=>[i.e("view"),r.viewClass]),m=()=>{var T;c.value&&((T=f.value)==null||T.handleScroll(c.value),s=c.value.scrollTop,l=c.value.scrollLeft,n("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function y(T,A){ac(T)?c.value.scrollTo(T):xo(T)&&xo(A)&&c.value.scrollTo(T,A)}const x=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollTop=T},E=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollLeft=T},b=()=>{var T;(T=f.value)==null||T.update()};return p.watch(()=>r.noresize,T=>{T?(o==null||o(),a==null||a()):({stop:o}=GL(d,b),a=xd("resize",b))},{immediate:!0}),p.watch(()=>[r.maxHeight,r.height],()=>{r.native||p.nextTick(()=>{var T;b(),c.value&&((T=f.value)==null||T.handleScroll(c.value))})}),p.provide(Sd,p.reactive({scrollbarElement:u,wrapElement:c})),p.onActivated(()=>{c.value&&(c.value.scrollTop=s,c.value.scrollLeft=l)}),p.onMounted(()=>{r.native||p.nextTick(()=>{b()})}),p.onUpdated(()=>b()),e({wrapRef:c,update:b,scrollTo:y,setScrollTop:x,setScrollLeft:E,handleScroll:m}),(T,A)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:p.normalizeClass(p.unref(i).b())},[p.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:p.normalizeClass(p.unref(v)),style:p.normalizeStyle(p.unref(h)),tabindex:T.tabindex,onScroll:m},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(T.tag),{id:T.id,ref_key:"resizeRef",ref:d,class:p.normalizeClass(p.unref(g)),style:p.normalizeStyle(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:p.withCtx(()=>[p.renderSlot(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(dI,{key:0,ref_key:"barRef",ref:f,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var vI=wd(gI,[["__file","scrollbar.vue"]]);const zm=rI(vI);function Zn(t,e){mI(t)&&(t="100%");var n=yI(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function mI(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function yI(t){return typeof t=="string"&&t.indexOf("%")!==-1}function _I(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ll(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Ad(t){return t.length===1?"0"+t:String(t)}function bI(t,e,n){return{r:Zn(t,255)*255,g:Zn(e,255)*255,b:Zn(n,255)*255}}function Od(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xI(t,e,n){var r,i,o;if(t=Zn(t,360),e=Zn(e,100),n=Zn(n,100),e===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;r=Od(s,a,t+1/3),i=Od(s,a,t),o=Od(s,a,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function EI(t,e,n){t=Zn(t,255),e=Zn(e,255),n=Zn(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case t:o=(e-n)/s+(e<n?6:0);break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4;break}o/=6}return{h:o,s:l,v:a}}function wI(t,e,n){t=Zn(t,360)*6,e=Zn(e,100),n=Zn(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6,u=[n,a,o,o,s,n][l],c=[s,n,n,a,o,o][l],d=[o,o,s,n,n,a][l];return{r:u*255,g:c*255,b:d*255}}function SI(t,e,n,r){var i=[Ad(Math.round(t).toString(16)),Ad(Math.round(e).toString(16)),Ad(Math.round(n).toString(16))];return i.join("")}function Wm(t){return jn(t)/255}function jn(t){return parseInt(t,16)}var Um={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _a(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=OI(t)),typeof t=="object"&&(Jr(t.r)&&Jr(t.g)&&Jr(t.b)?(e=bI(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Jr(t.h)&&Jr(t.s)&&Jr(t.v)?(r=ll(t.s),i=ll(t.v),e=wI(t.h,r,i),a=!0,s="hsv"):Jr(t.h)&&Jr(t.s)&&Jr(t.l)&&(r=ll(t.s),o=ll(t.l),e=xI(t.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=_I(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var CI="[-\\+]?\\d+%?",AI="[-\\+]?\\d*\\.\\d+%?",mi="(?:".concat(AI,")|(?:").concat(CI,")"),Td="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),Nd="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),fr={CSS_UNIT:new RegExp(mi),rgb:new RegExp("rgb"+Td),rgba:new RegExp("rgba"+Nd),hsl:new RegExp("hsl"+Td),hsla:new RegExp("hsla"+Nd),hsv:new RegExp("hsv"+Td),hsva:new RegExp("hsva"+Nd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function OI(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Um[t])t=Um[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=fr.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=fr.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=fr.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=fr.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=fr.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=fr.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=fr.hex8.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:Wm(n[4]),format:e?"name":"hex8"}:(n=fr.hex6.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:e?"name":"hex"}:(n=fr.hex4.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),a:Wm(n[4]+n[4]),format:e?"name":"hex8"}:(n=fr.hex3.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Jr(t){return!!fr.CSS_UNIT.exec(String(t))}function ul(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TI(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?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(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}const cl=Symbol("wf-bus"),NI={class:"wrapper"},MI={class:"content"},DI=["textContent"],PI=p.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(t){const e=t,n=p.ref("1"),r=p.ref(),i=p.ref();function o(){var u;if(!((u=e.data)!=null&&u.code))return;const s=n.value,l={code:e.data.code,type:s};Gt.getBpmnDetail(l).then(c=>{c.code===0&&(s==="1"?r.value="data:image/png;base64,"+c.result:i.value=c.result)})}function a(){o()}return p.onMounted(()=>{o()}),(s,l)=>{const u=ie.RadioButton,c=ie.RadioGroup,d=ie.Image;return p.openBlock(),p.createElementBlock("div",NI,[p.createVNode(c,{value:p.unref(n),"onUpdate:value":l[0]||(l[0]=f=>p.isRef(n)?n.value=f:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:p.withCtx(()=>[p.createVNode(u,{value:"1"},{default:p.withCtx(()=>l[1]||(l[1]=[p.createTextVNode("png")])),_:1}),p.createVNode(u,{value:"0"},{default:p.withCtx(()=>l[2]||(l[2]=[p.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),p.createElementVNode("div",MI,[p.unref(n)==="1"?(p.openBlock(),p.createBlock(d,{key:0,src:p.unref(r)},null,8,["src"])):(p.openBlock(),p.createElementBlock("span",{key:1,textContent:p.toDisplayString(p.unref(i))},null,8,DI))])])}}}),Qr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},RI=Qr(PI,[["__scopeId","data-v-248c7b10"]]),LI={class:"panel-left"},II={class:"title"},kI={class:"search-box"},BI={key:2,class:"btns-action"},jI=Qr(p.defineComponent({__name:"BusTypeList",setup(t){const{t:e}=Dn.useI18n(),n=p.ref(),r=p.ref([]),i=p.ref([]),o=p.ref([]),a=p.ref(!0);function s(){var M;o.value=[],r.value=[],i.value=[],(M=v.value)==null||M.reset(),u()}function l(M){if(!Array.isArray(M)||M.length===0)return M||[];function C(G){if(!G||typeof G!="object")return G;const K={...G};return K.title!==void 0&&K.key!==void 0&&(K.title=e(`temp.title${K.key}`)),Array.isArray(K.children)&&K.children.length>0&&(K.children=K.children.map(C)),K}return M.map(C)}function u(M){const C={sync:!0};n.value&&Object.assign(C,{description:n.value}),Gt.getBusTypeTree(C).then(G=>{var K;if(G.code===0){const J=G.result||[];o.value=l(J),J.length&&(r.value=[J[0].key],(K=J[0].children)!=null&&K.length&&(i.value=[J[0].children[0].key],a.value=J[0].children[0].type=="1",g()))}})}const c=p.inject(cl);function d(M,C){C.selected&&C.node.dataRef.isLeaf&&(i.value=M,a.value=C.node.dataRef.type=="1",g())}const f=p.ref([{title:e("bpmn.version"),dataIndex:"version",width:100},{title:e("bpmn.description"),dataIndex:"description",width:250},{title:e("bpmn.used"),dataIndex:"used",width:130},{title:e("bpmn.status"),dataIndex:"status",width:130},{title:e("bpmn.action"),key:"action",width:200,fixed:"right"}]);function h(M){const C={type:i.value[0]};return Object.assign(C,M),Gt.getBpmnList(C)}const v=p.ref(),g=()=>{var M;(M=v.value)==null||M.refresh()},{message:m,modal:y}=Wt.App.useApp();function x(M,C){y.confirm({title:e("button._006_msg1"),content:e(C==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const G={code:M.code,status:C};Gt.switchBpmnStatus(G).then(K=>{K.code===0&&(g(),m.success(e("common.successTip")))})}})}function E(){c.emit("changeComp",{comp:"BpmnEditPage",opType:"1",type:i.value[0],isApproval:a.value})}function b(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"2",code:M.code,type:M.type,isApproval:a.value})}function T(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"3",type:i.value[0],code:M.code,isApproval:a.value})}function A(M){y.confirm({title:e("button._006_msg1"),content:e("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const C={code:M.code};Gt.delBpmn(C).then(G=>{G.code===0&&(g(),m.success(e("common.successTip")))})}})}function S(M){y.info({title:e("wo_list.btn_chart"),content:p.h(RI,{data:M}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return p.onMounted(()=>{s(),p.onActivated(()=>{var M;(M=v.value)==null||M.loadData()})}),(M,C)=>{const G=ie.InputSearch,K=ie.Tree,J=ie.Empty,R=zm,k=ie.Button,B=ie.Space,Z=yE,ee=ie.Switch,ce=p.resolveComponent("a-table-ex"),Be=p.resolveComponent("wl-splitter"),me=p.resolveDirective("permission");return p.openBlock(),p.createBlock(Be,{bordered:!1},{left:p.withCtx(()=>[p.createElementVNode("div",LI,[p.createElementVNode("div",II,p.toDisplayString(M.$t("bpmn.list_title")),1),p.createElementVNode("div",kI,[p.createVNode(G,{value:p.unref(n),"onUpdate:value":C[0]||(C[0]=de=>p.isRef(n)?n.value=de:null),placeholder:M.$t("bpmn.type_placeholder"),onSearch:s},null,8,["value","placeholder"])]),p.createVNode(R,{class:"tree-wrapper"},{default:p.withCtx(()=>{var de;return[(de=p.unref(o))!=null&&de.length?(p.openBlock(),p.createBlock(K,{key:0,expandedKeys:p.unref(r),"onUpdate:expandedKeys":C[1]||(C[1]=Se=>p.isRef(r)?r.value=Se:null),selectedKeys:p.unref(i),"tree-data":p.unref(o),showLine:!0,onSelect:d},null,8,["expandedKeys","selectedKeys","tree-data"])):(p.openBlock(),p.createBlock(J,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:p.withCtx(()=>[p.createVNode(B,{class:"ml-lg my-nm"},{default:p.withCtx(()=>[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"primary",onClick:E},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.add_workflow")),1)]),_:1})),[[me,"002"]])]),_:1}),p.createVNode(ce,{ref_key:"tableEx",ref:v,class:"table-query bordered mx-lg",columns:p.unref(f),scroll:{x:1100},loadData:h},{bodyCell:p.withCtx(({column:de,record:Se,text:je})=>[de.dataIndex==="used"?(p.openBlock(),p.createBlock(Z,{key:0,type:"BPMN_USED",value:je},null,8,["value"])):p.createCommentVNode("",!0),de.dataIndex==="status"?(p.openBlock(),p.createBlock(ee,{key:1,checked:je,checkedValue:"0",unCheckedValue:"1",disabled:!p.unref(bs.hasPermission)("006"),onChange:he=>x(Se,he)},null,8,["checked","disabled","onChange"])):p.createCommentVNode("",!0),de.key==="action"?(p.openBlock(),p.createElementBlock("div",BI,[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>b(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[me,"003"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>A(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[me,"004"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>S(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[me,"005"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>T(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[me,"002"]])])):p.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-8a3cde47"]]);var dl,qe,Vm,Wi,Xm,Gm,Ym,Km,Md,Dd,Pd,ba={},qm=[],FI=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xa=Array.isArray;function ei(t,e){for(var n in e)t[n]=e[n];return t}function Rd(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Te(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?dl.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]==null&&(a[o]=t.defaultProps[o]);return fl(t,a,r,i,null)}function fl(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Vm,__i:-1,__u:0};return i==null&&qe.vnode!=null&&qe.vnode(o),o}function pl(){return{current:null}}function wo(t){return t.children}function Qe(t,e){this.props=t,this.context=e}function So(t,e){if(e==null)return t.__?So(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?So(t):null}function Zm(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Zm(t)}}function Jm(t){(!t.__d&&(t.__d=!0)&&Wi.push(t)&&!hl.__r++||Xm!=qe.debounceRendering)&&((Xm=qe.debounceRendering)||Gm)(hl)}function hl(){for(var t,e,n,r,i,o,a,s=1;Wi.length;)Wi.length>s&&Wi.sort(Ym),t=Wi.shift(),s=Wi.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,o=[],a=[],e.__P&&((n=ei({},r)).__v=r.__v+1,qe.vnode&&qe.vnode(n),Ld(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??So(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,ry(o,n,a),n.__e!=i&&Zm(n)));hl.__r=0}function Qm(t,e,n,r,i,o,a,s,l,u,c){var d,f,h,v,g,m,y=r&&r.__k||qm,x=e.length;for(l=$I(n,e,y,l,x),d=0;d<x;d++)(h=n.__k[d])!=null&&(f=h.__i==-1?ba:y[h.__i]||ba,h.__i=d,m=Ld(t,h,f,i,o,a,s,l,u,c),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Id(f.ref,null,h),c.push(h.ref,h.__c||v,h)),g==null&&v!=null&&(g=v),4&h.__u||f.__k===h.__k?l=ey(h,l,t):typeof h.type=="function"&&m!==void 0?l=m:v&&(l=v.nextSibling),h.__u&=-7);return n.__e=g,l}function $I(t,e,n,r,i){var o,a,s,l,u,c=n.length,d=c,f=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+f,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?fl(null,a,null,null,null):xa(a)?fl(wo,{children:a},null,null,null):a.constructor==null&&a.__b>0?fl(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,s=null,(u=a.__i=HI(a,n,l,d))!=-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>c?f--:i<c&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?f--:u==l+1?f++:(u>l?f--:f++,a.__u|=4))):t.__k[o]=null;if(d)for(o=0;o<c;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=So(s)),oy(s,s));return r}function ey(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=ey(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=So(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gl(t,e){return e=e||[],t==null||typeof t=="boolean"||(xa(t)?t.some(function(n){gl(n,e)}):e.push(t)),e}function HI(t,e,n,r){var i,o,a=t.key,s=t.type,l=e[n];if(l===null&&t.key==null||l&&a==l.key&&s==l.type&&(2&l.__u)==0)return n;if(r>(l!=null&&(2&l.__u)==0?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&(2&l.__u)==0&&a==l.key&&s==l.type)return i;i--}if(o<e.length){if((l=e[o])&&(2&l.__u)==0&&a==l.key&&s==l.type)return o;o++}}return-1}function ty(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||FI.test(e)?n:n+"px"}function vl(t,e,n,r,i){var o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ty(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ty(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Km,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Md,t.addEventListener(e,o?Pd:Dd,o)):t.removeEventListener(e,o?Pd:Dd,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ny(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Md++;else if(e.t<n.u)return;return n(qe.event?qe.event(e):e)}}}function Ld(t,e,n,r,i,o,a,s,l,u){var c,d,f,h,v,g,m,y,x,E,b,T,A,S,M,C,G,K=e.type;if(e.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),o=[s=e.__e=n.__e]),(c=qe.__b)&&c(e);e:if(typeof K=="function")try{if(y=e.props,x="prototype"in K&&K.prototype.render,E=(c=K.contextType)&&r[c.__c],b=c?E?E.props.value:c.__:r,n.__c?m=(d=e.__c=n.__c).__=d.__E:(x?e.__c=d=new K(y,b):(e.__c=d=new Qe(y,b),d.constructor=K,d.render=WI),E&&E.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&K.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ei({},d.__s)),ei(d.__s,K.getDerivedStateFromProps(y,d.__s))),h=d.props,v=d.state,d.__v=e,f)x&&K.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&K.getDerivedStateFromProps==null&&y!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,b),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,b)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(J){J&&(J.__=e)}),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,b),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,v,g)})}if(d.context=b,d.props=y,d.__P=t,d.__e=!1,A=qe.__r,S=0,x){for(d.state=d.__s,d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[]}else do d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=ei(ei({},r),d.getChildContext())),x&&!f&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(h,v)),C=c,c!=null&&c.type===wo&&c.key==null&&(C=iy(c.props.children)),s=Qm(t,xa(C)?C:[C],e,n,r,i,o,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(J){if(e.__v=null,l||o!=null)if(J.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else for(G=o.length;G--;)Rd(o[G]);else e.__e=n.__e,e.__k=n.__k;qe.__e(J,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=zI(n.__e,e,n,r,i,o,a,l,u);return(c=qe.diffed)&&c(e),128&e.__u?void 0:s}function ry(t,e,n){for(var r=0;r<n.length;r++)Id(n[r],n[++r],n[++r]);qe.__c&&qe.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){qe.__e(o,i.__v)}})}function iy(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:xa(t)?t.map(iy):ei({},t)}function zI(t,e,n,r,i,o,a,s,l){var u,c,d,f,h,v,g,m=n.props,y=e.props,x=e.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!x&&(x?h.localName==x:h.nodeType==3)){t=h,o[u]=null;break}}if(t==null){if(x==null)return document.createTextNode(y);t=document.createElementNS(i,x,y.is&&y),s&&(qe.__m&&qe.__m(e,o),s=!1),o=null}if(x==null)m===y||s&&t.data==y||(t.data=y);else{if(o=o&&dl.call(t.childNodes),m=n.props||ba,!s&&o!=null)for(m={},u=0;u<t.attributes.length;u++)m[(h=t.attributes[u]).name]=h.value;for(u in m)if(h=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=h;else if(!(u in y)){if(u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y)continue;vl(t,u,null,h,i)}}for(u in y)h=y[u],u=="children"?f=h:u=="dangerouslySetInnerHTML"?c=h:u=="value"?v=h:u=="checked"?g=h:s&&typeof h!="function"||m[u]===h||vl(t,u,h,m[u],i);if(c)s||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Qm(e.type=="template"?t.content:t,xa(f)?f:[f],e,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&So(n,0),s,l),o!=null)for(u=o.length;u--;)Rd(o[u]);s||(u="value",x=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[u]||x=="progress"&&!v||x=="option"&&v!=m[u])&&vl(t,u,v,m[u],i),u="checked",g!=null&&g!=t[u]&&vl(t,u,g,m[u],i))}return t}function Id(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){qe.__e(i,n)}}function oy(t,e,n){var r,i;if(qe.unmount&&qe.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Id(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){qe.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&oy(r[i],e,n||typeof t.type!="function");n||Rd(t.__e),t.__c=t.__=t.__e=void 0}function WI(t,e,n){return this.constructor(t,n)}function UI(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),qe.__&&qe.__(t,e),i=(r=!1)?null:e.__k,o=[],a=[],Ld(e,t=e.__k=Te(wo,null,[t]),i||ba,ba,e.namespaceURI,i?null:e.firstChild?dl.call(e.childNodes):null,o,i?i.__e:e.firstChild,r,a),ry(o,t,a)}dl=qm.slice,qe={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(s){t=s}throw t}},Vm=0,Qe.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ei({},this.state),typeof t=="function"&&(t=t(ei({},n),this.props)),t&&ei(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Jm(this))},Qe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Jm(this))},Qe.prototype.render=wo,Wi=[],Gm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ym=function(t,e){return t.__v.__b-e.__v.__b},hl.__r=0,Km=/(PointerCapture)$|Capture$/i,Md=0,Dd=ny(!1),Pd=ny(!0);var VI="An invariant failed, however the error is obfuscated because this is a production build.",ml=[];Object.freeze(ml);var kd={};Object.freeze(kd);function On(){return++pe.mobxGuid}function He(t){throw Mt(!1,t),"X"}function Mt(t,e){if(!t)throw new Error("[mobx] "+(e||VI))}var ay=[];function XI(t,e){return process.env.NODE_ENV==="production"||ay.indexOf(t)!==-1?!1:(ay.push(t),console.error("[mobx] Deprecated: "+t),!0)}function Bd(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var yl=function(){};function GI(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function jd(t){return t!==null&&typeof t=="object"}function Ui(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function YI(t){if(Ao(t)||gn(t))return t;if(Array.isArray(t))return new Map(t);if(Ui(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return He("Cannot convert to map from '"+t+"'")}function Co(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function KI(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function sy(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable!==!1&&n.writable!==!1}function qI(t,e){process.env.NODE_ENV!=="production"&&!sy(t,e)&&He("Cannot make property '"+e.toString()+"' observable, it is not configurable and writable in the target object")}function yi(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return jd(r)&&r[n]===!0}}function Ao(t){return t instanceof Map}function Ea(t){return t instanceof Set}function Fd(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach(function(r){Object.getOwnPropertyDescriptor(t,r).enumerable&&e.add(r)}),Array.from(e)}function Jn(t){return t&&t.toString?t.toString():new String(t).toString()}function ly(t){return t===null?null:typeof t=="object"?""+t:t}var ZI=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ke=Symbol("mobx administration"),Oo=function(){function t(e){e===void 0&&(e="Atom@"+On()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=vt.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.reportObserved=function(){return Ey(this)},t.prototype.reportChanged=function(){gr(),Ek(this),vr()},t.prototype.toString=function(){return this.name},t}(),$d=yi("Atom",Oo);function Hd(t,e,n){e===void 0&&(e=yl),n===void 0&&(n=yl);var r=new Oo(t);return e!==yl&&Bk(r,e),n!==yl&&My(r,n),r}function JI(t,e){return Yy(t,e)}function QI(t,e){return Object.is(t,e)}var To={structural:JI,default:QI};/*! *****************************************************************************
32
+ */var DL="4.17.21",PL=2,RL=1,LL=3,wm=4294967295,IL=Array.prototype,kL=Object.prototype,Sm=kL.hasOwnProperty,Cm=on?on.iterator:void 0,BL=Math.max,Am=Math.min,_d=function(t){return function(e,n,r){if(r==null){var i=Rt(n),o=i&&Vt(n),a=o&&o.length&&Ys(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(DD);O.after=kt.after,O.ary=kt.ary,O.assign=$e.assign,O.assignIn=$e.assignIn,O.assignInWith=$e.assignInWith,O.assignWith=$e.assignWith,O.at=$e.at,O.before=kt.before,O.bind=kt.bind,O.bindAll=bt.bindAll,O.bindKey=kt.bindKey,O.castArray=De.castArray,O.chain=Rr.chain,O.chunk=xe.chunk,O.compact=xe.compact,O.concat=xe.concat,O.cond=bt.cond,O.conforms=bt.conforms,O.constant=bt.constant,O.countBy=St.countBy,O.create=$e.create,O.curry=kt.curry,O.curryRight=kt.curryRight,O.debounce=kt.debounce,O.defaults=$e.defaults,O.defaultsDeep=$e.defaultsDeep,O.defer=kt.defer,O.delay=kt.delay,O.difference=xe.difference,O.differenceBy=xe.differenceBy,O.differenceWith=xe.differenceWith,O.drop=xe.drop,O.dropRight=xe.dropRight,O.dropRightWhile=xe.dropRightWhile,O.dropWhile=xe.dropWhile,O.fill=xe.fill,O.filter=St.filter,O.flatMap=St.flatMap,O.flatMapDeep=St.flatMapDeep,O.flatMapDepth=St.flatMapDepth,O.flatten=xe.flatten,O.flattenDeep=xe.flattenDeep,O.flattenDepth=xe.flattenDepth,O.flip=kt.flip,O.flow=bt.flow,O.flowRight=bt.flowRight,O.fromPairs=xe.fromPairs,O.functions=$e.functions,O.functionsIn=$e.functionsIn,O.groupBy=St.groupBy,O.initial=xe.initial,O.intersection=xe.intersection,O.intersectionBy=xe.intersectionBy,O.intersectionWith=xe.intersectionWith,O.invert=$e.invert,O.invertBy=$e.invertBy,O.invokeMap=St.invokeMap,O.iteratee=bt.iteratee,O.keyBy=St.keyBy,O.keys=Vt,O.keysIn=$e.keysIn,O.map=St.map,O.mapKeys=$e.mapKeys,O.mapValues=$e.mapValues,O.matches=bt.matches,O.matchesProperty=bt.matchesProperty,O.memoize=kt.memoize,O.merge=$e.merge,O.mergeWith=$e.mergeWith,O.method=bt.method,O.methodOf=bt.methodOf,O.mixin=_d,O.negate=tl,O.nthArg=bt.nthArg,O.omit=$e.omit,O.omitBy=$e.omitBy,O.once=kt.once,O.orderBy=St.orderBy,O.over=bt.over,O.overArgs=kt.overArgs,O.overEvery=bt.overEvery,O.overSome=bt.overSome,O.partial=kt.partial,O.partialRight=kt.partialRight,O.partition=St.partition,O.pick=$e.pick,O.pickBy=$e.pickBy,O.property=bt.property,O.propertyOf=bt.propertyOf,O.pull=xe.pull,O.pullAll=xe.pullAll,O.pullAllBy=xe.pullAllBy,O.pullAllWith=xe.pullAllWith,O.pullAt=xe.pullAt,O.range=bt.range,O.rangeRight=bt.rangeRight,O.rearg=kt.rearg,O.reject=St.reject,O.remove=xe.remove,O.rest=kt.rest,O.reverse=xe.reverse,O.sampleSize=St.sampleSize,O.set=$e.set,O.setWith=$e.setWith,O.shuffle=St.shuffle,O.slice=xe.slice,O.sortBy=St.sortBy,O.sortedUniq=xe.sortedUniq,O.sortedUniqBy=xe.sortedUniqBy,O.split=mt.split,O.spread=kt.spread,O.tail=xe.tail,O.take=xe.take,O.takeRight=xe.takeRight,O.takeRightWhile=xe.takeRightWhile,O.takeWhile=xe.takeWhile,O.tap=Rr.tap,O.throttle=kt.throttle,O.thru=sl,O.toArray=De.toArray,O.toPairs=$e.toPairs,O.toPairsIn=$e.toPairsIn,O.toPath=bt.toPath,O.toPlainObject=De.toPlainObject,O.transform=$e.transform,O.unary=kt.unary,O.union=xe.union,O.unionBy=xe.unionBy,O.unionWith=xe.unionWith,O.uniq=xe.uniq,O.uniqBy=xe.uniqBy,O.uniqWith=xe.uniqWith,O.unset=$e.unset,O.unzip=xe.unzip,O.unzipWith=xe.unzipWith,O.update=$e.update,O.updateWith=$e.updateWith,O.values=$e.values,O.valuesIn=$e.valuesIn,O.without=xe.without,O.words=mt.words,O.wrap=kt.wrap,O.xor=xe.xor,O.xorBy=xe.xorBy,O.xorWith=xe.xorWith,O.zip=xe.zip,O.zipObject=xe.zipObject,O.zipObjectDeep=xe.zipObjectDeep,O.zipWith=xe.zipWith,O.entries=$e.toPairs,O.entriesIn=$e.toPairsIn,O.extend=$e.assignIn,O.extendWith=$e.assignInWith,_d(O,O),O.add=hn.add,O.attempt=bt.attempt,O.camelCase=mt.camelCase,O.capitalize=mt.capitalize,O.ceil=hn.ceil,O.clamp=yd.clamp,O.clone=De.clone,O.cloneDeep=De.cloneDeep,O.cloneDeepWith=De.cloneDeepWith,O.cloneWith=De.cloneWith,O.conformsTo=De.conformsTo,O.deburr=mt.deburr,O.defaultTo=bt.defaultTo,O.divide=hn.divide,O.endsWith=mt.endsWith,O.eq=De.eq,O.escape=mt.escape,O.escapeRegExp=mt.escapeRegExp,O.every=St.every,O.find=St.find,O.findIndex=xe.findIndex,O.findKey=$e.findKey,O.findLast=St.findLast,O.findLastIndex=xe.findLastIndex,O.findLastKey=$e.findLastKey,O.floor=hn.floor,O.forEach=St.forEach,O.forEachRight=St.forEachRight,O.forIn=$e.forIn,O.forInRight=$e.forInRight,O.forOwn=$e.forOwn,O.forOwnRight=$e.forOwnRight,O.get=$e.get,O.gt=De.gt,O.gte=De.gte,O.has=$e.has,O.hasIn=$e.hasIn,O.head=xe.head,O.identity=wn,O.includes=St.includes,O.indexOf=xe.indexOf,O.inRange=yd.inRange,O.invoke=$e.invoke,O.isArguments=De.isArguments,O.isArray=We,O.isArrayBuffer=De.isArrayBuffer,O.isArrayLike=De.isArrayLike,O.isArrayLikeObject=De.isArrayLikeObject,O.isBoolean=De.isBoolean,O.isBuffer=De.isBuffer,O.isDate=De.isDate,O.isElement=De.isElement,O.isEmpty=De.isEmpty,O.isEqual=De.isEqual,O.isEqualWith=De.isEqualWith,O.isError=De.isError,O.isFinite=De.isFinite,O.isFunction=De.isFunction,O.isInteger=De.isInteger,O.isLength=De.isLength,O.isMap=De.isMap,O.isMatch=De.isMatch,O.isMatchWith=De.isMatchWith,O.isNaN=De.isNaN,O.isNative=De.isNative,O.isNil=De.isNil,O.isNull=De.isNull,O.isNumber=De.isNumber,O.isObject=Rt,O.isObjectLike=De.isObjectLike,O.isPlainObject=De.isPlainObject,O.isRegExp=De.isRegExp,O.isSafeInteger=De.isSafeInteger,O.isSet=De.isSet,O.isString=De.isString,O.isSymbol=De.isSymbol,O.isTypedArray=De.isTypedArray,O.isUndefined=De.isUndefined,O.isWeakMap=De.isWeakMap,O.isWeakSet=De.isWeakSet,O.join=xe.join,O.kebabCase=mt.kebabCase,O.last=kn,O.lastIndexOf=xe.lastIndexOf,O.lowerCase=mt.lowerCase,O.lowerFirst=mt.lowerFirst,O.lt=De.lt,O.lte=De.lte,O.max=hn.max,O.maxBy=hn.maxBy,O.mean=hn.mean,O.meanBy=hn.meanBy,O.min=hn.min,O.minBy=hn.minBy,O.stubArray=bt.stubArray,O.stubFalse=bt.stubFalse,O.stubObject=bt.stubObject,O.stubString=bt.stubString,O.stubTrue=bt.stubTrue,O.multiply=hn.multiply,O.nth=xe.nth,O.noop=bt.noop,O.now=xL.now,O.pad=mt.pad,O.padEnd=mt.padEnd,O.padStart=mt.padStart,O.parseInt=mt.parseInt,O.random=yd.random,O.reduce=St.reduce,O.reduceRight=St.reduceRight,O.repeat=mt.repeat,O.replace=mt.replace,O.result=$e.result,O.round=hn.round,O.sample=St.sample,O.size=St.size,O.snakeCase=mt.snakeCase,O.some=St.some,O.sortedIndex=xe.sortedIndex,O.sortedIndexBy=xe.sortedIndexBy,O.sortedIndexOf=xe.sortedIndexOf,O.sortedLastIndex=xe.sortedLastIndex,O.sortedLastIndexBy=xe.sortedLastIndexBy,O.sortedLastIndexOf=xe.sortedLastIndexOf,O.startCase=mt.startCase,O.startsWith=mt.startsWith,O.subtract=hn.subtract,O.sum=hn.sum,O.sumBy=hn.sumBy,O.template=mt.template,O.times=bt.times,O.toFinite=De.toFinite,O.toInteger=Ke,O.toLength=De.toLength,O.toLower=mt.toLower,O.toNumber=De.toNumber,O.toSafeInteger=De.toSafeInteger,O.toString=De.toString,O.toUpper=mt.toUpper,O.trim=mt.trim,O.trimEnd=mt.trimEnd,O.trimStart=mt.trimStart,O.truncate=mt.truncate,O.unescape=mt.unescape,O.uniqueId=bt.uniqueId,O.upperCase=mt.upperCase,O.upperFirst=mt.upperFirst,O.each=St.forEach,O.eachRight=St.forEachRight,O.first=xe.head,_d(O,function(){var t={};return Dr(O,function(e,n){Sm.call(O.prototype,n)||(t[n]=e)}),t}(),{chain:!1}),O.VERSION=DL,(O.templateSettings=mt.templateSettings).imports._=O,Gn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){O[t].placeholder=O}),Gn(["drop","take"],function(t,e){ot.prototype[t]=function(n){n=n===void 0?1:BL(Ke(n),0);var r=this.__filtered__&&!e?new ot(this):this.clone();return r.__filtered__?r.__takeCount__=Am(n,r.__takeCount__):r.__views__.push({size:Am(n,wm),type:t+(r.__dir__<0?"Right":"")}),r},ot.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),Gn(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==RL||n==LL;ot.prototype[t]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Ue(i),type:n}),o.__filtered__=o.__filtered__||r,o}}),Gn(["head","last"],function(t,e){var n="take"+(e?"Right":"");ot.prototype[t]=function(){return this[n](1).value()[0]}}),Gn(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");ot.prototype[t]=function(){return this.__filtered__?new ot(this):this[n](1)}}),ot.prototype.compact=function(){return this.filter(wn)},ot.prototype.find=function(t){return this.filter(t).head()},ot.prototype.findLast=function(t){return this.reverse().find(t)},ot.prototype.invokeMap=Je(function(t,e){return typeof t=="function"?new ot(this):this.map(function(n){return ma(n,t,e)})}),ot.prototype.reject=function(t){return this.filter(tl(Ue(t)))},ot.prototype.slice=function(t,e){t=Ke(t);var n=this;return n.__filtered__&&(t>0||e<0)?new ot(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=Ke(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},ot.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},ot.prototype.toArray=function(){return this.take(wm)},Dr(ot.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=O[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(O.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,l=a instanceof ot,u=s[0],c=l||We(a),d=function(y){var x=i.apply(O,ci([y],s));return r&&f?x[0]:x};c&&n&&typeof u=="function"&&u.length!=1&&(l=c=!1);var f=this.__chain__,h=!!this.__actions__.length,v=o&&!f,g=l&&!h;if(!o&&c){a=g?a:new ot(this);var m=t.apply(a,s);return m.__actions__.push({func:sl,args:[d],thisArg:void 0}),new Xn(m,f)}return v&&g?t.apply(this,s):(m=this.thru(d),v?r?m.value()[0]:m.value():m)})}),Gn(["pop","push","shift","sort","splice","unshift"],function(t){var e=IL[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);O.prototype[t]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(We(o)?o:[],i)}return this[n](function(a){return e.apply(We(a)?a:[],i)})}}),Dr(ot.prototype,function(t,e){var n=O[e];if(n){var r=n.name+"";Sm.call(uo,r)||(uo[r]=[]),uo[r].push({name:e,func:n})}}),uo[Rs(void 0,PL).name]=[{name:"wrapper",func:void 0}],ot.prototype.clone=EL,ot.prototype.reverse=wL,ot.prototype.value=ML,O.prototype.at=Rr.at,O.prototype.chain=Rr.wrapperChain,O.prototype.commit=Rr.commit,O.prototype.next=Rr.next,O.prototype.plant=Rr.plant,O.prototype.reverse=Rr.reverse,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=Rr.value,O.prototype.first=O.prototype.head,Cm&&(O.prototype[Cm]=Rr.toIterator);const xo=t=>typeof t=="number",jL=t=>oc(t)?!Number.isNaN(Number(t)):!1;var Om;const bd=typeof window<"u",FL=t=>typeof t=="string",$L=()=>{};bd&&((Om=window==null?void 0:window.navigator)!=null&&Om.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Tm(t){return typeof t=="function"?t():p.unref(t)}function HL(t){return t}function Nm(t){return p.getCurrentScope()?(p.onScopeDispose(t),!0):!1}function zL(t,e=!0){p.getCurrentInstance()?p.onMounted(t):e?t():p.nextTick(t)}function Mm(t){var e;const n=Tm(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Dm=bd?window:void 0;function xd(...t){let e,n,r,i;if(FL(t[0])||Array.isArray(t[0])?([n,r,i]=t,e=Dm):[e,n,r,i]=t,!e)return $L;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),l=p.watch(()=>[Mm(e),Tm(i)],([c,d])=>{a(),c&&o.push(...n.flatMap(f=>r.map(h=>s(c,f,h,d))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Nm(u),u}function WL(t,e=!1){const n=p.ref(),r=()=>n.value=!!t();return r(),zL(r,e),n}const Pm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Rm="__vueuse_ssr_handlers__";Pm[Rm]=Pm[Rm]||{};var Lm=Object.getOwnPropertySymbols,UL=Object.prototype.hasOwnProperty,VL=Object.prototype.propertyIsEnumerable,XL=(t,e)=>{var n={};for(var r in t)UL.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Lm)for(var r of Lm(t))e.indexOf(r)<0&&VL.call(t,r)&&(n[r]=t[r]);return n};function GL(t,e,n={}){const r=n,{window:i=Dm}=r,o=XL(r,["window"]);let a;const s=WL(()=>i&&"ResizeObserver"in i),l=()=>{a&&(a.disconnect(),a=void 0)},u=p.watch(()=>Mm(t),d=>{l(),s.value&&i&&d&&(a=new ResizeObserver(e),a.observe(d,o))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return Nm(c),{isSupported:s,stop:c}}var Im;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(Im||(Im={}));var YL=Object.defineProperty,km=Object.getOwnPropertySymbols,KL=Object.prototype.hasOwnProperty,qL=Object.prototype.propertyIsEnumerable,Bm=(t,e,n)=>e in t?YL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ZL=(t,e)=>{for(var n in e||(e={}))KL.call(e,n)&&Bm(t,n,e[n]);if(km)for(var n of km(e))qL.call(e,n)&&Bm(t,n,e[n]);return t};ZL({linear:HL},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});class jm extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function JL(t,e){throw new jm(`[${t}] ${e}`)}function Ed(t,e){if(process.env.NODE_ENV!=="production"){const n=oc(t)?new jm(`[${t}] ${e}`):t;console.warn(n)}}const Fm="__epPropKey",QL=t=>t,eI=t=>ac(t)&&!!t[Fm],tI=(t,e)=>{if(!ac(t)||eI(t))return t;const{values:n,required:r,default:i,type:o,validator:a}=t,l={type:o,required:!!r,validator:n||a?u=>{let c=!1,d=[];if(n&&(d=Array.from(n),nh(t,"default")&&d.push(i),c||(c=d.includes(u))),a&&(c||(c=a(u))),!c&&d.length>0){const f=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");p.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`)}return c}:void 0,[Fm]:!0};return nh(t,"default")&&(l.default=i),l},ll=t=>Dv(Object.entries(t).map(([e,n])=>[e,tI(n,e)]));var wd=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const nI="utils/dom/style";function $m(t,e="px"){if(!t)return"";if(xo(t)||jL(t))return`${t}${e}`;if(oc(t))return t;Ed(nI,"binding value must be a string or number")}const rI=(t,e)=>(t.install=n=>{for(const r of[t,...Object.values({})])n.component(r.name,r)},t),iI=ll({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),oI=t=>gi(iI,t),Eo=4,aI={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},sI=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),Sd=Symbol("scrollbarContextKey"),lI=ll({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),uI="Thumb";var Hm=wd(p.defineComponent({__name:"thumb",props:lI,setup(t){const e=t,n=p.inject(Sd),r=th("scrollbar");n||JL(uI,"can not inject scrollbar context");const i=p.ref(),o=p.ref(),a=p.ref({}),s=p.ref(!1);let l=!1,u=!1,c=bd?document.onselectstart:null;const d=p.computed(()=>aI[e.vertical?"vertical":"horizontal"]),f=p.computed(()=>sI({size:e.size,move:e.move,bar:d.value})),h=p.computed(()=>i.value[d.value.offset]**2/n.wrapElement[d.value.scrollSize]/e.ratio/o.value[d.value.offset]),v=A=>{var S;if(A.stopPropagation(),A.ctrlKey||[1,2].includes(A.button))return;(S=window.getSelection())==null||S.removeAllRanges(),m(A);const M=A.currentTarget;M&&(a.value[d.value.axis]=M[d.value.offset]-(A[d.value.client]-M.getBoundingClientRect()[d.value.direction]))},g=A=>{if(!o.value||!i.value||!n.wrapElement)return;const S=Math.abs(A.target.getBoundingClientRect()[d.value.direction]-A[d.value.client]),M=o.value[d.value.offset]/2,C=(S-M)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=C*n.wrapElement[d.value.scrollSize]/100},m=A=>{A.stopImmediatePropagation(),l=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),c=document.onselectstart,document.onselectstart=()=>!1},y=A=>{if(!i.value||!o.value||l===!1)return;const S=a.value[d.value.axis];if(!S)return;const M=(i.value.getBoundingClientRect()[d.value.direction]-A[d.value.client])*-1,C=o.value[d.value.offset]-S,G=(M-C)*100*h.value/i.value[d.value.offset];n.wrapElement[d.value.scroll]=G*n.wrapElement[d.value.scrollSize]/100},x=()=>{l=!1,a.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x),T(),u&&(s.value=!1)},E=()=>{u=!1,s.value=!!e.size},b=()=>{u=!0,s.value=l};p.onBeforeUnmount(()=>{T(),document.removeEventListener("mouseup",x)});const T=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return xd(p.toRef(n,"scrollbarElement"),"mousemove",E),xd(p.toRef(n,"scrollbarElement"),"mouseleave",b),(A,S)=>(p.openBlock(),p.createBlock(p.Transition,{name:p.unref(r).b("fade"),persisted:""},{default:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{ref_key:"instance",ref:i,class:p.normalizeClass([p.unref(r).e("bar"),p.unref(r).is(p.unref(d).key)]),onMousedown:g},[p.createElementVNode("div",{ref_key:"thumb",ref:o,class:p.normalizeClass(p.unref(r).e("thumb")),style:p.normalizeStyle(p.unref(f)),onMousedown:v},null,38)],34),[[p.vShow,A.always||s.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const cI=ll({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var dI=wd(p.defineComponent({__name:"bar",props:cI,setup(t,{expose:e}){const n=t,r=p.inject(Sd),i=p.ref(0),o=p.ref(0),a=p.ref(""),s=p.ref(""),l=p.ref(1),u=p.ref(1);return e({handleScroll:f=>{if(f){const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo;o.value=f.scrollTop*100/h*l.value,i.value=f.scrollLeft*100/v*u.value}},update:()=>{const f=r==null?void 0:r.wrapElement;if(!f)return;const h=f.offsetHeight-Eo,v=f.offsetWidth-Eo,g=h**2/f.scrollHeight,m=v**2/f.scrollWidth,y=Math.max(g,n.minSize),x=Math.max(m,n.minSize);l.value=g/(h-g)/(y/(h-y)),u.value=m/(v-m)/(x/(v-x)),s.value=y+Eo<h?`${y}px`:"",a.value=x+Eo<v?`${x}px`:""}}),(f,h)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(Hm,{move:i.value,ratio:u.value,size:a.value,always:f.always},null,8,["move","ratio","size","always"]),p.createVNode(Hm,{move:o.value,ratio:l.value,size:s.value,vertical:"",always:f.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const fI=ll({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:QL([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...oI(["ariaLabel","ariaOrientation"])}),pI={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(xo)},Cd="ElScrollbar",hI=p.defineComponent({name:Cd}),gI=p.defineComponent({...hI,props:fI,emits:pI,setup(t,{expose:e,emit:n}){const r=t,i=th("scrollbar");let o,a,s=0,l=0;const u=p.ref(),c=p.ref(),d=p.ref(),f=p.ref(),h=p.computed(()=>{const T={};return r.height&&(T.height=$m(r.height)),r.maxHeight&&(T.maxHeight=$m(r.maxHeight)),[r.wrapStyle,T]}),v=p.computed(()=>[r.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!r.native}]),g=p.computed(()=>[i.e("view"),r.viewClass]),m=()=>{var T;c.value&&((T=f.value)==null||T.handleScroll(c.value),s=c.value.scrollTop,l=c.value.scrollLeft,n("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function y(T,A){ac(T)?c.value.scrollTo(T):xo(T)&&xo(A)&&c.value.scrollTo(T,A)}const x=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollTop=T},E=T=>{if(!xo(T)){Ed(Cd,"value must be a number");return}c.value.scrollLeft=T},b=()=>{var T;(T=f.value)==null||T.update()};return p.watch(()=>r.noresize,T=>{T?(o==null||o(),a==null||a()):({stop:o}=GL(d,b),a=xd("resize",b))},{immediate:!0}),p.watch(()=>[r.maxHeight,r.height],()=>{r.native||p.nextTick(()=>{var T;b(),c.value&&((T=f.value)==null||T.handleScroll(c.value))})}),p.provide(Sd,p.reactive({scrollbarElement:u,wrapElement:c})),p.onActivated(()=>{c.value&&(c.value.scrollTop=s,c.value.scrollLeft=l)}),p.onMounted(()=>{r.native||p.nextTick(()=>{b()})}),p.onUpdated(()=>b()),e({wrapRef:c,update:b,scrollTo:y,setScrollTop:x,setScrollLeft:E,handleScroll:m}),(T,A)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:p.normalizeClass(p.unref(i).b())},[p.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:p.normalizeClass(p.unref(v)),style:p.normalizeStyle(p.unref(h)),tabindex:T.tabindex,onScroll:m},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(T.tag),{id:T.id,ref_key:"resizeRef",ref:d,class:p.normalizeClass(p.unref(g)),style:p.normalizeStyle(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:p.withCtx(()=>[p.renderSlot(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?p.createCommentVNode("v-if",!0):(p.openBlock(),p.createBlock(dI,{key:0,ref_key:"barRef",ref:f,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var vI=wd(gI,[["__file","scrollbar.vue"]]);const zm=rI(vI);function Zn(t,e){mI(t)&&(t="100%");var n=yI(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function mI(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function yI(t){return typeof t=="string"&&t.indexOf("%")!==-1}function _I(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ul(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Ad(t){return t.length===1?"0"+t:String(t)}function bI(t,e,n){return{r:Zn(t,255)*255,g:Zn(e,255)*255,b:Zn(n,255)*255}}function Od(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xI(t,e,n){var r,i,o;if(t=Zn(t,360),e=Zn(e,100),n=Zn(n,100),e===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+e):n+e-n*e,s=2*n-a;r=Od(s,a,t+1/3),i=Od(s,a,t),o=Od(s,a,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function EI(t,e,n){t=Zn(t,255),e=Zn(e,255),n=Zn(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case t:o=(e-n)/s+(e<n?6:0);break;case e:o=(n-t)/s+2;break;case n:o=(t-e)/s+4;break}o/=6}return{h:o,s:l,v:a}}function wI(t,e,n){t=Zn(t,360)*6,e=Zn(e,100),n=Zn(n,100);var r=Math.floor(t),i=t-r,o=n*(1-e),a=n*(1-i*e),s=n*(1-(1-i)*e),l=r%6,u=[n,a,o,o,s,n][l],c=[s,n,n,a,o,o][l],d=[o,o,s,n,n,a][l];return{r:u*255,g:c*255,b:d*255}}function SI(t,e,n,r){var i=[Ad(Math.round(t).toString(16)),Ad(Math.round(e).toString(16)),Ad(Math.round(n).toString(16))];return i.join("")}function Wm(t){return jn(t)/255}function jn(t){return parseInt(t,16)}var Um={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _a(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=OI(t)),typeof t=="object"&&(Jr(t.r)&&Jr(t.g)&&Jr(t.b)?(e=bI(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Jr(t.h)&&Jr(t.s)&&Jr(t.v)?(r=ul(t.s),i=ul(t.v),e=wI(t.h,r,i),a=!0,s="hsv"):Jr(t.h)&&Jr(t.s)&&Jr(t.l)&&(r=ul(t.s),o=ul(t.l),e=xI(t.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=_I(n),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var CI="[-\\+]?\\d+%?",AI="[-\\+]?\\d*\\.\\d+%?",mi="(?:".concat(AI,")|(?:").concat(CI,")"),Td="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),Nd="[\\s|\\(]+(".concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")[,|\\s]+(").concat(mi,")\\s*\\)?"),fr={CSS_UNIT:new RegExp(mi),rgb:new RegExp("rgb"+Td),rgba:new RegExp("rgba"+Nd),hsl:new RegExp("hsl"+Td),hsla:new RegExp("hsla"+Nd),hsv:new RegExp("hsv"+Td),hsva:new RegExp("hsva"+Nd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function OI(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Um[t])t=Um[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=fr.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=fr.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=fr.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=fr.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=fr.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=fr.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=fr.hex8.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:Wm(n[4]),format:e?"name":"hex8"}:(n=fr.hex6.exec(t),n?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:e?"name":"hex"}:(n=fr.hex4.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),a:Wm(n[4]+n[4]),format:e?"name":"hex8"}:(n=fr.hex3.exec(t),n?{r:jn(n[1]+n[1]),g:jn(n[2]+n[2]),b:jn(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Jr(t){return!!fr.CSS_UNIT.exec(String(t))}function cl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function TI(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?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(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}const dl=Symbol("wf-bus"),NI={class:"wrapper"},MI={class:"content"},DI=["textContent"],PI=p.defineComponent({__name:"BpmnDetail",props:{data:{type:Object,required:!0}},setup(t){const e=t,n=p.ref("1"),r=p.ref(),i=p.ref();function o(){var u;if(!((u=e.data)!=null&&u.code))return;const s=n.value,l={code:e.data.code,type:s};Gt.getBpmnDetail(l).then(c=>{c.code===0&&(s==="1"?r.value="data:image/png;base64,"+c.result:i.value=c.result)})}function a(){o()}return p.onMounted(()=>{o()}),(s,l)=>{const u=ie.RadioButton,c=ie.RadioGroup,d=ie.Image;return p.openBlock(),p.createElementBlock("div",NI,[p.createVNode(c,{value:p.unref(n),"onUpdate:value":l[0]||(l[0]=f=>p.isRef(n)?n.value=f:null),class:"flex-ec mr-sm mt-sm",onChange:a},{default:p.withCtx(()=>[p.createVNode(u,{value:"1"},{default:p.withCtx(()=>l[1]||(l[1]=[p.createTextVNode("png")])),_:1}),p.createVNode(u,{value:"0"},{default:p.withCtx(()=>l[2]||(l[2]=[p.createTextVNode("xml")])),_:1})]),_:1},8,["value"]),p.createElementVNode("div",MI,[p.unref(n)==="1"?(p.openBlock(),p.createBlock(d,{key:0,src:p.unref(r)},null,8,["src"])):(p.openBlock(),p.createElementBlock("span",{key:1,textContent:p.toDisplayString(p.unref(i))},null,8,DI))])])}}}),Qr=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},RI=Qr(PI,[["__scopeId","data-v-248c7b10"]]),LI={class:"panel-left"},II={class:"title"},kI={class:"search-box"},BI={key:2,class:"btns-action"},jI=Qr(p.defineComponent({__name:"BusTypeList",setup(t){const{t:e}=Dn.useI18n(),n=p.ref(),r=p.ref([]),i=p.ref([]),o=p.ref([]),a=p.ref(!0);function s(){var M;o.value=[],r.value=[],i.value=[],(M=v.value)==null||M.reset(),u()}function l(M){if(!Array.isArray(M)||M.length===0)return M||[];function C(G){if(!G||typeof G!="object")return G;const K={...G};return K.title!==void 0&&K.key!==void 0&&(K.title=e(`temp.title${K.key}`)),Array.isArray(K.children)&&K.children.length>0&&(K.children=K.children.map(C)),K}return M.map(C)}function u(M){const C={sync:!0};n.value&&Object.assign(C,{description:n.value}),Gt.getBusTypeTree(C).then(G=>{var K;if(G.code===0){const J=G.result||[];o.value=l(J),J.length&&(r.value=[J[0].key],(K=J[0].children)!=null&&K.length&&(i.value=[J[0].children[0].key],a.value=J[0].children[0].type=="1",g()))}})}const c=p.inject(dl);function d(M,C){C.selected&&C.node.dataRef.isLeaf&&(i.value=M,a.value=C.node.dataRef.type=="1",g())}const f=p.ref([{title:e("bpmn.version"),dataIndex:"version",width:100},{title:e("bpmn.description"),dataIndex:"description",width:250},{title:e("bpmn.used"),dataIndex:"used",width:130},{title:e("bpmn.status"),dataIndex:"status",width:130},{title:e("bpmn.action"),key:"action",width:200,fixed:"right"}]);function h(M){const C={type:i.value[0]};return Object.assign(C,M),Gt.getBpmnList(C)}const v=p.ref(),g=()=>{var M;(M=v.value)==null||M.refresh()},{message:m,modal:y}=Ht.App.useApp();function x(M,C){y.confirm({title:e("button._006_msg1"),content:e(C==="0"?"button._006_msg2":"button._006_msg3"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const G={code:M.code,status:C};Gt.switchBpmnStatus(G).then(K=>{K.code===0&&(g(),m.success(e("common.successTip")))})}})}function E(){c.emit("changeComp",{comp:"BpmnEditPage",opType:"1",type:i.value[0],isApproval:a.value})}function b(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"2",code:M.code,type:M.type,isApproval:a.value})}function T(M){c.emit("changeComp",{comp:"BpmnEditPage",opType:"3",type:i.value[0],code:M.code,isApproval:a.value})}function A(M){y.confirm({title:e("button._006_msg1"),content:e("button._004_msg2"),centered:!0,okButtonProps:{danger:!0},onOk:()=>{const C={code:M.code};Gt.delBpmn(C).then(G=>{G.code===0&&(g(),m.success(e("common.successTip")))})}})}function S(M){y.info({title:e("wo_list.btn_chart"),content:p.h(RI,{data:M}),centered:!0,footer:null,icon:null,closable:!0,maskClosable:!0,width:1e3,class:"modal-comp"})}return p.onMounted(()=>{s(),p.onActivated(()=>{var M;(M=v.value)==null||M.loadData()})}),(M,C)=>{const G=ie.InputSearch,K=ie.Tree,J=ie.Empty,R=zm,k=ie.Button,B=ie.Space,Z=yE,ee=ie.Switch,ce=p.resolveComponent("a-table-ex"),Be=p.resolveComponent("wl-splitter"),me=p.resolveDirective("permission");return p.openBlock(),p.createBlock(Be,{bordered:!1},{left:p.withCtx(()=>[p.createElementVNode("div",LI,[p.createElementVNode("div",II,p.toDisplayString(M.$t("bpmn.list_title")),1),p.createElementVNode("div",kI,[p.createVNode(G,{value:p.unref(n),"onUpdate:value":C[0]||(C[0]=de=>p.isRef(n)?n.value=de:null),placeholder:M.$t("bpmn.type_placeholder"),onSearch:s},null,8,["value","placeholder"])]),p.createVNode(R,{class:"tree-wrapper"},{default:p.withCtx(()=>{var de;return[(de=p.unref(o))!=null&&de.length?(p.openBlock(),p.createBlock(K,{key:0,expandedKeys:p.unref(r),"onUpdate:expandedKeys":C[1]||(C[1]=Se=>p.isRef(r)?r.value=Se:null),selectedKeys:p.unref(i),"tree-data":p.unref(o),showLine:!0,onSelect:d},null,8,["expandedKeys","selectedKeys","tree-data"])):(p.openBlock(),p.createBlock(J,{key:1,imageStyle:{height:"64px"}}))]}),_:1})])]),right:p.withCtx(()=>[p.createVNode(B,{class:"ml-lg my-nm"},{default:p.withCtx(()=>[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"primary",onClick:E},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.add_workflow")),1)]),_:1})),[[me,"002"]])]),_:1}),p.createVNode(ce,{ref_key:"tableEx",ref:v,class:"table-query bordered mx-lg",columns:p.unref(f),scroll:{x:1100},loadData:h},{bodyCell:p.withCtx(({column:de,record:Se,text:je})=>[de.dataIndex==="used"?(p.openBlock(),p.createBlock(Z,{key:0,type:"BPMN_USED",value:je},null,8,["value"])):p.createCommentVNode("",!0),de.dataIndex==="status"?(p.openBlock(),p.createBlock(ee,{key:1,checked:je,checkedValue:"0",unCheckedValue:"1",disabled:!p.unref(bs.hasPermission)("006"),onChange:he=>x(Se,he)},null,8,["checked","disabled","onChange"])):p.createCommentVNode("",!0),de.key==="action"?(p.openBlock(),p.createElementBlock("div",BI,[p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>b(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_edit")),1)]),_:2},1032,["onClick"])),[[me,"003"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>A(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("common.btn_del")),1)]),_:2},1032,["onClick"])),[[me,"004"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>S(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("wo_my.btn_detail")),1)]),_:2},1032,["onClick"])),[[me,"005"]]),p.withDirectives((p.openBlock(),p.createBlock(k,{type:"link",onClick:he=>T(Se)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(M.$t("bpmn.btn_clone")),1)]),_:2},1032,["onClick"])),[[me,"002"]])])):p.createCommentVNode("",!0)]),_:1},8,["columns"])]),_:1})}}}),[["__scopeId","data-v-8a3cde47"]]);var fl,qe,Vm,Wi,Xm,Gm,Ym,Km,Md,Dd,Pd,ba={},qm=[],FI=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,xa=Array.isArray;function ei(t,e){for(var n in e)t[n]=e[n];return t}function Rd(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Te(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?fl.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]==null&&(a[o]=t.defaultProps[o]);return pl(t,a,r,i,null)}function pl(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Vm,__i:-1,__u:0};return i==null&&qe.vnode!=null&&qe.vnode(o),o}function hl(){return{current:null}}function wo(t){return t.children}function Qe(t,e){this.props=t,this.context=e}function So(t,e){if(e==null)return t.__?So(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?So(t):null}function Zm(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Zm(t)}}function Jm(t){(!t.__d&&(t.__d=!0)&&Wi.push(t)&&!gl.__r++||Xm!=qe.debounceRendering)&&((Xm=qe.debounceRendering)||Gm)(gl)}function gl(){for(var t,e,n,r,i,o,a,s=1;Wi.length;)Wi.length>s&&Wi.sort(Ym),t=Wi.shift(),s=Wi.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,o=[],a=[],e.__P&&((n=ei({},r)).__v=r.__v+1,qe.vnode&&qe.vnode(n),Ld(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??So(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,ry(o,n,a),n.__e!=i&&Zm(n)));gl.__r=0}function Qm(t,e,n,r,i,o,a,s,l,u,c){var d,f,h,v,g,m,y=r&&r.__k||qm,x=e.length;for(l=$I(n,e,y,l,x),d=0;d<x;d++)(h=n.__k[d])!=null&&(f=h.__i==-1?ba:y[h.__i]||ba,h.__i=d,m=Ld(t,h,f,i,o,a,s,l,u,c),v=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Id(f.ref,null,h),c.push(h.ref,h.__c||v,h)),g==null&&v!=null&&(g=v),4&h.__u||f.__k===h.__k?l=ey(h,l,t):typeof h.type=="function"&&m!==void 0?l=m:v&&(l=v.nextSibling),h.__u&=-7);return n.__e=g,l}function $I(t,e,n,r,i){var o,a,s,l,u,c=n.length,d=c,f=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+f,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?pl(null,a,null,null,null):xa(a)?pl(wo,{children:a},null,null,null):a.constructor==null&&a.__b>0?pl(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,s=null,(u=a.__i=HI(a,n,l,d))!=-1&&(d--,(s=n[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>c?f--:i<c&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?f--:u==l+1?f++:(u>l?f--:f++,a.__u|=4))):t.__k[o]=null;if(d)for(o=0;o<c;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=So(s)),oy(s,s));return r}function ey(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=ey(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=So(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function vl(t,e){return e=e||[],t==null||typeof t=="boolean"||(xa(t)?t.some(function(n){vl(n,e)}):e.push(t)),e}function HI(t,e,n,r){var i,o,a=t.key,s=t.type,l=e[n];if(l===null&&t.key==null||l&&a==l.key&&s==l.type&&(2&l.__u)==0)return n;if(r>(l!=null&&(2&l.__u)==0?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&(2&l.__u)==0&&a==l.key&&s==l.type)return i;i--}if(o<e.length){if((l=e[o])&&(2&l.__u)==0&&a==l.key&&s==l.type)return o;o++}}return-1}function ty(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||FI.test(e)?n:n+"px"}function ml(t,e,n,r,i){var o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ty(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||ty(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Km,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Md,t.addEventListener(e,o?Pd:Dd,o)):t.removeEventListener(e,o?Pd:Dd,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ny(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Md++;else if(e.t<n.u)return;return n(qe.event?qe.event(e):e)}}}function Ld(t,e,n,r,i,o,a,s,l,u){var c,d,f,h,v,g,m,y,x,E,b,T,A,S,M,C,G,K=e.type;if(e.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),o=[s=e.__e=n.__e]),(c=qe.__b)&&c(e);e:if(typeof K=="function")try{if(y=e.props,x="prototype"in K&&K.prototype.render,E=(c=K.contextType)&&r[c.__c],b=c?E?E.props.value:c.__:r,n.__c?m=(d=e.__c=n.__c).__=d.__E:(x?e.__c=d=new K(y,b):(e.__c=d=new Qe(y,b),d.constructor=K,d.render=WI),E&&E.sub(d),d.props=y,d.state||(d.state={}),d.context=b,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&K.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ei({},d.__s)),ei(d.__s,K.getDerivedStateFromProps(y,d.__s))),h=d.props,v=d.state,d.__v=e,f)x&&K.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&K.getDerivedStateFromProps==null&&y!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,b),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,b)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(J){J&&(J.__=e)}),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,b),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,v,g)})}if(d.context=b,d.props=y,d.__P=t,d.__e=!1,A=qe.__r,S=0,x){for(d.state=d.__s,d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[]}else do d.__d=!1,A&&A(e),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=ei(ei({},r),d.getChildContext())),x&&!f&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(h,v)),C=c,c!=null&&c.type===wo&&c.key==null&&(C=iy(c.props.children)),s=Qm(t,xa(C)?C:[C],e,n,r,i,o,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(J){if(e.__v=null,l||o!=null)if(J.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else for(G=o.length;G--;)Rd(o[G]);else e.__e=n.__e,e.__k=n.__k;qe.__e(J,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=zI(n.__e,e,n,r,i,o,a,l,u);return(c=qe.diffed)&&c(e),128&e.__u?void 0:s}function ry(t,e,n){for(var r=0;r<n.length;r++)Id(n[r],n[++r],n[++r]);qe.__c&&qe.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){qe.__e(o,i.__v)}})}function iy(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:xa(t)?t.map(iy):ei({},t)}function zI(t,e,n,r,i,o,a,s,l){var u,c,d,f,h,v,g,m=n.props,y=e.props,x=e.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!x&&(x?h.localName==x:h.nodeType==3)){t=h,o[u]=null;break}}if(t==null){if(x==null)return document.createTextNode(y);t=document.createElementNS(i,x,y.is&&y),s&&(qe.__m&&qe.__m(e,o),s=!1),o=null}if(x==null)m===y||s&&t.data==y||(t.data=y);else{if(o=o&&fl.call(t.childNodes),m=n.props||ba,!s&&o!=null)for(m={},u=0;u<t.attributes.length;u++)m[(h=t.attributes[u]).name]=h.value;for(u in m)if(h=m[u],u!="children"){if(u=="dangerouslySetInnerHTML")d=h;else if(!(u in y)){if(u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y)continue;ml(t,u,null,h,i)}}for(u in y)h=y[u],u=="children"?f=h:u=="dangerouslySetInnerHTML"?c=h:u=="value"?v=h:u=="checked"?g=h:s&&typeof h!="function"||m[u]===h||ml(t,u,h,m[u],i);if(c)s||d&&(c.__html==d.__html||c.__html==t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),Qm(e.type=="template"?t.content:t,xa(f)?f:[f],e,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&So(n,0),s,l),o!=null)for(u=o.length;u--;)Rd(o[u]);s||(u="value",x=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[u]||x=="progress"&&!v||x=="option"&&v!=m[u])&&ml(t,u,v,m[u],i),u="checked",g!=null&&g!=t[u]&&ml(t,u,g,m[u],i))}return t}function Id(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){qe.__e(i,n)}}function oy(t,e,n){var r,i;if(qe.unmount&&qe.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Id(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){qe.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&oy(r[i],e,n||typeof t.type!="function");n||Rd(t.__e),t.__c=t.__=t.__e=void 0}function WI(t,e,n){return this.constructor(t,n)}function UI(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),qe.__&&qe.__(t,e),i=(r=!1)?null:e.__k,o=[],a=[],Ld(e,t=e.__k=Te(wo,null,[t]),i||ba,ba,e.namespaceURI,i?null:e.firstChild?fl.call(e.childNodes):null,o,i?i.__e:e.firstChild,r,a),ry(o,t,a)}fl=qm.slice,qe={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(s){t=s}throw t}},Vm=0,Qe.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ei({},this.state),typeof t=="function"&&(t=t(ei({},n),this.props)),t&&ei(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Jm(this))},Qe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Jm(this))},Qe.prototype.render=wo,Wi=[],Gm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ym=function(t,e){return t.__v.__b-e.__v.__b},gl.__r=0,Km=/(PointerCapture)$|Capture$/i,Md=0,Dd=ny(!1),Pd=ny(!0);var VI="An invariant failed, however the error is obfuscated because this is a production build.",yl=[];Object.freeze(yl);var kd={};Object.freeze(kd);function On(){return++pe.mobxGuid}function He(t){throw Mt(!1,t),"X"}function Mt(t,e){if(!t)throw new Error("[mobx] "+(e||VI))}var ay=[];function XI(t,e){return process.env.NODE_ENV==="production"||ay.indexOf(t)!==-1?!1:(ay.push(t),console.error("[mobx] Deprecated: "+t),!0)}function Bd(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var _l=function(){};function GI(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function jd(t){return t!==null&&typeof t=="object"}function Ui(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function YI(t){if(Ao(t)||gn(t))return t;if(Array.isArray(t))return new Map(t);if(Ui(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return He("Cannot convert to map from '"+t+"'")}function Co(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function KI(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function sy(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable!==!1&&n.writable!==!1}function qI(t,e){process.env.NODE_ENV!=="production"&&!sy(t,e)&&He("Cannot make property '"+e.toString()+"' observable, it is not configurable and writable in the target object")}function yi(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return jd(r)&&r[n]===!0}}function Ao(t){return t instanceof Map}function Ea(t){return t instanceof Set}function Fd(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach(function(r){Object.getOwnPropertyDescriptor(t,r).enumerable&&e.add(r)}),Array.from(e)}function Jn(t){return t&&t.toString?t.toString():new String(t).toString()}function ly(t){return t===null?null:typeof t=="object"?""+t:t}var ZI=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ke=Symbol("mobx administration"),Oo=function(){function t(e){e===void 0&&(e="Atom@"+On()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=vt.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.reportObserved=function(){return Ey(this)},t.prototype.reportChanged=function(){gr(),Ek(this),vr()},t.prototype.toString=function(){return this.name},t}(),$d=yi("Atom",Oo);function Hd(t,e,n){e===void 0&&(e=_l),n===void 0&&(n=_l);var r=new Oo(t);return e!==_l&&Bk(r,e),n!==_l&&My(r,n),r}function JI(t,e){return Yy(t,e)}function QI(t,e){return Object.is(t,e)}var To={structural:JI,default:QI};/*! *****************************************************************************
33
33
  Copyright (c) Microsoft Corporation. All rights reserved.
34
34
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
35
35
  this file except in compliance with the License. You may obtain a copy of the
@@ -42,7 +42,7 @@ function print() { __p += __j.call(arguments, '') }
42
42
 
43
43
  See the Apache Version 2.0 License for specific language governing permissions
44
44
  and limitations under the License.
45
- ***************************************************************************** */var zd=function(t,e){return zd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},zd(t,e)};function ek(t,e){zd(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ot=function(){return Ot=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ot.apply(this,arguments)};function pr(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function No(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Wd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(No(arguments[e]));return t}var _l=Symbol("mobx did run lazy initializers"),wa=Symbol("mobx pending decorators"),tk={},nk={};function rk(t,e){var n=e?tk:nk;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return Vi(this),this[t]},set:function(r){Vi(this),this[t]=r}})}function Vi(t){var e,n;if(t[_l]!==!0){var r=t[wa];if(r){Co(t,_l,!0);var i=Wd(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var o=pr(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=r[s];l.propertyCreator(t,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}}}function uy(t,e){return function(){var r,i=function(a,s,l,u){if(u===!0)return e(a,s,l,a,r),null;if(process.env.NODE_ENV!=="production"&&!cy(arguments)&&He("This function is a decorator, but it wasn't invoked like a decorator"),!Object.prototype.hasOwnProperty.call(a,wa)){var c=a[wa];Co(a,wa,Ot({},c))}return a[wa][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:r},rk(s,t)};return cy(arguments)?(r=ml,i.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),i)}}function cy(t){return(t.length===2||t.length===3)&&(typeof t[1]=="string"||typeof t[1]=="symbol")||t.length===4&&t[3]===!0}function Sa(t,e,n){return bi(t)?t:Array.isArray(t)?X.array(t,{name:n}):Ui(t)?X.object(t,void 0,{name:n}):Ao(t)?X.map(t,{name:n}):Ea(t)?X.set(t,{name:n}):t}function ik(t,e,n){return t==null||xr(t)||kr(t)||gn(t)||Qn(t)?t:Array.isArray(t)?X.array(t,{name:n,deep:!1}):Ui(t)?X.object(t,void 0,{name:n,deep:!1}):Ao(t)?X.map(t,{name:n,deep:!1}):Ea(t)?X.set(t,{name:n,deep:!1}):He(process.env.NODE_ENV!=="production"&&"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function bl(t){return t}function ok(t,e,n){if(process.env.NODE_ENV!=="production"&&bi(t))throw"observable.struct should not be used with observable values";return Yy(t,e)?e:t}function xl(t){Mt(t);var e=uy(!0,function(r,i,o,a,s){process.env.NODE_ENV!=="production"&&Mt(!o||!o.get,'@observable cannot be used on getter (property "'+Jn(i)+'"), use @computed instead.');var l=o?o.initializer?o.initializer.call(r):o.value:void 0;ef(r).addObservableProp(i,l,t)}),n=typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"?function(){return arguments.length<2?He("Incorrect decorator invocation. @observable decorator doesn't expect any arguments"):e.apply(null,arguments)}:e;return n.enhancer=t,n}var dy={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(dy);function ak(t){/^(deep|name|equals|defaultDecorator|proxy)$/.test(t)||He("invalid option for (extend)observable: "+t)}function Mo(t){if(t==null)return dy;if(typeof t=="string")return{name:t,deep:!0,proxy:!0};if(process.env.NODE_ENV!=="production"){if(typeof t!="object")return He("expected options object");Object.keys(t).forEach(ak)}return t}var Ud=xl(Sa),sk=xl(ik),fy=xl(bl),lk=xl(ok);function El(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?bl:Sa}function uk(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return Ud.apply(null,arguments);if(bi(t))return t;var r=Ui(t)?X.object(t,e,n):Array.isArray(t)?X.array(t,e):Ao(t)?X.map(t,e):Ea(t)?X.set(t,e):t;if(r!==t)return r;He(process.env.NODE_ENV!=="production"&&"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'")}var py={box:function(t,e){arguments.length>2&&Ca("box");var n=Mo(e);return new Gi(t,El(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ca("array");var n=Mo(e);return Zk(t,El(n),n.name)},map:function(t,e){arguments.length>2&&Ca("map");var n=Mo(e);return new Qd(t,El(n),n.name)},set:function(t,e){arguments.length>2&&Ca("set");var n=Mo(e);return new zy(t,El(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ca("object");var r=Mo(n);if(r.proxy===!1)return Zd({},t,e,r);var i=Py(r),o=Zd({},void 0,void 0,r),a=Yk(o);return Ry(a,t,e,i),a},ref:fy,shallow:sk,deep:Ud,struct:lk},X=uk;Object.keys(py).forEach(function(t){return X[t]=py[t]});function Ca(t){He("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var wl=uy(!1,function(t,e,n,r,i){process.env.NODE_ENV!=="production"&&Mt(n&&n.get,"Trying to declare a computed value for unspecified getter '"+Jn(e)+"'");var o=n.get,a=n.set,s=i[0]||{};ef(t).addComputedProp(t,e,Ot({get:o,set:a,context:t},s))}),ck=wl({equals:To.structural}),Et=function(e,n,r){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return wl.apply(null,arguments);process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","First argument to `computed` should be an expression."),Mt(arguments.length<3,"Computed takes one or two arguments if used as function"));var i=typeof n=="object"?n:{};return i.get=e,i.set=typeof n=="function"?n:i.set,i.name=i.name||e.name||"",new Ro(i)};Et.struct=ck;var vt;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(vt||(vt={}));var hr;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(hr||(hr={}));var Sl=function(){function t(e){this.cause=e}return t}();function Aa(t){return t instanceof Sl}function Vd(t){switch(t.dependenciesState){case vt.UP_TO_DATE:return!1;case vt.NOT_TRACKING:case vt.STALE:return!0;case vt.POSSIBLY_STALE:{for(var e=Gd(!0),n=Po(),r=t.observing,i=r.length,o=0;o<i;o++){var a=r[o];if(Lo(a)){if(pe.disableErrorBoundaries)a.get();else try{a.get()}catch{return _i(n),Oa(e),!0}if(t.dependenciesState===vt.STALE)return _i(n),Oa(e),!0}}return vy(t),_i(n),Oa(e),!1}}}function Do(t){var e=t.observers.size>0;pe.computationDepth>0&&e&&He(process.env.NODE_ENV!=="production"&&"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: "+t.name),!pe.allowStateChanges&&(e||pe.enforceActions==="strict")&&He(process.env.NODE_ENV!=="production"&&(pe.enforceActions?"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ")+t.name)}function dk(t){process.env.NODE_ENV!=="production"&&!pe.allowStateReads&&pe.observableRequiresReaction&&console.warn("[mobx] Observable "+t.name+" being read outside a reactive context")}function hy(t,e,n){var r=Gd(!0);vy(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++pe.runId;var i=pe.trackingDerivation;pe.trackingDerivation=t;var o;if(pe.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(a){o=new Sl(a)}return pe.trackingDerivation=i,pk(t),fk(t),Oa(r),o}function fk(t){process.env.NODE_ENV!=="production"&&t.observing.length===0&&(pe.reactionRequiresObservable||t.requiresObservable)&&console.warn("[mobx] Derivation "+t.name+" is created/updated without reading any observable value")}function pk(t){for(var e=t.observing,n=t.observing=t.newObserving,r=vt.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(n.length=i,t.newObserving=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&by(s,t),s.diffValue=0}for(;i--;){var s=n[i];s.diffValue===1&&(s.diffValue=0,xk(s,t))}r!==vt.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}function Xd(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)by(e[n],t);t.dependenciesState=vt.NOT_TRACKING}function gy(t){var e=Po();try{return t()}finally{_i(e)}}function Po(){var t=pe.trackingDerivation;return pe.trackingDerivation=null,t}function _i(t){pe.trackingDerivation=t}function Gd(t){var e=pe.allowStateReads;return pe.allowStateReads=t,e}function Oa(t){pe.allowStateReads=t}function vy(t){if(t.dependenciesState!==vt.UP_TO_DATE){t.dependenciesState=vt.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=vt.UP_TO_DATE}}var Cl=0,hk=1,my=Object.getOwnPropertyDescriptor(function(){},"name"),gk=my&&my.configurable;function Xi(t,e,n){process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","`action` can only be invoked on functions"),(typeof t!="string"||!t)&&He("actions should have valid names, got: '"+t+"'"));var r=function(){return yy(t,e,n||this,arguments)};return r.isMobxAction=!0,process.env.NODE_ENV!=="production"&&gk&&Object.defineProperty(r,"name",{value:t}),r}function yy(t,e,n,r){var i=vk(t,n,r);try{return e.apply(n,r)}catch(o){throw i.error=o,o}finally{mk(i)}}function vk(t,e,n){var r=Kt()&&!!t,i=0;if(r&&process.env.NODE_ENV!=="production"){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=n[s];Fn({type:"action",name:t,object:e,arguments:a})}var l=Po();gr();var u=Al(!0),c=Gd(!0),d={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:c,notifySpy:r,startTime:i,actionId:hk++,parentActionId:Cl};return Cl=d.actionId,d}function mk(t){Cl!==t.actionId&&He("invalid action stack. did you forget to finish an action?"),Cl=t.parentActionId,t.error!==void 0&&(pe.suppressReactionErrors=!0),Ol(t.prevAllowStateChanges),Oa(t.prevAllowStateReads),vr(),_i(t.prevDerivation),t.notifySpy&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-t.startTime}),pe.suppressReactionErrors=!1}function Al(t){var e=pe.allowStateChanges;return pe.allowStateChanges=t,e}function Ol(t){pe.allowStateChanges=t}var Gi=function(t){ek(e,t);function e(n,r,i,o,a){i===void 0&&(i="ObservableValue@"+On()),o===void 0&&(o=!0),a===void 0&&(a=To.default);var s=t.call(this,i)||this;return s.enhancer=r,s.name=i,s.equals=a,s.hasUnreportedChange=!1,s.value=r(n,void 0,i),o&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({type:"create",name:s.name,newValue:""+s.value}),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){var r=this.value;if(n=this.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt();i&&process.env.NODE_ENV!=="production"&&Fn({type:"update",name:this.name,newValue:n,oldValue:r}),this.setNewValue(n),i&&process.env.NODE_ENV!=="production"&&$n()}},e.prototype.prepareNewValue=function(n){if(Do(this),Lr(this)){var r=Ir(this,{object:this,type:"update",newValue:n});if(!r)return pe.UNCHANGED;n=r.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?pe.UNCHANGED:n},e.prototype.setNewValue=function(n){var r=this.value;this.value=n,this.reportChanged(),_r(this)&&br(this,{type:"update",object:this,newValue:n,oldValue:r})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return Na(this,n)},e.prototype.observe=function(n,r){return r&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ma(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return ly(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Oo),yk=yi("ObservableValue",Gi),Ro=function(){function t(e){this.dependenciesState=vt.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=vt.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+On(),this.value=new Sl(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=hr.NONE,Mt(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+On(),e.set&&(this.setter=Xi(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?To.structural:To.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){Sk(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&He("Cycle detected in computation "+this.name+": "+this.derivation),pe.inBatch===0&&this.observers.size===0&&!this.keepAlive?Vd(this)&&(this.warnAboutUntrackedRead(),gr(),this.value=this.computeValue(!1),vr()):(Ey(this),Vd(this)&&this.trackAndCompute()&&wk(this));var e=this.value;if(Aa(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(Aa(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Mt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Mt(!1,process.env.NODE_ENV!=="production"&&"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){Kt()&&process.env.NODE_ENV!=="production"&&Yi({object:this.scope,type:"compute",name:this.name});var e=this.value,n=this.dependenciesState===vt.NOT_TRACKING,r=this.computeValue(!0),i=n||Aa(e)||Aa(r)||!this.equals(e,r);return i&&(this.value=r),i},t.prototype.computeValue=function(e){this.isComputing=!0,pe.computationDepth++;var n;if(e)n=hy(this,this.derivation,this.scope);else if(pe.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(r){n=new Sl(r)}return pe.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(Xd(this),this.value=void 0)},t.prototype.observe=function(e,n){var r=this,i=!0,o=void 0;return Lk(function(){var a=r.get();if(!i||n){var s=Po();e({type:"update",object:r,newValue:a,oldValue:o}),_i(s)}i=!1,o=a})},t.prototype.warnAboutUntrackedRead=function(){process.env.NODE_ENV!=="production"&&(this.requiresReaction===!0&&He("[mobx] Computed value "+this.name+" is read outside a reactive context"),this.isTracing!==hr.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context. Doing a full recompute"),pe.computedRequiresReaction&&console.warn("[mobx] Computed value "+this.name+" is being read outside a reactive context. Doing a full recompute"))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return ly(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Lo=yi("ComputedValue",Ro),Tl=function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t}(),_k={};function Nl(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_k}var Ml=!0,_y=!1,pe=function(){var t=Nl();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Ml=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Tl().version&&(Ml=!1),Ml?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Tl):(setTimeout(function(){_y||He("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Tl)}();function bk(){(pe.pendingReactions.length||pe.inBatch||pe.isRunningReactions)&&He("isolateGlobalState should be called before MobX is running any reactions"),_y=!0,Ml&&(--Nl().__mobxInstanceCount===0&&(Nl().__mobxGlobals=void 0),pe=new Tl)}function Yd(){return pe}function xk(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function by(t,e){t.observers.delete(e),t.observers.size===0&&xy(t)}function xy(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,pe.pendingUnobservations.push(t))}function gr(){pe.inBatch++}function vr(){if(--pe.inBatch===0){Ay();for(var t=pe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ro&&n.suspend())}pe.pendingUnobservations=[]}}function Ey(t){dk(t);var e=pe.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.size===0&&pe.inBatch>0&&xy(t),!1)}function Ek(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale()),e.dependenciesState=vt.STALE}))}function wk(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.POSSIBLY_STALE?e.dependenciesState=vt.STALE:e.dependenciesState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.UP_TO_DATE)}))}function Sk(t){t.lowestObserverState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.dependenciesState=vt.POSSIBLY_STALE,e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale())}))}function wy(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===hr.BREAK){var n=[];Sy(Fk(t),n,1),new Function(`debugger;
45
+ ***************************************************************************** */var zd=function(t,e){return zd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},zd(t,e)};function ek(t,e){zd(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Ot=function(){return Ot=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ot.apply(this,arguments)};function pr(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function No(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Wd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(No(arguments[e]));return t}var bl=Symbol("mobx did run lazy initializers"),wa=Symbol("mobx pending decorators"),tk={},nk={};function rk(t,e){var n=e?tk:nk;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return Vi(this),this[t]},set:function(r){Vi(this),this[t]=r}})}function Vi(t){var e,n;if(t[bl]!==!0){var r=t[wa];if(r){Co(t,bl,!0);var i=Wd(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var o=pr(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=r[s];l.propertyCreator(t,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}}}function uy(t,e){return function(){var r,i=function(a,s,l,u){if(u===!0)return e(a,s,l,a,r),null;if(process.env.NODE_ENV!=="production"&&!cy(arguments)&&He("This function is a decorator, but it wasn't invoked like a decorator"),!Object.prototype.hasOwnProperty.call(a,wa)){var c=a[wa];Co(a,wa,Ot({},c))}return a[wa][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:r},rk(s,t)};return cy(arguments)?(r=yl,i.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),i)}}function cy(t){return(t.length===2||t.length===3)&&(typeof t[1]=="string"||typeof t[1]=="symbol")||t.length===4&&t[3]===!0}function Sa(t,e,n){return bi(t)?t:Array.isArray(t)?X.array(t,{name:n}):Ui(t)?X.object(t,void 0,{name:n}):Ao(t)?X.map(t,{name:n}):Ea(t)?X.set(t,{name:n}):t}function ik(t,e,n){return t==null||xr(t)||kr(t)||gn(t)||Qn(t)?t:Array.isArray(t)?X.array(t,{name:n,deep:!1}):Ui(t)?X.object(t,void 0,{name:n,deep:!1}):Ao(t)?X.map(t,{name:n,deep:!1}):Ea(t)?X.set(t,{name:n,deep:!1}):He(process.env.NODE_ENV!=="production"&&"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function xl(t){return t}function ok(t,e,n){if(process.env.NODE_ENV!=="production"&&bi(t))throw"observable.struct should not be used with observable values";return Yy(t,e)?e:t}function El(t){Mt(t);var e=uy(!0,function(r,i,o,a,s){process.env.NODE_ENV!=="production"&&Mt(!o||!o.get,'@observable cannot be used on getter (property "'+Jn(i)+'"), use @computed instead.');var l=o?o.initializer?o.initializer.call(r):o.value:void 0;ef(r).addObservableProp(i,l,t)}),n=typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"?function(){return arguments.length<2?He("Incorrect decorator invocation. @observable decorator doesn't expect any arguments"):e.apply(null,arguments)}:e;return n.enhancer=t,n}var dy={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(dy);function ak(t){/^(deep|name|equals|defaultDecorator|proxy)$/.test(t)||He("invalid option for (extend)observable: "+t)}function Mo(t){if(t==null)return dy;if(typeof t=="string")return{name:t,deep:!0,proxy:!0};if(process.env.NODE_ENV!=="production"){if(typeof t!="object")return He("expected options object");Object.keys(t).forEach(ak)}return t}var Ud=El(Sa),sk=El(ik),fy=El(xl),lk=El(ok);function wl(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?xl:Sa}function uk(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return Ud.apply(null,arguments);if(bi(t))return t;var r=Ui(t)?X.object(t,e,n):Array.isArray(t)?X.array(t,e):Ao(t)?X.map(t,e):Ea(t)?X.set(t,e):t;if(r!==t)return r;He(process.env.NODE_ENV!=="production"&&"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'")}var py={box:function(t,e){arguments.length>2&&Ca("box");var n=Mo(e);return new Gi(t,wl(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ca("array");var n=Mo(e);return Zk(t,wl(n),n.name)},map:function(t,e){arguments.length>2&&Ca("map");var n=Mo(e);return new Qd(t,wl(n),n.name)},set:function(t,e){arguments.length>2&&Ca("set");var n=Mo(e);return new zy(t,wl(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ca("object");var r=Mo(n);if(r.proxy===!1)return Zd({},t,e,r);var i=Py(r),o=Zd({},void 0,void 0,r),a=Yk(o);return Ry(a,t,e,i),a},ref:fy,shallow:sk,deep:Ud,struct:lk},X=uk;Object.keys(py).forEach(function(t){return X[t]=py[t]});function Ca(t){He("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var Sl=uy(!1,function(t,e,n,r,i){process.env.NODE_ENV!=="production"&&Mt(n&&n.get,"Trying to declare a computed value for unspecified getter '"+Jn(e)+"'");var o=n.get,a=n.set,s=i[0]||{};ef(t).addComputedProp(t,e,Ot({get:o,set:a,context:t},s))}),ck=Sl({equals:To.structural}),Et=function(e,n,r){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Sl.apply(null,arguments);process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","First argument to `computed` should be an expression."),Mt(arguments.length<3,"Computed takes one or two arguments if used as function"));var i=typeof n=="object"?n:{};return i.get=e,i.set=typeof n=="function"?n:i.set,i.name=i.name||e.name||"",new Ro(i)};Et.struct=ck;var vt;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(vt||(vt={}));var hr;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(hr||(hr={}));var Cl=function(){function t(e){this.cause=e}return t}();function Aa(t){return t instanceof Cl}function Vd(t){switch(t.dependenciesState){case vt.UP_TO_DATE:return!1;case vt.NOT_TRACKING:case vt.STALE:return!0;case vt.POSSIBLY_STALE:{for(var e=Gd(!0),n=Po(),r=t.observing,i=r.length,o=0;o<i;o++){var a=r[o];if(Lo(a)){if(pe.disableErrorBoundaries)a.get();else try{a.get()}catch{return _i(n),Oa(e),!0}if(t.dependenciesState===vt.STALE)return _i(n),Oa(e),!0}}return vy(t),_i(n),Oa(e),!1}}}function Do(t){var e=t.observers.size>0;pe.computationDepth>0&&e&&He(process.env.NODE_ENV!=="production"&&"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: "+t.name),!pe.allowStateChanges&&(e||pe.enforceActions==="strict")&&He(process.env.NODE_ENV!=="production"&&(pe.enforceActions?"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ")+t.name)}function dk(t){process.env.NODE_ENV!=="production"&&!pe.allowStateReads&&pe.observableRequiresReaction&&console.warn("[mobx] Observable "+t.name+" being read outside a reactive context")}function hy(t,e,n){var r=Gd(!0);vy(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++pe.runId;var i=pe.trackingDerivation;pe.trackingDerivation=t;var o;if(pe.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(a){o=new Cl(a)}return pe.trackingDerivation=i,pk(t),fk(t),Oa(r),o}function fk(t){process.env.NODE_ENV!=="production"&&t.observing.length===0&&(pe.reactionRequiresObservable||t.requiresObservable)&&console.warn("[mobx] Derivation "+t.name+" is created/updated without reading any observable value")}function pk(t){for(var e=t.observing,n=t.observing=t.newObserving,r=vt.UP_TO_DATE,i=0,o=t.unboundDepsCount,a=0;a<o;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(n.length=i,t.newObserving=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&by(s,t),s.diffValue=0}for(;i--;){var s=n[i];s.diffValue===1&&(s.diffValue=0,xk(s,t))}r!==vt.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}function Xd(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)by(e[n],t);t.dependenciesState=vt.NOT_TRACKING}function gy(t){var e=Po();try{return t()}finally{_i(e)}}function Po(){var t=pe.trackingDerivation;return pe.trackingDerivation=null,t}function _i(t){pe.trackingDerivation=t}function Gd(t){var e=pe.allowStateReads;return pe.allowStateReads=t,e}function Oa(t){pe.allowStateReads=t}function vy(t){if(t.dependenciesState!==vt.UP_TO_DATE){t.dependenciesState=vt.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=vt.UP_TO_DATE}}var Al=0,hk=1,my=Object.getOwnPropertyDescriptor(function(){},"name"),gk=my&&my.configurable;function Xi(t,e,n){process.env.NODE_ENV!=="production"&&(Mt(typeof e=="function","`action` can only be invoked on functions"),(typeof t!="string"||!t)&&He("actions should have valid names, got: '"+t+"'"));var r=function(){return yy(t,e,n||this,arguments)};return r.isMobxAction=!0,process.env.NODE_ENV!=="production"&&gk&&Object.defineProperty(r,"name",{value:t}),r}function yy(t,e,n,r){var i=vk(t,n,r);try{return e.apply(n,r)}catch(o){throw i.error=o,o}finally{mk(i)}}function vk(t,e,n){var r=Kt()&&!!t,i=0;if(r&&process.env.NODE_ENV!=="production"){i=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=n[s];Fn({type:"action",name:t,object:e,arguments:a})}var l=Po();gr();var u=Ol(!0),c=Gd(!0),d={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:c,notifySpy:r,startTime:i,actionId:hk++,parentActionId:Al};return Al=d.actionId,d}function mk(t){Al!==t.actionId&&He("invalid action stack. did you forget to finish an action?"),Al=t.parentActionId,t.error!==void 0&&(pe.suppressReactionErrors=!0),Tl(t.prevAllowStateChanges),Oa(t.prevAllowStateReads),vr(),_i(t.prevDerivation),t.notifySpy&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-t.startTime}),pe.suppressReactionErrors=!1}function Ol(t){var e=pe.allowStateChanges;return pe.allowStateChanges=t,e}function Tl(t){pe.allowStateChanges=t}var Gi=function(t){ek(e,t);function e(n,r,i,o,a){i===void 0&&(i="ObservableValue@"+On()),o===void 0&&(o=!0),a===void 0&&(a=To.default);var s=t.call(this,i)||this;return s.enhancer=r,s.name=i,s.equals=a,s.hasUnreportedChange=!1,s.value=r(n,void 0,i),o&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({type:"create",name:s.name,newValue:""+s.value}),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){var r=this.value;if(n=this.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt();i&&process.env.NODE_ENV!=="production"&&Fn({type:"update",name:this.name,newValue:n,oldValue:r}),this.setNewValue(n),i&&process.env.NODE_ENV!=="production"&&$n()}},e.prototype.prepareNewValue=function(n){if(Do(this),Lr(this)){var r=Ir(this,{object:this,type:"update",newValue:n});if(!r)return pe.UNCHANGED;n=r.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?pe.UNCHANGED:n},e.prototype.setNewValue=function(n){var r=this.value;this.value=n,this.reportChanged(),_r(this)&&br(this,{type:"update",object:this,newValue:n,oldValue:r})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return Na(this,n)},e.prototype.observe=function(n,r){return r&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ma(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return ly(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Oo),yk=yi("ObservableValue",Gi),Ro=function(){function t(e){this.dependenciesState=vt.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=vt.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+On(),this.value=new Cl(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=hr.NONE,Mt(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+On(),e.set&&(this.setter=Xi(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?To.structural:To.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){Sk(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&He("Cycle detected in computation "+this.name+": "+this.derivation),pe.inBatch===0&&this.observers.size===0&&!this.keepAlive?Vd(this)&&(this.warnAboutUntrackedRead(),gr(),this.value=this.computeValue(!1),vr()):(Ey(this),Vd(this)&&this.trackAndCompute()&&wk(this));var e=this.value;if(Aa(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(Aa(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Mt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Mt(!1,process.env.NODE_ENV!=="production"&&"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},t.prototype.trackAndCompute=function(){Kt()&&process.env.NODE_ENV!=="production"&&Yi({object:this.scope,type:"compute",name:this.name});var e=this.value,n=this.dependenciesState===vt.NOT_TRACKING,r=this.computeValue(!0),i=n||Aa(e)||Aa(r)||!this.equals(e,r);return i&&(this.value=r),i},t.prototype.computeValue=function(e){this.isComputing=!0,pe.computationDepth++;var n;if(e)n=hy(this,this.derivation,this.scope);else if(pe.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(r){n=new Cl(r)}return pe.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(Xd(this),this.value=void 0)},t.prototype.observe=function(e,n){var r=this,i=!0,o=void 0;return Lk(function(){var a=r.get();if(!i||n){var s=Po();e({type:"update",object:r,newValue:a,oldValue:o}),_i(s)}i=!1,o=a})},t.prototype.warnAboutUntrackedRead=function(){process.env.NODE_ENV!=="production"&&(this.requiresReaction===!0&&He("[mobx] Computed value "+this.name+" is read outside a reactive context"),this.isTracing!==hr.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context. Doing a full recompute"),pe.computedRequiresReaction&&console.warn("[mobx] Computed value "+this.name+" is being read outside a reactive context. Doing a full recompute"))},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return ly(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Lo=yi("ComputedValue",Ro),Nl=function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t}(),_k={};function Ml(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_k}var Dl=!0,_y=!1,pe=function(){var t=Ml();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Dl=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Nl().version&&(Dl=!1),Dl?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Nl):(setTimeout(function(){_y||He("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Nl)}();function bk(){(pe.pendingReactions.length||pe.inBatch||pe.isRunningReactions)&&He("isolateGlobalState should be called before MobX is running any reactions"),_y=!0,Dl&&(--Ml().__mobxInstanceCount===0&&(Ml().__mobxGlobals=void 0),pe=new Nl)}function Yd(){return pe}function xk(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function by(t,e){t.observers.delete(e),t.observers.size===0&&xy(t)}function xy(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,pe.pendingUnobservations.push(t))}function gr(){pe.inBatch++}function vr(){if(--pe.inBatch===0){Ay();for(var t=pe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ro&&n.suspend())}pe.pendingUnobservations=[]}}function Ey(t){dk(t);var e=pe.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.size===0&&pe.inBatch>0&&xy(t),!1)}function Ek(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale()),e.dependenciesState=vt.STALE}))}function wk(t){t.lowestObserverState!==vt.STALE&&(t.lowestObserverState=vt.STALE,t.observers.forEach(function(e){e.dependenciesState===vt.POSSIBLY_STALE?e.dependenciesState=vt.STALE:e.dependenciesState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.UP_TO_DATE)}))}function Sk(t){t.lowestObserverState===vt.UP_TO_DATE&&(t.lowestObserverState=vt.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===vt.UP_TO_DATE&&(e.dependenciesState=vt.POSSIBLY_STALE,e.isTracing!==hr.NONE&&wy(e,t),e.onBecomeStale())}))}function wy(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===hr.BREAK){var n=[];Sy(Fk(t),n,1),new Function(`debugger;
46
46
  /*
47
47
  Tracing '`+t.name+`'
48
48
 
@@ -57,44 +57,44 @@ The dependencies for this derivation are:
57
57
  `+n.join(`
58
58
  `)+`
59
59
  */
60
- `)()}}function Sy(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(r){return Sy(r,e,n+1)})}var Ta=function(){function t(e,n,r,i){e===void 0&&(e="Reaction@"+On()),i===void 0&&(i=!1),this.name=e,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=vt.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+On(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=hr.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,pe.pendingReactions.push(this),Ay())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(gr(),this._isScheduled=!1,Vd(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}vr()}},t.prototype.track=function(e){if(!this.isDisposed){gr();var n=Kt(),r;n&&process.env.NODE_ENV!=="production"&&(r=Date.now(),Fn({name:this.name,type:"reaction"})),this._isRunning=!0;var i=hy(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Xd(this),Aa(i)&&this.reportExceptionInDerivation(i.cause),n&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-r}),vr()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(pe.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";pe.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Kt()&&Yi({type:"error",name:this.name,message:r,error:""+e}),pe.globalReactionErrorHandlers.forEach(function(i){return i(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(gr(),Xd(this),vr()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[ke]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),Vk(this,e)},t}(),Cy=100,Kd=function(t){return t()};function Ay(){pe.inBatch>0||pe.isRunningReactions||Kd(Ck)}function Ck(){pe.isRunningReactions=!0;for(var t=pe.pendingReactions,e=0;t.length>0;){++e===Cy&&(console.error("Reaction doesn't converge to a stable state after "+Cy+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}pe.isRunningReactions=!1}var Dl=yi("Reaction",Ta);function Ak(t){var e=Kd;Kd=function(n){return t(function(){return e(n)})}}function Kt(){return process.env.NODE_ENV!=="production"&&!!pe.spyListeners.length}function Yi(t){if(process.env.NODE_ENV!=="production"&&pe.spyListeners.length)for(var e=pe.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function Fn(t){if(process.env.NODE_ENV!=="production"){var e=Ot(Ot({},t),{spyReportStart:!0});Yi(e)}}var Ok={spyReportEnd:!0};function $n(t){process.env.NODE_ENV!=="production"&&Yi(t?Ot(Ot({},t),{spyReportEnd:!0}):Ok)}function Tk(t){return process.env.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(pe.spyListeners.push(t),Bd(function(){pe.spyListeners=pe.spyListeners.filter(function(e){return e!==t})}))}function Nk(){He(process.env.NODE_ENV!=="production"&&"@action fields are not reassignable")}function Oy(t){return function(e,n,r){if(r){if(process.env.NODE_ENV!=="production"&&r.get!==void 0)return He("@action cannot be used with getters");if(r.value)return{value:Xi(t,r.value),enumerable:!1,configurable:!0,writable:!0};var i=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Xi(t,i.call(this))}}}return Mk(t).apply(this,arguments)}}function Mk(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(i){Co(this,n,U(t,i))}})}}function Dk(t,e,n,r){return r===!0?(qd(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return qd(this,e,n.value||n.initializer.call(this)),this[e]},set:Nk}:{enumerable:!1,configurable:!0,set:function(i){qd(this,e,i)},get:function(){}}}var U=function(e,n,r,i){if(arguments.length===1&&typeof e=="function")return Xi(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Xi(e,n);if(arguments.length===1&&typeof e=="string")return Oy(e);if(i===!0)Co(e,n,Xi(e.name||n,r.value,this));else return Oy(n).apply(null,arguments)};U.bound=Dk;function Pk(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",r=typeof t=="function"?t:e;return process.env.NODE_ENV!=="production"&&(Mt(typeof r=="function"&&r.length===0,"`runInAction` expects a function without arguments"),(typeof n!="string"||!n)&&He("actions should have valid names, got: '"+n+"'")),yy(n,r,this,void 0)}function Rk(t){return typeof t=="function"&&t.isMobxAction===!0}function qd(t,e,n){Co(t,e,Xi(e,n.bind(t)))}function Lk(t,e){e===void 0&&(e=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","Autorun expects a function as first argument"),Mt(Rk(t)===!1,"Autorun does not accept actions since actions are untrackable"));var n=e&&e.name||t.name||"Autorun@"+On(),r=!e.scheduler&&!e.delay,i;if(r)i=new Ta(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var o=Ty(e),a=!1;i=new Ta(n,function(){a||(a=!0,o(function(){a=!1,i.isDisposed||i.track(s)}))},e.onError,e.requiresObservable)}function s(){t(i)}return i.schedule(),i.getDisposer()}var Ik=function(t){return t()};function Ty(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ik}function Ny(t,e,n){n===void 0&&(n=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","First argument to reaction should be a function"),Mt(typeof n=="object","Third argument of reactions should be an object"));var r=n.name||"Reaction@"+On(),i=U(r,n.onError?kk(n.onError,e):e),o=!n.scheduler&&!n.delay,a=Ty(n),s=!0,l=!1,u,c=n.compareStructural?To.structural:n.equals||To.default,d=new Ta(r,function(){s||o?f():l||(l=!0,a(f))},n.onError,n.requiresObservable);function f(){if(l=!1,!d.isDisposed){var h=!1;d.track(function(){var v=t(d);h=s||!c(u,v),u=v}),s&&n.fireImmediately&&i(u,d),!s&&h===!0&&i(u,d),s&&(s=!1)}}return d.schedule(),d.getDisposer()}function kk(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function Bk(t,e,n){return Dy("onBecomeObserved",t,e)}function My(t,e,n){return Dy("onBecomeUnobserved",t,e)}function Dy(t,e,n,r){var i=Ei(e),o=n,a=t+"Listeners";i[a]?i[a].add(o):i[a]=new Set([o]);var s=i[t];return typeof s!="function"?He(process.env.NODE_ENV!=="production"&&"Not an atom that can be (un)observed"):function(){var l=i[a];l&&(l.delete(o),l.size===0&&delete i[a])}}function jk(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,i=t.disableErrorBoundaries,o=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bk(),e!==void 0){(typeof e=="boolean"||e==="strict")&&XI(`Deprecated value for 'enforceActions', use 'false' => '"never"', 'true' => '"observed"', '"strict"' => "'always'" instead`);var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:He("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}pe.enforceActions=l,pe.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(pe.computedRequiresReaction=!!n),a!==void 0&&(pe.reactionRequiresObservable=!!a),s!==void 0&&(pe.observableRequiresReaction=!!s,pe.allowStateReads=!pe.observableRequiresReaction),r!==void 0&&(pe.computedConfigurable=!!r),i!==void 0&&(i===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),pe.disableErrorBoundaries=!!i),o&&Ak(o)}function Zd(t,e,n,r){process.env.NODE_ENV!=="production"&&(Mt(arguments.length>=2&&arguments.length<=4,"'extendObservable' expected 2-4 arguments"),Mt(typeof t=="object","'extendObservable' expects an object as first argument"),Mt(!gn(t),"'extendObservable' should not be used on maps, use map.merge instead")),r=Mo(r);var i=Py(r);return Vi(t),ef(t,r.name,i.enhancer),e&&Ry(t,e,n,i),t}function Py(t){return t.defaultDecorator||(t.deep===!1?fy:Ud)}function Ry(t,e,n,r){var i,o,a,s;if(process.env.NODE_ENV!=="production"&&(Mt(!bi(e),"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),n)){var l=Fd(n);try{for(var u=pr(l),c=u.next();!c.done;c=u.next()){var d=c.value;d in e||He("Trying to declare a decorator for unspecified property '"+Jn(d)+"'")}}catch(y){i={error:y}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}gr();try{var l=ZI(e);try{for(var f=pr(l),h=f.next();!h.done;h=f.next()){var d=h.value,v=Object.getOwnPropertyDescriptor(e,d);process.env.NODE_ENV!=="production"&&(Ui(e)||He("'extendObservable' only accepts plain objects as second argument"),ky(v.value)&&He("Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead"));var g=n&&d in n?n[d]:v.get?wl:r;process.env.NODE_ENV!=="production"&&typeof g!="function"&&He("Not a valid decorator for '"+Jn(d)+"', got: "+g);var m=g(t,d,v,!0);m&&Object.defineProperty(t,d,m)}}catch(x){a={error:x}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}finally{vr()}}function Fk(t,e){return Ly(Ei(t,e))}function Ly(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=GI(t.observing).map(Ly)),e}function Iy(t,e){if(t==null)return!1;if(e!==void 0){if(xr(t)===!1||!t[ke].values.has(e))return!1;var n=Ei(t,e);return Lo(n)}return Lo(t)}function ky(t){return arguments.length>1?He(process.env.NODE_ENV!=="production"&&"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property"):Iy(t)}function By(t,e){return typeof e!="string"?He(process.env.NODE_ENV!=="production"&&"isComputed expected a property name as second argument"):Iy(t,e)}function $k(t,e){return t==null?!1:xr(t)||!!t[ke]||$d(t)||Dl(t)||Lo(t)}function bi(t){return arguments.length!==1&&He(process.env.NODE_ENV!=="production"&&"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),$k(t)}function Io(t){return xr(t)?t[ke].getKeys():gn(t)||Qn(t)?Array.from(t.keys()):kr(t)?t.map(function(e,n){return n}):He(process.env.NODE_ENV!=="production"&&"'keys()' can only be used on observable objects, arrays, sets and maps")}function Hk(t){return xr(t)?Io(t).map(function(e){return t[e]}):gn(t)?Io(t).map(function(e){return t.get(e)}):Qn(t)?Array.from(t.values()):kr(t)?t.slice():He(process.env.NODE_ENV!=="production"&&"'values()' can only be used on observable objects, arrays, sets and maps")}function zk(t){return xr(t)?Io(t).map(function(e){return[e,t[e]]}):gn(t)?Io(t).map(function(e){return[e,t.get(e)]}):Qn(t)?Array.from(t.entries()):kr(t)?t.map(function(e,n){return[n,e]}):He(process.env.NODE_ENV!=="production"&&"'entries()' can only be used on observable objects, arrays and maps")}function Jd(t,e,n){if(arguments.length===2&&!Qn(t)){gr();var r=e;try{for(var i in r)Jd(t,i,r[i])}finally{vr()}return}if(xr(t)){var o=t[ke],a=o.values.get(e);a?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(gn(t))t.set(e,n);else if(Qn(t))t.add(e);else if(kr(t))typeof e!="number"&&(e=parseInt(e,10)),Mt(e>=0,"Not a valid index: '"+e+"'"),gr(),e>=t.length&&(t.length=e+1),t[e]=n,vr();else return He(process.env.NODE_ENV!=="production"&&"'set()' can only be used on observable objects, arrays and maps")}function jy(t,e,n,r){return Wk(t,e,n)}function Wk(t,e,n){return Ll(t).observe(e,n)}var Uk={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function ko(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function xi(t,e,n){if(!e.recurseEverything&&!bi(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yk(t))return xi(t.get(),e,n);bi(t)&&Io(t);var r=e.detectCycles===!0;if(r&&t!==null&&n.has(t))return n.get(t);if(kr(t)||Array.isArray(t)){var i=ko(n,t,[],e),o=t.map(function(h){return xi(h,e,n)});i.length=o.length;for(var a=0,s=o.length;a<s;a++)i[a]=o[a];return i}if(Qn(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=ko(n,t,new Set,e);return t.forEach(function(h){l.add(xi(h,e,n))}),l}else{var u=ko(n,t,[],e);return t.forEach(function(h){u.push(xi(h,e,n))}),u}if(gn(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var c=ko(n,t,new Map,e);return t.forEach(function(h,v){c.set(v,xi(h,e,n))}),c}else{var d=ko(n,t,{},e);return t.forEach(function(h,v){d[v]=xi(h,e,n)}),d}var f=ko(n,t,{},e);return Fd(t).forEach(function(h){f[h]=xi(t[h],e,n)}),f}function mr(t,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=Uk),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var n;return e.detectCycles&&(n=new Map),xi(t,e,n)}function Vk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var r=Xk(t);if(!r)return He(process.env.NODE_ENV!=="production"&&"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===hr.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?hr.BREAK:hr.LOG}function Xk(t){switch(t.length){case 0:return pe.trackingDerivation;case 1:return Ei(t[0]);case 2:return Ei(t[0],t[1])}}function yr(t,e){e===void 0&&(e=void 0),gr();try{return t.apply(e)}finally{vr()}}function Pl(t){return t[ke]}function Rl(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"}var Gk={has:function(t,e){if(e===ke||e==="constructor"||e===_l)return!0;var n=Pl(t);return Rl(e)?n.has(e):e in t},get:function(t,e){if(e===ke||e==="constructor"||e===_l)return t[e];var n=Pl(t),r=n.values.get(e);if(r instanceof Oo){var i=r.get();return i===void 0&&n.has(e),i}return Rl(e)&&n.has(e),t[e]},set:function(t,e,n){return Rl(e)?(Jd(t,e,n),!0):!1},deleteProperty:function(t,e){if(!Rl(e))return!1;var n=Pl(t);return n.remove(e),!0},ownKeys:function(t){var e=Pl(t);return e.keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return He("Dynamic observable objects cannot be frozen"),!1}};function Yk(t){var e=new Proxy(t,Gk);return t[ke].proxy=e,e}function Lr(t){return t.interceptors!==void 0&&t.interceptors.length>0}function Na(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Ir(t,e){var n=Po();try{for(var r=Wd(t.interceptors||[]),i=0,o=r.length;i<o&&(e=r[i](e),Mt(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);i++);return e}finally{_i(n)}}function _r(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function Ma(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function br(t,e){var n=Po(),r=t.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);_i(n)}}var Kk=1e4,qk={get:function(t,e){return e===ke?t[ke]:e==="length"?t[ke].getArrayLength():typeof e=="number"?ti.get.call(t,e):typeof e=="string"&&!isNaN(e)?ti.get.call(t,parseInt(e)):ti.hasOwnProperty(e)?ti[e]:t[e]},set:function(t,e,n){return e==="length"&&t[ke].setArrayLength(n),typeof e=="number"&&ti.set.call(t,e,n),typeof e=="symbol"||isNaN(e)?t[e]=n:ti.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return He("Observable arrays cannot be frozen"),!1}};function Zk(t,e,n,r){n===void 0&&(n="ObservableArray@"+On()),r===void 0&&(r=!1);var i=new Fy(n,e,r);KI(i.values,ke,i);var o=new Proxy(i.values,qk);if(i.proxy=o,t&&t.length){var a=Al(!0);i.spliceWithArray(0,0,t),Ol(a)}return o}var Fy=function(){function t(e,n,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Oo(e||"ObservableArray@"+On()),this.enhancer=function(i,o){return n(i,o,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ma(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var r=new Array(e-n),i=0;i<e-n;i++)r[i]=void 0;this.spliceWithArray(n,0,r)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},t.prototype.spliceWithArray=function(e,n,r){var i=this;Do(this.atom);var o=this.values.length;if(e===void 0?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),arguments.length===1?n=o-e:n==null?n=0:n=Math.max(0,Math.min(n,o-e)),r===void 0&&(r=ml),Lr(this)){var a=Ir(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:r});if(!a)return ml;n=a.removedCount,r=a.added}if(r=r.length===0?r:r.map(function(u){return i.enhancer(u,void 0)}),process.env.NODE_ENV!=="production"){var s=r.length-n;this.updateArrayLength(o,s)}var l=this.spliceItemsIntoValues(e,n,r);return(n!==0||r.length!==0)&&this.notifyArraySplice(e,r,l),this.dehanceValues(l)},t.prototype.spliceItemsIntoValues=function(e,n,r){var i;if(r.length<Kk)return(i=this.values).splice.apply(i,Wd([e,n],r));var o=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+n)),o},t.prototype.notifyArrayChildUpdate=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:r}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.notifyArraySplice=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"splice",index:e,removed:r,added:n,removedCount:r.length,addedCount:n.length}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t}(),ti={intercept:function(t){return this[ke].intercept(t)},observe:function(t,e){e===void 0&&(e=!1);var n=this[ke];return n.observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[ke];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=this[ke];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(t);case 2:return i.spliceWithArray(t,e)}return i.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){var r=this[ke];return r.spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[ke].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place");var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place");var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[ke],n=e.dehanceValues(e.values).indexOf(t);return n>-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[ke];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[ke],r=n.values;if(t<r.length){Do(n.atom);var i=r[t];if(Lr(n)){var o=Ir(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!o)return;e=o.newValue}e=n.enhancer(e,i);var a=e!==i;a&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else if(t===r.length)n.spliceWithArray(t,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(){var e=this[ke];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})}),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(e,n){var r=this,i=this[ke];i.atom.reportObserved();var o=i.dehanceValues(i.values);return o[t](function(a,s){return e.call(n,a,s,r)},n)})}),["reduce","reduceRight"].forEach(function(t){ti[t]=function(){var e=this,n=this[ke];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(i,o,a){return o=n.dehanceValue(o),r(i,o,a,e)},n.values[t].apply(n.values,arguments)}});var Jk=yi("ObservableArrayAdministration",Fy);function kr(t){return jd(t)&&Jk(t[ke])}var $y,Qk={},Qd=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableMap@"+On()),this.enhancer=n,this.name=r,this[$y]=Qk,this._keysAtom=Hd(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!pe.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var i=r=new Gi(this._has(e),bl,this.name+"."+Jn(e)+"?",!1);this._hasMap.set(e,i),My(i,function(){return n._hasMap.delete(e)})}return r.get()},t.prototype.set=function(e,n){var r=this._has(e);if(Lr(this)){var i=Ir(this,{type:r?"update":"add",object:this,newValue:n,name:e});if(!i)return this;n=i.newValue}return r?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(Do(this._keysAtom),Lr(this)){var r=Ir(this,{type:"delete",object:this,name:e});if(!r)return!1}if(this._has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),yr(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var r=this._hasMap.get(e);r&&r.setNewValue(n)},t.prototype._updateValue=function(e,n){var r=this._data.get(e);if(n=r.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt(),o=_r(this),a=o||i?{type:"update",object:this,oldValue:r.value,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),r.setNewValue(n),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype._addValue=function(e,n){var r=this;Do(this._keysAtom),yr(function(){var s=new Gi(n,r.enhancer,r.name+"."+Jn(e),!1);r._data.set(e,s),n=s.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()});var i=Kt(),o=_r(this),a=o||i?{type:"add",object:this,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var e=this,n=this.keys();return Il({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:e.get(o)}}})},t.prototype.entries=function(){var e=this,n=this.keys();return Il({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:[o,e.get(o)]}}})},t.prototype[$y=ke,Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=No(a.value,2),l=s[0],u=s[1];e.call(n,u,l,this)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.merge=function(e){var n=this;return gn(e)&&(e=e.toJS()),yr(function(){var r=Al(!0);try{Ui(e)?Fd(e).forEach(function(i){return n.set(i,e[i])}):Array.isArray(e)?e.forEach(function(i){var o=No(i,2),a=o[0],s=o[1];return n.set(a,s)}):Ao(e)?(e.constructor!==Map&&He("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(i,o){return n.set(o,i)})):e!=null&&He("Cannot initialize map from "+e)}finally{Ol(r)}}),this},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e.keys()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.replace=function(e){var n=this;return yr(function(){var r,i,o,a,s=YI(e),l=new Map,u=!1;try{for(var c=pr(n._data.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(!s.has(f)){var h=n.delete(f);if(h)u=!0;else{var v=n._data.get(f);l.set(f,v)}}}}catch(M){r={error:M}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}try{for(var g=pr(s.entries()),m=g.next();!m.done;m=g.next()){var y=No(m.value,2),f=y[0],v=y[1],x=n._data.has(f);if(n.set(f,v),n._data.has(f)){var E=n._data.get(f);l.set(f,E),x||(u=!0)}}}catch(M){o={error:M}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}if(!u)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var b=n._data.keys(),T=l.keys(),A=b.next(),S=T.next();!A.done;){if(A.value!==S.value){n._keysAtom.reportChanged();break}A=b.next(),S=T.next()}n._data=l}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e,n,r={};try{for(var i=pr(this),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];r[typeof s=="symbol"?s:Jn(s)]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return Jn(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with maps."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t}(),gn=yi("ObservableMap",Qd),Hy,eB={},zy=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableSet@"+On()),this.name=r,this[Hy]=eB,this._data=new Set,this._atom=Hd(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(i,o){return n(i,o,r)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e._data.values()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=a.value;e.call(n,s,s,this)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(Do(this._atom),Lr(this)){var r=Ir(this,{type:"add",object:this,newValue:e});if(!r)return this}if(!this.has(e)){yr(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var i=Kt(),o=_r(this),r=o||i?{type:"add",object:this,newValue:e}:null;i&&process.env.NODE_ENV!=="production"&&Fn(r),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n()}return this},t.prototype.delete=function(e){var n=this;if(Lr(this)){var r=Ir(this,{type:"delete",object:this,oldValue:e});if(!r)return!1}if(this.has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name})),yr(function(){n._atom.reportChanged(),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=Array.from(this.keys()),r=Array.from(this.values());return Il({next:function(){var i=e;return e+=1,i<r.length?{value:[n[i],r[i]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,r=Array.from(this._data.values());return Il({next:function(){return n<r.length?{value:e.dehanceValue(r[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return Qn(e)&&(e=e.toJS()),yr(function(){var r=Al(!0);try{Array.isArray(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):Ea(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):e!=null&&He("Cannot initialize set from "+e)}finally{Ol(r)}}),this},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with sets."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[Hy=ke,Symbol.iterator]=function(){return this.values()},t}(),Qn=yi("ObservableSet",zy),Wy=function(){function t(e,n,r,i){n===void 0&&(n=new Map),this.target=e,this.values=n,this.name=r,this.defaultEnhancer=i,this.keysAtom=new Oo(r+".keys")}return t.prototype.read=function(e){return this.values.get(e).get()},t.prototype.write=function(e,n){var r=this.target,i=this.values.get(e);if(i instanceof Ro){i.set(n);return}if(Lr(this)){var o=Ir(this,{type:"update",object:this.proxy||r,name:e,newValue:n});if(!o)return;n=o.newValue}if(n=i.prepareNewValue(n),n!==pe.UNCHANGED){var a=_r(this),s=Kt(),o=a||s?{type:"update",object:this.proxy||r,oldValue:i.value,name:e,newValue:n}:null;s&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),i.setNewValue(n),a&&br(this,o),s&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype.has=function(e){var n=this.pendingKeys||(this.pendingKeys=new Map),r=n.get(e);if(r)return r.get();var i=!!this.values.get(e);return r=new Gi(i,bl,this.name+"."+Jn(e)+"?",!1),n.set(e,r),r.get()},t.prototype.addObservableProp=function(e,n,r){r===void 0&&(r=this.defaultEnhancer);var i=this.target;if(qI(i,e),Lr(this)){var o=Ir(this,{object:this.proxy||i,name:e,type:"add",newValue:n});if(!o)return;n=o.newValue}var a=new Gi(n,r,this.name+"."+Jn(e),!1);this.values.set(e,a),n=a.value,Object.defineProperty(i,e,tB(e)),this.notifyPropertyAddition(e,n)},t.prototype.addComputedProp=function(e,n,r){var i=this.target;r.name=r.name||this.name+"."+Jn(n),this.values.set(n,new Ro(r)),(e===i||sy(e,n))&&Object.defineProperty(e,n,nB(n))},t.prototype.remove=function(e){if(this.values.has(e)){var n=this.target;if(Lr(this)){var r=Ir(this,{object:this.proxy||n,name:e,type:"remove"});if(!r)return}try{gr();var i=_r(this),o=Kt(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var r=i||o?{type:"remove",object:this.proxy||n,oldValue:s,name:e}:null;o&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),i&&br(this,r),o&&process.env.NODE_ENV!=="production"&&$n()}finally{vr()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support the fire immediately property for observable objects."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.notifyPropertyAddition=function(e,n){var r=_r(this),i=Kt(),o=r||i?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),r&&br(this,o),i&&process.env.NODE_ENV!=="production"&&$n(),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var e,n;this.keysAtom.reportObserved();var r=[];try{for(var i=pr(this.values),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];l instanceof Gi&&r.push(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t}();function ef(t,e,n){if(e===void 0&&(e=""),n===void 0&&(n=Sa),Object.prototype.hasOwnProperty.call(t,ke))return t[ke];process.env.NODE_ENV!=="production"&&Mt(Object.isExtensible(t),"Cannot make the designated object observable; it is not extensible"),Ui(t)||(e=(t.constructor.name||"ObservableObject")+"@"+On()),e||(e="ObservableObject@"+On());var r=new Wy(t,new Map,Jn(e),n);return Co(t,ke,r),r}var Uy=Object.create(null),Vy=Object.create(null);function tB(t){return Uy[t]||(Uy[t]={configurable:!0,enumerable:!0,get:function(){return this[ke].read(t)},set:function(e){this[ke].write(t,e)}})}function Xy(t){var e=t[ke];return e||(Vi(t),t[ke])}function nB(t){return Vy[t]||(Vy[t]={configurable:pe.computedConfigurable,enumerable:!1,get:function(){return Xy(this).read(t)},set:function(e){Xy(this).write(t,e)}})}var rB=yi("ObservableObjectAdministration",Wy);function xr(t){return jd(t)?(Vi(t),rB(t[ke])):!1}function Ei(t,e){if(typeof t=="object"&&t!==null){if(kr(t))return e!==void 0&&He(process.env.NODE_ENV!=="production"&&"It is not possible to get index atoms from arrays"),t[ke].atom;if(Qn(t))return t[ke];if(gn(t)){var n=t;if(e===void 0)return n._keysAtom;var r=n._data.get(e)||n._hasMap.get(e);return r||He(process.env.NODE_ENV!=="production"&&"the entry '"+e+"' does not exist in the observable map '"+tf(t)+"'"),r}if(Vi(t),e&&!t[ke]&&t[e],xr(t)){if(!e)return He(process.env.NODE_ENV!=="production"&&"please specify a property");var r=t[ke].values.get(e);return r||He(process.env.NODE_ENV!=="production"&&"no observable property '"+e+"' found on the observable object '"+tf(t)+"'"),r}if($d(t)||Lo(t)||Dl(t))return t}else if(typeof t=="function"&&Dl(t[ke]))return t[ke];return He(process.env.NODE_ENV!=="production"&&"Cannot obtain atom from "+t)}function Ll(t,e){if(t||He("Expecting some object"),e!==void 0)return Ll(Ei(t,e));if($d(t)||Lo(t)||Dl(t)||gn(t)||Qn(t))return t;if(Vi(t),t[ke])return t[ke];He(process.env.NODE_ENV!=="production"&&"Cannot obtain administration from "+t)}function tf(t,e){var n;return e!==void 0?n=Ei(t,e):xr(t)||gn(t)||Qn(t)?n=Ll(t):n=Ei(t),n.name}var Gy=Object.prototype.toString;function Yy(t,e,n){return n===void 0&&(n=-1),nf(t,e,n)}function nf(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var o=typeof t;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var a=Gy.call(t);if(a!==Gy.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Ky(t),e=Ky(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!(typeof l=="function"&&l instanceof l&&typeof u=="function"&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var c=r.length;c--;)if(r[c]===t)return i[c]===e;if(r.push(t),i.push(e),s){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!nf(t[c],e[c],n-1,r,i))return!1}else{var d=Object.keys(t),f=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(f=d[c],!(iB(e,f)&&nf(t[f],e[f],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function Ky(t){return kr(t)?t.slice():Ao(t)||gn(t)||Ea(t)||Qn(t)?Array.from(t.entries()):t}function iB(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Il(t){return t[Symbol.iterator]=oB,t}function oB(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");try{process.env.NODE_ENV}catch{var qy=Nl();typeof process>"u"&&(qy.process={}),qy.process.env={}}(function(){function t(){}if(t.name!=="testCodeMinification"&&process.env.NODE_ENV!=="production"&&typeof process<"u"&&process.env.IGNORE_MOBX_MINIFY_WARNING!=="true"){var e=["process","env","NODE_ENV"].join(".");console.warn("[mobx] you are running a minified build, but '"+e+"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle")}})(),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Tk,extras:{getDebugName:tf},$mobx:ke});function aB(t){return!(t.prototype&&t.prototype.render)&&!Qe.isPrototypeOf(t)}function Zy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,r=n===void 0?"":n,i=e.suffix,o=i===void 0?"":i,a=t.displayName||t.name||t.constructor&&t.constructor.name||"<component>";return r+a+o}var Jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qy=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e_=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),t_=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},n_=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},r_=console;function sB(t){var e=Yd().allowStateChanges;return Yd().allowStateChanges=t,e}function lB(t){Yd().allowStateChanges=t}function uB(t,e,n,r,i){var o=sB(t),a=void 0;try{a=e(n,r,i)}finally{lB(o)}return a}function i_(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=t[e],i=a_[e],o=r?n===!0?function(){i.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),i.apply(this,arguments)}:i;t[e]=o}function o_(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":Jy(t))!=="object"||(typeof e>"u"?"undefined":Jy(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,i=n.length-1;r=n[i];i--)if(e[r]!==t[r])return!0;return!1}var a_={componentWillMount:function(){var e=this,n=Zy(this),r=!1,i=!1;function o(d){var f=this[d],h=Hd("reactive "+d);Object.defineProperty(this,d,{configurable:!0,enumerable:!0,get:function(){return h.reportObserved(),f},set:function(g){!i&&o_(f,g)?(f=g,r=!0,h.reportChanged(),r=!1):f=g}})}o.call(this,"props"),o.call(this,"state");var a=this.render.bind(this),s=null,l=!1,u=function(){return s=new Ta(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var f=!0;try{i=!0,r||Qe.prototype.forceUpdate.call(e),f=!1}finally{i=!1,f&&s.dispose()}}}),s.reactComponent=e,c.$mobx=s,e.render=c,c(e.props,e.state,e.context)},c=function(f,h,v){l=!1;var g=void 0,m=void 0;if(s.track(function(){try{m=uB(!1,a,f,h,v)}catch(y){g=y}}),g)throw g;return m};this.render=u},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:o_(this.props,e)}};function rf(t){if(arguments.length>1&&r_.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&r_.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aB(t)){var e,n;return rf((n=e=function(i){t_(o,i);function o(){return Qy(this,o),n_(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return e_(o,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),o}(Qe),e.displayName=Zy(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var r=t.prototype||t;return cB(r),t.isMobXReactObserver=!0,t}function cB(t){i_(t,"componentWillMount",!0),i_(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=a_.shouldComponentUpdate)}var dB=rf(function(t){var e=t.children;return e[0]()});dB.displayName="Observer";var fB=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pB(t,e){return e={exports:{}},t(e,e.exports),e.exports}pB(function(t,e){(function(n,r){t.exports=r()})(fB,function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.defineProperty,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,u=l&&l(Object);return function c(d,f,h){if(typeof f!="string"){if(u){var v=l(f);v&&v!==u&&c(d,v,h)}var g=o(f);a&&(g=g.concat(a(f)));for(var m=0;m<g.length;++m){var y=g[m];if(!n[y]&&!r[y]&&(!h||!h[y])){var x=s(f,y);try{i(d,y,x)}catch{}}}return d}return d}})});var s_={children:!0,key:!0,ref:!0},l_=console;if(function(t){t_(e,t);function e(){return Qy(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return e_(e,[{key:"render",value:function(r){var i=r.children;return i.length>1?Te("div",null," ",i," "):i[0]}},{key:"getChildContext",value:function(){var r={},i=this.context.mobxStores;if(i)for(var o in i)r[o]=i[o];for(var a in this.props)!s_[a]&&a!=="suppressChangedStoreWarning"&&(r[a]=this.props[a]);return{mobxStores:r}}},{key:"componentWillReceiveProps",value:function(r){if(Object.keys(r).length!==Object.keys(this.props).length&&l_.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!r.suppressChangedStoreWarning)for(var i in r)!s_[i]&&this.props[i]!==r[i]&&l_.warn("MobX Provider: Provided store '"+i+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(Qe),!Qe)throw new Error("mobx-preact requires Preact to be available");var Br,of,u_,c_=[],qt=qe,d_=qt.__b,f_=qt.__r,p_=qt.diffed,h_=qt.__c,g_=qt.unmount,v_=qt.__;function hB(){for(var t;t=c_.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(kl),t.__H.__h.forEach(af),t.__H.__h=[]}catch(e){t.__H.__h=[],qt.__e(e,t.__v)}}qt.__b=function(t){Br=null,d_&&d_(t)},qt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),v_&&v_(t,e)},qt.__r=function(t){f_&&f_(t);var e=(Br=t.__c).__H;e&&(of===Br?(e.__h=[],Br.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(kl),e.__h.forEach(af),e.__h=[])),of=Br},qt.diffed=function(t){p_&&p_(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(c_.push(e)!==1&&u_===qt.requestAnimationFrame||((u_=qt.requestAnimationFrame)||gB)(hB)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),of=Br=null},qt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(kl),n.__h=n.__h.filter(function(r){return!r.__||af(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],qt.__e(r,n.__v)}}),h_&&h_(t,e)},qt.unmount=function(t){g_&&g_(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{kl(r)}catch(i){e=i}}),n.__H=void 0,e&&qt.__e(e,n.__v))};var m_=typeof requestAnimationFrame=="function";function gB(t){var e,n=function(){clearTimeout(r),m_&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);m_&&(e=requestAnimationFrame(n))}function kl(t){var e=Br,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Br=e}function af(t){var e=Br;t.__c=t.__(),Br=e}function vB(t,e){for(var n in e)t[n]=e[n];return t}function y_(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function __(t,e){this.props=t,this.context=e}(__.prototype=new Qe).isPureReactComponent=!0,__.prototype.shouldComponentUpdate=function(t,e){return y_(this.props,t)||y_(this.state,e)};var b_=qe.__b;qe.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),b_&&b_(t)};var mB=qe.__e;qe.__e=function(t,e,n,r){if(t.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}mB(t,e,n,r)};var x_=qe.unmount;function E_(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=vB({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return E_(r,e,n)})),t}function w_(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return w_(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function sf(){this.__u=0,this.o=null,this.__b=null}function S_(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Bl(){this.i=null,this.l=null}qe.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),x_&&x_(t)},(sf.prototype=new Qe).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=S_(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=w_(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},sf.prototype.componentWillUnmount=function(){this.o=[]},sf.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=E_(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&Te(wo,null,t.fallback);return i&&(i.__u&=-33),[Te(wo,null,e.__a?null:t.children),i]};var C_=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(Bl.prototype=new Qe).__a=function(t){var e=this,n=S_(e.__v),r=e.l.get(t);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),C_(e,t,r)):i()};n?n(o):o()}},Bl.prototype.render=function(t){this.i=null,this.l=new Map;var e=gl(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},Bl.prototype.componentDidUpdate=Bl.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){C_(t,n,e)})};var yB=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bB=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xB=/[A-Z0-9]/g,EB=typeof document<"u",wB=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function A_(t,e,n){return e.__k==null&&(e.textContent=""),UI(t,e),typeof n=="function"&&n(),t?t.__c:null}Qe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Qe.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var O_=qe.event;function SB(){}function CB(){return this.cancelBubble}function AB(){return this.defaultPrevented}qe.event=function(t){return O_&&(t=O_(t)),t.persist=SB,t.isPropagationStopped=CB,t.isDefaultPrevented=AB,t.nativeEvent=t};var OB={enumerable:!1,configurable:!0,get:function(){return this.class}},T_=qe.vnode;qe.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||EB&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||wB(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":bB.test(a)&&(a=l):l=a="oninput":o&&_B.test(a)?a=a.replace(xB,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=gl(n.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=gl(n.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",OB)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),e.props=i}(t),t.$$typeof=yB,T_&&T_(t)};var N_=qe.__r;qe.__r=function(t){N_&&N_(t),t.__c};var M_=qe.diffed;qe.diffed=function(t){M_&&M_(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var TB=0;function V(t,e,n,r,i,o){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TB,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return qe.vnode&&qe.vnode(u),u}var NB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Da;(function(t){function e(n){var r=NB(n,[]),i=n.container;if(!i)throw new Error("Ensure the container of LogicFlow is specified and valid.");return ut({},t.defaults,r)}t.get=e})(Da||(Da={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(Da||(Da={}));var D_={node:!1,edge:!1},MB={node:!0,edge:!0},DB=function(t){return!t||typeof t=="boolean"?Pe(t===!0?MB:D_):zi(Pe(D_),t)},PB=function(){return ui(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function sn(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}var P_=200,RB=9999,LB=10,lt;(function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(lt||(lt={}));var Lt;(function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"})(Lt||(Lt={}));var Ye;(function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"})(Ye||(Ye={}));var be;(function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_FOCUS="node:focus",t.NODE_BLUR="node:blur",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_FOCUS="edge:focus",t.EDGE_BLUR="edge:blur",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_CLICK="anchor:click",t.ANCHOR_MOUSEDOWN="anchor:mousedown",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated",t.EDIT_CONFIG_CHANGED="editConfig:changed"})(be||(be={}));var Xt;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(Xt||(Xt={}));var Tt;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(Tt||(Tt={}));var er;(function(t){t.TEXT="text",t.LABEL="label"})(er||(er={}));var IB=0,tr=function(){function t(e){var n=e.onDragStart,r=n===void 0?lo:n,i=e.onDragging,o=i===void 0?lo:i,a=e.onDragEnd,s=a===void 0?lo:a,l=e.eventType,u=l===void 0?"":l,c=e.eventCenter,d=e.step,f=d===void 0?1:d,h=e.isStopPropagation,v=h===void 0?!0:h,g=e.model,m=e.data,y=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(x){var E,b,T=window==null?void 0:window.document;if(x.button===IB){y.isStopPropagation&&x.stopPropagation(),y.isStartDragging=!0,y.startX=x.clientX,y.startY=x.clientY,T.addEventListener("mousemove",y.handleMouseMove,!1),T.addEventListener("mouseup",y.handleMouseUp,!1);var A=(E=y.model)===null||E===void 0?void 0:E.getData();(b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_MOUSEDOWN")],{e:x,data:y.data||A}),y.startTime=new Date().getTime()}},this.handleMouseMove=function(x){var E,b;if(y.isStopPropagation&&x.stopPropagation(),!!y.isStartDragging&&(y.sumDeltaX+=x.clientX-y.startX,y.sumDeltaY+=x.clientY-y.startY,y.startX=x.clientX,y.startY=x.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var T=y.sumDeltaX%y.step,A=y.sumDeltaY%y.step,S=y.sumDeltaX-T,M=y.sumDeltaY-A;y.sumDeltaX=T,y.sumDeltaY=A;var C=(E=y.model)===null||E===void 0?void 0:E.getData();y.isDragging||((b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_DRAGSTART")],{e:x,data:y.data||C}),y.onDragStart({event:x})),y.isDragging=!0,Promise.resolve().then(function(){var G,K;y.onDragging({deltaX:S,deltaY:M,event:x}),(G=y.eventCenter)===null||G===void 0||G.emit(be["".concat(y.eventType,"_MOUSEMOVE")],{deltaX:S,deltaY:M,e:x,data:y.data||C}),(K=y.eventCenter)===null||K===void 0||K.emit(be["".concat(y.eventType,"_DRAG")],{e:x,data:y.data||C})})}},this.handleMouseUp=function(x){var E=window.document;y.isStartDragging=!1,y.isStopPropagation&&x.stopPropagation(),Promise.resolve().then(function(){var b,T,A;E.removeEventListener("mousemove",y.handleMouseMove,!1),E.removeEventListener("mouseup",y.handleMouseUp,!1);var S=(b=y.model)===null||b===void 0?void 0:b.getData();(T=y.eventCenter)===null||T===void 0||T.emit(be["".concat(y.eventType,"_MOUSEUP")],{e:x,data:y.data||S}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:x}),(A=y.eventCenter)===null||A===void 0||A.emit(be["".concat(y.eventType,"_DROP")],{e:x,data:y.data||S}))})},this.cancelDrag=function(){var x=window==null?void 0:window.document;x.removeEventListener("mousemove",y.handleMouseMove,!1),x.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:void 0}),y.isDragging=!1},this.destroy=function(){y.isStartDragging&&y.cancelDrag()},this.onDragStart=r,this.onDragging=o,this.onDragEnd=s,this.step=f,this.isStopPropagation=v,this.eventType=u,this.eventCenter=c,this.model=g,this.data=m}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t}(),kB=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{x:e-r/2,y:n-i/2,x1:e+r/2,y1:n+i/2}},BB=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,i=(e.y+n.y)/2,o=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-o/2,y:i-a/2,x1:r+o/2,y1:i+a/2}},jB=function(t){var e=t.points,n=Ki(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},FB=function(t){var e=t.path,n=cf(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},$B=function(t){if(t.modelType===Ye.LINE_EDGE)return BB(t);if(t.modelType===Ye.POLYLINE_EDGE)return jB(t);if(t.modelType===Ye.BEZIER_EDGE)return FB(t)},HB=function(t,e,n,r){var i=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(i===0)return!1;var o=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/i,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/i;return(o-t.x)*(o-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(o-n.x)*(o-r.x)<=0&&(a-n.y)*(a-r.y)<=0?{x:o,y:a}:!1},Pa=function(t,e,n){var r=t.x,i=t.y,o=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-o),c=a-u*o;return(r>=o&&r<=s||r<=o&&r>=s)&&(i>=a&&i<=l||i<=a&&i>=l)&&Math.abs(i-u*r-c)<Number.EPSILON},Ra=function(t){var e=t.start,n=t.end,r=t.offset,i=t.verticalLength,o=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),l=Math.atan(r/i),u=Math.sqrt(i*i+r*r);return o==="start"?n.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):o==="end"&&(n.x>=e.x?(a.leftX=n.x+u*Math.sin(s-l),a.leftY=n.y-u*Math.cos(s-l),a.rightX=n.x-u*Math.sin(s+l),a.rightY=n.y+u*Math.cos(s+l)):(a.leftX=n.x-u*Math.sin(s-l),a.leftY=n.y+u*Math.cos(s-l),a.rightX=n.x+u*Math.sin(s+l),a.rightY=n.y-u*Math.cos(s+l))),a},Bo=function(){return Bo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bo.apply(this,arguments)},nr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},wi=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zB=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},lf=function(t){var e=[],n={};return t.forEach(function(r){var i="".concat(r.x,"-").concat(r.y);r.id=i,n[i]=r}),Object.keys(n).forEach(function(r){e.push(n[r])}),e},jl=function(t,e){return t.width===0&&t.height===0?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},WB=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?Tt.HORIZONTAL:Tt.VERTICAL},Fl=function(t,e,n){var r=WB(n,e);return r===Tt.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},R_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{x:(n+i)/2,y:(r+o)/2,centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},La=function(t,e){t===void 0&&(t=[]);var n=[],r=[];t.forEach(function(c){n.push(c.x),r.push(c.y)});var i=Math.min.apply(Math,wi([],nr(n),!1)),o=Math.max.apply(Math,wi([],nr(n),!1)),a=Math.min.apply(Math,wi([],nr(r),!1)),s=Math.max.apply(Math,wi([],nr(r),!1)),l=o-i,u=s-a;return e&&(l+=e,u+=e),{centerX:(i+o)/2,centerY:(a+s)/2,maxX:o,maxY:s,minX:i,minY:a,x:(i+o)/2,y:(a+s)/2,height:u,width:l}},$l=function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:i},{x:e,y:i}]},Hl=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},UB=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},VB=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},XB=function(t,e){return wi(wi([],nr(UB(t,e.x)),!1),nr(VB(t,e.y)),!1)},uf=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},GB=function(t,e){var n=-2,r=0;return e.forEach(function(i){i&&(t.x===i.x&&(r+=n),t.y===i.y&&(r+=n))}),r},L_=function(t,e,n,r,i){return uf(t,e)+uf(t,n)+GB(t,[e,n,r,i])},I_=function(t,e,n,r,i){i||(i=0),t.unshift(e[r]),n[r]&&n[r]!==r&&i<=100&&I_(t,e,n,n[r],i+1)},YB=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Ia=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=r.x-n.x,s=r.y-n.y,l=(-o*(t.x-n.x)+i*(t.y-n.y))/(-a*o+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*o+i*s);return l>=0&&l<=1&&u>=0&&u<=1},k_=function(t,e,n){if(n.width===0&&n.height===0)return!1;var r=nr($l(n),4),i=r[0],o=r[1],a=r[2],s=r[3];return Ia(t,e,i,o)||Ia(t,e,i,s)||Ia(t,e,o,a)||Ia(t,e,a,s)},KB=function(t,e,n,r){var i=[];return t.forEach(function(o){o!==e&&(o.x===e.x||o.y===e.y)&&!k_(o,e,n)&&!k_(o,e,r)&&i.push(o)}),lf(i)},qB=function(t,e,n,r,i,o,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=L_(e,n,e));var f={};t.forEach(function(g){g.id&&(f[g.id]=g)});for(var h=function(){var g,m=1/0;if(l.forEach(function(x){x.id&&d[x.id]<m&&(m=d[x.id],g=x)}),g===n&&n.id){var y=[];return I_(y,f,u,n.id),{value:y}}if(!g)return{value:[e,n]};YB(l,g),s.push(g),KB(t,g,r,i).forEach(function(x){if(s.indexOf(x)===-1&&(l.indexOf(x)===-1&&l.push(x),g!=null&&g.id&&(x!=null&&x.id))){var E=d[g.id]+uf(g,x);if(c[x.id]&&E>=c[x.id])return;u[x.id]=g.id,c[x.id]=E,d[x.id]=c[x.id]+L_(x,n,e,o,a)}})};l.length;){var v=h();if(typeof v=="object")return v.value}return[e,n]},B_=function(t){return Hn(t)},j_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],i=t[e+1];n.x===r.x&&r.x===i.x||n.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t},F_=function(t,e,n,r,i){var o=B_(n),a=B_(r),s=jl(o,i),l=jl(a,i),u=Fl(s,o,t),c=Fl(l,a,e);if(zB(s,l)){var d=JB(t,e,u,c);return wi(wi([t,u],nr(d),!1),[c,e],!1)}var f=La([u,c]),h=R_(s,f),v=R_(l,f),g=[];g=g.concat($l(h)),g=g.concat($l(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,h,v].forEach(function(x){g=g.concat(XB(x,m).filter(function(E){return Hl(E,s)&&Hl(E,l)}))}),[{x:u.x,y:c.y},{x:c.x,y:u.y}].forEach(function(x){Hl(x,s)&&Hl(x,l)&&g.push(x)}),g.unshift(u),g.push(c),g=lf(g);var y=qB(g,u,c,o,a,t,e);return y.unshift(t),y.push(e),y.length>2&&(y=j_(y)),lf(y)},ZB=function(t){if(t.length===1){var e=nr(t,1),n=e[0];return[n,n]}else{for(var r=t[0],i=t[1],o=Er(r.x,r.y,i.x,i.y),a=1;a<t.length-1;a++){var s=t[a],l=t[a+1],u=Er(s.x,s.y,l.x,l.y);u>o&&(o=u,r=s,i=l)}return[r,i]}},$_=function(t,e,n){var r=ni(t,n),i=ni(e,n);return r&&i},H_=function(t,e,n){var r=ni(t,n),i=ni(e,n),o=r&&i,a=r||i;return!o&&a},z_=function(t,e,n){for(var r=void 0,i=Hn(n),o=$l(i),a=0;a<o.length;a++){var s=Ia(t,e,o[a],o[(a+1)%o.length]);s&&(r=[o[a],o[(a+1)%o.length]])}if(r)return HB(t,e,r[0],r[1])},zl=function(t,e){var n=void 0;return t.x===e.x?n=Tt.VERTICAL:t.y===e.y&&(n=Tt.HORIZONTAL),n},Ki=function(t){var e=t.split(" "),n=[];return e&&e.forEach(function(r){var i=nr(r.split(","),2),o=i[0],a=i[1];n.push({x:Number(o),y:Number(a)})}),n},JB=function(t,e,n,r){var i=[],o=zl(t,n),a=zl(e,r);if(o===a)t.y===n.y?(i.push({x:n.x,y:(n.y+r.y)/2}),i.push({x:r.x,y:(n.y+r.y)/2})):(i.push({x:(n.x+r.x)/2,y:n.y}),i.push({x:(n.x+r.x)/2,y:r.y}));else{var s={x:n.x,y:r.y},l=Pa(s,t,n),u=Pa(s,e,r);if(l||u)s={x:r.x,y:n.y};else{var c=W_(s,t,n),d=W_(s,e,r);c&&d&&(s={x:r.x,y:n.y})}i.push(s)}return i},W_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},U_=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:r>=1&&r<=126||r>=65376&&r<=65439?e+=1:e+=2}return e},QB=function(t){var e=t.start,n=t.end,r;if(e.x===n.x&&e.y===n.y)r="";else{var i={start:e,end:n,offset:10,verticalLength:5},o=Ra(Bo(Bo({},i),{type:"start"})),a=Ra(Bo(Bo({},i),{type:"end"}));r="M".concat(o.leftX," ").concat(o.leftY,`
60
+ `)()}}function Sy(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(r){return Sy(r,e,n+1)})}var Ta=function(){function t(e,n,r,i){e===void 0&&(e="Reaction@"+On()),i===void 0&&(i=!1),this.name=e,this.onInvalidate=n,this.errorHandler=r,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=vt.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+On(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=hr.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,pe.pendingReactions.push(this),Ay())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(gr(),this._isScheduled=!1,Vd(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Kt()&&process.env.NODE_ENV!=="production"&&Yi({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}vr()}},t.prototype.track=function(e){if(!this.isDisposed){gr();var n=Kt(),r;n&&process.env.NODE_ENV!=="production"&&(r=Date.now(),Fn({name:this.name,type:"reaction"})),this._isRunning=!0;var i=hy(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Xd(this),Aa(i)&&this.reportExceptionInDerivation(i.cause),n&&process.env.NODE_ENV!=="production"&&$n({time:Date.now()-r}),vr()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(pe.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";pe.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Kt()&&Yi({type:"error",name:this.name,message:r,error:""+e}),pe.globalReactionErrorHandlers.forEach(function(i){return i(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(gr(),Xd(this),vr()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[ke]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),Vk(this,e)},t}(),Cy=100,Kd=function(t){return t()};function Ay(){pe.inBatch>0||pe.isRunningReactions||Kd(Ck)}function Ck(){pe.isRunningReactions=!0;for(var t=pe.pendingReactions,e=0;t.length>0;){++e===Cy&&(console.error("Reaction doesn't converge to a stable state after "+Cy+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}pe.isRunningReactions=!1}var Pl=yi("Reaction",Ta);function Ak(t){var e=Kd;Kd=function(n){return t(function(){return e(n)})}}function Kt(){return process.env.NODE_ENV!=="production"&&!!pe.spyListeners.length}function Yi(t){if(process.env.NODE_ENV!=="production"&&pe.spyListeners.length)for(var e=pe.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function Fn(t){if(process.env.NODE_ENV!=="production"){var e=Ot(Ot({},t),{spyReportStart:!0});Yi(e)}}var Ok={spyReportEnd:!0};function $n(t){process.env.NODE_ENV!=="production"&&Yi(t?Ot(Ot({},t),{spyReportEnd:!0}):Ok)}function Tk(t){return process.env.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(pe.spyListeners.push(t),Bd(function(){pe.spyListeners=pe.spyListeners.filter(function(e){return e!==t})}))}function Nk(){He(process.env.NODE_ENV!=="production"&&"@action fields are not reassignable")}function Oy(t){return function(e,n,r){if(r){if(process.env.NODE_ENV!=="production"&&r.get!==void 0)return He("@action cannot be used with getters");if(r.value)return{value:Xi(t,r.value),enumerable:!1,configurable:!0,writable:!0};var i=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Xi(t,i.call(this))}}}return Mk(t).apply(this,arguments)}}function Mk(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(i){Co(this,n,U(t,i))}})}}function Dk(t,e,n,r){return r===!0?(qd(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return qd(this,e,n.value||n.initializer.call(this)),this[e]},set:Nk}:{enumerable:!1,configurable:!0,set:function(i){qd(this,e,i)},get:function(){}}}var U=function(e,n,r,i){if(arguments.length===1&&typeof e=="function")return Xi(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Xi(e,n);if(arguments.length===1&&typeof e=="string")return Oy(e);if(i===!0)Co(e,n,Xi(e.name||n,r.value,this));else return Oy(n).apply(null,arguments)};U.bound=Dk;function Pk(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",r=typeof t=="function"?t:e;return process.env.NODE_ENV!=="production"&&(Mt(typeof r=="function"&&r.length===0,"`runInAction` expects a function without arguments"),(typeof n!="string"||!n)&&He("actions should have valid names, got: '"+n+"'")),yy(n,r,this,void 0)}function Rk(t){return typeof t=="function"&&t.isMobxAction===!0}function qd(t,e,n){Co(t,e,Xi(e,n.bind(t)))}function Lk(t,e){e===void 0&&(e=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","Autorun expects a function as first argument"),Mt(Rk(t)===!1,"Autorun does not accept actions since actions are untrackable"));var n=e&&e.name||t.name||"Autorun@"+On(),r=!e.scheduler&&!e.delay,i;if(r)i=new Ta(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var o=Ty(e),a=!1;i=new Ta(n,function(){a||(a=!0,o(function(){a=!1,i.isDisposed||i.track(s)}))},e.onError,e.requiresObservable)}function s(){t(i)}return i.schedule(),i.getDisposer()}var Ik=function(t){return t()};function Ty(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ik}function Ny(t,e,n){n===void 0&&(n=kd),process.env.NODE_ENV!=="production"&&(Mt(typeof t=="function","First argument to reaction should be a function"),Mt(typeof n=="object","Third argument of reactions should be an object"));var r=n.name||"Reaction@"+On(),i=U(r,n.onError?kk(n.onError,e):e),o=!n.scheduler&&!n.delay,a=Ty(n),s=!0,l=!1,u,c=n.compareStructural?To.structural:n.equals||To.default,d=new Ta(r,function(){s||o?f():l||(l=!0,a(f))},n.onError,n.requiresObservable);function f(){if(l=!1,!d.isDisposed){var h=!1;d.track(function(){var v=t(d);h=s||!c(u,v),u=v}),s&&n.fireImmediately&&i(u,d),!s&&h===!0&&i(u,d),s&&(s=!1)}}return d.schedule(),d.getDisposer()}function kk(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function Bk(t,e,n){return Dy("onBecomeObserved",t,e)}function My(t,e,n){return Dy("onBecomeUnobserved",t,e)}function Dy(t,e,n,r){var i=Ei(e),o=n,a=t+"Listeners";i[a]?i[a].add(o):i[a]=new Set([o]);var s=i[t];return typeof s!="function"?He(process.env.NODE_ENV!=="production"&&"Not an atom that can be (un)observed"):function(){var l=i[a];l&&(l.delete(o),l.size===0&&delete i[a])}}function jk(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,i=t.disableErrorBoundaries,o=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bk(),e!==void 0){(typeof e=="boolean"||e==="strict")&&XI(`Deprecated value for 'enforceActions', use 'false' => '"never"', 'true' => '"observed"', '"strict"' => "'always'" instead`);var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:He("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}pe.enforceActions=l,pe.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(pe.computedRequiresReaction=!!n),a!==void 0&&(pe.reactionRequiresObservable=!!a),s!==void 0&&(pe.observableRequiresReaction=!!s,pe.allowStateReads=!pe.observableRequiresReaction),r!==void 0&&(pe.computedConfigurable=!!r),i!==void 0&&(i===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),pe.disableErrorBoundaries=!!i),o&&Ak(o)}function Zd(t,e,n,r){process.env.NODE_ENV!=="production"&&(Mt(arguments.length>=2&&arguments.length<=4,"'extendObservable' expected 2-4 arguments"),Mt(typeof t=="object","'extendObservable' expects an object as first argument"),Mt(!gn(t),"'extendObservable' should not be used on maps, use map.merge instead")),r=Mo(r);var i=Py(r);return Vi(t),ef(t,r.name,i.enhancer),e&&Ry(t,e,n,i),t}function Py(t){return t.defaultDecorator||(t.deep===!1?fy:Ud)}function Ry(t,e,n,r){var i,o,a,s;if(process.env.NODE_ENV!=="production"&&(Mt(!bi(e),"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),n)){var l=Fd(n);try{for(var u=pr(l),c=u.next();!c.done;c=u.next()){var d=c.value;d in e||He("Trying to declare a decorator for unspecified property '"+Jn(d)+"'")}}catch(y){i={error:y}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}gr();try{var l=ZI(e);try{for(var f=pr(l),h=f.next();!h.done;h=f.next()){var d=h.value,v=Object.getOwnPropertyDescriptor(e,d);process.env.NODE_ENV!=="production"&&(Ui(e)||He("'extendObservable' only accepts plain objects as second argument"),ky(v.value)&&He("Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead"));var g=n&&d in n?n[d]:v.get?Sl:r;process.env.NODE_ENV!=="production"&&typeof g!="function"&&He("Not a valid decorator for '"+Jn(d)+"', got: "+g);var m=g(t,d,v,!0);m&&Object.defineProperty(t,d,m)}}catch(x){a={error:x}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}}finally{vr()}}function Fk(t,e){return Ly(Ei(t,e))}function Ly(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=GI(t.observing).map(Ly)),e}function Iy(t,e){if(t==null)return!1;if(e!==void 0){if(xr(t)===!1||!t[ke].values.has(e))return!1;var n=Ei(t,e);return Lo(n)}return Lo(t)}function ky(t){return arguments.length>1?He(process.env.NODE_ENV!=="production"&&"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property"):Iy(t)}function By(t,e){return typeof e!="string"?He(process.env.NODE_ENV!=="production"&&"isComputed expected a property name as second argument"):Iy(t,e)}function $k(t,e){return t==null?!1:xr(t)||!!t[ke]||$d(t)||Pl(t)||Lo(t)}function bi(t){return arguments.length!==1&&He(process.env.NODE_ENV!=="production"&&"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),$k(t)}function Io(t){return xr(t)?t[ke].getKeys():gn(t)||Qn(t)?Array.from(t.keys()):kr(t)?t.map(function(e,n){return n}):He(process.env.NODE_ENV!=="production"&&"'keys()' can only be used on observable objects, arrays, sets and maps")}function Hk(t){return xr(t)?Io(t).map(function(e){return t[e]}):gn(t)?Io(t).map(function(e){return t.get(e)}):Qn(t)?Array.from(t.values()):kr(t)?t.slice():He(process.env.NODE_ENV!=="production"&&"'values()' can only be used on observable objects, arrays, sets and maps")}function zk(t){return xr(t)?Io(t).map(function(e){return[e,t[e]]}):gn(t)?Io(t).map(function(e){return[e,t.get(e)]}):Qn(t)?Array.from(t.entries()):kr(t)?t.map(function(e,n){return[n,e]}):He(process.env.NODE_ENV!=="production"&&"'entries()' can only be used on observable objects, arrays and maps")}function Jd(t,e,n){if(arguments.length===2&&!Qn(t)){gr();var r=e;try{for(var i in r)Jd(t,i,r[i])}finally{vr()}return}if(xr(t)){var o=t[ke],a=o.values.get(e);a?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(gn(t))t.set(e,n);else if(Qn(t))t.add(e);else if(kr(t))typeof e!="number"&&(e=parseInt(e,10)),Mt(e>=0,"Not a valid index: '"+e+"'"),gr(),e>=t.length&&(t.length=e+1),t[e]=n,vr();else return He(process.env.NODE_ENV!=="production"&&"'set()' can only be used on observable objects, arrays and maps")}function jy(t,e,n,r){return Wk(t,e,n)}function Wk(t,e,n){return Il(t).observe(e,n)}var Uk={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function ko(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function xi(t,e,n){if(!e.recurseEverything&&!bi(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yk(t))return xi(t.get(),e,n);bi(t)&&Io(t);var r=e.detectCycles===!0;if(r&&t!==null&&n.has(t))return n.get(t);if(kr(t)||Array.isArray(t)){var i=ko(n,t,[],e),o=t.map(function(h){return xi(h,e,n)});i.length=o.length;for(var a=0,s=o.length;a<s;a++)i[a]=o[a];return i}if(Qn(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=ko(n,t,new Set,e);return t.forEach(function(h){l.add(xi(h,e,n))}),l}else{var u=ko(n,t,[],e);return t.forEach(function(h){u.push(xi(h,e,n))}),u}if(gn(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var c=ko(n,t,new Map,e);return t.forEach(function(h,v){c.set(v,xi(h,e,n))}),c}else{var d=ko(n,t,{},e);return t.forEach(function(h,v){d[v]=xi(h,e,n)}),d}var f=ko(n,t,{},e);return Fd(t).forEach(function(h){f[h]=xi(t[h],e,n)}),f}function mr(t,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=Uk),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var n;return e.detectCycles&&(n=new Map),xi(t,e,n)}function Vk(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var r=Xk(t);if(!r)return He(process.env.NODE_ENV!=="production"&&"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===hr.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?hr.BREAK:hr.LOG}function Xk(t){switch(t.length){case 0:return pe.trackingDerivation;case 1:return Ei(t[0]);case 2:return Ei(t[0],t[1])}}function yr(t,e){e===void 0&&(e=void 0),gr();try{return t.apply(e)}finally{vr()}}function Rl(t){return t[ke]}function Ll(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"}var Gk={has:function(t,e){if(e===ke||e==="constructor"||e===bl)return!0;var n=Rl(t);return Ll(e)?n.has(e):e in t},get:function(t,e){if(e===ke||e==="constructor"||e===bl)return t[e];var n=Rl(t),r=n.values.get(e);if(r instanceof Oo){var i=r.get();return i===void 0&&n.has(e),i}return Ll(e)&&n.has(e),t[e]},set:function(t,e,n){return Ll(e)?(Jd(t,e,n),!0):!1},deleteProperty:function(t,e){if(!Ll(e))return!1;var n=Rl(t);return n.remove(e),!0},ownKeys:function(t){var e=Rl(t);return e.keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return He("Dynamic observable objects cannot be frozen"),!1}};function Yk(t){var e=new Proxy(t,Gk);return t[ke].proxy=e,e}function Lr(t){return t.interceptors!==void 0&&t.interceptors.length>0}function Na(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Ir(t,e){var n=Po();try{for(var r=Wd(t.interceptors||[]),i=0,o=r.length;i<o&&(e=r[i](e),Mt(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);i++);return e}finally{_i(n)}}function _r(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function Ma(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),Bd(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function br(t,e){var n=Po(),r=t.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);_i(n)}}var Kk=1e4,qk={get:function(t,e){return e===ke?t[ke]:e==="length"?t[ke].getArrayLength():typeof e=="number"?ti.get.call(t,e):typeof e=="string"&&!isNaN(e)?ti.get.call(t,parseInt(e)):ti.hasOwnProperty(e)?ti[e]:t[e]},set:function(t,e,n){return e==="length"&&t[ke].setArrayLength(n),typeof e=="number"&&ti.set.call(t,e,n),typeof e=="symbol"||isNaN(e)?t[e]=n:ti.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return He("Observable arrays cannot be frozen"),!1}};function Zk(t,e,n,r){n===void 0&&(n="ObservableArray@"+On()),r===void 0&&(r=!1);var i=new Fy(n,e,r);KI(i.values,ke,i);var o=new Proxy(i.values,qk);if(i.proxy=o,t&&t.length){var a=Ol(!0);i.spliceWithArray(0,0,t),Tl(a)}return o}var Fy=function(){function t(e,n,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Oo(e||"ObservableArray@"+On()),this.enhancer=function(i,o){return n(i,o,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ma(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var r=new Array(e-n),i=0;i<e-n;i++)r[i]=void 0;this.spliceWithArray(n,0,r)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},t.prototype.spliceWithArray=function(e,n,r){var i=this;Do(this.atom);var o=this.values.length;if(e===void 0?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),arguments.length===1?n=o-e:n==null?n=0:n=Math.max(0,Math.min(n,o-e)),r===void 0&&(r=yl),Lr(this)){var a=Ir(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:r});if(!a)return yl;n=a.removedCount,r=a.added}if(r=r.length===0?r:r.map(function(u){return i.enhancer(u,void 0)}),process.env.NODE_ENV!=="production"){var s=r.length-n;this.updateArrayLength(o,s)}var l=this.spliceItemsIntoValues(e,n,r);return(n!==0||r.length!==0)&&this.notifyArraySplice(e,r,l),this.dehanceValues(l)},t.prototype.spliceItemsIntoValues=function(e,n,r){var i;if(r.length<Kk)return(i=this.values).splice.apply(i,Wd([e,n],r));var o=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+n)),o},t.prototype.notifyArrayChildUpdate=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:r}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.notifyArraySplice=function(e,n,r){var i=!this.owned&&Kt(),o=_r(this),a=o||i?{object:this.proxy,type:"splice",index:e,removed:r,added:n,removedCount:r.length,addedCount:n.length}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t}(),ti={intercept:function(t){return this[ke].intercept(t)},observe:function(t,e){e===void 0&&(e=!1);var n=this[ke];return n.observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[ke];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=this[ke];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(t);case 2:return i.spliceWithArray(t,e)}return i.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){var r=this[ke];return r.spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[ke].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[ke];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place");var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place");var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[ke],n=e.dehanceValues(e.values).indexOf(t);return n>-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[ke];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[ke],r=n.values;if(t<r.length){Do(n.atom);var i=r[t];if(Lr(n)){var o=Ir(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!o)return;e=o.newValue}e=n.enhancer(e,i);var a=e!==i;a&&(r[t]=e,n.notifyArrayChildUpdate(t,e,i))}else if(t===r.length)n.spliceWithArray(t,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(){var e=this[ke];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})}),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(t){typeof Array.prototype[t]=="function"&&(ti[t]=function(e,n){var r=this,i=this[ke];i.atom.reportObserved();var o=i.dehanceValues(i.values);return o[t](function(a,s){return e.call(n,a,s,r)},n)})}),["reduce","reduceRight"].forEach(function(t){ti[t]=function(){var e=this,n=this[ke];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(i,o,a){return o=n.dehanceValue(o),r(i,o,a,e)},n.values[t].apply(n.values,arguments)}});var Jk=yi("ObservableArrayAdministration",Fy);function kr(t){return jd(t)&&Jk(t[ke])}var $y,Qk={},Qd=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableMap@"+On()),this.enhancer=n,this.name=r,this[$y]=Qk,this._keysAtom=Hd(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!pe.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var i=r=new Gi(this._has(e),xl,this.name+"."+Jn(e)+"?",!1);this._hasMap.set(e,i),My(i,function(){return n._hasMap.delete(e)})}return r.get()},t.prototype.set=function(e,n){var r=this._has(e);if(Lr(this)){var i=Ir(this,{type:r?"update":"add",object:this,newValue:n,name:e});if(!i)return this;n=i.newValue}return r?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(Do(this._keysAtom),Lr(this)){var r=Ir(this,{type:"delete",object:this,name:e});if(!r)return!1}if(this._has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),yr(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var r=this._hasMap.get(e);r&&r.setNewValue(n)},t.prototype._updateValue=function(e,n){var r=this._data.get(e);if(n=r.prepareNewValue(n),n!==pe.UNCHANGED){var i=Kt(),o=_r(this),a=o||i?{type:"update",object:this,oldValue:r.value,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),r.setNewValue(n),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype._addValue=function(e,n){var r=this;Do(this._keysAtom),yr(function(){var s=new Gi(n,r.enhancer,r.name+"."+Jn(e),!1);r._data.set(e,s),n=s.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()});var i=Kt(),o=_r(this),a=o||i?{type:"add",object:this,name:e,newValue:n}:null;i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},a),{name:this.name,key:e})),o&&br(this,a),i&&process.env.NODE_ENV!=="production"&&$n()},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var e=this,n=this.keys();return kl({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:e.get(o)}}})},t.prototype.entries=function(){var e=this,n=this.keys();return kl({next:function(){var r=n.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:[o,e.get(o)]}}})},t.prototype[$y=ke,Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=No(a.value,2),l=s[0],u=s[1];e.call(n,u,l,this)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.merge=function(e){var n=this;return gn(e)&&(e=e.toJS()),yr(function(){var r=Ol(!0);try{Ui(e)?Fd(e).forEach(function(i){return n.set(i,e[i])}):Array.isArray(e)?e.forEach(function(i){var o=No(i,2),a=o[0],s=o[1];return n.set(a,s)}):Ao(e)?(e.constructor!==Map&&He("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(i,o){return n.set(o,i)})):e!=null&&He("Cannot initialize map from "+e)}finally{Tl(r)}}),this},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e.keys()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.replace=function(e){var n=this;return yr(function(){var r,i,o,a,s=YI(e),l=new Map,u=!1;try{for(var c=pr(n._data.keys()),d=c.next();!d.done;d=c.next()){var f=d.value;if(!s.has(f)){var h=n.delete(f);if(h)u=!0;else{var v=n._data.get(f);l.set(f,v)}}}}catch(M){r={error:M}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}try{for(var g=pr(s.entries()),m=g.next();!m.done;m=g.next()){var y=No(m.value,2),f=y[0],v=y[1],x=n._data.has(f);if(n.set(f,v),n._data.has(f)){var E=n._data.get(f);l.set(f,E),x||(u=!0)}}}catch(M){o={error:M}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}if(!u)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var b=n._data.keys(),T=l.keys(),A=b.next(),S=T.next();!A.done;){if(A.value!==S.value){n._keysAtom.reportChanged();break}A=b.next(),S=T.next()}n._data=l}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e,n,r={};try{for(var i=pr(this),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];r[typeof s=="symbol"?s:Jn(s)]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return Jn(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with maps."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t}(),gn=yi("ObservableMap",Qd),Hy,eB={},zy=function(){function t(e,n,r){if(n===void 0&&(n=Sa),r===void 0&&(r="ObservableSet@"+On()),this.name=r,this[Hy]=eB,this._data=new Set,this._atom=Hd(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(i,o){return n(i,o,r)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;yr(function(){gy(function(){var n,r;try{for(var i=pr(e._data.values()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})})},t.prototype.forEach=function(e,n){var r,i;try{for(var o=pr(this),a=o.next();!a.done;a=o.next()){var s=a.value;e.call(n,s,s,this)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(Do(this._atom),Lr(this)){var r=Ir(this,{type:"add",object:this,newValue:e});if(!r)return this}if(!this.has(e)){yr(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var i=Kt(),o=_r(this),r=o||i?{type:"add",object:this,newValue:e}:null;i&&process.env.NODE_ENV!=="production"&&Fn(r),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n()}return this},t.prototype.delete=function(e){var n=this;if(Lr(this)){var r=Ir(this,{type:"delete",object:this,oldValue:e});if(!r)return!1}if(this.has(e)){var i=Kt(),o=_r(this),r=o||i?{type:"delete",object:this,oldValue:e}:null;return i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name})),yr(function(){n._atom.reportChanged(),n._data.delete(e)}),o&&br(this,r),i&&process.env.NODE_ENV!=="production"&&$n(),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=Array.from(this.keys()),r=Array.from(this.values());return kl({next:function(){var i=e;return e+=1,i<r.length?{value:[n[i],r[i]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,r=Array.from(this._data.values());return kl({next:function(){return n<r.length?{value:e.dehanceValue(r[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return Qn(e)&&(e=e.toJS()),yr(function(){var r=Ol(!0);try{Array.isArray(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):Ea(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):e!=null&&He("Cannot initialize set from "+e)}finally{Tl(r)}}),this},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support fireImmediately=true in combination with sets."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[Hy=ke,Symbol.iterator]=function(){return this.values()},t}(),Qn=yi("ObservableSet",zy),Wy=function(){function t(e,n,r,i){n===void 0&&(n=new Map),this.target=e,this.values=n,this.name=r,this.defaultEnhancer=i,this.keysAtom=new Oo(r+".keys")}return t.prototype.read=function(e){return this.values.get(e).get()},t.prototype.write=function(e,n){var r=this.target,i=this.values.get(e);if(i instanceof Ro){i.set(n);return}if(Lr(this)){var o=Ir(this,{type:"update",object:this.proxy||r,name:e,newValue:n});if(!o)return;n=o.newValue}if(n=i.prepareNewValue(n),n!==pe.UNCHANGED){var a=_r(this),s=Kt(),o=a||s?{type:"update",object:this.proxy||r,oldValue:i.value,name:e,newValue:n}:null;s&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),i.setNewValue(n),a&&br(this,o),s&&process.env.NODE_ENV!=="production"&&$n()}},t.prototype.has=function(e){var n=this.pendingKeys||(this.pendingKeys=new Map),r=n.get(e);if(r)return r.get();var i=!!this.values.get(e);return r=new Gi(i,xl,this.name+"."+Jn(e)+"?",!1),n.set(e,r),r.get()},t.prototype.addObservableProp=function(e,n,r){r===void 0&&(r=this.defaultEnhancer);var i=this.target;if(qI(i,e),Lr(this)){var o=Ir(this,{object:this.proxy||i,name:e,type:"add",newValue:n});if(!o)return;n=o.newValue}var a=new Gi(n,r,this.name+"."+Jn(e),!1);this.values.set(e,a),n=a.value,Object.defineProperty(i,e,tB(e)),this.notifyPropertyAddition(e,n)},t.prototype.addComputedProp=function(e,n,r){var i=this.target;r.name=r.name||this.name+"."+Jn(n),this.values.set(n,new Ro(r)),(e===i||sy(e,n))&&Object.defineProperty(e,n,nB(n))},t.prototype.remove=function(e){if(this.values.has(e)){var n=this.target;if(Lr(this)){var r=Ir(this,{object:this.proxy||n,name:e,type:"remove"});if(!r)return}try{gr();var i=_r(this),o=Kt(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var r=i||o?{type:"remove",object:this.proxy||n,oldValue:s,name:e}:null;o&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},r),{name:this.name,key:e})),i&&br(this,r),o&&process.env.NODE_ENV!=="production"&&$n()}finally{vr()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return process.env.NODE_ENV!=="production"&&Mt(n!==!0,"`observe` doesn't support the fire immediately property for observable objects."),Ma(this,e)},t.prototype.intercept=function(e){return Na(this,e)},t.prototype.notifyPropertyAddition=function(e,n){var r=_r(this),i=Kt(),o=r||i?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(i&&process.env.NODE_ENV!=="production"&&Fn(Ot(Ot({},o),{name:this.name,key:e})),r&&br(this,o),i&&process.env.NODE_ENV!=="production"&&$n(),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var e,n;this.keysAtom.reportObserved();var r=[];try{for(var i=pr(this.values),o=i.next();!o.done;o=i.next()){var a=No(o.value,2),s=a[0],l=a[1];l instanceof Gi&&r.push(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t}();function ef(t,e,n){if(e===void 0&&(e=""),n===void 0&&(n=Sa),Object.prototype.hasOwnProperty.call(t,ke))return t[ke];process.env.NODE_ENV!=="production"&&Mt(Object.isExtensible(t),"Cannot make the designated object observable; it is not extensible"),Ui(t)||(e=(t.constructor.name||"ObservableObject")+"@"+On()),e||(e="ObservableObject@"+On());var r=new Wy(t,new Map,Jn(e),n);return Co(t,ke,r),r}var Uy=Object.create(null),Vy=Object.create(null);function tB(t){return Uy[t]||(Uy[t]={configurable:!0,enumerable:!0,get:function(){return this[ke].read(t)},set:function(e){this[ke].write(t,e)}})}function Xy(t){var e=t[ke];return e||(Vi(t),t[ke])}function nB(t){return Vy[t]||(Vy[t]={configurable:pe.computedConfigurable,enumerable:!1,get:function(){return Xy(this).read(t)},set:function(e){Xy(this).write(t,e)}})}var rB=yi("ObservableObjectAdministration",Wy);function xr(t){return jd(t)?(Vi(t),rB(t[ke])):!1}function Ei(t,e){if(typeof t=="object"&&t!==null){if(kr(t))return e!==void 0&&He(process.env.NODE_ENV!=="production"&&"It is not possible to get index atoms from arrays"),t[ke].atom;if(Qn(t))return t[ke];if(gn(t)){var n=t;if(e===void 0)return n._keysAtom;var r=n._data.get(e)||n._hasMap.get(e);return r||He(process.env.NODE_ENV!=="production"&&"the entry '"+e+"' does not exist in the observable map '"+tf(t)+"'"),r}if(Vi(t),e&&!t[ke]&&t[e],xr(t)){if(!e)return He(process.env.NODE_ENV!=="production"&&"please specify a property");var r=t[ke].values.get(e);return r||He(process.env.NODE_ENV!=="production"&&"no observable property '"+e+"' found on the observable object '"+tf(t)+"'"),r}if($d(t)||Lo(t)||Pl(t))return t}else if(typeof t=="function"&&Pl(t[ke]))return t[ke];return He(process.env.NODE_ENV!=="production"&&"Cannot obtain atom from "+t)}function Il(t,e){if(t||He("Expecting some object"),e!==void 0)return Il(Ei(t,e));if($d(t)||Lo(t)||Pl(t)||gn(t)||Qn(t))return t;if(Vi(t),t[ke])return t[ke];He(process.env.NODE_ENV!=="production"&&"Cannot obtain administration from "+t)}function tf(t,e){var n;return e!==void 0?n=Ei(t,e):xr(t)||gn(t)||Qn(t)?n=Il(t):n=Ei(t),n.name}var Gy=Object.prototype.toString;function Yy(t,e,n){return n===void 0&&(n=-1),nf(t,e,n)}function nf(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var o=typeof t;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var a=Gy.call(t);if(a!==Gy.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Ky(t),e=Ky(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!(typeof l=="function"&&l instanceof l&&typeof u=="function"&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var c=r.length;c--;)if(r[c]===t)return i[c]===e;if(r.push(t),i.push(e),s){if(c=t.length,c!==e.length)return!1;for(;c--;)if(!nf(t[c],e[c],n-1,r,i))return!1}else{var d=Object.keys(t),f=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(f=d[c],!(iB(e,f)&&nf(t[f],e[f],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function Ky(t){return kr(t)?t.slice():Ao(t)||gn(t)||Ea(t)||Qn(t)?Array.from(t.entries()):t}function iB(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kl(t){return t[Symbol.iterator]=oB,t}function oB(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");try{process.env.NODE_ENV}catch{var qy=Ml();typeof process>"u"&&(qy.process={}),qy.process.env={}}(function(){function t(){}if(t.name!=="testCodeMinification"&&process.env.NODE_ENV!=="production"&&typeof process<"u"&&process.env.IGNORE_MOBX_MINIFY_WARNING!=="true"){var e=["process","env","NODE_ENV"].join(".");console.warn("[mobx] you are running a minified build, but '"+e+"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle")}})(),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Tk,extras:{getDebugName:tf},$mobx:ke});function aB(t){return!(t.prototype&&t.prototype.render)&&!Qe.isPrototypeOf(t)}function Zy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,r=n===void 0?"":n,i=e.suffix,o=i===void 0?"":i,a=t.displayName||t.name||t.constructor&&t.constructor.name||"<component>";return r+a+o}var Jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qy=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e_=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),t_=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},n_=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},r_=console;function sB(t){var e=Yd().allowStateChanges;return Yd().allowStateChanges=t,e}function lB(t){Yd().allowStateChanges=t}function uB(t,e,n,r,i){var o=sB(t),a=void 0;try{a=e(n,r,i)}finally{lB(o)}return a}function i_(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=t[e],i=a_[e],o=r?n===!0?function(){i.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),i.apply(this,arguments)}:i;t[e]=o}function o_(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":Jy(t))!=="object"||(typeof e>"u"?"undefined":Jy(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,i=n.length-1;r=n[i];i--)if(e[r]!==t[r])return!0;return!1}var a_={componentWillMount:function(){var e=this,n=Zy(this),r=!1,i=!1;function o(d){var f=this[d],h=Hd("reactive "+d);Object.defineProperty(this,d,{configurable:!0,enumerable:!0,get:function(){return h.reportObserved(),f},set:function(g){!i&&o_(f,g)?(f=g,r=!0,h.reportChanged(),r=!1):f=g}})}o.call(this,"props"),o.call(this,"state");var a=this.render.bind(this),s=null,l=!1,u=function(){return s=new Ta(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var f=!0;try{i=!0,r||Qe.prototype.forceUpdate.call(e),f=!1}finally{i=!1,f&&s.dispose()}}}),s.reactComponent=e,c.$mobx=s,e.render=c,c(e.props,e.state,e.context)},c=function(f,h,v){l=!1;var g=void 0,m=void 0;if(s.track(function(){try{m=uB(!1,a,f,h,v)}catch(y){g=y}}),g)throw g;return m};this.render=u},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:o_(this.props,e)}};function rf(t){if(arguments.length>1&&r_.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&r_.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aB(t)){var e,n;return rf((n=e=function(i){t_(o,i);function o(){return Qy(this,o),n_(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return e_(o,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),o}(Qe),e.displayName=Zy(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var r=t.prototype||t;return cB(r),t.isMobXReactObserver=!0,t}function cB(t){i_(t,"componentWillMount",!0),i_(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=a_.shouldComponentUpdate)}var dB=rf(function(t){var e=t.children;return e[0]()});dB.displayName="Observer";var fB=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pB(t,e){return e={exports:{}},t(e,e.exports),e.exports}pB(function(t,e){(function(n,r){t.exports=r()})(fB,function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.defineProperty,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,u=l&&l(Object);return function c(d,f,h){if(typeof f!="string"){if(u){var v=l(f);v&&v!==u&&c(d,v,h)}var g=o(f);a&&(g=g.concat(a(f)));for(var m=0;m<g.length;++m){var y=g[m];if(!n[y]&&!r[y]&&(!h||!h[y])){var x=s(f,y);try{i(d,y,x)}catch{}}}return d}return d}})});var s_={children:!0,key:!0,ref:!0},l_=console;if(function(t){t_(e,t);function e(){return Qy(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return e_(e,[{key:"render",value:function(r){var i=r.children;return i.length>1?Te("div",null," ",i," "):i[0]}},{key:"getChildContext",value:function(){var r={},i=this.context.mobxStores;if(i)for(var o in i)r[o]=i[o];for(var a in this.props)!s_[a]&&a!=="suppressChangedStoreWarning"&&(r[a]=this.props[a]);return{mobxStores:r}}},{key:"componentWillReceiveProps",value:function(r){if(Object.keys(r).length!==Object.keys(this.props).length&&l_.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!r.suppressChangedStoreWarning)for(var i in r)!s_[i]&&this.props[i]!==r[i]&&l_.warn("MobX Provider: Provided store '"+i+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(Qe),!Qe)throw new Error("mobx-preact requires Preact to be available");var Br,of,u_,c_=[],qt=qe,d_=qt.__b,f_=qt.__r,p_=qt.diffed,h_=qt.__c,g_=qt.unmount,v_=qt.__;function hB(){for(var t;t=c_.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Bl),t.__H.__h.forEach(af),t.__H.__h=[]}catch(e){t.__H.__h=[],qt.__e(e,t.__v)}}qt.__b=function(t){Br=null,d_&&d_(t)},qt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),v_&&v_(t,e)},qt.__r=function(t){f_&&f_(t);var e=(Br=t.__c).__H;e&&(of===Br?(e.__h=[],Br.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Bl),e.__h.forEach(af),e.__h=[])),of=Br},qt.diffed=function(t){p_&&p_(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(c_.push(e)!==1&&u_===qt.requestAnimationFrame||((u_=qt.requestAnimationFrame)||gB)(hB)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),of=Br=null},qt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Bl),n.__h=n.__h.filter(function(r){return!r.__||af(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],qt.__e(r,n.__v)}}),h_&&h_(t,e)},qt.unmount=function(t){g_&&g_(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Bl(r)}catch(i){e=i}}),n.__H=void 0,e&&qt.__e(e,n.__v))};var m_=typeof requestAnimationFrame=="function";function gB(t){var e,n=function(){clearTimeout(r),m_&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);m_&&(e=requestAnimationFrame(n))}function Bl(t){var e=Br,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Br=e}function af(t){var e=Br;t.__c=t.__(),Br=e}function vB(t,e){for(var n in e)t[n]=e[n];return t}function y_(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var r in e)if(r!=="__source"&&t[r]!==e[r])return!0;return!1}function __(t,e){this.props=t,this.context=e}(__.prototype=new Qe).isPureReactComponent=!0,__.prototype.shouldComponentUpdate=function(t,e){return y_(this.props,t)||y_(this.state,e)};var b_=qe.__b;qe.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),b_&&b_(t)};var mB=qe.__e;qe.__e=function(t,e,n,r){if(t.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),i.__c(t,e)}mB(t,e,n,r)};var x_=qe.unmount;function E_(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),t.__c.__H=null),(t=vB({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(r){return E_(r,e,n)})),t}function w_(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(r){return w_(r,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function sf(){this.__u=0,this.o=null,this.__b=null}function S_(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function jl(){this.i=null,this.l=null}qe.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),x_&&x_(t)},(sf.prototype=new Qe).__c=function(t,e){var n=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var i=S_(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=w_(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},sf.prototype.componentWillUnmount=function(){this.o=[]},sf.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=E_(this.__b,n,r.__O=r.__P)}this.__b=null}var i=e.__a&&Te(wo,null,t.fallback);return i&&(i.__u&=-33),[Te(wo,null,e.__a?null:t.children),i]};var C_=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(jl.prototype=new Qe).__a=function(t){var e=this,n=S_(e.__v),r=e.l.get(t);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),C_(e,t,r)):i()};n?n(o):o()}},jl.prototype.render=function(t){this.i=null,this.l=new Map;var e=vl(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},jl.prototype.componentDidUpdate=jl.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){C_(t,n,e)})};var yB=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_B=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bB=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,xB=/[A-Z0-9]/g,EB=typeof document<"u",wB=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function A_(t,e,n){return e.__k==null&&(e.textContent=""),UI(t,e),typeof n=="function"&&n(),t?t.__c:null}Qe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Qe.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var O_=qe.event;function SB(){}function CB(){return this.cancelBubble}function AB(){return this.defaultPrevented}qe.event=function(t){return O_&&(t=O_(t)),t.persist=SB,t.isPropagationStopped=CB,t.isDefaultPrevented=AB,t.nativeEvent=t};var OB={enumerable:!1,configurable:!0,get:function(){return this.class}},T_=qe.vnode;qe.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||EB&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||wB(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":bB.test(a)&&(a=l):l=a="oninput":o&&_B.test(a)?a=a.replace(xB,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=vl(n.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=vl(n.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",OB)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),e.props=i}(t),t.$$typeof=yB,T_&&T_(t)};var N_=qe.__r;qe.__r=function(t){N_&&N_(t),t.__c};var M_=qe.diffed;qe.diffed=function(t){M_&&M_(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var TB=0;function V(t,e,n,r,i,o){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TB,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return qe.vnode&&qe.vnode(u),u}var NB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Da;(function(t){function e(n){var r=NB(n,[]),i=n.container;if(!i)throw new Error("Ensure the container of LogicFlow is specified and valid.");return ut({},t.defaults,r)}t.get=e})(Da||(Da={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(Da||(Da={}));var D_={node:!1,edge:!1},MB={node:!0,edge:!0},DB=function(t){return!t||typeof t=="boolean"?Pe(t===!0?MB:D_):zi(Pe(D_),t)},PB=function(){return ui(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function sn(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}var P_=200,RB=9999,LB=10,lt;(function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(lt||(lt={}));var Lt;(function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"})(Lt||(Lt={}));var Ye;(function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"})(Ye||(Ye={}));var be;(function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_FOCUS="node:focus",t.NODE_BLUR="node:blur",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_FOCUS="edge:focus",t.EDGE_BLUR="edge:blur",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_CLICK="anchor:click",t.ANCHOR_MOUSEDOWN="anchor:mousedown",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated",t.EDIT_CONFIG_CHANGED="editConfig:changed"})(be||(be={}));var Xt;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(Xt||(Xt={}));var Tt;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(Tt||(Tt={}));var er;(function(t){t.TEXT="text",t.LABEL="label"})(er||(er={}));var IB=0,tr=function(){function t(e){var n=e.onDragStart,r=n===void 0?lo:n,i=e.onDragging,o=i===void 0?lo:i,a=e.onDragEnd,s=a===void 0?lo:a,l=e.eventType,u=l===void 0?"":l,c=e.eventCenter,d=e.step,f=d===void 0?1:d,h=e.isStopPropagation,v=h===void 0?!0:h,g=e.model,m=e.data,y=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(x){var E,b,T=window==null?void 0:window.document;if(x.button===IB){y.isStopPropagation&&x.stopPropagation(),y.isStartDragging=!0,y.startX=x.clientX,y.startY=x.clientY,T.addEventListener("mousemove",y.handleMouseMove,!1),T.addEventListener("mouseup",y.handleMouseUp,!1);var A=(E=y.model)===null||E===void 0?void 0:E.getData();(b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_MOUSEDOWN")],{e:x,data:y.data||A}),y.startTime=new Date().getTime()}},this.handleMouseMove=function(x){var E,b;if(y.isStopPropagation&&x.stopPropagation(),!!y.isStartDragging&&(y.sumDeltaX+=x.clientX-y.startX,y.sumDeltaY+=x.clientY-y.startY,y.startX=x.clientX,y.startY=x.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var T=y.sumDeltaX%y.step,A=y.sumDeltaY%y.step,S=y.sumDeltaX-T,M=y.sumDeltaY-A;y.sumDeltaX=T,y.sumDeltaY=A;var C=(E=y.model)===null||E===void 0?void 0:E.getData();y.isDragging||((b=y.eventCenter)===null||b===void 0||b.emit(be["".concat(y.eventType,"_DRAGSTART")],{e:x,data:y.data||C}),y.onDragStart({event:x})),y.isDragging=!0,Promise.resolve().then(function(){var G,K;y.onDragging({deltaX:S,deltaY:M,event:x}),(G=y.eventCenter)===null||G===void 0||G.emit(be["".concat(y.eventType,"_MOUSEMOVE")],{deltaX:S,deltaY:M,e:x,data:y.data||C}),(K=y.eventCenter)===null||K===void 0||K.emit(be["".concat(y.eventType,"_DRAG")],{e:x,data:y.data||C})})}},this.handleMouseUp=function(x){var E=window.document;y.isStartDragging=!1,y.isStopPropagation&&x.stopPropagation(),Promise.resolve().then(function(){var b,T,A;E.removeEventListener("mousemove",y.handleMouseMove,!1),E.removeEventListener("mouseup",y.handleMouseUp,!1);var S=(b=y.model)===null||b===void 0?void 0:b.getData();(T=y.eventCenter)===null||T===void 0||T.emit(be["".concat(y.eventType,"_MOUSEUP")],{e:x,data:y.data||S}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:x}),(A=y.eventCenter)===null||A===void 0||A.emit(be["".concat(y.eventType,"_DROP")],{e:x,data:y.data||S}))})},this.cancelDrag=function(){var x=window==null?void 0:window.document;x.removeEventListener("mousemove",y.handleMouseMove,!1),x.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:void 0}),y.isDragging=!1},this.destroy=function(){y.isStartDragging&&y.cancelDrag()},this.onDragStart=r,this.onDragging=o,this.onDragEnd=s,this.step=f,this.isStopPropagation=v,this.eventType=u,this.eventCenter=c,this.model=g,this.data=m}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t}(),kB=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{x:e-r/2,y:n-i/2,x1:e+r/2,y1:n+i/2}},BB=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,i=(e.y+n.y)/2,o=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-o/2,y:i-a/2,x1:r+o/2,y1:i+a/2}},jB=function(t){var e=t.points,n=Ki(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},FB=function(t){var e=t.path,n=cf(e),r=La(n,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},$B=function(t){if(t.modelType===Ye.LINE_EDGE)return BB(t);if(t.modelType===Ye.POLYLINE_EDGE)return jB(t);if(t.modelType===Ye.BEZIER_EDGE)return FB(t)},HB=function(t,e,n,r){var i=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(i===0)return!1;var o=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/i,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/i;return(o-t.x)*(o-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(o-n.x)*(o-r.x)<=0&&(a-n.y)*(a-r.y)<=0?{x:o,y:a}:!1},Pa=function(t,e,n){var r=t.x,i=t.y,o=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-o),c=a-u*o;return(r>=o&&r<=s||r<=o&&r>=s)&&(i>=a&&i<=l||i<=a&&i>=l)&&Math.abs(i-u*r-c)<Number.EPSILON},Ra=function(t){var e=t.start,n=t.end,r=t.offset,i=t.verticalLength,o=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),l=Math.atan(r/i),u=Math.sqrt(i*i+r*r);return o==="start"?n.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):o==="end"&&(n.x>=e.x?(a.leftX=n.x+u*Math.sin(s-l),a.leftY=n.y-u*Math.cos(s-l),a.rightX=n.x-u*Math.sin(s+l),a.rightY=n.y+u*Math.cos(s+l)):(a.leftX=n.x-u*Math.sin(s-l),a.leftY=n.y+u*Math.cos(s-l),a.rightX=n.x+u*Math.sin(s+l),a.rightY=n.y-u*Math.cos(s+l))),a},Bo=function(){return Bo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bo.apply(this,arguments)},nr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},wi=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zB=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},lf=function(t){var e=[],n={};return t.forEach(function(r){var i="".concat(r.x,"-").concat(r.y);r.id=i,n[i]=r}),Object.keys(n).forEach(function(r){e.push(n[r])}),e},Fl=function(t,e){return t.width===0&&t.height===0?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},WB=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?Tt.HORIZONTAL:Tt.VERTICAL},$l=function(t,e,n){var r=WB(n,e);return r===Tt.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},R_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{x:(n+i)/2,y:(r+o)/2,centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},La=function(t,e){t===void 0&&(t=[]);var n=[],r=[];t.forEach(function(c){n.push(c.x),r.push(c.y)});var i=Math.min.apply(Math,wi([],nr(n),!1)),o=Math.max.apply(Math,wi([],nr(n),!1)),a=Math.min.apply(Math,wi([],nr(r),!1)),s=Math.max.apply(Math,wi([],nr(r),!1)),l=o-i,u=s-a;return e&&(l+=e,u+=e),{centerX:(i+o)/2,centerY:(a+s)/2,maxX:o,maxY:s,minX:i,minY:a,x:(i+o)/2,y:(a+s)/2,height:u,width:l}},Hl=function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:i},{x:e,y:i}]},zl=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},UB=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},VB=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},XB=function(t,e){return wi(wi([],nr(UB(t,e.x)),!1),nr(VB(t,e.y)),!1)},uf=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},GB=function(t,e){var n=-2,r=0;return e.forEach(function(i){i&&(t.x===i.x&&(r+=n),t.y===i.y&&(r+=n))}),r},L_=function(t,e,n,r,i){return uf(t,e)+uf(t,n)+GB(t,[e,n,r,i])},I_=function(t,e,n,r,i){i||(i=0),t.unshift(e[r]),n[r]&&n[r]!==r&&i<=100&&I_(t,e,n,n[r],i+1)},YB=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Ia=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=r.x-n.x,s=r.y-n.y,l=(-o*(t.x-n.x)+i*(t.y-n.y))/(-a*o+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*o+i*s);return l>=0&&l<=1&&u>=0&&u<=1},k_=function(t,e,n){if(n.width===0&&n.height===0)return!1;var r=nr(Hl(n),4),i=r[0],o=r[1],a=r[2],s=r[3];return Ia(t,e,i,o)||Ia(t,e,i,s)||Ia(t,e,o,a)||Ia(t,e,a,s)},KB=function(t,e,n,r){var i=[];return t.forEach(function(o){o!==e&&(o.x===e.x||o.y===e.y)&&!k_(o,e,n)&&!k_(o,e,r)&&i.push(o)}),lf(i)},qB=function(t,e,n,r,i,o,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=L_(e,n,e));var f={};t.forEach(function(g){g.id&&(f[g.id]=g)});for(var h=function(){var g,m=1/0;if(l.forEach(function(x){x.id&&d[x.id]<m&&(m=d[x.id],g=x)}),g===n&&n.id){var y=[];return I_(y,f,u,n.id),{value:y}}if(!g)return{value:[e,n]};YB(l,g),s.push(g),KB(t,g,r,i).forEach(function(x){if(s.indexOf(x)===-1&&(l.indexOf(x)===-1&&l.push(x),g!=null&&g.id&&(x!=null&&x.id))){var E=d[g.id]+uf(g,x);if(c[x.id]&&E>=c[x.id])return;u[x.id]=g.id,c[x.id]=E,d[x.id]=c[x.id]+L_(x,n,e,o,a)}})};l.length;){var v=h();if(typeof v=="object")return v.value}return[e,n]},B_=function(t){return Hn(t)},j_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],i=t[e+1];n.x===r.x&&r.x===i.x||n.y===r.y&&r.y===i.y?t.splice(e,1):e++}return t},F_=function(t,e,n,r,i){var o=B_(n),a=B_(r),s=Fl(o,i),l=Fl(a,i),u=$l(s,o,t),c=$l(l,a,e);if(zB(s,l)){var d=JB(t,e,u,c);return wi(wi([t,u],nr(d),!1),[c,e],!1)}var f=La([u,c]),h=R_(s,f),v=R_(l,f),g=[];g=g.concat(Hl(h)),g=g.concat(Hl(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,h,v].forEach(function(x){g=g.concat(XB(x,m).filter(function(E){return zl(E,s)&&zl(E,l)}))}),[{x:u.x,y:c.y},{x:c.x,y:u.y}].forEach(function(x){zl(x,s)&&zl(x,l)&&g.push(x)}),g.unshift(u),g.push(c),g=lf(g);var y=qB(g,u,c,o,a,t,e);return y.unshift(t),y.push(e),y.length>2&&(y=j_(y)),lf(y)},ZB=function(t){if(t.length===1){var e=nr(t,1),n=e[0];return[n,n]}else{for(var r=t[0],i=t[1],o=Er(r.x,r.y,i.x,i.y),a=1;a<t.length-1;a++){var s=t[a],l=t[a+1],u=Er(s.x,s.y,l.x,l.y);u>o&&(o=u,r=s,i=l)}return[r,i]}},$_=function(t,e,n){var r=ni(t,n),i=ni(e,n);return r&&i},H_=function(t,e,n){var r=ni(t,n),i=ni(e,n),o=r&&i,a=r||i;return!o&&a},z_=function(t,e,n){for(var r=void 0,i=Hn(n),o=Hl(i),a=0;a<o.length;a++){var s=Ia(t,e,o[a],o[(a+1)%o.length]);s&&(r=[o[a],o[(a+1)%o.length]])}if(r)return HB(t,e,r[0],r[1])},Wl=function(t,e){var n=void 0;return t.x===e.x?n=Tt.VERTICAL:t.y===e.y&&(n=Tt.HORIZONTAL),n},Ki=function(t){var e=t.split(" "),n=[];return e&&e.forEach(function(r){var i=nr(r.split(","),2),o=i[0],a=i[1];n.push({x:Number(o),y:Number(a)})}),n},JB=function(t,e,n,r){var i=[],o=Wl(t,n),a=Wl(e,r);if(o===a)t.y===n.y?(i.push({x:n.x,y:(n.y+r.y)/2}),i.push({x:r.x,y:(n.y+r.y)/2})):(i.push({x:(n.x+r.x)/2,y:n.y}),i.push({x:(n.x+r.x)/2,y:r.y}));else{var s={x:n.x,y:r.y},l=Pa(s,t,n),u=Pa(s,e,r);if(l||u)s={x:r.x,y:n.y};else{var c=W_(s,t,n),d=W_(s,e,r);c&&d&&(s={x:r.x,y:n.y})}i.push(s)}return i},W_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},U_=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:r>=1&&r<=126||r>=65376&&r<=65439?e+=1:e+=2}return e},QB=function(t){var e=t.start,n=t.end,r;if(e.x===n.x&&e.y===n.y)r="";else{var i={start:e,end:n,offset:10,verticalLength:5},o=Ra(Bo(Bo({},i),{type:"start"})),a=Ra(Bo(Bo({},i),{type:"end"}));r="M".concat(o.leftX," ").concat(o.leftY,`
61
61
  L`).concat(o.rightX," ").concat(o.rightY,`
62
62
  L`).concat(a.rightX," ").concat(a.rightY,`
63
- L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:r,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},V_=function(t){var e=t.start,n=t.end,r=t.sourceNode,i=t.targetNode,o=t.offset,a=Hn(r),s=Hn(i),l=jl(a,o),u=jl(s,o),c=Fl(l,a,e),d=Fl(u,s,n);return{sNext:c,ePre:d}},cf=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=Wl(e[0]),r=Wl(e[1]),i=Wl(e[2]),o=Wl(e[3]);return[n,r,i,o]},Wl=function(t){var e=nr(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],r=e[1];return{x:+n,y:+r}},X_=function(t,e){var n=nr(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=zj(r,i,o,a,e);return[s,t[3]]},G_=function(t,e){for(var n=t.x,r=t.y,i=Ki(e),o=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+1)%i.length]});if(s.forEach(function(f){var h=f.start,v=f.end;if(h.x===v.x){var g={x:h.x,y:r},m=Pa(g,h,v);if(m){var y=Math.abs(h.x-n);y<o&&(o=y,a=g)}}else if(h.y===v.y){var g={x:n,y:h.y},m=Pa(g,h,v);if(m){var y=Math.abs(h.y-r);y<o&&(o=y,a=g)}}}),!a){var u=s[0],c=u.start,d=u.end;a={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return a},ej=function(t){return gi(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Y_=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function tj(t,e){return typeof e!="function"?function(n,r,i){return Object.assign({type:t.edgeType},i)}:function(n,r,i){var o=e(n,r,i);return o?typeof o=="string"?Object.assign({},i,{type:o}):Object.assign({type:o},i):{type:t.edgeType}}}var nj=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return gt(e,function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},jo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ul=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Fo(t,e,n){return n&&e*Math.round(t/e)||t}function rj(t,e,n){if(!t)return[];var r=Math.min.apply(Math,Ul([],jo(t.map(function(g){return g[0]})),!1)),i=Math.max.apply(Math,Ul([],jo(t.map(function(g){return g[0]})),!1)),o=Math.min.apply(Math,Ul([],jo(t.map(function(g){return g[1]})),!1)),a=Math.max.apply(Math,Ul([],jo(t.map(function(g){return g[1]})),!1)),s=-r,l=-o,u=t.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y+s,x+l]}),c=i-r,d=a-o,f=e?e/c:1,h=n?n/d:1,v=Math.min(f,h);return u.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y*v,x*v]})}var df=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ff=function(t,e,n){var r=df(t,2),i=r[0],o=r[1],a=df(e,2),s=a[0],l=a[1],u=df(n,2),c=u[0],d=u[1];return i>s&&i<c&&o>l&&o<d},K_=function(t,e){var n=e.multipleSelectKey,r=!1;switch(n){case"meta":r=t.metaKey;break;case"alt":r=t.altKey;break;case"shift":r=t.shiftKey;break;case"ctrl":r=t.ctrlKey;break;default:r=!1;break}return r},pf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function q_(t,e){return t instanceof Zt&&e instanceof Zt}var Z_=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,3)||this;return o[0]=n,o[1]=r,o[2]=i,o.x=n,o.y=r,o.z=i,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.add=function(n){if(q_(this,n))return new Zt(this.x+n.x,this.y+n.y);var r=this.z+n.z;return new hf((this.x+n.x)/r,(this.y+n.y)/r)},e.prototype.subtract=function(n){if(q_(this,n))return new Zt(this.x-n.x,this.y-n.y);var r=this.z-n.z;return r===0?new Zt(this.x-n.x,this.y-n.y):new hf((this.x-n.x)/r,(this.y-n.y)/r)},e}(Array),Zt=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,n,r,i??0)||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(n){var r=this;return n.reduce(function(i,o,a){return i+o*r[a]})},e.prototype.cross=function(n){return new e(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var n=this.getLength();return new e(this.x/n,this.y/n)},e.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},e.prototype.angle=function(n){var r=this.crossZ(n),i=Math.acos(this.normalize().dot(n.normalize()));return r>=0?i:-i},e}(Z_),hf=function(t){pf(e,t);function e(n,r){var i=t.call(this,n,r,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Point"},e}(Z_),Vl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$o=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gf=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},ka=function(t){Vl(e,t);function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.call(this,n.length)||this;return i.fill(new Array(3)),n.forEach(function(o,a){i[a]=o}),i.columns=n[0].length,i.rows=n.length,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.getRow=function(n){return this[n]},e.prototype.getColumn=function(n){return gf([],$o(this.map(function(r){return r[n]})),!1)},e.prototype.transpose=function(){for(var n=[],r=0;r<this.columns;r++)n.push(this.getColumn(r));return new(e.bind.apply(e,gf([void 0],$o(n),!1)))},e.prototype.cross=function(n){var r=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var i=0;i<this.rows;i++)for(var o=this.getRow(i),a=function(l){var u=n.getColumn(l);r[i][l]=o.reduce(function(c,d,f){return c+d*u[f]},0)},s=0;s<n.columns;s++)a(s);return new(e.bind.apply(e,gf([void 0],$o(r),!1)))},e.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},e.prototype.toPoints=function(){return this.map(function(n){return new hf(n[0],n[1])})},e.prototype.toString=function(){var n=$o(this[0],2),r=n[0],i=n[1],o=$o(this[1],2),a=o[0],s=o[1],l=$o(this[2],2),u=l[0],c=l[1];return"matrix(".concat(r," ").concat(i," ").concat(a," ").concat(s," ").concat(u," ").concat(c,")")},e.prototype.translate=function(n,r){return this.cross(new Xl(n,r))},e.prototype.rotate=function(n){return this.cross(new ij(n))},e.prototype.scale=function(n,r){return this.cross(new oj(n,r))},e}(Array),ij=function(t){Vl(e,t);function e(n){var r=t.call(this,new Zt(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Zt(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Zt(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return this.transpose()},e}(ka),oj=function(t){Vl(e,t);function e(n,r){var i=t.call(this,new Zt(n,0,0),new Zt(0,r,0),new Zt(0,0,1))||this;return i.sx=n,i.sy=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(ka),Xl=function(t){Vl(e,t);function e(n,r){var i=t.call(this,new Zt(1,0,0),new Zt(0,1,0),new Zt(n,r,1))||this;return i.tx=n,i.ty=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(ka);jk({});var Gl=function(){return Gl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gl.apply(this,arguments)},aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},vf=function(t){var e=t.anchors;return e},Yl=function(t,e){for(var n=e.nodes,r,i=n.length-1;i>=0;i--){var o=n[i],a=uj(t,o);if(a){var s=o.getTargetAnchor(t);if(s){var l={node:o,anchorIndex:s.index,anchor:s.anchor};(!r||sj(o,r.node,e))&&(r=l)}}}return r},sj=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},lj=function(t,e){for(var n=vf(e),r,i=Number.MAX_SAFE_INTEGER,o=0;o<n.length;o++){var a=Er(t.x,t.y,n[o].x,n[o].y);a<i&&(i=a,r={index:o,anchor:Gl(Gl({},n[o]),{x:n[o].x,y:n[o].y,id:n[o].id})})}return r},Er=function(t,e,n,r){return Math.hypot(t-n,e-r)},ni=function(t,e,n){n===void 0&&(n=0);var r=!1,i=Hn(e),o=aj(new ka([t.x,t.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=o[0],s=o[1],l={x:a,y:s};return l.x>=i.minX-n&&l.x<=i.maxX+n&&l.y>=i.minY-n&&l.y<=i.maxY+n&&(r=!0),r},uj=function(t,e){return ni(t,e,5)},Hn=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}},cj=function(t){var e=t,n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;return[{x:n-i/2+a,y:r-o/2+a,r:a},{x:n+i/2-a,y:r-o/2+a,r:a},{x:n-i/2+a,y:r+o/2-a,r:a},{x:n+i/2-a,y:r+o/2-a,r:a}]},J_=function(t,e,n){var r=cj(n),i,o=Number.MAX_SAFE_INTEGER;return r.forEach(function(a){var s=Er(t.x,t.y,a.x,a.y);s<o&&(o=s,i=a)}),mf(t,e,i)},mf=function(t,e,n){var r,i=n.x,o=n.y,a=n.r;if(e===Tt.HORIZONTAL){var s=i-Math.sqrt(a*a-(t.y-o)*(t.y-o)),l=i+Math.sqrt(a*a-(t.y-o)*(t.y-o)),u=Math.abs(s-t.x)<Math.abs(l-t.x)?s:l;r={x:u,y:t.y}}else if(e===Tt.VERTICAL){var c=o-Math.sqrt(a*a-(t.x-i)*(t.x-i)),d=o+Math.sqrt(a*a-(t.x-i)*(t.x-i)),f=Math.abs(c-t.y)<Math.abs(d-t.y)?c:d;r={x:t.x,y:f}}return r},Q_=function(t,e){var n=e,r=!1,i=n.x,o=n.y,a=n.width,s=n.height,l=n.radius,u={minX:i-a/2+l,maxX:i+a/2-l,minY:o-s/2+l,maxY:o+s/2-l};return t.y===o+s/2||t.y===o-s/2?r=t.x>u.minX&&t.x<u.maxX:(t.x===i+a/2||t.x===i-a/2)&&(r=t.y>u.minY&&t.y<u.maxY),r},eb=function(t,e,n){var r,i=n,o=i.x,a=i.y,s=i.rx,l=i.ry;if(e===Tt.HORIZONTAL){var u=o-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=o+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),d=Math.abs(u-t.x)<Math.abs(c-t.x)?u:c;r={x:d,y:t.y}}else if(e===Tt.VERTICAL){var f=a-Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),h=a+Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),v=Math.abs(f-t.y)<Math.abs(h-t.y)?f:h;r={x:t.x,y:v}}return r},Kl=function(t,e,n){for(var r=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,o,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach(function(l){var u=l.start,c=l.end,d=u,f=c;u.x>c.x&&(d=c,f=u);var h={x:t.x,y:t.y};if(d.x===f.x&&e===Tt.HORIZONTAL&&(h={x:d.x,y:t.y}),d.y===f.y&&e===Tt.VERTICAL&&(h={x:t.x,y:d.y}),d.x!==f.x&&d.y!==f.y){var v=(f.y-d.y)/(f.x-d.x),g=(d.x*f.y-f.x*d.y)/(d.x-f.x);e===Tt.HORIZONTAL?h={x:(t.y-g)/v,y:t.y}:e===Tt.VERTICAL&&(h={x:t.x,y:v*t.x+g})}var m=Pa(h,u,c);if(m){var y=Er(h.x,h.y,t.x,t.y);y<i&&(i=y,o=h)}}),o},dj=function(t){var e=gi(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},tb=function(t,e,n,r){var i=t.x,o=t.y;return e.x>t.x?i=t.x+n/2:e.x<t.x&&(i=t.x-n/2),e.y>t.y?o=t.y+r/2:e.y<t.y&&(o=t.y-r/2),{x:i,y:o}},nb=function(t){var e=t.rows,n=t.style,r=t.rowsLength,i=t.className,o=document.createElement("div");o.className=i,o.style.fontSize="".concat(n.fontSize),o.style.width="".concat(n.width),o.style.lineHeight="".concat(n.lineHeight),o.style.padding="".concat(n.padding),n.fontFamily&&(o.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,o.appendChild(l)}):o.textContent=e[0],document.body.appendChild(o);var a=o.clientHeight;return document.body.removeChild(o),a},rb=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return e&&e.forEach(function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},ql=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Zl;const fj=new Uint8Array(16);function pj(){if(!Zl&&(Zl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zl(fj)}const Jt=[];for(let t=0;t<256;++t)Jt.push((t+256).toString(16).slice(1));function hj(t,e=0){return Jt[t[e+0]]+Jt[t[e+1]]+Jt[t[e+2]]+Jt[t[e+3]]+"-"+Jt[t[e+4]]+Jt[t[e+5]]+"-"+Jt[t[e+6]]+Jt[t[e+7]]+"-"+Jt[t[e+8]]+Jt[t[e+9]]+"-"+Jt[t[e+10]]+Jt[t[e+11]]+Jt[t[e+12]]+Jt[t[e+13]]+Jt[t[e+14]]+Jt[t[e+15]]}const ib={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gj(t,e,n){if(ib.randomUUID&&!t)return ib.randomUUID();t=t||{};const r=t.random||(t.rng||pj)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,hj(r)}var Si=function(){return gj()},Ba=new Map,ob=function(t){var e=Si();function n(){t();var i=Ba.get(e);if(i){var o=window.requestAnimationFrame(n);Ba.set(e,o)}}var r=window.requestAnimationFrame(n);return Ba.set(e,r),e},Jl=function(t){var e=Ba.get(t);e&&(window.cancelAnimationFrame(e),Ba.delete(t))},ja=function(){return ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ja.apply(this,arguments)},vj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ab(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,u=l===void 0?"currentColor":l,c=t.overflowMode,d=c===void 0?"default":c,f=t.textWidth,h=f===void 0?void 0:f,v=t.model,g={x:n,y:i,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(gt(Zr(t),function(T){var A=vj(T,2),S=A[0],M=A[1];typeof M!="object"&&(g[S]=M)}),o){var m=String(o).split(/[\r\n]/g),y=m.length;if(d!=="default"){var x=v.BaseType,E=v.modelType;if(x===Lt.NODE&&E!==Ye.TEXT_NODE||x===Lt.EDGE&&h)return mj(t)}if(y>1){var b=m.map(function(T,A){var S=s+2,M=(A-(y-1)/2)*S;return V("tspan",{className:"lf-text-tspan",x:n,y:i+M,children:T})});return V("text",ja({},g,{children:b}))}return V("text",ja({},g,{children:o}))}return null}function mj(t){var e=t.x,n=t.y,r=t.value,i=t.model,o=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,u=t.fontFamily,c=u===void 0?"":u,d=t.wrapPadding,f=d===void 0?"0, 0":d,h=t.overflowMode,v=i.width,g=i.height,m=i.textHeight,y=o||v,x=String(r).split(/[\r\n]/g),E=x.length,b=nb({rows:x,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:c,lineHeight:l,padding:f},rowsLength:E,className:"lf-get-text-height"}),T=g>b?g:b;m&&(T=m);var A=h==="ellipsis";return A&&(T=s+2),V("g",{children:V("foreignObject",{width:y,height:T,x:e-y/2,y:n-T/2,style:{overflow:"visible",textAlign:"left"},children:V("div",{className:"lf-node-text-auto-wrap",style:{minHeight:T,width:y,padding:f},children:V("div",{className:A?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:A?x.join(""):"",style:ja({},t),children:x.map(function(S){return V("div",{className:"lf-node-text--auto-wrap-inner",children:S})})})})})})}var yf=function(){return yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yf.apply(this,arguments)},yj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Ho(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return gt(Zr(t),function(n){var r=yj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("line",yf({},e))}var _f=function(){return _f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_f.apply(this,arguments)},_j=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function rr(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,u=e-r/2,c=n-i/2,d={};return d["stroke-width"]=a,gt(Zr(t),function(f){var h=_j(f,2),v=h[0],g=h[1];typeof g!="object"&&(d[v]=g)}),o?d.className="lf-basic-shape ".concat(o):d.className="lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,V("rect",_f({},d))}var bf=function(){return bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bf.apply(this,arguments)},bj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Fa(t){var e={d:""};return gt(Zr(t),function(n){var r=bj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("path",bf({},e))}var xf=function(){return xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xf.apply(this,arguments)},xj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function zo(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.r,a=o===void 0?4:o,s=t.className,l={cx:n,cy:i,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(u){var c=xj(u,2),d=c[0],f=c[1];typeof f!="object"&&(l[d]=f)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",V("circle",xf({},l))}var Ef=function(){return Ef=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ef.apply(this,arguments)},Ej=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function wj(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.rx,a=o===void 0?4:o,s=t.ry,l=s===void 0?4:s,u=t.className,c={cx:n,cy:i,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(d){var f=Ej(d,2),h=f[0],v=f[1];typeof v!="object"&&(c[h]=v)}),u?c.className="lf-basic-shape ".concat(u):c.className="lf-basic-shape",V("ellipse",Ef({},c))}var Ql=function(){return Ql=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ql.apply(this,arguments)},Sj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Cj(t,e){var n=t.map(function(x){return{x:x[0],y:x[1]}}),r=n.length;if(r<3)return"";for(var i=Math.abs(e),o="",a=0;a<r;a++){var s=n[(a-1+r)%r],l=n[a],u=n[(a+1)%r],c={x:l.x-s.x,y:l.y-s.y},d={x:u.x-l.x,y:u.y-l.y},f=Math.hypot(c.x,c.y),h=Math.hypot(d.x,d.y),v={x:c.x/f,y:c.y/f},g={x:d.x/h,y:d.y/h},m={x:l.x-v.x*i,y:l.y-v.y*i},y={x:l.x+g.x*i,y:l.y+g.y*i};a===0?o+="M ".concat(m.x," ").concat(m.y," "):o+="L ".concat(m.x," ").concat(m.y," "),o+="Q ".concat(l.x," ").concat(l.y," ").concat(y.x," ").concat(y.y," ")}return o+="Z",o}function wf(t){var e=t.points,n=e===void 0?[]:e,r=t.className,i=t.radius,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(gt(Zr(t),function(s){var l=Sj(s,2),u=l[0],c=l[1];typeof c!="object"&&(o[u]=c)}),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",i){var a=Cj(n,i);return o.d=a,V("path",Ql({},o))}else return o.points=n.map(function(s){return s.join(",")}).join(" "),V("polygon",Ql({},o))}var Sf=function(){return Sf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Sf.apply(this,arguments)},Aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Oj(t){var e=t.className,n={points:"",fill:"none"};return gt(Zr(t),function(r){var i=Aj(r,2),o=i[0],a=i[1];(o==="style"||typeof a!="object")&&(n[o]=a)}),e&&(n.className="".concat(e)),V("polyline",Sf({},n))}var sb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$a=function(){return $a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$a.apply(this,arguments)},Tj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Nj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ct;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(ct||(ct={}));var Mj=function(t){sb(e,t);function e(n){var r=t.call(this)||this;r.isShiftPressed=!1,r.bindKeyboardEvents=function(){document.addEventListener("keydown",r.handleKeyDown),document.addEventListener("keyup",r.handleKeyUp)},r.handleKeyDown=function(s){s.key==="Shift"&&(r.isShiftPressed=!0)},r.handleKeyUp=function(s){s.key==="Shift"&&(r.isShiftPressed=!1)},r.updateEdgePointByAnchors=function(){var s=r.nodeModel,l=s.id,u=s.anchors,c=r.graphModel.getNodeEdges(l);gt(c,function(d){if(d.sourceNodeId===l){var f=hi(u,function(h){return h.id===d.sourceAnchorId});f&&d.updateStartPoint({x:f.x,y:f.y})}else if(d.targetNodeId===l){var f=hi(u,function(v){return v.id===d.targetAnchorId});f&&d.updateEndPoint({x:f.x,y:f.y})}})},r.triggerResizeEvent=function(s,l,u,c,d,f){r.graphModel.eventCenter.emit(be.NODE_RESIZE,{preData:s,data:l,deltaX:u,deltaY:c,index:d,model:f})},r.recalcResizeInfo=function(s,l,u,c,d){u===void 0&&(u=1),c===void 0&&(c=!1),d===void 0&&(d=!1);var f=Pe(l),h=f.deltaX,v=f.deltaY,g=f.width,m=f.height,y=f.PCTResizeInfo;if(y){var x=4,E=0,b=0;switch(s){case ct.LEFT_TOP:b=(h*-1-v)/x;break;case ct.RIGHT_TOP:b=(h-v)/x;break;case ct.RIGHT_BOTTOM:b=(h+v)/x;break;case ct.LEFT_BOTTOM:b=(h*-1+v)/x;break}b!==0&&(E=Math.round(b/y.ResizeBasis.basisHeight*1e5)/1e3),y.ResizePCT.widthPCT=Math.max(Math.min(y.ResizePCT.widthPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit),y.ResizePCT.heightPCT=Math.max(Math.min(y.ResizePCT.heightPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit);var T=Math.round(y.ResizePCT.widthPCT*y.ResizeBasis.basisWidth/100),A=Math.round(y.ResizePCT.heightPCT*y.ResizeBasis.basisHeight/100);switch(s){case ct.LEFT_TOP:h=g-T,v=m-A;break;case ct.RIGHT_TOP:h=T-g,v=m-A;break;case ct.RIGHT_BOTTOM:h=T-g,v=A-m;break;case ct.LEFT_BOTTOM:h=g-T,v=A-m;break}return f}switch(s){case ct.LEFT_TOP:f.width=c?g:g-h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_TOP:f.width=c?g:g+h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_BOTTOM:f.width=c?g:g+h*u,f.height=d?m:m+v*u;break;case ct.LEFT_BOTTOM:f.width=c?g:g-h*u,f.height=d?m:m+v*u;break}return f},r.resizeNode=function(s){var l=s.deltaX,u=s.deltaY,c=r.index,d=r.props,f=d.model,h=d.graphModel,v=d.x,g=d.y;lb({x:v,y:g,deltaX:l,deltaY:u,index:c,nodeModel:f,graphModel:h,forceProportional:r.isShiftPressed,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragStart=function(){r.graphModel.selectNodeById(r.nodeModel.id)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.graphModel.transformModel,d=Nj(c.fixDeltaXY(l,u),2),f=d[0],h=d[1];r.resizeNode({deltaX:f,deltaY:h})},r.onDragEnd=function(){var s=r.nodeModel.x,l=r.nodeModel.y;r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()};var i=n.index,o=n.model,a=n.graphModel;return r.index=i,r.nodeModel=o,r.graphModel=a,r.dragHandler=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r.bindKeyboardEvents(),r}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,u=s.height,c=Tj(s,["width","height"]);return V("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[V(rr,$a({className:"lf-resize-control-content",x:r,y:i,width:l??7,height:u??7},c)),V(rr,{className:"lf-resize-control-content",x:r,y:i,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(Qe),Dj=function(t){sb(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=Hn(r),a=o.minX,s=o.minY,l=o.maxX,u=o.maxY,c=[{index:ct.LEFT_TOP,direction:"nw",x:a,y:s},{index:ct.RIGHT_TOP,direction:"ne",x:l,y:s},{index:ct.RIGHT_BOTTOM,direction:"se",x:l,y:u},{index:ct.LEFT_BOTTOM,direction:"sw",x:a,y:u}];return Bn(c,function(d){return V(Mj,$a({},d,{model:r,graphModel:i}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,$a({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Qe);function Pj(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a={x:n+(i-n)/2,y:r+(o-r)/2};return a}function Ha(t,e,n){var r=Rj(n),i=t.x-e.x,o=t.y-e.y,a=i*Math.cos(r)-o*Math.sin(r)+e.x,s=i*Math.sin(r)+o*Math.cos(r)+e.y;return{x:a,y:s}}function Rj(t){return t*Math.PI/180}function Lj(t){return t/Math.PI*180}function Ij(t,e,n,r,i,o,a,s){i===void 0&&(i=!1),o===void 0&&(o=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},u=Pj(l,e),c=Ha(e,u,-r),d=Ha(l,u,-r);if(i){var f=Math.abs(c.x-d.x),h=f-a;u.x>c.x?u.x=u.x+h/2:u.x=u.x-h/2}if(o){var v=Math.abs(c.y-d.y),g=v-s;u.y>c.y?u.y=u.y+g/2:u.y=u.y-g/2}if(i||o){var m=Ha(d,u,r),y=m.x-l.x,x=m.y-l.y;u.x=u.x-y,u.y=u.y-x,d=Ha(l,u,-r),c={x:u.x-(d.x-u.x),y:u.y-(d.y-u.y)}}var E=Math.abs(c.x-d.x),b=Math.abs(c.y-d.y);return i&&(E=a),o&&(b=s),{width:E,height:b,center:u}}function kj(t,e,n,r,i,o,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var u=e.deltaX,c=e.deltaY,d=e.width,f=e.height,h=Lj(n),v={x:r,y:i},g={x:o,y:a},m=Ha(v,g,h),y={x:m.x+u,y:m.y+c},x=Ij(m,y,g,h,s,l,d,f),E=x.width,b=x.height,T=x.center;return e.width=E*t,e.height=b*t,e.deltaX=(T.x-g.x)*2,e.deltaY=(T.y-g.y)*2,e}var Bj=function(t,e,n,r,i,o,a,s,l,u,c){n===void 0&&(n=1),r===void 0&&(r=!1),i===void 0&&(i=!1),o===void 0&&(o=0),c===void 0&&(c=!1);var d=Pe(e),f=d.deltaX,h=d.deltaY,v=d.width,g=d.height,m=d.PCTResizeInfo;if(m){var y=4,x=0,E=0;switch(t){case ct.LEFT_TOP:E=(f*-1-h)/y;break;case ct.RIGHT_TOP:E=(f-h)/y;break;case ct.RIGHT_BOTTOM:E=(f+h)/y;break;case ct.LEFT_BOTTOM:E=(f*-1+h)/y;break}E!==0&&(x=Math.round(E/m.ResizeBasis.basisHeight*1e5)/1e3),m.ResizePCT.widthPCT=Math.max(Math.min(m.ResizePCT.widthPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit),m.ResizePCT.heightPCT=Math.max(Math.min(m.ResizePCT.heightPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit);var b=Math.round(m.ResizePCT.widthPCT*m.ResizeBasis.basisWidth/100),T=Math.round(m.ResizePCT.heightPCT*m.ResizeBasis.basisHeight/100);switch(t){case ct.LEFT_TOP:f=v-b,h=g-T;break;case ct.RIGHT_TOP:f=b-v,h=g-T;break;case ct.RIGHT_BOTTOM:f=b-v,h=T-g;break;case ct.LEFT_BOTTOM:f=v-b,h=T-g;break}return d}if(o%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return kj(n,d,o,a,s,l,u,r,i);if(c){var A=v/g,S=0,M=v,C=g;switch(t){case ct.LEFT_TOP:S=Math.abs(f)>Math.abs(h)?-f:-h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=g-C;break;case ct.RIGHT_TOP:S=Math.abs(f)>Math.abs(h)?f:-h,A>=1?(M=v+S,C=M/A):(C=g-S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=g-C;break;case ct.RIGHT_BOTTOM:S=Math.abs(f)>Math.abs(h)?f:h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=C-g;break;case ct.LEFT_BOTTOM:S=Math.abs(f)>Math.abs(h)?-f:h,A>=1?(M=v-S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=C-g;break}return d}switch(t){case ct.LEFT_TOP:d.width=r?v:v-f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_TOP:d.width=r?v:v+f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_BOTTOM:d.width=r?v:v+f*n,d.height=i?g:g+h*n;break;case ct.LEFT_BOTTOM:d.width=r?v:v-f*n,d.height=i?g:g+h*n;break}return d},jj=function(t,e){var n=t.id,r=t.anchors,i=e.getNodeEdges(n);gt(i,function(o){if(o.sourceNodeId===n){var a=hi(r,function(s){return s.id===o.sourceAnchorId});a&&o.updateStartPoint({x:a.x,y:a.y})}else if(o.targetNodeId===n){var a=hi(r,function(l){return l.id===o.targetAnchorId});a&&o.updateEndPoint({x:a.x,y:a.y})}})},Fj=function(t,e,n,r,i,o,a){a.eventCenter.emit(be.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:r,index:i,model:o})},lb=function(t){var e=t.x,n=t.y,r=t.deltaX,i=t.deltaY,o=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,u=t.forceProportional,c=u===void 0?!1:u,d=a.r,f=a.rx,h=a.ry,v=a.width,g=a.height,m=a.PCTResizeInfo,y=a.minWidth,x=a.minHeight,E=a.maxWidth,b=a.maxHeight,T=a.rotate,A=a.x,S=a.y,M=y===E,C=x===b,G={width:d||f||v,height:d||h||g,deltaX:r,deltaY:i,PCTResizeInfo:m},K=d||f&&h?1/2:1,J=e,R=n,k=Bj(o,G,K,M,C,T,J,R,A,S,c);if(k.width<y||k.width>E||k.height<x||k.height>b){l==null||l();return}(T%(2*Math.PI)==0||m||J===void 0||R===void 0)&&(k.deltaX=M?0:k.deltaX,k.deltaY=C?0:k.deltaY);var B=a.getData(),Z=a.resize(k);B.x===Z.x&&B.y===Z.y||(jj(a,s),Fj(B,Z,r,i,o,a,s))},$j=100,Hj={x:1,y:0};function zj(t,e,n,r,i){for(var o=function(h){if(h<0||h>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-h,3)+3*e.x*h*Math.pow(1-h,2)+3*n.x*Math.pow(h,2)*(1-h)+r.x*Math.pow(h,3),y:t.y*Math.pow(1-h,3)+3*e.y*h*Math.pow(1-h,2)+3*n.y*Math.pow(h,2)*(1-h)+r.y*Math.pow(h,3)}},a=0,s=2,l=r.x,u=r.y,c=r;a<i&&s<50;){c=o(1-s/$j);var d=c.x,f=c.y;a=Er(l,u,d,f),s++}return c}function Wj(t,e){return t.x*e.y-t.y*e.x}function Uj(t,e){var n=[t.x,t.y,t.z],r=[e.x,e.y,e.z];return r.reduce(function(i,o,a){return i+o*n[a]})}function Vj(t,e){var n=Wj(t,e),r=Math.acos(Uj(ub(t),ub(e)));return n>=0?r:-r}function ub(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function Xj(t){return Vj(Hj,t)}function Gj(t){return t*(180/Math.PI)}var cb={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Yj={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Kj={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qj={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},za={colorful:qj,dark:Kj,radius:Yj,default:cb},Zj={background:"#23272e"},Jj={background:"#fefeff"},Cf={background:"#ffffff"},Wa={colorful:Jj,dark:Zj,radius:Cf,default:Cf},Qj={color:"#66676a",thickness:1},e3={color:"#dadada",thickness:1},Af={color:"#acacac",thickness:1},Ua={colorful:e3,dark:Qj,radius:Af,default:Af},db=function(t,e){var n=Pe(cb);return e&&(n=zi(n,za[e])),t&&(n=zi(n,t)),n},t3=function(t,e){if(za[t]){console.warn("theme mode ".concat(t," already exists"));return}za[t]=e,Wa[t]=e.background||Cf,Ua[t]=e.grid||Af},n3=function(t){delete za[t],delete Wa[t],delete Ua[t]},r3=function(){var t={colorful:{},dark:{},radius:{},default:{}};ut(za,t),ut(Wa,t),ut(Ua,t)},i3=db,o3=1e3,a3=999,Va=function(){return++o3},s3=function(){return--a3},jt=function(){return jt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jt.apply(this,arguments)},Ce=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},eu=function(){function t(e,n){var r;this.BaseType=Lt.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=lt.DEFAULT,this.modelType=Ye.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,ut(this,ej(e));var s=this.graphModel,l=s.overlapMode,u=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||Va()),this.setAnchors(),this.initPoints(),this.formatText(e),u.on("overlap:change",function(c){var d=c.overlapMode;n.updateZIndexByOverlap(d,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return jt(jt({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return jt({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return Pe(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return Pe(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),r=this.graphModel.theme.arrow,i=this.isAnimation?n.stroke:e.stroke;return jt(jt(jt({},e),{fill:i,stroke:i}),r)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return Pe(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,r){var i,o,a=vf(e);if(r){if(i=hi(a,function(s){return s.id===r}),i)return i;console.warn("未在节点上找到指定的起点锚点".concat(r,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=Y_(s,n);(o===void 0||l<o)&&(o=l,i=s)}),i},t.prototype.getEndAnchor=function(e,n){var r=this,i,o,a=vf(e);if(n){if(i=hi(a,function(s){return s.id===n}),i)return i;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(r.startPoint){var l=Y_(s,r.startPoint);(o===void 0||l<o)&&(o=l,i=s)}}),i},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getData=function(){var e=this.properties;bi(e)&&(e=mr(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:ut({},this.startPoint),endPoint:ut({},this.endPoint)};[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var r=this.text,i=r.x,o=r.y,a=r.value;return a&&(n.text={x:i,y:o,value:a}),n},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(e,n){Jd(this.properties,e,sn(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=jt(jt({},mr(this.properties)),sn(e)),this.setAttributes()},t.prototype.changeEdgeId=function(e){var n=this.arrowConfig,r=n.markerEnd,i=n.markerStart;i&&i==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),r&&r==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},t.prototype.setStyle=function(e,n){var r;this.style=jt(jt({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=jt(jt({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=jt({},sn(e))},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.edgeTextDraggable,s=o.edgeTextEdit,l=this.textPosition,u=l.x,c=l.y,d=e.text,f={value:"",x:u,y:c,draggable:a,editable:s};d&&(typeof d=="string"?f=jt(jt({},f),{value:d}):(f=jt(jt({},f),{x:(n=d.x)!==null&&n!==void 0?n:u,y:(r=d.y)!==null&&r!==void 0?r:c,value:(i=d.value)!==null&&i!==void 0?i:""}),Hi(d.draggable)||(f.draggable=d.draggable),Hi(d.editable)||(f.editable=d.editable))),this.text=f},t.prototype.resetTextPosition=function(){var e=this.textPosition,n=e.x,r=e.y;this.text.x=n,this.text.y=r},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.setText=function(e){e&&ut(this.text,e)},t.prototype.updateText=function(e){this.text=jt(jt({},mr(this.text)),{value:e})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateStartPoint=function(e){this.startPoint=e},t.prototype.moveStartPoint=function(e,n){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=n)},t.prototype.updateEndPoint=function(e){this.endPoint=e},t.prototype.moveEndPoint=function(e,n){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=n)},t.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var n=e.startPoint,r=e.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:r.x,y:r.y})},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=0;break;case Xt.EDGE_TOP:this.zIndex=1;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.EDGE,Ce([X],t.prototype,"type",void 0),Ce([X],t.prototype,"sourceNodeId",void 0),Ce([X],t.prototype,"targetNodeId",void 0),Ce([X],t.prototype,"startPoint",void 0),Ce([X],t.prototype,"endPoint",void 0),Ce([X],t.prototype,"textMode",void 0),Ce([X],t.prototype,"text",void 0),Ce([X],t.prototype,"properties",void 0),Ce([X],t.prototype,"points",void 0),Ce([X],t.prototype,"pointsList",void 0),Ce([X],t.prototype,"isSelected",void 0),Ce([X],t.prototype,"isHovered",void 0),Ce([X],t.prototype,"isHitable",void 0),Ce([X],t.prototype,"isHittable",void 0),Ce([X],t.prototype,"draggable",void 0),Ce([X],t.prototype,"visible",void 0),Ce([X],t.prototype,"isAnimation",void 0),Ce([X],t.prototype,"isShowAdjustPoint",void 0),Ce([X],t.prototype,"zIndex",void 0),Ce([X],t.prototype,"state",void 0),Ce([X],t.prototype,"style",void 0),Ce([X],t.prototype,"arrowConfig",void 0),Ce([Et],t.prototype,"sourceNode",null),Ce([Et],t.prototype,"targetNode",null),Ce([Et],t.prototype,"textPosition",null),Ce([U],t.prototype,"setProperty",null),Ce([U],t.prototype,"deleteProperty",null),Ce([U],t.prototype,"setProperties",null),Ce([U],t.prototype,"changeEdgeId",null),Ce([U],t.prototype,"setStyle",null),Ce([U],t.prototype,"setStyles",null),Ce([U],t.prototype,"updateStyles",null),Ce([U],t.prototype,"setTextMode",null),Ce([U],t.prototype,"formatText",null),Ce([U],t.prototype,"resetTextPosition",null),Ce([U],t.prototype,"moveText",null),Ce([U],t.prototype,"setText",null),Ce([U],t.prototype,"updateText",null),Ce([U],t.prototype,"setAnchors",null),Ce([U],t.prototype,"setSelected",null),Ce([U],t.prototype,"setHovered",null),Ce([U],t.prototype,"setHitable",null),Ce([U],t.prototype,"setHittable",null),Ce([U],t.prototype,"openEdgeAnimation",null),Ce([U],t.prototype,"closeEdgeAnimation",null),Ce([U],t.prototype,"setElementState",null),Ce([U],t.prototype,"updateStartPoint",null),Ce([U],t.prototype,"moveStartPoint",null),Ce([U],t.prototype,"updateEndPoint",null),Ce([U],t.prototype,"moveEndPoint",null),Ce([U],t.prototype,"setZIndex",null),Ce([U],t.prototype,"initPoints",null),Ce([U],t.prototype,"updateAttributes",null),Ce([U],t.prototype,"getAdjustStart",null),Ce([U],t.prototype,"getAdjustEnd",null),Ce([U],t.prototype,"updateAfterAdjustStartAndEnd",null),Ce([U],t.prototype,"updateZIndexByOverlap",null),t}(),l3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qi=function(){return qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qi.apply(this,arguments)},ir=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Of=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},fb=function(t){l3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.BEZIER_EDGE,i.path="",i.initEdgeData(n),i.setAttributes(),i}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return qi(qi(qi({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,r=0;return this.pointsList.forEach(function(i){var o=i.x,a=i.y;n+=o,r+=a}),{x:n/this.pointsList.length,y:r/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return qi(qi({},n),{pointsList:r})},e.prototype.getControls=function(){var n=this.startPoint,r=this.endPoint,i=V_({start:n,end:r,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return i},e.prototype.getPath=function(n){var r=Of(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return"M ".concat(i.x," ").concat(i.y,`
63
+ L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:r,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},V_=function(t){var e=t.start,n=t.end,r=t.sourceNode,i=t.targetNode,o=t.offset,a=Hn(r),s=Hn(i),l=Fl(a,o),u=Fl(s,o),c=$l(l,a,e),d=$l(u,s,n);return{sNext:c,ePre:d}},cf=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=Ul(e[0]),r=Ul(e[1]),i=Ul(e[2]),o=Ul(e[3]);return[n,r,i,o]},Ul=function(t){var e=nr(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],r=e[1];return{x:+n,y:+r}},X_=function(t,e){var n=nr(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=zj(r,i,o,a,e);return[s,t[3]]},G_=function(t,e){for(var n=t.x,r=t.y,i=Ki(e),o=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+1)%i.length]});if(s.forEach(function(f){var h=f.start,v=f.end;if(h.x===v.x){var g={x:h.x,y:r},m=Pa(g,h,v);if(m){var y=Math.abs(h.x-n);y<o&&(o=y,a=g)}}else if(h.y===v.y){var g={x:n,y:h.y},m=Pa(g,h,v);if(m){var y=Math.abs(h.y-r);y<o&&(o=y,a=g)}}}),!a){var u=s[0],c=u.start,d=u.end;a={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return a},ej=function(t){return gi(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Y_=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function tj(t,e){return typeof e!="function"?function(n,r,i){return Object.assign({type:t.edgeType},i)}:function(n,r,i){var o=e(n,r,i);return o?typeof o=="string"?Object.assign({},i,{type:o}):Object.assign({type:o},i):{type:t.edgeType}}}var nj=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return gt(e,function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},jo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Vl=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function Fo(t,e,n){return n&&e*Math.round(t/e)||t}function rj(t,e,n){if(!t)return[];var r=Math.min.apply(Math,Vl([],jo(t.map(function(g){return g[0]})),!1)),i=Math.max.apply(Math,Vl([],jo(t.map(function(g){return g[0]})),!1)),o=Math.min.apply(Math,Vl([],jo(t.map(function(g){return g[1]})),!1)),a=Math.max.apply(Math,Vl([],jo(t.map(function(g){return g[1]})),!1)),s=-r,l=-o,u=t.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y+s,x+l]}),c=i-r,d=a-o,f=e?e/c:1,h=n?n/d:1,v=Math.min(f,h);return u.map(function(g){var m=jo(g,2),y=m[0],x=m[1];return[y*v,x*v]})}var df=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ff=function(t,e,n){var r=df(t,2),i=r[0],o=r[1],a=df(e,2),s=a[0],l=a[1],u=df(n,2),c=u[0],d=u[1];return i>s&&i<c&&o>l&&o<d},K_=function(t,e){var n=e.multipleSelectKey,r=!1;switch(n){case"meta":r=t.metaKey;break;case"alt":r=t.altKey;break;case"shift":r=t.shiftKey;break;case"ctrl":r=t.ctrlKey;break;default:r=!1;break}return r},pf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function q_(t,e){return t instanceof Zt&&e instanceof Zt}var Z_=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,3)||this;return o[0]=n,o[1]=r,o[2]=i,o.x=n,o.y=r,o.z=i,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.add=function(n){if(q_(this,n))return new Zt(this.x+n.x,this.y+n.y);var r=this.z+n.z;return new hf((this.x+n.x)/r,(this.y+n.y)/r)},e.prototype.subtract=function(n){if(q_(this,n))return new Zt(this.x-n.x,this.y-n.y);var r=this.z-n.z;return r===0?new Zt(this.x-n.x,this.y-n.y):new hf((this.x-n.x)/r,(this.y-n.y)/r)},e}(Array),Zt=function(t){pf(e,t);function e(n,r,i){var o=t.call(this,n,r,i??0)||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(n){var r=this;return n.reduce(function(i,o,a){return i+o*r[a]})},e.prototype.cross=function(n){return new e(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var n=this.getLength();return new e(this.x/n,this.y/n)},e.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},e.prototype.angle=function(n){var r=this.crossZ(n),i=Math.acos(this.normalize().dot(n.normalize()));return r>=0?i:-i},e}(Z_),hf=function(t){pf(e,t);function e(n,r){var i=t.call(this,n,r,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Point"},e}(Z_),Xl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$o=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gf=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},ka=function(t){Xl(e,t);function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.call(this,n.length)||this;return i.fill(new Array(3)),n.forEach(function(o,a){i[a]=o}),i.columns=n[0].length,i.rows=n.length,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.getRow=function(n){return this[n]},e.prototype.getColumn=function(n){return gf([],$o(this.map(function(r){return r[n]})),!1)},e.prototype.transpose=function(){for(var n=[],r=0;r<this.columns;r++)n.push(this.getColumn(r));return new(e.bind.apply(e,gf([void 0],$o(n),!1)))},e.prototype.cross=function(n){var r=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var i=0;i<this.rows;i++)for(var o=this.getRow(i),a=function(l){var u=n.getColumn(l);r[i][l]=o.reduce(function(c,d,f){return c+d*u[f]},0)},s=0;s<n.columns;s++)a(s);return new(e.bind.apply(e,gf([void 0],$o(r),!1)))},e.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},e.prototype.toPoints=function(){return this.map(function(n){return new hf(n[0],n[1])})},e.prototype.toString=function(){var n=$o(this[0],2),r=n[0],i=n[1],o=$o(this[1],2),a=o[0],s=o[1],l=$o(this[2],2),u=l[0],c=l[1];return"matrix(".concat(r," ").concat(i," ").concat(a," ").concat(s," ").concat(u," ").concat(c,")")},e.prototype.translate=function(n,r){return this.cross(new Gl(n,r))},e.prototype.rotate=function(n){return this.cross(new ij(n))},e.prototype.scale=function(n,r){return this.cross(new oj(n,r))},e}(Array),ij=function(t){Xl(e,t);function e(n){var r=t.call(this,new Zt(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Zt(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Zt(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return this.transpose()},e}(ka),oj=function(t){Xl(e,t);function e(n,r){var i=t.call(this,new Zt(n,0,0),new Zt(0,r,0),new Zt(0,0,1))||this;return i.sx=n,i.sy=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(ka),Gl=function(t){Xl(e,t);function e(n,r){var i=t.call(this,new Zt(1,0,0),new Zt(0,1,0),new Zt(n,r,1))||this;return i.tx=n,i.ty=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(ka);jk({});var Yl=function(){return Yl=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yl.apply(this,arguments)},aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},vf=function(t){var e=t.anchors;return e},Kl=function(t,e){for(var n=e.nodes,r,i=n.length-1;i>=0;i--){var o=n[i],a=uj(t,o);if(a){var s=o.getTargetAnchor(t);if(s){var l={node:o,anchorIndex:s.index,anchor:s.anchor};(!r||sj(o,r.node,e))&&(r=l)}}}return r},sj=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},lj=function(t,e){for(var n=vf(e),r,i=Number.MAX_SAFE_INTEGER,o=0;o<n.length;o++){var a=Er(t.x,t.y,n[o].x,n[o].y);a<i&&(i=a,r={index:o,anchor:Yl(Yl({},n[o]),{x:n[o].x,y:n[o].y,id:n[o].id})})}return r},Er=function(t,e,n,r){return Math.hypot(t-n,e-r)},ni=function(t,e,n){n===void 0&&(n=0);var r=!1,i=Hn(e),o=aj(new ka([t.x,t.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=o[0],s=o[1],l={x:a,y:s};return l.x>=i.minX-n&&l.x<=i.maxX+n&&l.y>=i.minY-n&&l.y<=i.maxY+n&&(r=!0),r},uj=function(t,e){return ni(t,e,5)},Hn=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}},cj=function(t){var e=t,n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;return[{x:n-i/2+a,y:r-o/2+a,r:a},{x:n+i/2-a,y:r-o/2+a,r:a},{x:n-i/2+a,y:r+o/2-a,r:a},{x:n+i/2-a,y:r+o/2-a,r:a}]},J_=function(t,e,n){var r=cj(n),i,o=Number.MAX_SAFE_INTEGER;return r.forEach(function(a){var s=Er(t.x,t.y,a.x,a.y);s<o&&(o=s,i=a)}),mf(t,e,i)},mf=function(t,e,n){var r,i=n.x,o=n.y,a=n.r;if(e===Tt.HORIZONTAL){var s=i-Math.sqrt(a*a-(t.y-o)*(t.y-o)),l=i+Math.sqrt(a*a-(t.y-o)*(t.y-o)),u=Math.abs(s-t.x)<Math.abs(l-t.x)?s:l;r={x:u,y:t.y}}else if(e===Tt.VERTICAL){var c=o-Math.sqrt(a*a-(t.x-i)*(t.x-i)),d=o+Math.sqrt(a*a-(t.x-i)*(t.x-i)),f=Math.abs(c-t.y)<Math.abs(d-t.y)?c:d;r={x:t.x,y:f}}return r},Q_=function(t,e){var n=e,r=!1,i=n.x,o=n.y,a=n.width,s=n.height,l=n.radius,u={minX:i-a/2+l,maxX:i+a/2-l,minY:o-s/2+l,maxY:o+s/2-l};return t.y===o+s/2||t.y===o-s/2?r=t.x>u.minX&&t.x<u.maxX:(t.x===i+a/2||t.x===i-a/2)&&(r=t.y>u.minY&&t.y<u.maxY),r},eb=function(t,e,n){var r,i=n,o=i.x,a=i.y,s=i.rx,l=i.ry;if(e===Tt.HORIZONTAL){var u=o-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=o+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),d=Math.abs(u-t.x)<Math.abs(c-t.x)?u:c;r={x:d,y:t.y}}else if(e===Tt.VERTICAL){var f=a-Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),h=a+Math.sqrt(l*l-(t.x-o)*(t.x-o)*l*l/(s*s)),v=Math.abs(f-t.y)<Math.abs(h-t.y)?f:h;r={x:t.x,y:v}}return r},ql=function(t,e,n){for(var r=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,o,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach(function(l){var u=l.start,c=l.end,d=u,f=c;u.x>c.x&&(d=c,f=u);var h={x:t.x,y:t.y};if(d.x===f.x&&e===Tt.HORIZONTAL&&(h={x:d.x,y:t.y}),d.y===f.y&&e===Tt.VERTICAL&&(h={x:t.x,y:d.y}),d.x!==f.x&&d.y!==f.y){var v=(f.y-d.y)/(f.x-d.x),g=(d.x*f.y-f.x*d.y)/(d.x-f.x);e===Tt.HORIZONTAL?h={x:(t.y-g)/v,y:t.y}:e===Tt.VERTICAL&&(h={x:t.x,y:v*t.x+g})}var m=Pa(h,u,c);if(m){var y=Er(h.x,h.y,t.x,t.y);y<i&&(i=y,o=h)}}),o},dj=function(t){var e=gi(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},tb=function(t,e,n,r){var i=t.x,o=t.y;return e.x>t.x?i=t.x+n/2:e.x<t.x&&(i=t.x-n/2),e.y>t.y?o=t.y+r/2:e.y<t.y&&(o=t.y-r/2),{x:i,y:o}},nb=function(t){var e=t.rows,n=t.style,r=t.rowsLength,i=t.className,o=document.createElement("div");o.className=i,o.style.fontSize="".concat(n.fontSize),o.style.width="".concat(n.width),o.style.lineHeight="".concat(n.lineHeight),o.style.padding="".concat(n.padding),n.fontFamily&&(o.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,o.appendChild(l)}):o.textContent=e[0],document.body.appendChild(o);var a=o.clientHeight;return document.body.removeChild(o),a},rb=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,i=0;return e&&e.forEach(function(o){var a=U_(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:n*(r+2)+r/4}},Zl=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Jl;const fj=new Uint8Array(16);function pj(){if(!Jl&&(Jl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jl(fj)}const Jt=[];for(let t=0;t<256;++t)Jt.push((t+256).toString(16).slice(1));function hj(t,e=0){return Jt[t[e+0]]+Jt[t[e+1]]+Jt[t[e+2]]+Jt[t[e+3]]+"-"+Jt[t[e+4]]+Jt[t[e+5]]+"-"+Jt[t[e+6]]+Jt[t[e+7]]+"-"+Jt[t[e+8]]+Jt[t[e+9]]+"-"+Jt[t[e+10]]+Jt[t[e+11]]+Jt[t[e+12]]+Jt[t[e+13]]+Jt[t[e+14]]+Jt[t[e+15]]}const ib={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gj(t,e,n){if(ib.randomUUID&&!t)return ib.randomUUID();t=t||{};const r=t.random||(t.rng||pj)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,hj(r)}var Si=function(){return gj()},Ba=new Map,ob=function(t){var e=Si();function n(){t();var i=Ba.get(e);if(i){var o=window.requestAnimationFrame(n);Ba.set(e,o)}}var r=window.requestAnimationFrame(n);return Ba.set(e,r),e},Ql=function(t){var e=Ba.get(t);e&&(window.cancelAnimationFrame(e),Ba.delete(t))},ja=function(){return ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ja.apply(this,arguments)},vj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ab(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,u=l===void 0?"currentColor":l,c=t.overflowMode,d=c===void 0?"default":c,f=t.textWidth,h=f===void 0?void 0:f,v=t.model,g={x:n,y:i,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(gt(Zr(t),function(T){var A=vj(T,2),S=A[0],M=A[1];typeof M!="object"&&(g[S]=M)}),o){var m=String(o).split(/[\r\n]/g),y=m.length;if(d!=="default"){var x=v.BaseType,E=v.modelType;if(x===Lt.NODE&&E!==Ye.TEXT_NODE||x===Lt.EDGE&&h)return mj(t)}if(y>1){var b=m.map(function(T,A){var S=s+2,M=(A-(y-1)/2)*S;return V("tspan",{className:"lf-text-tspan",x:n,y:i+M,children:T})});return V("text",ja({},g,{children:b}))}return V("text",ja({},g,{children:o}))}return null}function mj(t){var e=t.x,n=t.y,r=t.value,i=t.model,o=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,u=t.fontFamily,c=u===void 0?"":u,d=t.wrapPadding,f=d===void 0?"0, 0":d,h=t.overflowMode,v=i.width,g=i.height,m=i.textHeight,y=o||v,x=String(r).split(/[\r\n]/g),E=x.length,b=nb({rows:x,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:c,lineHeight:l,padding:f},rowsLength:E,className:"lf-get-text-height"}),T=g>b?g:b;m&&(T=m);var A=h==="ellipsis";return A&&(T=s+2),V("g",{children:V("foreignObject",{width:y,height:T,x:e-y/2,y:n-T/2,style:{overflow:"visible",textAlign:"left"},children:V("div",{className:"lf-node-text-auto-wrap",style:{minHeight:T,width:y,padding:f},children:V("div",{className:A?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:A?x.join(""):"",style:ja({},t),children:x.map(function(S){return V("div",{className:"lf-node-text--auto-wrap-inner",children:S})})})})})})}var yf=function(){return yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yf.apply(this,arguments)},yj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Ho(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return gt(Zr(t),function(n){var r=yj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("line",yf({},e))}var _f=function(){return _f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_f.apply(this,arguments)},_j=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function rr(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,u=e-r/2,c=n-i/2,d={};return d["stroke-width"]=a,gt(Zr(t),function(f){var h=_j(f,2),v=h[0],g=h[1];typeof g!="object"&&(d[v]=g)}),o?d.className="lf-basic-shape ".concat(o):d.className="lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,V("rect",_f({},d))}var bf=function(){return bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bf.apply(this,arguments)},bj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Fa(t){var e={d:""};return gt(Zr(t),function(n){var r=bj(n,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),V("path",bf({},e))}var xf=function(){return xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xf.apply(this,arguments)},xj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function zo(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.r,a=o===void 0?4:o,s=t.className,l={cx:n,cy:i,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(u){var c=xj(u,2),d=c[0],f=c[1];typeof f!="object"&&(l[d]=f)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",V("circle",xf({},l))}var Ef=function(){return Ef=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ef.apply(this,arguments)},Ej=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function wj(t){var e=t.x,n=e===void 0?0:e,r=t.y,i=r===void 0?0:r,o=t.rx,a=o===void 0?4:o,s=t.ry,l=s===void 0?4:s,u=t.className,c={cx:n,cy:i,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return gt(Zr(t),function(d){var f=Ej(d,2),h=f[0],v=f[1];typeof v!="object"&&(c[h]=v)}),u?c.className="lf-basic-shape ".concat(u):c.className="lf-basic-shape",V("ellipse",Ef({},c))}var eu=function(){return eu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},eu.apply(this,arguments)},Sj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Cj(t,e){var n=t.map(function(x){return{x:x[0],y:x[1]}}),r=n.length;if(r<3)return"";for(var i=Math.abs(e),o="",a=0;a<r;a++){var s=n[(a-1+r)%r],l=n[a],u=n[(a+1)%r],c={x:l.x-s.x,y:l.y-s.y},d={x:u.x-l.x,y:u.y-l.y},f=Math.hypot(c.x,c.y),h=Math.hypot(d.x,d.y),v={x:c.x/f,y:c.y/f},g={x:d.x/h,y:d.y/h},m={x:l.x-v.x*i,y:l.y-v.y*i},y={x:l.x+g.x*i,y:l.y+g.y*i};a===0?o+="M ".concat(m.x," ").concat(m.y," "):o+="L ".concat(m.x," ").concat(m.y," "),o+="Q ".concat(l.x," ").concat(l.y," ").concat(y.x," ").concat(y.y," ")}return o+="Z",o}function wf(t){var e=t.points,n=e===void 0?[]:e,r=t.className,i=t.radius,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(gt(Zr(t),function(s){var l=Sj(s,2),u=l[0],c=l[1];typeof c!="object"&&(o[u]=c)}),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",i){var a=Cj(n,i);return o.d=a,V("path",eu({},o))}else return o.points=n.map(function(s){return s.join(",")}).join(" "),V("polygon",eu({},o))}var Sf=function(){return Sf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Sf.apply(this,arguments)},Aj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function Oj(t){var e=t.className,n={points:"",fill:"none"};return gt(Zr(t),function(r){var i=Aj(r,2),o=i[0],a=i[1];(o==="style"||typeof a!="object")&&(n[o]=a)}),e&&(n.className="".concat(e)),V("polyline",Sf({},n))}var sb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$a=function(){return $a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$a.apply(this,arguments)},Tj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Nj=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ct;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(ct||(ct={}));var Mj=function(t){sb(e,t);function e(n){var r=t.call(this)||this;r.isShiftPressed=!1,r.bindKeyboardEvents=function(){document.addEventListener("keydown",r.handleKeyDown),document.addEventListener("keyup",r.handleKeyUp)},r.handleKeyDown=function(s){s.key==="Shift"&&(r.isShiftPressed=!0)},r.handleKeyUp=function(s){s.key==="Shift"&&(r.isShiftPressed=!1)},r.updateEdgePointByAnchors=function(){var s=r.nodeModel,l=s.id,u=s.anchors,c=r.graphModel.getNodeEdges(l);gt(c,function(d){if(d.sourceNodeId===l){var f=hi(u,function(h){return h.id===d.sourceAnchorId});f&&d.updateStartPoint({x:f.x,y:f.y})}else if(d.targetNodeId===l){var f=hi(u,function(v){return v.id===d.targetAnchorId});f&&d.updateEndPoint({x:f.x,y:f.y})}})},r.triggerResizeEvent=function(s,l,u,c,d,f){r.graphModel.eventCenter.emit(be.NODE_RESIZE,{preData:s,data:l,deltaX:u,deltaY:c,index:d,model:f})},r.recalcResizeInfo=function(s,l,u,c,d){u===void 0&&(u=1),c===void 0&&(c=!1),d===void 0&&(d=!1);var f=Pe(l),h=f.deltaX,v=f.deltaY,g=f.width,m=f.height,y=f.PCTResizeInfo;if(y){var x=4,E=0,b=0;switch(s){case ct.LEFT_TOP:b=(h*-1-v)/x;break;case ct.RIGHT_TOP:b=(h-v)/x;break;case ct.RIGHT_BOTTOM:b=(h+v)/x;break;case ct.LEFT_BOTTOM:b=(h*-1+v)/x;break}b!==0&&(E=Math.round(b/y.ResizeBasis.basisHeight*1e5)/1e3),y.ResizePCT.widthPCT=Math.max(Math.min(y.ResizePCT.widthPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit),y.ResizePCT.heightPCT=Math.max(Math.min(y.ResizePCT.heightPCT+E,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit);var T=Math.round(y.ResizePCT.widthPCT*y.ResizeBasis.basisWidth/100),A=Math.round(y.ResizePCT.heightPCT*y.ResizeBasis.basisHeight/100);switch(s){case ct.LEFT_TOP:h=g-T,v=m-A;break;case ct.RIGHT_TOP:h=T-g,v=m-A;break;case ct.RIGHT_BOTTOM:h=T-g,v=A-m;break;case ct.LEFT_BOTTOM:h=g-T,v=A-m;break}return f}switch(s){case ct.LEFT_TOP:f.width=c?g:g-h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_TOP:f.width=c?g:g+h*u,f.height=d?m:m-v*u;break;case ct.RIGHT_BOTTOM:f.width=c?g:g+h*u,f.height=d?m:m+v*u;break;case ct.LEFT_BOTTOM:f.width=c?g:g-h*u,f.height=d?m:m+v*u;break}return f},r.resizeNode=function(s){var l=s.deltaX,u=s.deltaY,c=r.index,d=r.props,f=d.model,h=d.graphModel,v=d.x,g=d.y;lb({x:v,y:g,deltaX:l,deltaY:u,index:c,nodeModel:f,graphModel:h,forceProportional:r.isShiftPressed,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragStart=function(){r.graphModel.selectNodeById(r.nodeModel.id)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.graphModel.transformModel,d=Nj(c.fixDeltaXY(l,u),2),f=d[0],h=d[1];r.resizeNode({deltaX:f,deltaY:h})},r.onDragEnd=function(){var s=r.nodeModel.x,l=r.nodeModel.y;r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()};var i=n.index,o=n.model,a=n.graphModel;return r.index=i,r.nodeModel=o,r.graphModel=a,r.dragHandler=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r.bindKeyboardEvents(),r}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,u=s.height,c=Tj(s,["width","height"]);return V("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[V(rr,$a({className:"lf-resize-control-content",x:r,y:i,width:l??7,height:u??7},c)),V(rr,{className:"lf-resize-control-content",x:r,y:i,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(Qe),Dj=function(t){sb(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=Hn(r),a=o.minX,s=o.minY,l=o.maxX,u=o.maxY,c=[{index:ct.LEFT_TOP,direction:"nw",x:a,y:s},{index:ct.RIGHT_TOP,direction:"ne",x:l,y:s},{index:ct.RIGHT_BOTTOM,direction:"se",x:l,y:u},{index:ct.LEFT_BOTTOM,direction:"sw",x:a,y:u}];return Bn(c,function(d){return V(Mj,$a({},d,{model:r,graphModel:i}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,$a({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Qe);function Pj(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a={x:n+(i-n)/2,y:r+(o-r)/2};return a}function Ha(t,e,n){var r=Rj(n),i=t.x-e.x,o=t.y-e.y,a=i*Math.cos(r)-o*Math.sin(r)+e.x,s=i*Math.sin(r)+o*Math.cos(r)+e.y;return{x:a,y:s}}function Rj(t){return t*Math.PI/180}function Lj(t){return t/Math.PI*180}function Ij(t,e,n,r,i,o,a,s){i===void 0&&(i=!1),o===void 0&&(o=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},u=Pj(l,e),c=Ha(e,u,-r),d=Ha(l,u,-r);if(i){var f=Math.abs(c.x-d.x),h=f-a;u.x>c.x?u.x=u.x+h/2:u.x=u.x-h/2}if(o){var v=Math.abs(c.y-d.y),g=v-s;u.y>c.y?u.y=u.y+g/2:u.y=u.y-g/2}if(i||o){var m=Ha(d,u,r),y=m.x-l.x,x=m.y-l.y;u.x=u.x-y,u.y=u.y-x,d=Ha(l,u,-r),c={x:u.x-(d.x-u.x),y:u.y-(d.y-u.y)}}var E=Math.abs(c.x-d.x),b=Math.abs(c.y-d.y);return i&&(E=a),o&&(b=s),{width:E,height:b,center:u}}function kj(t,e,n,r,i,o,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var u=e.deltaX,c=e.deltaY,d=e.width,f=e.height,h=Lj(n),v={x:r,y:i},g={x:o,y:a},m=Ha(v,g,h),y={x:m.x+u,y:m.y+c},x=Ij(m,y,g,h,s,l,d,f),E=x.width,b=x.height,T=x.center;return e.width=E*t,e.height=b*t,e.deltaX=(T.x-g.x)*2,e.deltaY=(T.y-g.y)*2,e}var Bj=function(t,e,n,r,i,o,a,s,l,u,c){n===void 0&&(n=1),r===void 0&&(r=!1),i===void 0&&(i=!1),o===void 0&&(o=0),c===void 0&&(c=!1);var d=Pe(e),f=d.deltaX,h=d.deltaY,v=d.width,g=d.height,m=d.PCTResizeInfo;if(m){var y=4,x=0,E=0;switch(t){case ct.LEFT_TOP:E=(f*-1-h)/y;break;case ct.RIGHT_TOP:E=(f-h)/y;break;case ct.RIGHT_BOTTOM:E=(f+h)/y;break;case ct.LEFT_BOTTOM:E=(f*-1+h)/y;break}E!==0&&(x=Math.round(E/m.ResizeBasis.basisHeight*1e5)/1e3),m.ResizePCT.widthPCT=Math.max(Math.min(m.ResizePCT.widthPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit),m.ResizePCT.heightPCT=Math.max(Math.min(m.ResizePCT.heightPCT+x,m.ScaleLimit.maxScaleLimit),m.ScaleLimit.minScaleLimit);var b=Math.round(m.ResizePCT.widthPCT*m.ResizeBasis.basisWidth/100),T=Math.round(m.ResizePCT.heightPCT*m.ResizeBasis.basisHeight/100);switch(t){case ct.LEFT_TOP:f=v-b,h=g-T;break;case ct.RIGHT_TOP:f=b-v,h=g-T;break;case ct.RIGHT_BOTTOM:f=b-v,h=T-g;break;case ct.LEFT_BOTTOM:f=v-b,h=T-g;break}return d}if(o%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return kj(n,d,o,a,s,l,u,r,i);if(c){var A=v/g,S=0,M=v,C=g;switch(t){case ct.LEFT_TOP:S=Math.abs(f)>Math.abs(h)?-f:-h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=g-C;break;case ct.RIGHT_TOP:S=Math.abs(f)>Math.abs(h)?f:-h,A>=1?(M=v+S,C=M/A):(C=g-S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=g-C;break;case ct.RIGHT_BOTTOM:S=Math.abs(f)>Math.abs(h)?f:h,A>=1?(M=v+S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=M-v,d.deltaY=C-g;break;case ct.LEFT_BOTTOM:S=Math.abs(f)>Math.abs(h)?-f:h,A>=1?(M=v-S,C=M/A):(C=g+S,M=C*A),d.width=M,d.height=C,d.deltaX=v-M,d.deltaY=C-g;break}return d}switch(t){case ct.LEFT_TOP:d.width=r?v:v-f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_TOP:d.width=r?v:v+f*n,d.height=i?g:g-h*n;break;case ct.RIGHT_BOTTOM:d.width=r?v:v+f*n,d.height=i?g:g+h*n;break;case ct.LEFT_BOTTOM:d.width=r?v:v-f*n,d.height=i?g:g+h*n;break}return d},jj=function(t,e){var n=t.id,r=t.anchors,i=e.getNodeEdges(n);gt(i,function(o){if(o.sourceNodeId===n){var a=hi(r,function(s){return s.id===o.sourceAnchorId});a&&o.updateStartPoint({x:a.x,y:a.y})}else if(o.targetNodeId===n){var a=hi(r,function(l){return l.id===o.targetAnchorId});a&&o.updateEndPoint({x:a.x,y:a.y})}})},Fj=function(t,e,n,r,i,o,a){a.eventCenter.emit(be.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:r,index:i,model:o})},lb=function(t){var e=t.x,n=t.y,r=t.deltaX,i=t.deltaY,o=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,u=t.forceProportional,c=u===void 0?!1:u,d=a.r,f=a.rx,h=a.ry,v=a.width,g=a.height,m=a.PCTResizeInfo,y=a.minWidth,x=a.minHeight,E=a.maxWidth,b=a.maxHeight,T=a.rotate,A=a.x,S=a.y,M=y===E,C=x===b,G={width:d||f||v,height:d||h||g,deltaX:r,deltaY:i,PCTResizeInfo:m},K=d||f&&h?1/2:1,J=e,R=n,k=Bj(o,G,K,M,C,T,J,R,A,S,c);if(k.width<y||k.width>E||k.height<x||k.height>b){l==null||l();return}(T%(2*Math.PI)==0||m||J===void 0||R===void 0)&&(k.deltaX=M?0:k.deltaX,k.deltaY=C?0:k.deltaY);var B=a.getData(),Z=a.resize(k);B.x===Z.x&&B.y===Z.y||(jj(a,s),Fj(B,Z,r,i,o,a,s))},$j=100,Hj={x:1,y:0};function zj(t,e,n,r,i){for(var o=function(h){if(h<0||h>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-h,3)+3*e.x*h*Math.pow(1-h,2)+3*n.x*Math.pow(h,2)*(1-h)+r.x*Math.pow(h,3),y:t.y*Math.pow(1-h,3)+3*e.y*h*Math.pow(1-h,2)+3*n.y*Math.pow(h,2)*(1-h)+r.y*Math.pow(h,3)}},a=0,s=2,l=r.x,u=r.y,c=r;a<i&&s<50;){c=o(1-s/$j);var d=c.x,f=c.y;a=Er(l,u,d,f),s++}return c}function Wj(t,e){return t.x*e.y-t.y*e.x}function Uj(t,e){var n=[t.x,t.y,t.z],r=[e.x,e.y,e.z];return r.reduce(function(i,o,a){return i+o*n[a]})}function Vj(t,e){var n=Wj(t,e),r=Math.acos(Uj(ub(t),ub(e)));return n>=0?r:-r}function ub(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function Xj(t){return Vj(Hj,t)}function Gj(t){return t*(180/Math.PI)}var cb={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Yj={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Kj={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qj={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},za={colorful:qj,dark:Kj,radius:Yj,default:cb},Zj={background:"#23272e"},Jj={background:"#fefeff"},Cf={background:"#ffffff"},Wa={colorful:Jj,dark:Zj,radius:Cf,default:Cf},Qj={color:"#66676a",thickness:1},e3={color:"#dadada",thickness:1},Af={color:"#acacac",thickness:1},Ua={colorful:e3,dark:Qj,radius:Af,default:Af},db=function(t,e){var n=Pe(cb);return e&&(n=zi(n,za[e])),t&&(n=zi(n,t)),n},t3=function(t,e){if(za[t]){console.warn("theme mode ".concat(t," already exists"));return}za[t]=e,Wa[t]=e.background||Cf,Ua[t]=e.grid||Af},n3=function(t){delete za[t],delete Wa[t],delete Ua[t]},r3=function(){var t={colorful:{},dark:{},radius:{},default:{}};ut(za,t),ut(Wa,t),ut(Ua,t)},i3=db,o3=1e3,a3=999,Va=function(){return++o3},s3=function(){return--a3},jt=function(){return jt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jt.apply(this,arguments)},Ce=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},tu=function(){function t(e,n){var r;this.BaseType=Lt.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=lt.DEFAULT,this.modelType=Ye.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,ut(this,ej(e));var s=this.graphModel,l=s.overlapMode,u=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||Va()),this.setAnchors(),this.initPoints(),this.formatText(e),u.on("overlap:change",function(c){var d=c.overlapMode;n.updateZIndexByOverlap(d,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return jt(jt({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return jt({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return Pe(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return Pe(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),r=this.graphModel.theme.arrow,i=this.isAnimation?n.stroke:e.stroke;return jt(jt(jt({},e),{fill:i,stroke:i}),r)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return Pe(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,r){var i,o,a=vf(e);if(r){if(i=hi(a,function(s){return s.id===r}),i)return i;console.warn("未在节点上找到指定的起点锚点".concat(r,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=Y_(s,n);(o===void 0||l<o)&&(o=l,i=s)}),i},t.prototype.getEndAnchor=function(e,n){var r=this,i,o,a=vf(e);if(n){if(i=hi(a,function(s){return s.id===n}),i)return i;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(r.startPoint){var l=Y_(s,r.startPoint);(o===void 0||l<o)&&(o=l,i=s)}}),i},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getData=function(){var e=this.properties;bi(e)&&(e=mr(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:ut({},this.startPoint),endPoint:ut({},this.endPoint)};[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var r=this.text,i=r.x,o=r.y,a=r.value;return a&&(n.text={x:i,y:o,value:a}),n},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(e,n){Jd(this.properties,e,sn(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=jt(jt({},mr(this.properties)),sn(e)),this.setAttributes()},t.prototype.changeEdgeId=function(e){var n=this.arrowConfig,r=n.markerEnd,i=n.markerStart;i&&i==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),r&&r==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},t.prototype.setStyle=function(e,n){var r;this.style=jt(jt({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=jt(jt({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=jt({},sn(e))},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.edgeTextDraggable,s=o.edgeTextEdit,l=this.textPosition,u=l.x,c=l.y,d=e.text,f={value:"",x:u,y:c,draggable:a,editable:s};d&&(typeof d=="string"?f=jt(jt({},f),{value:d}):(f=jt(jt({},f),{x:(n=d.x)!==null&&n!==void 0?n:u,y:(r=d.y)!==null&&r!==void 0?r:c,value:(i=d.value)!==null&&i!==void 0?i:""}),Hi(d.draggable)||(f.draggable=d.draggable),Hi(d.editable)||(f.editable=d.editable))),this.text=f},t.prototype.resetTextPosition=function(){var e=this.textPosition,n=e.x,r=e.y;this.text.x=n,this.text.y=r},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.setText=function(e){e&&ut(this.text,e)},t.prototype.updateText=function(e){this.text=jt(jt({},mr(this.text)),{value:e})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateStartPoint=function(e){this.startPoint=e},t.prototype.moveStartPoint=function(e,n){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=n)},t.prototype.updateEndPoint=function(e){this.endPoint=e},t.prototype.moveEndPoint=function(e,n){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=n)},t.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var n=e.startPoint,r=e.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:r.x,y:r.y})},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=0;break;case Xt.EDGE_TOP:this.zIndex=1;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.EDGE,Ce([X],t.prototype,"type",void 0),Ce([X],t.prototype,"sourceNodeId",void 0),Ce([X],t.prototype,"targetNodeId",void 0),Ce([X],t.prototype,"startPoint",void 0),Ce([X],t.prototype,"endPoint",void 0),Ce([X],t.prototype,"textMode",void 0),Ce([X],t.prototype,"text",void 0),Ce([X],t.prototype,"properties",void 0),Ce([X],t.prototype,"points",void 0),Ce([X],t.prototype,"pointsList",void 0),Ce([X],t.prototype,"isSelected",void 0),Ce([X],t.prototype,"isHovered",void 0),Ce([X],t.prototype,"isHitable",void 0),Ce([X],t.prototype,"isHittable",void 0),Ce([X],t.prototype,"draggable",void 0),Ce([X],t.prototype,"visible",void 0),Ce([X],t.prototype,"isAnimation",void 0),Ce([X],t.prototype,"isShowAdjustPoint",void 0),Ce([X],t.prototype,"zIndex",void 0),Ce([X],t.prototype,"state",void 0),Ce([X],t.prototype,"style",void 0),Ce([X],t.prototype,"arrowConfig",void 0),Ce([Et],t.prototype,"sourceNode",null),Ce([Et],t.prototype,"targetNode",null),Ce([Et],t.prototype,"textPosition",null),Ce([U],t.prototype,"setProperty",null),Ce([U],t.prototype,"deleteProperty",null),Ce([U],t.prototype,"setProperties",null),Ce([U],t.prototype,"changeEdgeId",null),Ce([U],t.prototype,"setStyle",null),Ce([U],t.prototype,"setStyles",null),Ce([U],t.prototype,"updateStyles",null),Ce([U],t.prototype,"setTextMode",null),Ce([U],t.prototype,"formatText",null),Ce([U],t.prototype,"resetTextPosition",null),Ce([U],t.prototype,"moveText",null),Ce([U],t.prototype,"setText",null),Ce([U],t.prototype,"updateText",null),Ce([U],t.prototype,"setAnchors",null),Ce([U],t.prototype,"setSelected",null),Ce([U],t.prototype,"setHovered",null),Ce([U],t.prototype,"setHitable",null),Ce([U],t.prototype,"setHittable",null),Ce([U],t.prototype,"openEdgeAnimation",null),Ce([U],t.prototype,"closeEdgeAnimation",null),Ce([U],t.prototype,"setElementState",null),Ce([U],t.prototype,"updateStartPoint",null),Ce([U],t.prototype,"moveStartPoint",null),Ce([U],t.prototype,"updateEndPoint",null),Ce([U],t.prototype,"moveEndPoint",null),Ce([U],t.prototype,"setZIndex",null),Ce([U],t.prototype,"initPoints",null),Ce([U],t.prototype,"updateAttributes",null),Ce([U],t.prototype,"getAdjustStart",null),Ce([U],t.prototype,"getAdjustEnd",null),Ce([U],t.prototype,"updateAfterAdjustStartAndEnd",null),Ce([U],t.prototype,"updateZIndexByOverlap",null),t}(),l3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qi=function(){return qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qi.apply(this,arguments)},ir=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Of=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},fb=function(t){l3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.BEZIER_EDGE,i.path="",i.initEdgeData(n),i.setAttributes(),i}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return qi(qi(qi({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,r=0;return this.pointsList.forEach(function(i){var o=i.x,a=i.y;n+=o,r+=a}),{x:n/this.pointsList.length,y:r/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return qi(qi({},n),{pointsList:r})},e.prototype.getControls=function(){var n=this.startPoint,r=this.endPoint,i=V_({start:n,end:r,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return i},e.prototype.getPath=function(n){var r=Of(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return"M ".concat(i.x," ").concat(i.y,`
64
64
  C `).concat(o.x," ").concat(o.y,`,
65
65
  `).concat(a.x," ").concat(a.y,`,
66
- `).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),r=n.sNext,i=n.ePre;this.updatePath(r,i)},e.prototype.updatePath=function(n,r){n=Pe(n),r=Pe(r);var i={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!n||!r){var a=this.getControls();n=a.sNext,r=a.ePre}this.pointsList=[i,n,r,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];o.x+=n,o.y+=r,this.updatePath(o,a)},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];a.x+=n,a.y+=r,this.updatePath(o,a)},e.prototype.updateAdjustAnchor=function(n,r){var i;r==="sNext"?this.pointsList[1]=n:r==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode,s=V_({start:r,end:i,sourceNode:o,targetNode:a,offset:this.offset}),l=s.sNext,u=s.ePre;this.pointsList=[r,l,u,i],this.initPoints()},ir([X],e.prototype,"offset",void 0),ir([X],e.prototype,"path",void 0),ir([U],e.prototype,"initPoints",null),ir([U],e.prototype,"updatePoints",null),ir([U],e.prototype,"updateStartPoint",null),ir([U],e.prototype,"updateEndPoint",null),ir([U],e.prototype,"moveStartPoint",null),ir([U],e.prototype,"moveEndPoint",null),ir([U],e.prototype,"updateAdjustAnchor",null),ir([U],e.prototype,"getAdjustStart",null),ir([U],e.prototype,"getAdjustEnd",null),ir([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(eu),u3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xa=function(){return Xa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xa.apply(this,arguments)},pb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},c3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hb=function(t){u3(e,t);function e(){var n=t.apply(this,c3([],pb(arguments),!1))||this;return n.modelType=Ye.LINE_EDGE,n}return e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Xa(Xa(Xa({},r),Pe(n)),Pe(o))},e.prototype.initEdgeData=function(n){t.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(n){var r=pb(n,2),i=r[0],o=r[1];return"".concat(i.x,",").concat(i.y," ").concat(o.x,",").concat(o.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(eu),d3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ga=function(){return Ga=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ga.apply(this,arguments)},Qt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},gb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},f3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Ya=function(t){d3(e,t);function e(){var n=t.apply(this,f3([],gb(arguments),!1))||this;return n.modelType=Ye.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",30),n.pointsList&&(this.pointsList=n.pointsList),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Ga(Ga(Ga({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){var n,r=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!r){var i=this.dbClickPosition,o=i.x,a=i.y;return{x:o,y:a}}var s=Ki(this.points),l=gb(ZB(s),2),u=l[0],c=l[1];return{x:(u.x+c.x)/2,y:(u.y+c.y)/2}},e.prototype.getAfterAnchor=function(n,r,i){var o,a;return i.forEach(function(s){var l;n===Tt.HORIZONTAL?l=Math.abs(r.y-s.y):n===Tt.VERTICAL&&(l=Math.abs(r.x-s.x)),(!a||a>l)&&(a=l,o=s)}),o},e.prototype.getCrossPoint=function(n,r,i){var o;return n===Tt.HORIZONTAL?o={x:i.x,y:r.y}:n===Tt.VERTICAL&&(o={x:r.x,y:i.y}),o},e.prototype.removeCrossPoints=function(n,r,i){var o=i.map(function(y){return y});if(n===1){var a=o[n],s=o[r],l=o[n-1],u=$_(l,a,this.sourceNode);if(u){var c=H_(a,s,this.sourceNode);if(c){var d=z_(a,s,this.sourceNode);d&&(o[n]=d,o.splice(n-1,1),n--,r--)}}else{var f=this.sourceNode.anchors;f.forEach(function(y){if(y.x===l.x&&y.x===a.x||y.y===l.y&&y.y===a.y){var x=Er(y.x,y.y,a.x,a.y),E=Er(l.x,l.y,a.x,a.y);x<E&&(o[n-1]=y)}})}}if(r===i.length-2){var h=o[n],v=o[r],g=o[r+1],m=$_(v,g,this.targetNode);if(m){var c=H_(h,v,this.targetNode);if(c){var d=z_(h,v,this.targetNode);d&&(o[r]=d,o.splice(r+1,1))}}else{var f=this.targetNode.anchors;f.forEach(function(x){if(x.x===g.x&&x.x===v.x||x.y===g.y&&x.y===v.y){var E=Er(x.x,x.y,v.x,v.y),b=Er(g.x,g.y,v.x,v.y);E<b&&(o[r+1]=x)}})}}return o},e.prototype.getDraggingPoints=function(n,r,i,o,a){var s=a.map(function(c){return c}),l=this.getAfterAnchor(n,i,o),u=this.getCrossPoint(n,i,l);return r==="start"?(s.unshift(u),s.unshift(l)):(s.push(u),s.push(l)),s},e.prototype.updateCrossPoints=function(n){var r=n.map(function(x){return x}),i=n[0],o=n[1],a=n[r.length-2],s=n[r.length-1],l=this,u=l.sourceNode,c=l.targetNode,d=u.modelType,f=c.modelType,h=zl(i,o),v=r[0];switch(d){case Ye.RECT_NODE:if(u.radius!==0){var g=Q_(i,u);g||(v=J_(i,h,u))}break;case Ye.CIRCLE_NODE:v=mf(i,h,u);break;case Ye.ELLIPSE_NODE:v=eb(i,h,u);break;case Ye.DIAMOND_NODE:v=Kl(i,h,u);break;case Ye.POLYGON_NODE:v=Kl(i,h,u);break}v&&(r[0]=v);var m=zl(a,s),y=r[r.length-1];switch(f){case Ye.RECT_NODE:if(c.radius!==0){var g=Q_(s,c);g||(y=J_(s,m,c))}break;case Ye.CIRCLE_NODE:y=mf(s,m,c);break;case Ye.ELLIPSE_NODE:y=eb(s,m,c);break;case Ye.DIAMOND_NODE:y=Kl(s,m,c);break;case Ye.POLYGON_NODE:y=Kl(s,m,c);break}return y&&(r[r.length-1]=y),r},e.prototype.updatePath=function(n){this.pointsList=n,this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return Object.assign({},n,{pointsList:r})},e.prototype.getPath=function(n){return n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=F_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=n,this.points=n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r,this.updatePoints()},e.prototype.updatePointsList=function(n,r){this.pointsList.forEach(function(a){a.x+=n,a.y+=r});var i=this.pointsList[0];this.startPoint=Object.assign({},i);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList,d=c;return u===Tt.HORIZONTAL?(c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y},d=this.pointsList.map(function(f){return f})):u===Tt.VERTICAL&&(c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y},d=this.pointsList.map(function(f){return f})),this.updatePointsAfterDrag(d),this.draggingPointList=d,!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppend=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList;if(u===Tt.HORIZONTAL){c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y};var d=this.pointsList.map(function(m){return m});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x,y:o.y+r.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x,y:a.y+r.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}else if(u===Tt.VERTICAL){c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y};var d=this.pointsList.map(function(y){return y});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x+r.x,y:o.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x+r.x,y:a.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}return!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=j_(Ki(this.points));this.pointsList=n.map(function(o){return o}),this.draggingPointList=[];var r=n[0];this.startPoint=ut({},r);var i=n[n.length-1];this.endPoint=ut({},i)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var r=this.updateCrossPoints(n);this.points=r.map(function(i){return"".concat(i.x,",").concat(i.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode;this.pointsList=F_({x:r.x,y:r.y},{x:i.x,y:i.y},o,a,this.offset||0),this.initPoints()},Qt([X],e.prototype,"offset",void 0),Qt([X],e.prototype,"dbClickPosition",void 0),Qt([U],e.prototype,"initPoints",null),Qt([U],e.prototype,"updatePoints",null),Qt([U],e.prototype,"updateStartPoint",null),Qt([U],e.prototype,"moveStartPoint",null),Qt([U],e.prototype,"updateEndPoint",null),Qt([U],e.prototype,"moveEndPoint",null),Qt([U],e.prototype,"updatePointsList",null),Qt([U],e.prototype,"dragAppendStart",null),Qt([U],e.prototype,"dragAppendSimple",null),Qt([U],e.prototype,"dragAppend",null),Qt([U],e.prototype,"dragAppendEnd",null),Qt([U],e.prototype,"updatePointsAfterDrag",null),Qt([U],e.prototype,"getAdjustStart",null),Qt([U],e.prototype,"getAdjustEnd",null),Qt([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(eu),Ht=function(){return Ht=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ht.apply(this,arguments)},Re=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},vb=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ci=function(){function t(e,n){var r;this.BaseType=Lt.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=lt.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Ye.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,r=n.x,i=r===void 0?0:r,o=n.y,a=o===void 0?0:o;this.transform=new Xl(-i,-a).rotate(e).translate(i,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.formatText(e),ut(this,dj(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||Va()),l.on("overlap:change",function(u){var c=u.overlapMode;n.updateZIndexByOverlap(c,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.nodeTextDraggable,s=o.nodeTextEdit,l=e.x,u=e.y,c=e.text,d={value:"",x:l,y:u,draggable:a,editable:s};c&&(typeof c=="string"?d.value=c:(d=Ht(Ht({},d),{x:(n=c.x)!==null&&n!==void 0?n:l,y:(r=c.y)!==null&&r!==void 0?r:u,value:(i=c.value)!==null&&i!==void 0?i:""}),Hi(c.draggable)||(d.draggable=c.draggable),Hi(c.editable)||(d.editable=c.editable))),e.text=d},t.prototype.resize=function(e){var n=e.width,r=e.height,i=e.deltaX,o=e.deltaY,a=this.isAllowResizeNode(i,o,n,r);return a?(this.move(i/2,o/2),this.width=n,this.height=r,this.setProperties({width:n,height:r}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,r=e.y,i=e.value,o=this.properties;bi(o)&&(o=mr(o)),pn(o.width)&&(o.width=this.width),pn(o.height)&&(o.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(a.rotate=this.rotate),[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),i&&(a.text={x:n,y:r,value:i}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return Ht(Ht({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,r=n===void 0?{}:n;return Ht(Ht({},Pe(e)),Pe(r))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return Pe(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return Pe(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return Pe(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return Pe(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return Pe(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return Pe(e)},t.prototype.isAllowConnectedAsSource=function(e,n,r,i){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,this,e,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(e,n,r,i){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,e,this,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.isAllowMoveNode=function(e,n){var r,i,o=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n);if(!d)return!1;if(typeof d=="object"){var f=d;if(!f.x&&!f.y)return!1;o=o&&f.x,a=a&&f.y}}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return{x:o,y:a}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var e=this,n=e.anchorsOffset,r=e.id,i=e.x,o=e.y;return n&&n.length>0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(r,"_").concat(s),x:i+a[0],y:o+a[1]}):(a=a,Ht(Ht({},a),{x:i+a.x,y:o+a.y,id:a.id||"".concat(r,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return lj(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,r=n.x,i=n.y,o=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,u=p3(new ka([s,l,1]).translate(-r,-i).rotate(o).translate(r,i)[0],2),c=u[0],d=u[1];a.x=c,a.y=d}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!pn(e))for(var n=0;n<this.anchors.length;n++){var r=this.anchors[n];if(r.id===e)return r}},t.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},t.prototype.isAllowMoveByXORY=function(e,n,r){var i,o;if(r)i=!0,o=!0;else{var a=this.isAllowMoveNode(e,n);typeof a=="boolean"?(i=a,o=a):(i=a.x,o=a.y)}return{isAllowMoveX:i,isAllowMoveY:o}},t.prototype.move=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY;return o&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(o||a)&&(this.rotate=this._rotate),o||a},t.prototype.getMoveDistance=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY,s=0,l=0;return o&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Xl(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},t.prototype.moveTo=function(e,n,r){r===void 0&&(r=!1);var i=e-this.x,o=n-this.y;return!r&&!this.isAllowMoveNode(i,o)?!1:(this.text&&this.moveText(i,o),this.x=e,this.y=n,!0)},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.updateText=function(e){this.text=Ht(Ht({},mr(this.text)),{value:e})},t.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},t.prototype.isAllowResizeNode=function(e,n,r,i){var o,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n,r,i);if(!d)return!1}}catch(f){o={error:f}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return!0},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},t.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},t.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},t.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateProperties=function(e,n){var r=mr(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(be.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:r,properties:e})},t.prototype.setProperty=function(e,n){var r=mr(this.properties),i=Pe(r);um(i,e,sn(n)),this.updateProperties(i,[e])},t.prototype.setProperties=function(e){var n=mr(this.properties),r=Ht(Ht({},n),sn(e)),i=[];Hv(e,function(o,a){(Ks(n,a)&&n[a]!==o||!Ks(n,a))&&i.push(a)}),this.updateProperties(r,i)},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setStyle=function(e,n){var r;this.style=Ht(Ht({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=Ht(Ht({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=Ht({},sn(e))},t.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=1;break;case Xt.EDGE_TOP:this.zIndex=0;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.NODE,Re([X],t.prototype,"type",void 0),Re([X],t.prototype,"x",void 0),Re([X],t.prototype,"y",void 0),Re([X],t.prototype,"textMode",void 0),Re([X],t.prototype,"text",void 0),Re([X],t.prototype,"properties",void 0),Re([X],t.prototype,"_width",void 0),Re([X],t.prototype,"_height",void 0),Re([X],t.prototype,"anchorsOffset",void 0),Re([X],t.prototype,"isSelected",void 0),Re([X],t.prototype,"isHovered",void 0),Re([X],t.prototype,"isShowAnchor",void 0),Re([X],t.prototype,"isDragging",void 0),Re([X],t.prototype,"isHitable",void 0),Re([X],t.prototype,"isHittable",void 0),Re([X],t.prototype,"draggable",void 0),Re([X],t.prototype,"visible",void 0),Re([X],t.prototype,"rotatable",void 0),Re([X],t.prototype,"resizable",void 0),Re([X],t.prototype,"zIndex",void 0),Re([X],t.prototype,"state",void 0),Re([X],t.prototype,"autoToFront",void 0),Re([X],t.prototype,"style",void 0),Re([X],t.prototype,"transform",void 0),Re([X],t.prototype,"_rotate",void 0),Re([Et],t.prototype,"incoming",null),Re([Et],t.prototype,"outgoing",null),Re([U],t.prototype,"setTextMode",null),Re([U],t.prototype,"addNodeMoveRules",null),Re([U],t.prototype,"move",null),Re([U],t.prototype,"getMoveDistance",null),Re([U],t.prototype,"moveTo",null),Re([U],t.prototype,"moveText",null),Re([U],t.prototype,"updateText",null),Re([U],t.prototype,"addNodeResizeRules",null),Re([U],t.prototype,"setSelected",null),Re([U],t.prototype,"setHovered",null),Re([U],t.prototype,"setIsShowAnchor",null),Re([U],t.prototype,"setRotatable",null),Re([U],t.prototype,"setResizable",null),Re([U],t.prototype,"setHitable",null),Re([U],t.prototype,"setHittable",null),Re([U],t.prototype,"setElementState",null),Re([U],t.prototype,"setProperty",null),Re([U],t.prototype,"setProperties",null),Re([U],t.prototype,"deleteProperty",null),Re([U],t.prototype,"setStyle",null),Re([U],t.prototype,"setStyles",null),Re([U],t.prototype,"updateStyles",null),Re([U],t.prototype,"setZIndex",null),Re([U],t.prototype,"updateAttributes",null),Re([U],t.prototype,"updateZIndexByOverlap",null),t}(),h3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ka=function(){return Ka=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ka.apply(this,arguments)},Tf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},tu=function(t){h3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.CIRCLE_NODE,i.r=50,i.initNodeData(n),i.setAttributes(),i}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.circle,i=this.properties.style,o=i===void 0?{}:i;return Ka(Ka(Ka({},n),Pe(r)),Pe(o))},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.r;return[{x:r,y:i-o,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+o,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.deltaX,o=n.deltaY;return this.move(i/2,o/2),this.r=r,this.setProperties({r}),this.getData()},Tf([X],e.prototype,"r",void 0),Tf([Et],e.prototype,"width",null),Tf([Et],e.prototype,"height",null),e}(Ci),g3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qa=function(){return qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qa.apply(this,arguments)},Wo=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},nu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Nf=function(t){g3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.DIAMOND_NODE,i.rx=30,i.ry=50,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.diamond,i=this.properties.style,o=i===void 0?{}:i;return qa(qa(qa({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[[r,i-a],[r+o,i],[r,i+a],[r-o,i]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Bn(this.points,function(n){var r=nu(n,2),i=r[0],o=r[1];return{x:i,y:o}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=nu(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=nu(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return Bn(this.points,function(r,i){var o=nu(r,2),a=o[0],s=o[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(i)}})},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},Wo([X],e.prototype,"rx",void 0),Wo([X],e.prototype,"ry",void 0),Wo([Et],e.prototype,"points",null),Wo([Et],e.prototype,"pointsPosition",null),Wo([Et],e.prototype,"width",null),Wo([Et],e.prototype,"height",null),e}(Ci),v3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Za=function(){return Za=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Za.apply(this,arguments)},ru=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Mf=function(t){v3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.ELLIPSE_NODE,i.rx=30,i.ry=45,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.ellipse,i=this.properties.style,o=i===void 0?{}:i;return Za(Za(Za({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[{x:r,y:i-a,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},ru([X],e.prototype,"rx",void 0),ru([X],e.prototype,"ry",void 0),ru([Et],e.prototype,"width",null),ru([Et],e.prototype,"height",null),e}(Ci),m3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ja=function(){return Ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ja.apply(this,arguments)},iu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ou=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},au=function(t){m3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.POLYGON_NODE,i.points=[[50,0],[100,50],[50,100],[0,50]],i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.points,i=n.width,o=n.height,a=r||this.points;this.points=rj(a,i,o)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.polygon,i=this.properties.style,o=i===void 0?{}:i;return Ja(Ja(Ja({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+r-o/2,y:s[1]+i-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=ou(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=ou(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=this,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points;return l.map(function(u,c){var d=ou(u,2),f=d[0],h=d[1];return{x:i+f-a/2,y:o+h-s/2,id:"".concat(n.id,"_").concat(c)}})},e.prototype.resize=function(n){var r=this,i=n.width,o=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=Bn(this.points,function(u){var c=ou(u,2),d=c[0],f=c[1];return[d*i/r.width,f*o/r.height]});return this.points=l,this.properties.points=l,this.getData()},iu([X],e.prototype,"points",void 0),iu([Et],e.prototype,"pointsPosition",null),iu([Et],e.prototype,"width",null),iu([Et],e.prototype,"height",null),e}(Ci),y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qa=function(){return Qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qa.apply(this,arguments)},_3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Uo=function(t){y3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.RECT_NODE,i.radius=0,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height,o=n.radius,a=this.getNodeStyle().radius;pn(r)||(this.width=r),pn(i)||(this.height=i),pn(o)||(this.radius=o),pn(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.rect,i=this.properties.style,o=i===void 0?{}:i;return Qa(Qa(Qa({},n),Pe(r)),Pe(o))},_3([X],e.prototype,"radius",void 0),e}(Ci),b3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),es=function(){return es=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},es.apply(this,arguments)},mb=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},x3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},E3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},yb=function(t){b3(e,t);function e(){var n=t.apply(this,E3([],x3(arguments),!1))||this;return n.modelType=Ye.TEXT_NODE,n}return e.prototype.getTextStyle=function(){var n=t.prototype.getTextStyle.call(this),r=this.graphModel.theme.text,i=this.properties.textStyle;return es(es(es({},n),Pe(r)),Pe(i))},Object.defineProperty(e.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).width;return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).height;return i},enumerable:!1,configurable:!0}),mb([Et],e.prototype,"width",null),mb([Et],e.prototype,"height",null),e}(Ci),w3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Df=function(t){w3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.HTML_NODE,i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height;r&&(this.width=r),i&&(this.height=i)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e}(Ci),ht=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},S3={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},su=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],C3=function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=er.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=er.TEXT,this.edgeTextMode=er.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",ut(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);ut(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,r=e.textDraggable,i=e.textMode,o=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&ut(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=gi(S3,su);this.stagedConfig=gi(this,su),ut(s,l)}Hi(o)||ut(s,{nodeTextEdit:o,edgeTextEdit:o}),Hi(r)||ut(s,{nodeTextDraggable:r,edgeTextDraggable:r}),i&&ut(s,{nodeTextMode:i,edgeTextMode:i}),Zs(a)&&ut(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var u=gi(e,su);return ut(s,u)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return gi(this,su)},ht([X],t.prototype,"isSilentMode",void 0),ht([X],t.prototype,"stopZoomGraph",void 0),ht([X],t.prototype,"stopMoveGraph",void 0),ht([X],t.prototype,"stopScrollGraph",void 0),ht([X],t.prototype,"snapGrid",void 0),ht([X],t.prototype,"textMode",void 0),ht([X],t.prototype,"textEdit",void 0),ht([X],t.prototype,"textDraggable",void 0),ht([X],t.prototype,"nodeTextEdit",void 0),ht([X],t.prototype,"nodeTextDraggable",void 0),ht([X],t.prototype,"nodeTextMultiple",void 0),ht([X],t.prototype,"nodeTextVertical",void 0),ht([X],t.prototype,"nodeTextMode",void 0),ht([X],t.prototype,"edgeTextMode",void 0),ht([X],t.prototype,"edgeTextEdit",void 0),ht([X],t.prototype,"edgeTextDraggable",void 0),ht([X],t.prototype,"edgeTextMultiple",void 0),ht([X],t.prototype,"edgeTextVertical",void 0),ht([X],t.prototype,"hideAnchors",void 0),ht([X],t.prototype,"allowRotate",void 0),ht([X],t.prototype,"allowResize",void 0),ht([X],t.prototype,"hoverOutline",void 0),ht([X],t.prototype,"nodeSelectedOutline",void 0),ht([X],t.prototype,"adjustNodePosition",void 0),ht([X],t.prototype,"autoExpand",void 0),ht([X],t.prototype,"adjustEdge",void 0),ht([X],t.prototype,"adjustEdgeMiddle",void 0),ht([X],t.prototype,"adjustEdgeStartAndEnd",void 0),ht([X],t.prototype,"adjustEdgeStart",void 0),ht([X],t.prototype,"adjustEdgeEnd",void 0),ht([X],t.prototype,"edgeSelectedOutline",void 0),ht([U],t.prototype,"updateEditConfig",null),ht([U],t.prototype,"updateTextMode",null),t}(),A3="*",O3=function(){function t(){this._events={}}return t.prototype.on=function(e,n,r){var i=this;e==null||e.split(",").forEach(function(o){o=o.trim(),i._events[o]||(i._events[o]=[]),i._events[o].push({callback:n,once:!!r})})},t.prototype.once=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r.on(i,n,!0)})},t.prototype.emit=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){var o=r._events[i]||[],a=r._events[A3]||[],s=function(l){for(var u=l.length,c=0;c<u;c++)if(l[c]){var d=l[c],f=d.callback,h=d.once;h&&(l.splice(c,1),l.length===0&&delete r._events[i],u--,c--),f.apply(r,[n])}};s(o),s(a)})},t.prototype.off=function(e,n){var r=this;e||(this._events={}),e.split(",").forEach(function(i){if(!n)delete r._events[i];else{for(var o=r._events[i]||[],a=o.length,s=0;s<a;s++)o[s].callback===n&&(o.splice(s,1),a--,s--);o.length===0&&delete r._events[i]}})},t.prototype.getEvents=function(){return this._events},t.prototype.destroy=function(){this._events={}},t}(),T3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(){return Pf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Pf.apply(this,arguments)},N3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},M3=function(t){T3(e,t);function e(n){var r=t.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(s){var l=s.deltaX,u=s.deltaY;r.setState({isDragging:!0});var c=r.props.graphModel,d=c.transformModel,f=c.editConfigModel;f.stopMoveGraph!==!0&&d.translate(l,u)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(s){var l=r.props,u=l.graphModel,c=u.editConfigModel,d=u.transformModel,f=u.gridSize,h=l.graphModel,v=s.deltaX,g=s.deltaY,m=c.stopScrollGraph,y=c.stopZoomGraph;if(!m&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),r.stepScrollX+=v,r.stepScrollY+=g,Math.abs(r.stepScrollX)>=f){var x=r.stepScrollX%f,E=r.stepScrollX-x;d.translate(-E*d.SCALE_X,0),r.stepScrollX=x}if(Math.abs(r.stepScrollY)>=f){var b=r.stepScrollY%f,T=r.stepScrollY-b;d.translate(0,-T*d.SCALE_Y),r.stepScrollY=b}return}if(!y){s.preventDefault();var A=h.getPointByClient({x:s.clientX,y:s.clientY}),S=A.canvasOverlayPosition,M=S.x,C=S.y;d.zoom(s.deltaY<0,[M,C])}},r.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var u=r.props.graphModel,c=u.selectElements;c.size>0&&u.clearSelectElements(),u.eventCenter.emit(be.BLANK_CLICK,{e:s})}},r.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var u=r.props.graphModel,c=u.getPointByClient({x:s.clientX,y:s.clientY});u.eventCenter.emit(be.BLANK_CONTEXTMENU,{e:s,position:c})}},r.mouseDownHandler=function(s){var l=r.props.graphModel,u=l.eventCenter,c=l.editConfigModel,d=l.transformModel.SCALE_X,f=l.gridSize,h=c.adjustEdge,v=c.adjustNodePosition,g=c.stopMoveGraph,m=s.target,y=!h&&!v;(m.getAttribute("name")==="canvas-overlay"||y)&&(g!==!0?(r.stepDrag.setStep(f*d),r.stepDrag.handleMouseDown(s)):u.emit(be.BLANK_MOUSEDOWN,{e:s}),r.clickHandler(s))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props,o=i.children,a=i.dnd,s=this.state.isDragging;return V("svg",Pf({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:V("g",{transform:r,children:o})}))},e=N3([vn],e),e}(Qe),_b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(){return ts=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ts.apply(this,arguments)},D3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},P3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},bb=function(t){_b(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.bezierModel,l=o.type,u=a.getPointByClient({x:i.clientX,y:i.clientY}).canvasOverlayPosition,c=u.x,d=u.y;s.updateAdjustAnchor({x:c,y:d},l),a.eventCenter.emit(be.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var r=n.props.bezierModel;r.isDragging=!1},n.dragHandler=new tr({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,r=this.props.position,i=r.x,o=r.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return V(zo,ts({className:"lf-bezier-adjust-anchor",x:i,y:o},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e}(Qe),R3=function(t){_b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,r){var i=n.path,o=n.id,a=cf(i),s=P3(a,4),l=s[0],u=s[1],c=s[2],d=s[3],f=n.getEdgeStyle().adjustLine,h=[];return h.push(V(Ho,ts({x1:l.x,y1:l.y,x2:u.x,y2:u.y},f))),h.push(V(bb,{position:u,bezierModel:n,graphModel:r,type:"sNext"},"".concat(o,"_ePre"))),h.push(V(Ho,ts({x1:d.x,y1:d.y,x2:c.x,y2:c.y},f))),h.push(V(bb,{position:c,bezierModel:n,graphModel:r,type:"ePre"},"".concat(o,"_sNext"))),h},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,r=n.edges,i=[],o=0;o<r.length;o++){var a=r[o];a.isSelected&&a.modelType===Ye.BEZIER_EDGE&&a.draggable&&i.push(this.getBezierAdjust(a,n))}return i},e.prototype.render=function(){return V("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=D3([vn],e),e}(Qe),L3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},k3=function(t){L3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return V("div",{className:"lf-background",children:V("div",{style:Rt(n)?n:{},className:"lf-background-area"})})},e=I3([vn],e),e}(Qe),B3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Vo=function(t){B3(e,t);function e(n){var r=t.call(this,n)||this;return r.id=Si(),r.gridOptions=r.props.graphModel.grid,r}return e.prototype.renderDot=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?2:u,d=Math.min(Math.max(2,c),o/4),f=a?1:0;return V("g",{fill:l,opacity:f,children:[V("circle",{cx:0,cy:0,r:d/2}),V("circle",{cx:0,cy:o,r:d/2}),V("circle",{cx:o,cy:0,r:d/2}),V("circle",{cx:o,cy:o,r:d/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?1:u,d=Math.min(Math.max(1,c),o/2),f="M 0 0 H ".concat(o," V ").concat(o," H 0 Z"),h=a?1:0;return V("path",{d:f,stroke:l,strokeWidth:d/2,opacity:h,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,r=n.transformModel,i=n.grid;this.gridOptions=i;var o=this.gridOptions,a=o.type,s=o.size,l=s===void 0?1:s,u=r.SCALE_X,c=r.SKEW_Y,d=r.SKEW_X,f=r.SCALE_Y,h=r.TRANSLATE_X,v=r.TRANSLATE_Y,g=[u,c,d,f,h,v].join(","),m="matrix(".concat(g,")");return V("div",{className:"lf-grid",children:V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[V("defs",{children:V("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:m,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),V("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=j3([vn],e),e}(Qe);(function(t){t.defaultProps={size:LB,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var r=Pe(t.defaultProps);return typeof n=="number"?ut(r,{size:n}):typeof n=="boolean"?ut(r,{visible:n}):ut(r,n)}t.getGridOptions=e})(Vo||(Vo={}));var F3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},H3=function(t){F3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props.children;return V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:V("g",{transform:r,children:i})})},e=$3([vn],e),e}(Qe),z3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ai=function(){return Ai=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ai.apply(this,arguments)},W3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},U3=function(t){z3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,r=n.nodes,i=n.editConfigModel,o=i.hoverOutline,a=i.nodeSelectedOutline,s=[];return r.forEach(function(l){if(l.isHovered||l.isSelected){var u=l.isHovered,c=l.isSelected,d=l.x,f=l.y,h=l.width,v=l.height;if(a&&c||o&&u){var g=l.getOutlineStyle()||{},m={};if(Object.keys(g).forEach(function(x){x!=="hover"&&(m[x]=g[x])}),u){var y=g.hover;m=Ai(Ai({},m),y)}s.push(V(rr,Ai({transform:l.transform,className:"lf-outline-node",x:d,y:f,width:h+10,height:v+10},m)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,r=n.edges,i=n.editConfigModel,o=i.edgeSelectedOutline,a=i.hoverOutline,s=[],l=0;l<r.length;l++){var u=r[l];(o&&u.isSelected||a&&u.isHovered)&&(u.modelType===Ye.LINE_EDGE?s.push(this.getLineOutline(u)):u.modelType===Ye.POLYLINE_EDGE?s.push(this.getPolylineOutline(u)):u.modelType===Ye.BEZIER_EDGE&&s.push(this.getBezierOutline(u)))}return s},e.prototype.getLineOutline=function(n){var r=n.startPoint,i=n.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2,s=Math.abs(r.x-i.x)+10,l=Math.abs(r.y-i.y)+10,u=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline-edge",x:o,y:a,width:s,height:l},u))},e.prototype.getPolylineOutline=function(n){var r=n.points,i=Ki(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.getBezierOutline=function(n){var r=n.path,i=cf(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.render=function(){return V("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=W3([vn],e),e}(Qe),V3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(){return Oi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Oi.apply(this,arguments)},X3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},G3=function(t){V3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,r=n??{},i=r.position,o=r.isShowHorizontal,a=r.isShowVertical,s=n==null?void 0:n.getStyle(),l=i??{},u=l.x,c=u===void 0?0:u,d=l.y,f=d===void 0?0:d,h=Oi(Oi({x1:-1e5,y1:f,x2:1e5,y2:f},s),{stroke:o?s==null?void 0:s.stroke:"none"}),v=Oi(Oi({x1:c,y1:-1e5,x2:c,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return V("g",{className:"lf-snapline",children:[V(Ho,Oi({},h)),V(Ho,Oi({},v))]})},e=X3([vn],e),e}(Qe),Y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},q3=function(t){Y3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,r=n.tool,i=n.graphModel,o=i.textEditElement,a=r.getTools(),s=a.map(function(l){return Te(l,{textEditElement:o,graphModel:i,lf:r.instance})});return r.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,r=n.tool,i=n.graphModel,o=document.querySelector("#ToolOverlay_".concat(i.flowId)),a=r.getInstance();a.components.forEach(function(s){return s(a,o)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return V("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=K3([vn],e),e}(Qe),wr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Xo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Z3={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},J3=function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var r=n.stopMoveGraph,i=r===void 0?!1:r;this.updateTranslateLimits(i)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[(r-this.TRANSLATE_X)/this.SCALE_X,(i-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[r*this.SCALE_X+this.TRANSLATE_X,i*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,r){var i=Xo(e,2),o=i[0],a=i[1];return[o+n/this.SCALE_X,a+r/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var r=this.SCALE_X,i=this.SCALE_Y;return typeof e=="number"?(r=e,i=e):e?(r+=this.ZOOM_SIZE,i+=this.ZOOM_SIZE):(r-=this.ZOOM_SIZE,i-=this.ZOOM_SIZE),r<this.MINI_SCALE_SIZE||r>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(r-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(i-this.SCALE_Y)*n[1]),this.SCALE_X=r,this.SCALE_Y=i,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(be.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,r,i){var o=Xo(this.CanvasPointToHtmlPoint([e,n]),2),a=o[0],s=o[1],l=Xo([r/2-a,i/2-s],2),u=l[0],c=l[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=c,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=Xo(Array.isArray(e)&&e.length===4?e:Z3[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},wr([X],t.prototype,"SCALE_X",void 0),wr([X],t.prototype,"SKEW_Y",void 0),wr([X],t.prototype,"SKEW_X",void 0),wr([X],t.prototype,"SCALE_Y",void 0),wr([X],t.prototype,"TRANSLATE_X",void 0),wr([X],t.prototype,"TRANSLATE_Y",void 0),wr([X],t.prototype,"ZOOM_SIZE",void 0),wr([U],t.prototype,"zoom",null),wr([U],t.prototype,"resetZoom",null),wr([U],t.prototype,"translate",null),wr([U],t.prototype,"focusOn",null),t}(),Q3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},e4=function(t){Q3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.parentTransform=r.parentTransform,i}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,r=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale();n*=i.scaleX,r*=i.scaleY}else n*=this.parentTransform.SCALE_X,r*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:r}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,r=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale(),o=i.scaleX,a=i.scaleY;n=o*n,r=a*r}return{translateX:n,translateY:r}},e.prototype.HtmlPointToCanvasPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[(i-c)/s,(o-d)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[i*s+c,o*l+d]},e.prototype.moveCanvasPointByHtml=function(n,r,i){var o=Rf(n,2),a=o[0],s=o[1],l=this.getCumulativeScale(),u=l.scaleX,c=l.scaleY;return[a+r/u,s+i/c]},e.prototype.fixDeltaXY=function(n,r){var i=this.getCumulativeScale(),o=i.scaleX,a=i.scaleY;return[n/o,r/a]},e}(J3),ln=function(){return ln=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ln.apply(this,arguments)},_e=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},t4=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},zn=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},n4=function(){function t(e){var n=this,r,i;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=Xt.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var o=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,u=e.grid,c=e.idGenerator,d=e.edgeGenerator,f=e.animation,h=e.customTrajectory;this.rootEl=o,this.partial=!!a,this.background=l,typeof u=="object"&&e.snapGrid&&(this.gridSize=u.size||1),this.customStyles=e.style||{},this.grid=Vo.getGridOptions(u??!1),this.theme=db(e.style,e.themeMode),this.theme.grid=Pe(this.grid),this.theme.background=Pe(this.background),this.edgeType=e.edgeType||"polyline",this.animation=DB(f),this.overlapMode=e.overlapMode||Xt.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(r=e.width)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e.width),this.height=(i=e.height)!==null&&i!==void 0?i:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(e.height);var v=new ResizeObserver(Us(function(g){var m,y;try{for(var x=t4(g),E=x.next();!E.done;E=x.next()){var b=E.value;if(b.target===n.rootEl){var T=document.body.contains(n.rootEl);if(!T)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:b.contentRect})}}}catch(A){m={error:A}}finally{try{E&&!E.done&&(y=x.return)&&y.call(x)}finally{if(m)throw m.error}}},16));v.observe(this.rootEl),this.waitCleanEffects.push(function(){v.disconnect()}),this.eventCenter=new O3,this.editConfigModel=new C3(e),this.transformModel=new e4(this.eventCenter,e),this.flowId=Si(),this.idGenerator=c,this.edgeGenerator=tj(this,d),this.customTrajectory=h}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return zn(zn([],zt(this.nodes),!1),zt(this.edges),!1).reduce(function(e,n){return e[n.id]=n,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var e=function(l){return zn([],zt(l),!1).sort(function(u,c){return u.zIndex-c.zIndex})},n=e(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1)),r=[],i=[-200,-200],o=[this.width+P_,this.height+P_],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,i,o,!1,!1))&&r.push(s)}return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(r){return r.state===lt.TEXT_EDIT}),n=this.edges.find(function(r){return r.state===lt.TEXT_EDIT});return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(n){n.isSelected&&e.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&e.set(n.id,n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(n){n.isSelected&&e.push(n)}),e},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(e,n,r,i,o){var a=this;r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1);var s=[];return gt(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1),function(l){var u=a.isElementInArea(l,e,n,r,i);(!o||l.visible)&&u&&s.push(l)}),s},t.prototype.getModel=function(e){return this.modelMap.get(e)},t.prototype.getNodeModelById=function(e){var n;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getPointByClient=function(e){var n=e.x,r=e.y,i=this.rootEl.getBoundingClientRect(),o={x:n-i.left,y:r-i.top},a=zt(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2),s=a[0],l=a[1],u={x:s,y:l};return{domOverlayPosition:o,canvasOverlayPosition:u}},t.prototype.isElementInArea=function(e,n,r,i,o){var a;if(i===void 0&&(i=!0),o===void 0&&(o=!0),e.BaseType===Lt.NODE){e=e;for(var s=Hn(e),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY,f=[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}],h=o,v=0;v<f.length;v++){var g=f[v],m=g.x,y=g.y;if(a=zt(this.transformModel.CanvasPointToHtmlPoint([m,y]),2),m=a[0],y=a[1],ff([m,y],n,r)!==o){h=!o;break}}return h}if(e.BaseType===Lt.EDGE){e=e;var x=e.startPoint,E=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([x.x,x.y]),T=this.transformModel.CanvasPointToHtmlPoint([E.x,E.y]),A=ff(b,n,r),S=ff(T,n,r);return i?A&&S:A||S}return!1},t.prototype.graphDataToModel=function(e){var n=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=Bn(e.nodes,function(i){var o=n.getModelAfterSnapToGrid(i);return n.elementsModelMap.set(o.id,o),n.nodeModelMap.set(o.id,o),o}):this.nodes=[],e.edges){var r=this.edgeType;this.edges=Bn(e.edges,function(i){var o,a=n.getModel((o=i.type)!==null&&o!==void 0?o:r);if(!a)throw new Error("找不到".concat(i.type,"对应的边。"));var s=new a(i,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},t.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(r){var i=r.getData();i&&!r.virtual&&e.push(i)});var n=[];return this.nodes.forEach(function(r){var i=r.getData();i&&!r.virtual&&n.push(i)}),{nodes:n,edges:e}},t.prototype.modelToHistoryData=function(){for(var e=!1,n=[],r=0;r<this.nodes.length;r++){var i=this.nodes[r];if(i.isDragging){e=!0;break}else n.push(i.getHistoryData())}if(e)return!1;for(var o=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){o=!0;break}l.virtual||a.push(l.getHistoryData())}return o?!1:{nodes:n,edges:a}},t.prototype.getEdgeModelById=function(e){var n;return(n=this.edgesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getElement=function(e){return this.modelsMap[e]},t.prototype.getNodeEdges=function(e){for(var n=[],r=0;r<this.edges.length;r++){var i=this.edges[r],o=i.sourceNodeId===e,a=i.targetNodeId===e;(o||a)&&n.push(i)}return n},t.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach(function(i){if(i.BaseType===Lt.NODE&&r.nodes.push(i.getData()),i.BaseType===Lt.EDGE){var o=i.getData(),a=n.get(o.sourceNodeId)&&n.get(o.targetNodeId);(e||a)&&r.edges.push(o)}}),r},t.prototype.updateAttributes=function(e,n){var r=this.getElement(e);r==null||r.updateAttributes(n)},t.prototype.changeNodeId=function(e,n){return n||(n=Si()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(r){r.sourceNodeId===e&&(r.sourceNodeId=n),r.targetNodeId===e&&(r.targetNodeId=n)}),this.nodesMap[e].model.id=n,this.nodesMap[n]=this.nodesMap[e],n):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},t.prototype.changeEdgeId=function(e,n){return n||(n=Si()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(r){r.id===e&&r.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},t.prototype.getTextModel=function(e){var n=this.editConfigModel,r=n.textMode,i=n.nodeTextMode,o=n.edgeTextMode;if(e.BaseType===Lt.NODE)return e.textMode||i||r||er.TEXT;if(e.BaseType===Lt.EDGE)return e.textMode||o||r||er.TEXT},t.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},t.prototype.setTextMode=function(e,n){this.editConfigModel.updateEditConfig({textMode:e})},t.prototype.setFakeNode=function(e){this.fakeNode=e},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(e,n){return this.modelMap.set(e,n)},t.prototype.toFront=function(e){var n,r,i,o=((n=this.nodesMap[e])===null||n===void 0?void 0:n.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(o){if(this.overlapMode===Xt.STATIC)return;if(this.overlapMode===Xt.INCREASE){this.setElementZIndex(e,"top");return}(i=this.topElement)===null||i===void 0||i.setZIndex(),o.setZIndex(RB),this.topElement=o}},t.prototype.setElementZIndex=function(e,n){var r,i,o=((r=this.nodesMap[e])===null||r===void 0?void 0:r.model)||((i=this.edgesMap[e])===null||i===void 0?void 0:i.model);if(o){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=Va()),n==="bottom"&&(a=s3())),o.setZIndex(a)}},t.prototype.deleteNode=function(e){var n=this.nodesMap[e].model,r=n.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(be.NODE_DELETE,{data:r,model:n})},t.prototype.addNode=function(e,n,r){n===void 0&&(n=be.NODE_ADD);var i=sn(e),o=i.id;o&&this.nodesMap[o]&&delete i.id;var a=this.getModelAfterSnapToGrid(i);this.nodes.push(a);var s=a.getData(),l={data:s};return r&&(l.e=r),this.eventCenter.emit(n,l),a},t.prototype.getModelAfterSnapToGrid=function(e){var n=this.getModel(e.type),r=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var i=e.x,o=e.y;i&&o&&(e.x=Fo(i,this.gridSize,r),e.y=Fo(o,this.gridSize,r),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-i,e.text.y+=e.y-o));var a=new n(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},t.prototype.cloneNode=function(e){var n=this.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){r.x+=30,r.y+=30,r.id="",typeof r.text=="object"&&r.text!==null&&(r.text.x+=30,r.text.y+=30);var i=this.addNode(r);return i.setSelected(!0),n==null||n.setSelected(!1),i.getData()}},t.prototype.moveNode=function(e,n,r,i){var o;i===void 0&&(i=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;o=zt(s.getMoveDistance(n,r,i),2),n=o[0],r=o[1],this.moveEdge(e,n,r)},t.prototype.moveNode2Coordinate=function(e,n,r,i){i===void 0&&(i=!1);var o=this.nodesMap[e];if(!o){console.warn("不存在id为".concat(e,"的节点"));return}var a=o.model,s=a.x,l=a.y,u=n-s,c=r-l;this.moveNode(e,u,c,i)},t.prototype.editText=function(e){this.setElementStateById(e,lt.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=sn(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var i=this.getModel(r);if(!i)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var o=new i(ln(ln({},n),{type:r}),this);this.edgeModelMap.set(o.id,o),this.elementsModelMap.set(o.id,o);var a=o.getData();return this.edges.push(o),this.eventCenter.emit(be.EDGE_ADD,{data:a}),o},t.prototype.moveEdge=function(e,n,r){for(var i=0;i<this.edges.length;i++){var o=this.edges[i],a=o.textPosition,s=a.x,l=a.y,u=this.edges[i].sourceNodeId===e,c=this.edges[i].targetNodeId===e;u&&o.moveStartPoint(n,r),c&&o.moveEndPoint(n,r),(u||c)&&this.handleEdgeTextMove(o,s,l)}},t.prototype.handleEdgeTextMove=function(e,n,r){var i;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===Ye.POLYLINE_EDGE&&(!((i=e.text)===null||i===void 0)&&i.value)){var o=e.text,a=G_(o,e.points);e.moveText(a.x-o.x,a.y-o.y)}var s=e.textPosition,l=s.x,u=s.y;e.moveText(l-n,u-r)},t.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var i=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeById=function(e){var n=this.edgesMap[e];if(n){var r=this.edgesMap[e].index,i=this.edgesMap[e].model.getData();this.edges.splice(r,1),this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.setElementStateById=function(e,n,r){this.nodes.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)}),this.edges.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)})},t.prototype.updateText=function(e,n){var r=hi(zn(zn([],zt(this.nodes),!1),zt(this.edges),!1),function(i){return i.id===e});r==null||r.updateText(n)},t.prototype.selectNodeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.nodesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectEdgeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.edgesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectElementById=function(e,n){n===void 0&&(n=!1),n||this.clearSelectElements();var r=this.getElement(e);r==null||r.setSelected(!0)},t.prototype.deselectElementById=function(e){var n=this.getElement(e);n&&n.setSelected(!1)},t.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[Xt.DEFAULT,Xt.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},t.prototype.moveNodes=function(e,n,r,i){var o,a,s,l=this;i===void 0&&(i=!1);for(var u=e.reduce(function(E,b){var T,A=(T=l.nodesMap[b])===null||T===void 0?void 0:T.model;return A&&(E[b]=A.getMoveDistance(n,r,i)),E},{}),c=0;c<this.edges.length;c++){var d=this.edges[c],f=d.textPosition,h=f.x,v=f.y,g=u[d.sourceNodeId],m=u[d.targetNodeId],y=void 0,x=void 0;g&&m&&d.modelType===Ye.POLYLINE_EDGE?(o=zt(g,2),y=o[0],x=o[1],d.updatePointsList(y,x)):(g&&(a=zt(g,2),y=a[0],x=a[1],d.moveStartPoint(y,x)),m&&(s=zt(m,2),y=s[0],x=s[1],d.moveEndPoint(y,x))),(g||m)&&this.handleEdgeTextMove(d,h,v)}},t.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},t.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},t.prototype.setDefaultEdgeType=function(e){this.edgeType=e},t.prototype.changeNodeType=function(e,n){var r=this.getNodeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的节点"));return}var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new o(i,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var u=tb(a,l.startPoint,a.width,a.height);l.updateStartPoint(u)}if(l.targetNodeId===e){var u=tb(a,l.endPoint,a.width,a.height);l.updateEndPoint(u)}})},t.prototype.changeEdgeType=function(e,n){var r=this.getEdgeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的边"));return}if(r.type!==n){var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete i.pointsList;var a=new o(i,this);this.edges.splice(this.edgesMap[e].index,1,a)}},t.prototype.getNodeIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetNodeId===e&&n.push(r)}),n},t.prototype.getNodeOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&n.push(r)}),n},t.prototype.getAnchorIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetAnchorId===e&&n.push(r)}),n},t.prototype.getAnchorOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceAnchorId===e&&n.push(r)}),n},t.prototype.getNodeIncomingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){var o;i.targetNodeId===e&&r.push((o=n.nodesMap[i.sourceNodeId])===null||o===void 0?void 0:o.model)}),r},t.prototype.getNodeOutgoingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){i.sourceNodeId===e&&r.push(n.nodesMap[i.targetNodeId].model)}),r},t.prototype.setTheme=function(e,n){var r;if(n&&(Wa[n]&&this.updateBackgroundOptions(ln(ln({},typeof this.background=="object"?this.background:{}),Wa[n])),Ua[n]&&this.updateGridOptions(Vo.getGridOptions(ln(ln({},this.grid),Ua[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var i=Vo.getGridOptions((r=e.grid)!==null&&r!==void 0?r:!1);this.updateGridOptions(i)}this.theme=i3(ln(ln({},this.customStyles),e),n),this.customStyles=ln(ln({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,r=e.grid,i=ln(ln({},Pe(this.theme)),{background:n,grid:r});return i},t.prototype.updateGridOptions=function(e){zi(this.grid,e)},t.prototype.updateGridSize=function(e){this.gridSize=e},t.prototype.updateBackgroundOptions=function(e){Zs(e)||Zs(this.background)?this.background=e:this.background=ln(ln({},this.background),e)},t.prototype.resize=function(e,n){if(this.rootEl){var r=document.body.contains(this.rootEl);if(r){var i=this.rootEl.offsetParent!==null;if(i)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(n),i&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(o){console.warn("获取画布宽高时发生错误:",o)}}}},t.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},t.prototype.getVirtualRectSize=function(){var e=this.nodes,n=[],r=[];e.forEach(function(f){var h=f.x,v=f.y,g=f.width,m=f.height,y=f.getNodeStyle().strokeWidth,x=y===void 0?0:y,E=h+g/2+x,b=h-g/2-x,T=v+m/2+x,A=v-m/2-x;n=n.concat([E,b].filter(function(S){return!Number.isNaN(S)})),r=r.concat([T,A].filter(function(S){return!Number.isNaN(S)}))});var i=Math.min.apply(Math,zn([],zt(n),!1)),o=Math.max.apply(Math,zn([],zt(n),!1)),a=Math.min.apply(Math,zn([],zt(r),!1)),s=Math.max.apply(Math,zn([],zt(r),!1)),l=o-i||0,u=s-a||0,c=i+l/2,d=a+u/2;return{width:l,height:u,x:c,y:d}},t.prototype.translateCenter=function(){var e=this,n=e.nodes,r=e.width,i=e.height,o=e.rootEl,a=e.transformModel;if(n.length){var s=r||o.clientWidth,l=i||o.clientHeight,u=this.getVirtualRectSize(),c=u.x,d=u.y;a.focusOn(c,d,s,l)}},t.prototype.fitView=function(e,n){e===void 0&&(e=20),n===void 0&&(n=20);var r=this,i=r.nodes,o=r.width,a=r.height,s=r.rootEl,l=r.transformModel;if(i.length){var u=o||s.clientWidth,c=a||s.clientHeight,d=this.getVirtualRectSize(),f=d.width,h=d.height,v=d.x,g=d.y,m=(f+n)/u,y=(h+e)/c,x=1/Math.max(m,y),E=[u/2,c/2];l.zoom(x,E),l.focusOn(v,g,u,c)}},t.prototype.openEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(e){this.partial=e},t.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},_e([X],t.prototype,"width",void 0),_e([X],t.prototype,"height",void 0),_e([X],t.prototype,"theme",void 0),_e([X],t.prototype,"grid",void 0),_e([X],t.prototype,"edgeType",void 0),_e([X],t.prototype,"nodes",void 0),_e([X],t.prototype,"edges",void 0),_e([X],t.prototype,"fakeNode",void 0),_e([X],t.prototype,"overlapMode",void 0),_e([X],t.prototype,"background",void 0),_e([X],t.prototype,"gridSize",void 0),_e([X],t.prototype,"transformModel",void 0),_e([X],t.prototype,"editConfigModel",void 0),_e([X],t.prototype,"partial",void 0),_e([Et],t.prototype,"nodesMap",null),_e([Et],t.prototype,"edgesMap",null),_e([Et],t.prototype,"modelsMap",null),_e([Et],t.prototype,"sortElements",null),_e([Et],t.prototype,"textEditElement",null),_e([Et],t.prototype,"selectElements",null),_e([Et],t.prototype,"selectNodes",null),_e([U],t.prototype,"setOverlapMode",null),_e([U],t.prototype,"setTextMode",null),_e([U],t.prototype,"setFakeNode",null),_e([U],t.prototype,"removeFakeNode",null),_e([U],t.prototype,"setModel",null),_e([U],t.prototype,"toFront",null),_e([U],t.prototype,"setElementZIndex",null),_e([U],t.prototype,"deleteNode",null),_e([U],t.prototype,"addNode",null),_e([U],t.prototype,"cloneNode",null),_e([U],t.prototype,"moveNode",null),_e([U],t.prototype,"moveNode2Coordinate",null),_e([U],t.prototype,"editText",null),_e([U],t.prototype,"addEdge",null),_e([U],t.prototype,"moveEdge",null),_e([U],t.prototype,"deleteEdgeBySourceAndTarget",null),_e([U],t.prototype,"deleteEdgeById",null),_e([U],t.prototype,"deleteEdgeBySource",null),_e([U],t.prototype,"deleteEdgeByTarget",null),_e([U],t.prototype,"setElementStateById",null),_e([U],t.prototype,"updateText",null),_e([U],t.prototype,"selectNodeById",null),_e([U],t.prototype,"selectEdgeById",null),_e([U],t.prototype,"selectElementById",null),_e([U],t.prototype,"deselectElementById",null),_e([U],t.prototype,"clearSelectElements",null),_e([U],t.prototype,"moveNodes",null),_e([U],t.prototype,"setDefaultEdgeType",null),_e([U],t.prototype,"changeNodeType",null),_e([U],t.prototype,"changeEdgeType",null),_e([U],t.prototype,"getNodeIncomingEdge",null),_e([U],t.prototype,"getNodeOutgoingEdge",null),_e([U],t.prototype,"getAnchorIncomingEdge",null),_e([U],t.prototype,"getAnchorOutgoingEdge",null),_e([U],t.prototype,"getNodeIncomingNode",null),_e([U],t.prototype,"getNodeOutgoingNode",null),_e([U],t.prototype,"setTheme",null),_e([U],t.prototype,"getTheme",null),_e([U],t.prototype,"resize",null),_e([U],t.prototype,"clearData",null),_e([U],t.prototype,"translateCenter",null),_e([U],t.prototype,"fitView",null),_e([U],t.prototype,"openEdgeAnimation",null),_e([U],t.prototype,"closeEdgeAnimation",null),_e([U],t.prototype,"setPartial",null),t}(),Zi=function(){return Zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zi.apply(this,arguments)},ns=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},r4=function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Zi({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var r=e.x,i=e.y,o=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==e.id&&(Sr(r,l.x,this.epsilon)&&(o=!0),Sr(i,l.y,this.epsilon)&&(a=!0),o&&a))break}return{isShowVertical:o,isShowHorizontal:a,position:{x:r,y:i}}},t.prototype.getHorizontalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minY,a==null?void 0:a.minY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.minY,this.epsilon)){r=!0,i=a.minY;break}if(Sr(d.minY,a==null?void 0:a.maxY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.maxY,this.epsilon)){r=!0,i=a.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Zi(Zi({},this.position),{y:i})}},t.prototype.getVerticalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.maxX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.maxX,this.epsilon)){r=!0,i=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Zi(Zi({},this.position),{x:i})}},t.prototype.getSnapLinePosition=function(e,n){var r=this.getCenterSnapLine(e,n),i=r.isShowHorizontal,o=r.isShowVertical;if(!i){var a=this.getHorizontalSnapline(e,n);a.isShowHorizontal&&(r.isShowHorizontal=a.isShowHorizontal,r.position.y=a.position.y)}if(!o){var s=this.getVerticalSnapline(e,n);s.isShowVertical&&(r.isShowVertical=s.isShowVertical,r.position.x=s.position.x)}return r},t.prototype.setSnaplineInfo=function(e){var n=e.isShowHorizontal,r=e.isShowVertical,i=e.position;this.position=i,this.isShowHorizontal=n,this.isShowVertical=r},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(e){var n=this.graphModel.nodes,r=this.getSnapLinePosition(e,n);this.setSnaplineInfo(r)},ns([X],t.prototype,"isShowHorizontal",void 0),ns([X],t.prototype,"isShowVertical",void 0),ns([X],t.prototype,"position",void 0),ns([U],t.prototype,"clearSnapline",null),ns([U],t.prototype,"setNodeSnapLine",null),t}();function Sr(t,e,n){return Math.abs(t-e)<=n}var i4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),o4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},a4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},s4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},l4=function(t){i4(e,t);function e(){var n=t.apply(this,s4([],a4(arguments),!1))||this;return n.handleResize=function(){var r=n.props,i=r.graphModel,o=r.options,a=i.width,s=i.height,l=i.isContainerWidth,u=i.isContainerHeight,c=a,d=s,f=!1;l&&(c=void 0,f=!0),u&&(d=void 0,f=!0),f&&i.resize(c,d),o.width=a,o.height=s},n.throttleResize=gm(n.handleResize,200),n}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(be.GRAPH_UPDATED,{data:n})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(n,r,i){i===void 0&&(i="canvas-overlay");var o=this.props.getView,a=o(n.type);return a?V(a,{model:n,graphModel:r,overlay:i},n.id):null},e.prototype.render=function(){var n=this,r=this.props,i=r.graphModel,o=r.tool,a=r.options,s=r.dnd,l=r.snaplineModel,u={};a.width&&(u.width="".concat(i.width,"px")),a.height&&(u.height="".concat(i.height,"px"));var c=i.fakeNode,d=i.editConfigModel,f=i.background,h=d.adjustEdge;return V("div",{className:"lf-graph","flow-id":i.flowId,style:u,children:[V(M3,{graphModel:i,dnd:s,children:[V("g",{className:"lf-base",children:Bn(i.sortElements,function(v){return n.getComponent(v,i)})}),c?this.getComponent(c,i):""]}),V(H3,{graphModel:i,children:[V(U3,{graphModel:i}),h?V(R3,{graphModel:i}):"",a.snapline!==!1?V(G3,{snaplineModel:l}):""]}),V(q3,{graphModel:i,tool:o}),f&&V(k3,{background:f}),V(Vo,{graphModel:i})]})},e=o4([vn],e),e}(Qe),u4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(){return jr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jr.apply(this,arguments)},c4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},d4=function(t){u4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(r){var i=r.event,o=n.props,a=o.anchorData,s=o.nodeModel,l=o.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(be.ANCHOR_DRAGSTART,{data:a,e:i,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=a.transformModel,c=a.eventCenter,d=a.width,f=a.height,h=a.editConfigModel,v=h.autoExpand,g=h.stopMoveGraph;if(i){var m=i.clientX,y=i.clientY,x=a.getPointByClient({x:m,y}),E=x.domOverlayPosition,b=E.x,T=E.y,A=x.canvasOverlayPosition,S=A.x,M=A.y;n.t&&Jl(n.t);var C=[],G=10;b<10?C=[G,0]:b+10>d?C=[-10,0]:T<10?C=[0,G]:T+10>f&&(C=[0,-10]),n.setState({endX:S,endY:M,dragging:!0}),n.moveAnchorEnd(S,M),C.length>0&&!g&&v&&(n.t=ob(function(){var K=c4(C,2),J=K[0],R=K[1];u.translate(J,R);var k=n.state,B=k.endX,Z=k.endY;n.setState({endX:B-J,endY:Z-R}),n.moveAnchorEnd(B-J,Z-R)})),c.emit(be.ANCHOR_DRAG,{data:l,e:i,nodeModel:s})}},n.onDragEnd=function(r){var i=r.event;n.t&&Jl(n.t);var o=n.checkEnd(i);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData;s.eventCenter.emit(be.ANCHOR_DRAGEND,{data:u,e:i,nodeModel:l,edgeModel:o??void 0})},n.checkEnd=function(r){var i,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=l.x,c=l.y,d=l.id,f=n.state,h=f.endX,v=f.endY,g=f.dragging,m=Yl({x:h,y:v},a);if(n.preTargetNode&&n.preTargetNode.state!==lt.DEFAULT&&n.preTargetNode.setElementState(lt.DEFAULT),!!g&&m&&m.node){var y=m.node,x=m.anchor.id,E="".concat(s.id,"_").concat(y.id,"_").concat(x,"_").concat(d),b=n.sourceRuleResults.get(E)||{},T=b.isAllPass,A=b.msg,S=n.targetRuleResults.get(E)||{},M=S.isAllPass,C=S.msg;if(T&&M){y.setElementState(lt.DEFAULT);var G=a.getNodeModelById(m.node.id),K=(i=a.edgeGenerator)===null||i===void 0?void 0:i.call(a,s.getData(),G==null?void 0:G.getData()),J=a.addEdge(jr(jr({},K),{sourceNodeId:s.id,sourceAnchorId:d,startPoint:{x:u,y:c},targetNodeId:m.node.id,targetAnchorId:m.anchor.id,endPoint:{x:m.anchor.x,y:m.anchor.y}})),R=n.props.anchorData;return a.eventCenter.emit(be.ANCHOR_DROP,{data:R,e:r,nodeModel:s,edgeModel:J}),J}var k=y.getData();return a.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:k,msg:C||A||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,r=n.anchorData,i=n.style,o=n.node,a=o.getAnchorShape(r);if(a)return a;var s=r.x,l=r.y,u=jr(jr({},i),i==null?void 0:i.hover);return V("g",{children:[V(zo,jr({className:"lf-node-anchor-hover"},u,{x:s,y:l})),V(zo,jr({className:"lf-node-anchor"},i,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,r=n.graphModel,i=r.getAnchorIncomingEdge,o=r.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:i(a),outgoingEdgeList:o(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,r){var i,o,a=this.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData,c=Yl({x:n,y:r},s);if(c){var d=c.node,f=c.anchor.id;if(this.preTargetNode&&this.preTargetNode!==c.node&&this.preTargetNode.setElementState(lt.DEFAULT),u.id===f)return;this.preTargetNode=d;var h="".concat(l.id,"_").concat(d.id,"_").concat(f,"_").concat(u.id);if(!this.targetRuleResults.has(h)){var v=c.anchor,g=l.isAllowConnectedAsSource(d,u,v),m=d.isAllowConnectedAsTarget(l,u,v);this.sourceRuleResults.set(h,ql(g)),this.targetRuleResults.set(h,ql(m))}var y=((i=this.sourceRuleResults.get(h))!==null&&i!==void 0?i:{}).isAllPass,x=((o=this.targetRuleResults.get(h))!==null&&o!==void 0?o:{}).isAllPass;y&&x?d.setElementState(lt.ALLOW_CONNECT):d.setElementState(lt.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==lt.DEFAULT&&this.preTargetNode.setElementState(lt.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,r=n.startX,i=n.startY,o=n.endX,a=n.endY,s=Er(r,i,o,a);return s>10},e.prototype.render=function(){var n=this,r=this.state,i=r.startX,o=r.startY,a=r.endX,s=r.endY,l=this.props,u=l.anchorData,c=l.edgeStyle,d=l.nodeModel,f=l.graphModel,h=u.edgeAddable;return V("g",{className:"lf-anchor",children:[V("g",{onClick:function(v){v.stopPropagation(),f.eventCenter.emit(be.ANCHOR_CLICK,{data:u,e:v,nodeModel:d})},onMouseDown:function(v){f.eventCenter.emit(be.ANCHOR_MOUSEDOWN,{data:u,e:v,nodeModel:d}),h!==!1&&n.dragHandler.handleMouseDown(v)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(jr({sourcePoint:{x:i,y:o},targetPoint:{x:a,y:s}},c)):V(Ho,jr({x1:i,y1:o,x2:a,y2:s},c,{"pointer-events":"none"})))]})},e}(Qe),f4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lf=function(){return Lf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Lf.apply(this,arguments)},p4=function(t){f4(e,t);function e(n){var r=t.call(this,n)||this;return r.style={},r.onDragging=function(i){var o,a=i.event,s=r.props,l=s.graphModel,u=s.nodeModel,c=s.eventCenter,d=l.selectNodes,f=u.x,h=u.y,v=a.clientX,g=a.clientY,m=l.getPointByClient({x:v,y:g}).canvasOverlayPosition,y=m.x,x=m.y,E=new Zt(y-f,x-h),b=((o=r.normal)===null||o===void 0?void 0:o.angle(E))-r.defaultAngle,T=new Xl(-f,-h).rotate(b).translate(f,h).toString();u.transform=T,u.rotate=b;var A=Bn(d,function(M){return M.id});A.indexOf(u.id)===-1&&(A=[u.id]);var S=sm(A,function(M,C){var G=l.getNodeModelById(C);return M[C]=G==null?void 0:G.getMoveDistance(0,0,!1),M},{});A.forEach(function(M){var C=l.getNodeEdges(M);C.forEach(function(G){if(S[G.sourceNodeId]){var K=l.getNodeModelById(G.sourceNodeId),J=K.anchors.find(function(R){return R.id===G.sourceAnchorId});G.updateStartPoint(J)}if(S[G.targetNodeId]){var K=l.getNodeModelById(G.targetNodeId),J=K.anchors.find(function(B){return B.id===G.targetAnchorId});G.updateEndPoint(J)}})}),c.emit(be.NODE_ROTATE,{e:a,model:u,data:u.getData()})},r.style=n.style,r.stepperDrag=new tr({onDragging:r.onDragging}),r}return e.prototype.render=function(){var n=this,r=this.props.nodeModel,i=r.x,o=r.y,a=r.width,s=r.height,l=i+a/2+20,u=o-s/2-20;return this.normal=new Zt(1,0),this.defaultAngle=this.normal.angle(new Zt(l-i,u-o)),r.defaultAngle=this.defaultAngle,V("g",{className:"lf-rotate-control",children:V("g",{onMouseDown:function(c){n.stepperDrag.handleMouseDown(c)},children:V(zo,Lf({},this.style,{cx:l,cy:u}))})})},e}(Qe),If={exports:{}};/*!
66
+ `).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),r=n.sNext,i=n.ePre;this.updatePath(r,i)},e.prototype.updatePath=function(n,r){n=Pe(n),r=Pe(r);var i={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!n||!r){var a=this.getControls();n=a.sNext,r=a.ePre}this.pointsList=[i,n,r,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];o.x+=n,o.y+=r,this.updatePath(o,a)},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r;var i=Of(this.pointsList,3),o=i[1],a=i[2];a.x+=n,a.y+=r,this.updatePath(o,a)},e.prototype.updateAdjustAnchor=function(n,r){var i;r==="sNext"?this.pointsList[1]=n:r==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode,s=V_({start:r,end:i,sourceNode:o,targetNode:a,offset:this.offset}),l=s.sNext,u=s.ePre;this.pointsList=[r,l,u,i],this.initPoints()},ir([X],e.prototype,"offset",void 0),ir([X],e.prototype,"path",void 0),ir([U],e.prototype,"initPoints",null),ir([U],e.prototype,"updatePoints",null),ir([U],e.prototype,"updateStartPoint",null),ir([U],e.prototype,"updateEndPoint",null),ir([U],e.prototype,"moveStartPoint",null),ir([U],e.prototype,"moveEndPoint",null),ir([U],e.prototype,"updateAdjustAnchor",null),ir([U],e.prototype,"getAdjustStart",null),ir([U],e.prototype,"getAdjustEnd",null),ir([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(tu),u3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xa=function(){return Xa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xa.apply(this,arguments)},pb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},c3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hb=function(t){u3(e,t);function e(){var n=t.apply(this,c3([],pb(arguments),!1))||this;return n.modelType=Ye.LINE_EDGE,n}return e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Xa(Xa(Xa({},r),Pe(n)),Pe(o))},e.prototype.initEdgeData=function(n){t.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(n){var r=pb(n,2),i=r[0],o=r[1];return"".concat(i.x,",").concat(i.y," ").concat(o.x,",").concat(o.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(tu),d3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ga=function(){return Ga=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ga.apply(this,arguments)},Qt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},gb=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},f3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Ya=function(t){d3(e,t);function e(){var n=t.apply(this,f3([],gb(arguments),!1))||this;return n.modelType=Ye.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){this.offset=ui(n,"properties.offset",30),n.pointsList&&(this.pointsList=n.pointsList),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,r=t.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Ga(Ga(Ga({},r),Pe(n)),Pe(o))},e.prototype.getTextPosition=function(){var n,r=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!r){var i=this.dbClickPosition,o=i.x,a=i.y;return{x:o,y:a}}var s=Ki(this.points),l=gb(ZB(s),2),u=l[0],c=l[1];return{x:(u.x+c.x)/2,y:(u.y+c.y)/2}},e.prototype.getAfterAnchor=function(n,r,i){var o,a;return i.forEach(function(s){var l;n===Tt.HORIZONTAL?l=Math.abs(r.y-s.y):n===Tt.VERTICAL&&(l=Math.abs(r.x-s.x)),(!a||a>l)&&(a=l,o=s)}),o},e.prototype.getCrossPoint=function(n,r,i){var o;return n===Tt.HORIZONTAL?o={x:i.x,y:r.y}:n===Tt.VERTICAL&&(o={x:r.x,y:i.y}),o},e.prototype.removeCrossPoints=function(n,r,i){var o=i.map(function(y){return y});if(n===1){var a=o[n],s=o[r],l=o[n-1],u=$_(l,a,this.sourceNode);if(u){var c=H_(a,s,this.sourceNode);if(c){var d=z_(a,s,this.sourceNode);d&&(o[n]=d,o.splice(n-1,1),n--,r--)}}else{var f=this.sourceNode.anchors;f.forEach(function(y){if(y.x===l.x&&y.x===a.x||y.y===l.y&&y.y===a.y){var x=Er(y.x,y.y,a.x,a.y),E=Er(l.x,l.y,a.x,a.y);x<E&&(o[n-1]=y)}})}}if(r===i.length-2){var h=o[n],v=o[r],g=o[r+1],m=$_(v,g,this.targetNode);if(m){var c=H_(h,v,this.targetNode);if(c){var d=z_(h,v,this.targetNode);d&&(o[r]=d,o.splice(r+1,1))}}else{var f=this.targetNode.anchors;f.forEach(function(x){if(x.x===g.x&&x.x===v.x||x.y===g.y&&x.y===v.y){var E=Er(x.x,x.y,v.x,v.y),b=Er(g.x,g.y,v.x,v.y);E<b&&(o[r+1]=x)}})}}return o},e.prototype.getDraggingPoints=function(n,r,i,o,a){var s=a.map(function(c){return c}),l=this.getAfterAnchor(n,i,o),u=this.getCrossPoint(n,i,l);return r==="start"?(s.unshift(u),s.unshift(l)):(s.push(u),s.push(l)),s},e.prototype.updateCrossPoints=function(n){var r=n.map(function(x){return x}),i=n[0],o=n[1],a=n[r.length-2],s=n[r.length-1],l=this,u=l.sourceNode,c=l.targetNode,d=u.modelType,f=c.modelType,h=Wl(i,o),v=r[0];switch(d){case Ye.RECT_NODE:if(u.radius!==0){var g=Q_(i,u);g||(v=J_(i,h,u))}break;case Ye.CIRCLE_NODE:v=mf(i,h,u);break;case Ye.ELLIPSE_NODE:v=eb(i,h,u);break;case Ye.DIAMOND_NODE:v=ql(i,h,u);break;case Ye.POLYGON_NODE:v=ql(i,h,u);break}v&&(r[0]=v);var m=Wl(a,s),y=r[r.length-1];switch(f){case Ye.RECT_NODE:if(c.radius!==0){var g=Q_(s,c);g||(y=J_(s,m,c))}break;case Ye.CIRCLE_NODE:y=mf(s,m,c);break;case Ye.ELLIPSE_NODE:y=eb(s,m,c);break;case Ye.DIAMOND_NODE:y=ql(s,m,c);break;case Ye.POLYGON_NODE:y=ql(s,m,c);break}return y&&(r[r.length-1]=y),r},e.prototype.updatePath=function(n){this.pointsList=n,this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var n=t.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return Object.assign({},n,{pointsList:r})},e.prototype.getPath=function(n){return n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=F_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=n,this.points=n.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,r){this.startPoint.x+=n,this.startPoint.y+=r,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,r){this.endPoint.x+=n,this.endPoint.y+=r,this.updatePoints()},e.prototype.updatePointsList=function(n,r){this.pointsList.forEach(function(a){a.x+=n,a.y+=r});var i=this.pointsList[0];this.startPoint=Object.assign({},i);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList,d=c;return u===Tt.HORIZONTAL?(c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y},d=this.pointsList.map(function(f){return f})):u===Tt.VERTICAL&&(c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y},d=this.pointsList.map(function(f){return f})),this.updatePointsAfterDrag(d),this.draggingPointList=d,!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppend=function(n,r){var i;this.isDragging=!0;var o=n.start,a=n.end,s=n.startIndex,l=n.endIndex,u=n.direction,c=this.pointsList;if(u===Tt.HORIZONTAL){c[s]={x:o.x,y:o.y+r.y},c[l]={x:a.x,y:a.y+r.y};var d=this.pointsList.map(function(m){return m});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x,y:o.y+r.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x,y:a.y+r.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}else if(u===Tt.VERTICAL){c[s]={x:o.x+r.x,y:o.y},c[l]={x:a.x+r.x,y:a.y};var d=this.pointsList.map(function(y){return y});if(s!==0&&l!==this.pointsList.length-1&&(d=this.removeCrossPoints(s,l,d)),s===0){var f={x:o.x+r.x,y:o.y},h=ni(f,this.sourceNode);if(!h){var v=this.sourceNode.anchors;d=this.getDraggingPoints(u,"start",f,v,d)}}if(l===this.pointsList.length-1){var g={x:a.x+r.x,y:a.y},h=ni(g,this.targetNode);if(!h){var v=this.targetNode.anchors;d=this.getDraggingPoints(u,"end",g,v,d)}}this.updatePointsAfterDrag(d),this.draggingPointList=d}return!((i=this.text)===null||i===void 0)&&i.value&&this.setText(ut({},this.text,this.textPosition)),{start:ut({},c[s]),end:ut({},c[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=j_(Ki(this.points));this.pointsList=n.map(function(o){return o}),this.draggingPointList=[];var r=n[0];this.startPoint=ut({},r);var i=n[n.length-1];this.endPoint=ut({},i)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var r=this.updateCrossPoints(n);this.points=r.map(function(i){return"".concat(i.x,",").concat(i.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var r=n.startPoint,i=n.endPoint,o=n.sourceNode,a=n.targetNode;this.pointsList=F_({x:r.x,y:r.y},{x:i.x,y:i.y},o,a,this.offset||0),this.initPoints()},Qt([X],e.prototype,"offset",void 0),Qt([X],e.prototype,"dbClickPosition",void 0),Qt([U],e.prototype,"initPoints",null),Qt([U],e.prototype,"updatePoints",null),Qt([U],e.prototype,"updateStartPoint",null),Qt([U],e.prototype,"moveStartPoint",null),Qt([U],e.prototype,"updateEndPoint",null),Qt([U],e.prototype,"moveEndPoint",null),Qt([U],e.prototype,"updatePointsList",null),Qt([U],e.prototype,"dragAppendStart",null),Qt([U],e.prototype,"dragAppendSimple",null),Qt([U],e.prototype,"dragAppend",null),Qt([U],e.prototype,"dragAppendEnd",null),Qt([U],e.prototype,"updatePointsAfterDrag",null),Qt([U],e.prototype,"getAdjustStart",null),Qt([U],e.prototype,"getAdjustEnd",null),Qt([U],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(tu),zt=function(){return zt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zt.apply(this,arguments)},Re=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},vb=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ci=function(){function t(e,n){var r;this.BaseType=Lt.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=er.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=lt.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Ye.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,r=n.x,i=r===void 0?0:r,o=n.y,a=o===void 0?0:o;this.transform=new Gl(-i,-a).rotate(e).translate(i,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||Si()}this.formatText(e),ut(this,dj(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||Va()),l.on("overlap:change",function(u){var c=u.overlapMode;n.updateZIndexByOverlap(c,n.zIndex||Va())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,r,i,o=this.graphModel.editConfigModel,a=o.nodeTextDraggable,s=o.nodeTextEdit,l=e.x,u=e.y,c=e.text,d={value:"",x:l,y:u,draggable:a,editable:s};c&&(typeof c=="string"?d.value=c:(d=zt(zt({},d),{x:(n=c.x)!==null&&n!==void 0?n:l,y:(r=c.y)!==null&&r!==void 0?r:u,value:(i=c.value)!==null&&i!==void 0?i:""}),Hi(c.draggable)||(d.draggable=c.draggable),Hi(c.editable)||(d.editable=c.editable))),e.text=d},t.prototype.resize=function(e){var n=e.width,r=e.height,i=e.deltaX,o=e.deltaY,a=this.isAllowResizeNode(i,o,n,r);return a?(this.move(i/2,o/2),this.width=n,this.height=r,this.setProperties({width:n,height:r}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,r=e.y,i=e.value,o=this.properties;bi(o)&&(o=mr(o)),pn(o.width)&&(o.width=this.width),pn(o.height)&&(o.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(a.rotate=this.rotate),[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),i&&(a.text={x:n,y:r,value:i}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return mr(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return zt(zt({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,r=n===void 0?{}:n;return zt(zt({},Pe(e)),Pe(r))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return Pe(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return Pe(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return Pe(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return Pe(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return Pe(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return Pe(e)},t.prototype.isAllowConnectedAsSource=function(e,n,r,i){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,this,e,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(e,n,r,i){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,e,this,n,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},t.prototype.isAllowMoveNode=function(e,n){var r,i,o=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n);if(!d)return!1;if(typeof d=="object"){var f=d;if(!f.x&&!f.y)return!1;o=o&&f.x,a=a&&f.y}}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return{x:o,y:a}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var e=this,n=e.anchorsOffset,r=e.id,i=e.x,o=e.y;return n&&n.length>0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(r,"_").concat(s),x:i+a[0],y:o+a[1]}):(a=a,zt(zt({},a),{x:i+a.x,y:o+a.y,id:a.id||"".concat(r,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return lj(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,r=n.x,i=n.y,o=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,u=p3(new ka([s,l,1]).translate(-r,-i).rotate(o).translate(r,i)[0],2),c=u[0],d=u[1];a.x=c,a.y=d}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!pn(e))for(var n=0;n<this.anchors.length;n++){var r=this.anchors[n];if(r.id===e)return r}},t.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},t.prototype.isAllowMoveByXORY=function(e,n,r){var i,o;if(r)i=!0,o=!0;else{var a=this.isAllowMoveNode(e,n);typeof a=="boolean"?(i=a,o=a):(i=a.x,o=a.y)}return{isAllowMoveX:i,isAllowMoveY:o}},t.prototype.move=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY;return o&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(o||a)&&(this.rotate=this._rotate),o||a},t.prototype.getMoveDistance=function(e,n,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,n,r),o=i.isAllowMoveX,a=i.isAllowMoveY,s=0,l=0;return o&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Gl(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},t.prototype.moveTo=function(e,n,r){r===void 0&&(r=!1);var i=e-this.x,o=n-this.y;return!r&&!this.isAllowMoveNode(i,o)?!1:(this.text&&this.moveText(i,o),this.x=e,this.y=n,!0)},t.prototype.moveText=function(e,n){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+n}},t.prototype.updateText=function(e){this.text=zt(zt({},mr(this.text)),{value:e})},t.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},t.prototype.isAllowResizeNode=function(e,n,r,i){var o,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=vb(s),u=l.next();!u.done;u=l.next()){var c=u.value,d=c(this,e,n,r,i);if(!d)return!1}}catch(f){o={error:f}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return!0},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},t.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},t.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},t.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateProperties=function(e,n){var r=mr(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(be.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:r,properties:e})},t.prototype.setProperty=function(e,n){var r=mr(this.properties),i=Pe(r);um(i,e,sn(n)),this.updateProperties(i,[e])},t.prototype.setProperties=function(e){var n=mr(this.properties),r=zt(zt({},n),sn(e)),i=[];Hv(e,function(o,a){(qs(n,a)&&n[a]!==o||!qs(n,a))&&i.push(a)}),this.updateProperties(r,i)},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setStyle=function(e,n){var r;this.style=zt(zt({},this.style),(r={},r[e]=sn(n),r))},t.prototype.setStyles=function(e){this.style=zt(zt({},this.style),sn(e))},t.prototype.updateStyles=function(e){this.style=zt({},sn(e))},t.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},t.prototype.updateAttributes=function(e){ut(this,e)},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case Xt.DEFAULT:this.zIndex=1;break;case Xt.EDGE_TOP:this.zIndex=0;break;case Xt.INCREASE:this.zIndex=n;break}},t.BaseType=Lt.NODE,Re([X],t.prototype,"type",void 0),Re([X],t.prototype,"x",void 0),Re([X],t.prototype,"y",void 0),Re([X],t.prototype,"textMode",void 0),Re([X],t.prototype,"text",void 0),Re([X],t.prototype,"properties",void 0),Re([X],t.prototype,"_width",void 0),Re([X],t.prototype,"_height",void 0),Re([X],t.prototype,"anchorsOffset",void 0),Re([X],t.prototype,"isSelected",void 0),Re([X],t.prototype,"isHovered",void 0),Re([X],t.prototype,"isShowAnchor",void 0),Re([X],t.prototype,"isDragging",void 0),Re([X],t.prototype,"isHitable",void 0),Re([X],t.prototype,"isHittable",void 0),Re([X],t.prototype,"draggable",void 0),Re([X],t.prototype,"visible",void 0),Re([X],t.prototype,"rotatable",void 0),Re([X],t.prototype,"resizable",void 0),Re([X],t.prototype,"zIndex",void 0),Re([X],t.prototype,"state",void 0),Re([X],t.prototype,"autoToFront",void 0),Re([X],t.prototype,"style",void 0),Re([X],t.prototype,"transform",void 0),Re([X],t.prototype,"_rotate",void 0),Re([Et],t.prototype,"incoming",null),Re([Et],t.prototype,"outgoing",null),Re([U],t.prototype,"setTextMode",null),Re([U],t.prototype,"addNodeMoveRules",null),Re([U],t.prototype,"move",null),Re([U],t.prototype,"getMoveDistance",null),Re([U],t.prototype,"moveTo",null),Re([U],t.prototype,"moveText",null),Re([U],t.prototype,"updateText",null),Re([U],t.prototype,"addNodeResizeRules",null),Re([U],t.prototype,"setSelected",null),Re([U],t.prototype,"setHovered",null),Re([U],t.prototype,"setIsShowAnchor",null),Re([U],t.prototype,"setRotatable",null),Re([U],t.prototype,"setResizable",null),Re([U],t.prototype,"setHitable",null),Re([U],t.prototype,"setHittable",null),Re([U],t.prototype,"setElementState",null),Re([U],t.prototype,"setProperty",null),Re([U],t.prototype,"setProperties",null),Re([U],t.prototype,"deleteProperty",null),Re([U],t.prototype,"setStyle",null),Re([U],t.prototype,"setStyles",null),Re([U],t.prototype,"updateStyles",null),Re([U],t.prototype,"setZIndex",null),Re([U],t.prototype,"updateAttributes",null),Re([U],t.prototype,"updateZIndexByOverlap",null),t}(),h3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ka=function(){return Ka=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ka.apply(this,arguments)},Tf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},nu=function(t){h3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.CIRCLE_NODE,i.r=50,i.initNodeData(n),i.setAttributes(),i}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.circle,i=this.properties.style,o=i===void 0?{}:i;return Ka(Ka(Ka({},n),Pe(r)),Pe(o))},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.r;return[{x:r,y:i-o,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+o,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.deltaX,o=n.deltaY;return this.move(i/2,o/2),this.r=r,this.setProperties({r}),this.getData()},Tf([X],e.prototype,"r",void 0),Tf([Et],e.prototype,"width",null),Tf([Et],e.prototype,"height",null),e}(Ci),g3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qa=function(){return qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},qa.apply(this,arguments)},Wo=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},ru=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Nf=function(t){g3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.DIAMOND_NODE,i.rx=30,i.ry=50,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.diamond,i=this.properties.style,o=i===void 0?{}:i;return qa(qa(qa({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[[r,i-a],[r+o,i],[r,i+a],[r-o,i]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Bn(this.points,function(n){var r=ru(n,2),i=r[0],o=r[1];return{x:i,y:o}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=ru(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return gt(this.points,function(i){var o=ru(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return Bn(this.points,function(r,i){var o=ru(r,2),a=o[0],s=o[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(i)}})},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},Wo([X],e.prototype,"rx",void 0),Wo([X],e.prototype,"ry",void 0),Wo([Et],e.prototype,"points",null),Wo([Et],e.prototype,"pointsPosition",null),Wo([Et],e.prototype,"width",null),Wo([Et],e.prototype,"height",null),e}(Ci),v3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Za=function(){return Za=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Za.apply(this,arguments)},iu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Mf=function(t){v3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.ELLIPSE_NODE,i.rx=30,i.ry=45,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.rx,i=n.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.ellipse,i=this.properties.style,o=i===void 0?{}:i;return Za(Za(Za({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.rx,a=n.ry;return[{x:r,y:i-a,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var r=n.width,i=n.height,o=n.deltaX,a=n.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},iu([X],e.prototype,"rx",void 0),iu([X],e.prototype,"ry",void 0),iu([Et],e.prototype,"width",null),iu([Et],e.prototype,"height",null),e}(Ci),m3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ja=function(){return Ja=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ja.apply(this,arguments)},ou=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},au=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},su=function(t){m3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.POLYGON_NODE,i.points=[[50,0],[100,50],[50,100],[0,50]],i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.points,i=n.width,o=n.height,a=r||this.points;this.points=rj(a,i,o)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.polygon,i=this.properties.style,o=i===void 0?{}:i;return Ja(Ja(Ja({},n),Pe(r)),Pe(o))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+r-o/2,y:s[1]+i-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=au(i,1),a=o[0];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=au(i,2),a=o[1];a<n&&(n=a),a>r&&(r=a)}),r-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,r=this,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points;return l.map(function(u,c){var d=au(u,2),f=d[0],h=d[1];return{x:i+f-a/2,y:o+h-s/2,id:"".concat(n.id,"_").concat(c)}})},e.prototype.resize=function(n){var r=this,i=n.width,o=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=Bn(this.points,function(u){var c=au(u,2),d=c[0],f=c[1];return[d*i/r.width,f*o/r.height]});return this.points=l,this.properties.points=l,this.getData()},ou([X],e.prototype,"points",void 0),ou([Et],e.prototype,"pointsPosition",null),ou([Et],e.prototype,"width",null),ou([Et],e.prototype,"height",null),e}(Ci),y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qa=function(){return Qa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qa.apply(this,arguments)},_3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Uo=function(t){y3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.RECT_NODE,i.radius=0,i.initNodeData(n),i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height,o=n.radius,a=this.getNodeStyle().radius;pn(r)||(this.width=r),pn(i)||(this.height=i),pn(o)||(this.radius=o),pn(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),r=this.graphModel.theme.rect,i=this.properties.style,o=i===void 0?{}:i;return Qa(Qa(Qa({},n),Pe(r)),Pe(o))},_3([X],e.prototype,"radius",void 0),e}(Ci),b3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),es=function(){return es=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},es.apply(this,arguments)},mb=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},x3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},E3=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},yb=function(t){b3(e,t);function e(){var n=t.apply(this,E3([],x3(arguments),!1))||this;return n.modelType=Ye.TEXT_NODE,n}return e.prototype.getTextStyle=function(){var n=t.prototype.getTextStyle.call(this),r=this.graphModel.theme.text,i=this.properties.textStyle;return es(es(es({},n),Pe(r)),Pe(i))},Object.defineProperty(e.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).width;return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=rb({rows:n,fontSize:r,rowsLength:n.length}).height;return i},enumerable:!1,configurable:!0}),mb([Et],e.prototype,"width",null),mb([Et],e.prototype,"height",null),e}(Ci),w3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Df=function(t){w3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.modelType=Ye.HTML_NODE,i.setAttributes(),i}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,r=n.width,i=n.height;r&&(this.width=r),i&&(this.height=i)},e.prototype.getDefaultAnchor=function(){var n=this,r=n.x,i=n.y,o=n.width,a=n.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e}(Ci),ht=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},S3={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},lu=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],C3=function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=er.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=er.TEXT,this.edgeTextMode=er.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",ut(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);ut(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,r=e.textDraggable,i=e.textMode,o=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&ut(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=gi(S3,lu);this.stagedConfig=gi(this,lu),ut(s,l)}Hi(o)||ut(s,{nodeTextEdit:o,edgeTextEdit:o}),Hi(r)||ut(s,{nodeTextDraggable:r,edgeTextDraggable:r}),i&&ut(s,{nodeTextMode:i,edgeTextMode:i}),Js(a)&&ut(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var u=gi(e,lu);return ut(s,u)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return gi(this,lu)},ht([X],t.prototype,"isSilentMode",void 0),ht([X],t.prototype,"stopZoomGraph",void 0),ht([X],t.prototype,"stopMoveGraph",void 0),ht([X],t.prototype,"stopScrollGraph",void 0),ht([X],t.prototype,"snapGrid",void 0),ht([X],t.prototype,"textMode",void 0),ht([X],t.prototype,"textEdit",void 0),ht([X],t.prototype,"textDraggable",void 0),ht([X],t.prototype,"nodeTextEdit",void 0),ht([X],t.prototype,"nodeTextDraggable",void 0),ht([X],t.prototype,"nodeTextMultiple",void 0),ht([X],t.prototype,"nodeTextVertical",void 0),ht([X],t.prototype,"nodeTextMode",void 0),ht([X],t.prototype,"edgeTextMode",void 0),ht([X],t.prototype,"edgeTextEdit",void 0),ht([X],t.prototype,"edgeTextDraggable",void 0),ht([X],t.prototype,"edgeTextMultiple",void 0),ht([X],t.prototype,"edgeTextVertical",void 0),ht([X],t.prototype,"hideAnchors",void 0),ht([X],t.prototype,"allowRotate",void 0),ht([X],t.prototype,"allowResize",void 0),ht([X],t.prototype,"hoverOutline",void 0),ht([X],t.prototype,"nodeSelectedOutline",void 0),ht([X],t.prototype,"adjustNodePosition",void 0),ht([X],t.prototype,"autoExpand",void 0),ht([X],t.prototype,"adjustEdge",void 0),ht([X],t.prototype,"adjustEdgeMiddle",void 0),ht([X],t.prototype,"adjustEdgeStartAndEnd",void 0),ht([X],t.prototype,"adjustEdgeStart",void 0),ht([X],t.prototype,"adjustEdgeEnd",void 0),ht([X],t.prototype,"edgeSelectedOutline",void 0),ht([U],t.prototype,"updateEditConfig",null),ht([U],t.prototype,"updateTextMode",null),t}(),A3="*",O3=function(){function t(){this._events={}}return t.prototype.on=function(e,n,r){var i=this;e==null||e.split(",").forEach(function(o){o=o.trim(),i._events[o]||(i._events[o]=[]),i._events[o].push({callback:n,once:!!r})})},t.prototype.once=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r.on(i,n,!0)})},t.prototype.emit=function(e,n){var r=this;e==null||e.split(",").forEach(function(i){var o=r._events[i]||[],a=r._events[A3]||[],s=function(l){for(var u=l.length,c=0;c<u;c++)if(l[c]){var d=l[c],f=d.callback,h=d.once;h&&(l.splice(c,1),l.length===0&&delete r._events[i],u--,c--),f.apply(r,[n])}};s(o),s(a)})},t.prototype.off=function(e,n){var r=this;e||(this._events={}),e.split(",").forEach(function(i){if(!n)delete r._events[i];else{for(var o=r._events[i]||[],a=o.length,s=0;s<a;s++)o[s].callback===n&&(o.splice(s,1),a--,s--);o.length===0&&delete r._events[i]}})},t.prototype.getEvents=function(){return this._events},t.prototype.destroy=function(){this._events={}},t}(),T3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(){return Pf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Pf.apply(this,arguments)},N3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},M3=function(t){T3(e,t);function e(n){var r=t.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(s){var l=s.deltaX,u=s.deltaY;r.setState({isDragging:!0});var c=r.props.graphModel,d=c.transformModel,f=c.editConfigModel;f.stopMoveGraph!==!0&&d.translate(l,u)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(s){var l=r.props,u=l.graphModel,c=u.editConfigModel,d=u.transformModel,f=u.gridSize,h=l.graphModel,v=s.deltaX,g=s.deltaY,m=c.stopScrollGraph,y=c.stopZoomGraph;if(!m&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),r.stepScrollX+=v,r.stepScrollY+=g,Math.abs(r.stepScrollX)>=f){var x=r.stepScrollX%f,E=r.stepScrollX-x;d.translate(-E*d.SCALE_X,0),r.stepScrollX=x}if(Math.abs(r.stepScrollY)>=f){var b=r.stepScrollY%f,T=r.stepScrollY-b;d.translate(0,-T*d.SCALE_Y),r.stepScrollY=b}return}if(!y){s.preventDefault();var A=h.getPointByClient({x:s.clientX,y:s.clientY}),S=A.canvasOverlayPosition,M=S.x,C=S.y;d.zoom(s.deltaY<0,[M,C])}},r.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var u=r.props.graphModel,c=u.selectElements;c.size>0&&u.clearSelectElements(),u.eventCenter.emit(be.BLANK_CLICK,{e:s})}},r.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var u=r.props.graphModel,c=u.getPointByClient({x:s.clientX,y:s.clientY});u.eventCenter.emit(be.BLANK_CONTEXTMENU,{e:s,position:c})}},r.mouseDownHandler=function(s){var l=r.props.graphModel,u=l.eventCenter,c=l.editConfigModel,d=l.transformModel.SCALE_X,f=l.gridSize,h=c.adjustEdge,v=c.adjustNodePosition,g=c.stopMoveGraph,m=s.target,y=!h&&!v;(m.getAttribute("name")==="canvas-overlay"||y)&&(g!==!0?(r.stepDrag.setStep(f*d),r.stepDrag.handleMouseDown(s)):u.emit(be.BLANK_MOUSEDOWN,{e:s}),r.clickHandler(s))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props,o=i.children,a=i.dnd,s=this.state.isDragging;return V("svg",Pf({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:V("g",{transform:r,children:o})}))},e=N3([vn],e),e}(Qe),_b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(){return ts=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ts.apply(this,arguments)},D3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},P3=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},bb=function(t){_b(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.bezierModel,l=o.type,u=a.getPointByClient({x:i.clientX,y:i.clientY}).canvasOverlayPosition,c=u.x,d=u.y;s.updateAdjustAnchor({x:c,y:d},l),a.eventCenter.emit(be.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var r=n.props.bezierModel;r.isDragging=!1},n.dragHandler=new tr({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,r=this.props.position,i=r.x,o=r.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return V(zo,ts({className:"lf-bezier-adjust-anchor",x:i,y:o},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e}(Qe),R3=function(t){_b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,r){var i=n.path,o=n.id,a=cf(i),s=P3(a,4),l=s[0],u=s[1],c=s[2],d=s[3],f=n.getEdgeStyle().adjustLine,h=[];return h.push(V(Ho,ts({x1:l.x,y1:l.y,x2:u.x,y2:u.y},f))),h.push(V(bb,{position:u,bezierModel:n,graphModel:r,type:"sNext"},"".concat(o,"_ePre"))),h.push(V(Ho,ts({x1:d.x,y1:d.y,x2:c.x,y2:c.y},f))),h.push(V(bb,{position:c,bezierModel:n,graphModel:r,type:"ePre"},"".concat(o,"_sNext"))),h},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,r=n.edges,i=[],o=0;o<r.length;o++){var a=r[o];a.isSelected&&a.modelType===Ye.BEZIER_EDGE&&a.draggable&&i.push(this.getBezierAdjust(a,n))}return i},e.prototype.render=function(){return V("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=D3([vn],e),e}(Qe),L3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},k3=function(t){L3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return V("div",{className:"lf-background",children:V("div",{style:Rt(n)?n:{},className:"lf-background-area"})})},e=I3([vn],e),e}(Qe),B3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Vo=function(t){B3(e,t);function e(n){var r=t.call(this,n)||this;return r.id=Si(),r.gridOptions=r.props.graphModel.grid,r}return e.prototype.renderDot=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?2:u,d=Math.min(Math.max(2,c),o/4),f=a?1:0;return V("g",{fill:l,opacity:f,children:[V("circle",{cx:0,cy:0,r:d/2}),V("circle",{cx:0,cy:o,r:d/2}),V("circle",{cx:o,cy:0,r:d/2}),V("circle",{cx:o,cy:o,r:d/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,r=n.config,i=n.size,o=i===void 0?1:i,a=n.visible,s=r??{},l=s.color,u=s.thickness,c=u===void 0?1:u,d=Math.min(Math.max(1,c),o/2),f="M 0 0 H ".concat(o," V ").concat(o," H 0 Z"),h=a?1:0;return V("path",{d:f,stroke:l,strokeWidth:d/2,opacity:h,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,r=n.transformModel,i=n.grid;this.gridOptions=i;var o=this.gridOptions,a=o.type,s=o.size,l=s===void 0?1:s,u=r.SCALE_X,c=r.SKEW_Y,d=r.SKEW_X,f=r.SCALE_Y,h=r.TRANSLATE_X,v=r.TRANSLATE_Y,g=[u,c,d,f,h,v].join(","),m="matrix(".concat(g,")");return V("div",{className:"lf-grid",children:V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[V("defs",{children:V("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:m,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),V("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=j3([vn],e),e}(Qe);(function(t){t.defaultProps={size:LB,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var r=Pe(t.defaultProps);return typeof n=="number"?ut(r,{size:n}):typeof n=="boolean"?ut(r,{visible:n}):ut(r,n)}t.getGridOptions=e})(Vo||(Vo={}));var F3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},H3=function(t){F3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,r=n.getTransformStyle().transform,i=this.props.children;return V("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:V("g",{transform:r,children:i})})},e=$3([vn],e),e}(Qe),z3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ai=function(){return Ai=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ai.apply(this,arguments)},W3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},U3=function(t){z3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,r=n.nodes,i=n.editConfigModel,o=i.hoverOutline,a=i.nodeSelectedOutline,s=[];return r.forEach(function(l){if(l.isHovered||l.isSelected){var u=l.isHovered,c=l.isSelected,d=l.x,f=l.y,h=l.width,v=l.height;if(a&&c||o&&u){var g=l.getOutlineStyle()||{},m={};if(Object.keys(g).forEach(function(x){x!=="hover"&&(m[x]=g[x])}),u){var y=g.hover;m=Ai(Ai({},m),y)}s.push(V(rr,Ai({transform:l.transform,className:"lf-outline-node",x:d,y:f,width:h+10,height:v+10},m)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,r=n.edges,i=n.editConfigModel,o=i.edgeSelectedOutline,a=i.hoverOutline,s=[],l=0;l<r.length;l++){var u=r[l];(o&&u.isSelected||a&&u.isHovered)&&(u.modelType===Ye.LINE_EDGE?s.push(this.getLineOutline(u)):u.modelType===Ye.POLYLINE_EDGE?s.push(this.getPolylineOutline(u)):u.modelType===Ye.BEZIER_EDGE&&s.push(this.getBezierOutline(u)))}return s},e.prototype.getLineOutline=function(n){var r=n.startPoint,i=n.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2,s=Math.abs(r.x-i.x)+10,l=Math.abs(r.y-i.y)+10,u=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline-edge",x:o,y:a,width:s,height:l},u))},e.prototype.getPolylineOutline=function(n){var r=n.points,i=Ki(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.getBezierOutline=function(n){var r=n.path,i=cf(r),o=La(i,8),a=o.x,s=o.y,l=o.width,u=o.height,c=n.getOutlineStyle();return V(rr,Ai({className:"lf-outline",x:a,y:s,width:l,height:u},c))},e.prototype.render=function(){return V("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=W3([vn],e),e}(Qe),V3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(){return Oi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Oi.apply(this,arguments)},X3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},G3=function(t){V3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,r=n??{},i=r.position,o=r.isShowHorizontal,a=r.isShowVertical,s=n==null?void 0:n.getStyle(),l=i??{},u=l.x,c=u===void 0?0:u,d=l.y,f=d===void 0?0:d,h=Oi(Oi({x1:-1e5,y1:f,x2:1e5,y2:f},s),{stroke:o?s==null?void 0:s.stroke:"none"}),v=Oi(Oi({x1:c,y1:-1e5,x2:c,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return V("g",{className:"lf-snapline",children:[V(Ho,Oi({},h)),V(Ho,Oi({},v))]})},e=X3([vn],e),e}(Qe),Y3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K3=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},q3=function(t){Y3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,r=n.tool,i=n.graphModel,o=i.textEditElement,a=r.getTools(),s=a.map(function(l){return Te(l,{textEditElement:o,graphModel:i,lf:r.instance})});return r.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,r=n.tool,i=n.graphModel,o=document.querySelector("#ToolOverlay_".concat(i.flowId)),a=r.getInstance();a.components.forEach(function(s){return s(a,o)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return V("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=K3([vn],e),e}(Qe),wr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Xo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Z3={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},J3=function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var r=n.stopMoveGraph,i=r===void 0?!1:r;this.updateTranslateLimits(i)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[(r-this.TRANSLATE_X)/this.SCALE_X,(i-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=Xo(e,2),r=n[0],i=n[1];return[r*this.SCALE_X+this.TRANSLATE_X,i*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,r){var i=Xo(e,2),o=i[0],a=i[1];return[o+n/this.SCALE_X,a+r/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var r=this.SCALE_X,i=this.SCALE_Y;return typeof e=="number"?(r=e,i=e):e?(r+=this.ZOOM_SIZE,i+=this.ZOOM_SIZE):(r-=this.ZOOM_SIZE,i-=this.ZOOM_SIZE),r<this.MINI_SCALE_SIZE||r>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(r-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(i-this.SCALE_Y)*n[1]),this.SCALE_X=r,this.SCALE_Y=i,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(be.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,r,i){var o=Xo(this.CanvasPointToHtmlPoint([e,n]),2),a=o[0],s=o[1],l=Xo([r/2-a,i/2-s],2),u=l[0],c=l[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=c,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=Xo(Array.isArray(e)&&e.length===4?e:Z3[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},wr([X],t.prototype,"SCALE_X",void 0),wr([X],t.prototype,"SKEW_Y",void 0),wr([X],t.prototype,"SKEW_X",void 0),wr([X],t.prototype,"SCALE_Y",void 0),wr([X],t.prototype,"TRANSLATE_X",void 0),wr([X],t.prototype,"TRANSLATE_Y",void 0),wr([X],t.prototype,"ZOOM_SIZE",void 0),wr([U],t.prototype,"zoom",null),wr([U],t.prototype,"resetZoom",null),wr([U],t.prototype,"translate",null),wr([U],t.prototype,"focusOn",null),t}(),Q3=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},e4=function(t){Q3(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.parentTransform=r.parentTransform,i}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,r=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale();n*=i.scaleX,r*=i.scaleY}else n*=this.parentTransform.SCALE_X,r*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:r}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,r=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale(),o=i.scaleX,a=i.scaleY;n=o*n,r=a*r}return{translateX:n,translateY:r}},e.prototype.HtmlPointToCanvasPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[(i-c)/s,(o-d)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var r=Rf(n,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),c=u.translateX,d=u.translateY;return[i*s+c,o*l+d]},e.prototype.moveCanvasPointByHtml=function(n,r,i){var o=Rf(n,2),a=o[0],s=o[1],l=this.getCumulativeScale(),u=l.scaleX,c=l.scaleY;return[a+r/u,s+i/c]},e.prototype.fixDeltaXY=function(n,r){var i=this.getCumulativeScale(),o=i.scaleX,a=i.scaleY;return[n/o,r/a]},e}(J3),ln=function(){return ln=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ln.apply(this,arguments)},_e=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},t4=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},zn=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},n4=function(){function t(e){var n=this,r,i;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=Xt.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var o=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,u=e.grid,c=e.idGenerator,d=e.edgeGenerator,f=e.animation,h=e.customTrajectory;this.rootEl=o,this.partial=!!a,this.background=l,typeof u=="object"&&e.snapGrid&&(this.gridSize=u.size||1),this.customStyles=e.style||{},this.grid=Vo.getGridOptions(u??!1),this.theme=db(e.style,e.themeMode),this.theme.grid=Pe(this.grid),this.theme.background=Pe(this.background),this.edgeType=e.edgeType||"polyline",this.animation=DB(f),this.overlapMode=e.overlapMode||Xt.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(r=e.width)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e.width),this.height=(i=e.height)!==null&&i!==void 0?i:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(e.height);var v=new ResizeObserver(Vs(function(g){var m,y;try{for(var x=t4(g),E=x.next();!E.done;E=x.next()){var b=E.value;if(b.target===n.rootEl){var T=document.body.contains(n.rootEl);if(!T)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:b.contentRect})}}}catch(A){m={error:A}}finally{try{E&&!E.done&&(y=x.return)&&y.call(x)}finally{if(m)throw m.error}}},16));v.observe(this.rootEl),this.waitCleanEffects.push(function(){v.disconnect()}),this.eventCenter=new O3,this.editConfigModel=new C3(e),this.transformModel=new e4(this.eventCenter,e),this.flowId=Si(),this.idGenerator=c,this.edgeGenerator=tj(this,d),this.customTrajectory=h}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,n,r){return e[n.id]={index:r,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return zn(zn([],Wt(this.nodes),!1),Wt(this.edges),!1).reduce(function(e,n){return e[n.id]=n,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var e=function(l){return zn([],Wt(l),!1).sort(function(u,c){return u.zIndex-c.zIndex})},n=e(zn(zn([],Wt(this.nodes),!1),Wt(this.edges),!1)),r=[],i=[-200,-200],o=[this.width+P_,this.height+P_],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,i,o,!1,!1))&&r.push(s)}return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(r){return r.state===lt.TEXT_EDIT}),n=this.edges.find(function(r){return r.state===lt.TEXT_EDIT});return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(n){n.isSelected&&e.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&e.set(n.id,n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(n){n.isSelected&&e.push(n)}),e},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(e,n,r,i,o){var a=this;r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1);var s=[];return gt(zn(zn([],Wt(this.nodes),!1),Wt(this.edges),!1),function(l){var u=a.isElementInArea(l,e,n,r,i);(!o||l.visible)&&u&&s.push(l)}),s},t.prototype.getModel=function(e){return this.modelMap.get(e)},t.prototype.getNodeModelById=function(e){var n;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getPointByClient=function(e){var n=e.x,r=e.y,i=this.rootEl.getBoundingClientRect(),o={x:n-i.left,y:r-i.top},a=Wt(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2),s=a[0],l=a[1],u={x:s,y:l};return{domOverlayPosition:o,canvasOverlayPosition:u}},t.prototype.isElementInArea=function(e,n,r,i,o){var a;if(i===void 0&&(i=!0),o===void 0&&(o=!0),e.BaseType===Lt.NODE){e=e;for(var s=Hn(e),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY,f=[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}],h=o,v=0;v<f.length;v++){var g=f[v],m=g.x,y=g.y;if(a=Wt(this.transformModel.CanvasPointToHtmlPoint([m,y]),2),m=a[0],y=a[1],ff([m,y],n,r)!==o){h=!o;break}}return h}if(e.BaseType===Lt.EDGE){e=e;var x=e.startPoint,E=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([x.x,x.y]),T=this.transformModel.CanvasPointToHtmlPoint([E.x,E.y]),A=ff(b,n,r),S=ff(T,n,r);return i?A&&S:A||S}return!1},t.prototype.graphDataToModel=function(e){var n=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=Bn(e.nodes,function(i){var o=n.getModelAfterSnapToGrid(i);return n.elementsModelMap.set(o.id,o),n.nodeModelMap.set(o.id,o),o}):this.nodes=[],e.edges){var r=this.edgeType;this.edges=Bn(e.edges,function(i){var o,a=n.getModel((o=i.type)!==null&&o!==void 0?o:r);if(!a)throw new Error("找不到".concat(i.type,"对应的边。"));var s=new a(i,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},t.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(r){var i=r.getData();i&&!r.virtual&&e.push(i)});var n=[];return this.nodes.forEach(function(r){var i=r.getData();i&&!r.virtual&&n.push(i)}),{nodes:n,edges:e}},t.prototype.modelToHistoryData=function(){for(var e=!1,n=[],r=0;r<this.nodes.length;r++){var i=this.nodes[r];if(i.isDragging){e=!0;break}else n.push(i.getHistoryData())}if(e)return!1;for(var o=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){o=!0;break}l.virtual||a.push(l.getHistoryData())}return o?!1:{nodes:n,edges:a}},t.prototype.getEdgeModelById=function(e){var n;return(n=this.edgesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getElement=function(e){return this.modelsMap[e]},t.prototype.getNodeEdges=function(e){for(var n=[],r=0;r<this.edges.length;r++){var i=this.edges[r],o=i.sourceNodeId===e,a=i.targetNodeId===e;(o||a)&&n.push(i)}return n},t.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach(function(i){if(i.BaseType===Lt.NODE&&r.nodes.push(i.getData()),i.BaseType===Lt.EDGE){var o=i.getData(),a=n.get(o.sourceNodeId)&&n.get(o.targetNodeId);(e||a)&&r.edges.push(o)}}),r},t.prototype.updateAttributes=function(e,n){var r=this.getElement(e);r==null||r.updateAttributes(n)},t.prototype.changeNodeId=function(e,n){return n||(n=Si()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(r){r.sourceNodeId===e&&(r.sourceNodeId=n),r.targetNodeId===e&&(r.targetNodeId=n)}),this.nodesMap[e].model.id=n,this.nodesMap[n]=this.nodesMap[e],n):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},t.prototype.changeEdgeId=function(e,n){return n||(n=Si()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(r){r.id===e&&r.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},t.prototype.getTextModel=function(e){var n=this.editConfigModel,r=n.textMode,i=n.nodeTextMode,o=n.edgeTextMode;if(e.BaseType===Lt.NODE)return e.textMode||i||r||er.TEXT;if(e.BaseType===Lt.EDGE)return e.textMode||o||r||er.TEXT},t.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},t.prototype.setTextMode=function(e,n){this.editConfigModel.updateEditConfig({textMode:e})},t.prototype.setFakeNode=function(e){this.fakeNode=e},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(e,n){return this.modelMap.set(e,n)},t.prototype.toFront=function(e){var n,r,i,o=((n=this.nodesMap[e])===null||n===void 0?void 0:n.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(o){if(this.overlapMode===Xt.STATIC)return;if(this.overlapMode===Xt.INCREASE){this.setElementZIndex(e,"top");return}(i=this.topElement)===null||i===void 0||i.setZIndex(),o.setZIndex(RB),this.topElement=o}},t.prototype.setElementZIndex=function(e,n){var r,i,o=((r=this.nodesMap[e])===null||r===void 0?void 0:r.model)||((i=this.edgesMap[e])===null||i===void 0?void 0:i.model);if(o){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=Va()),n==="bottom"&&(a=s3())),o.setZIndex(a)}},t.prototype.deleteNode=function(e){var n=this.nodesMap[e].model,r=n.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(be.NODE_DELETE,{data:r,model:n})},t.prototype.addNode=function(e,n,r){n===void 0&&(n=be.NODE_ADD);var i=sn(e),o=i.id;o&&this.nodesMap[o]&&delete i.id;var a=this.getModelAfterSnapToGrid(i);this.nodes.push(a);var s=a.getData(),l={data:s};return r&&(l.e=r),this.eventCenter.emit(n,l),a},t.prototype.getModelAfterSnapToGrid=function(e){var n=this.getModel(e.type),r=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var i=e.x,o=e.y;i&&o&&(e.x=Fo(i,this.gridSize,r),e.y=Fo(o,this.gridSize,r),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-i,e.text.y+=e.y-o));var a=new n(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},t.prototype.cloneNode=function(e){var n=this.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){r.x+=30,r.y+=30,r.id="",typeof r.text=="object"&&r.text!==null&&(r.text.x+=30,r.text.y+=30);var i=this.addNode(r);return i.setSelected(!0),n==null||n.setSelected(!1),i.getData()}},t.prototype.moveNode=function(e,n,r,i){var o;i===void 0&&(i=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;o=Wt(s.getMoveDistance(n,r,i),2),n=o[0],r=o[1],this.moveEdge(e,n,r)},t.prototype.moveNode2Coordinate=function(e,n,r,i){i===void 0&&(i=!1);var o=this.nodesMap[e];if(!o){console.warn("不存在id为".concat(e,"的节点"));return}var a=o.model,s=a.x,l=a.y,u=n-s,c=r-l;this.moveNode(e,u,c,i)},t.prototype.editText=function(e){this.setElementStateById(e,lt.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=sn(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var i=this.getModel(r);if(!i)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var o=new i(ln(ln({},n),{type:r}),this);this.edgeModelMap.set(o.id,o),this.elementsModelMap.set(o.id,o);var a=o.getData();return this.edges.push(o),this.eventCenter.emit(be.EDGE_ADD,{data:a}),o},t.prototype.moveEdge=function(e,n,r){for(var i=0;i<this.edges.length;i++){var o=this.edges[i],a=o.textPosition,s=a.x,l=a.y,u=this.edges[i].sourceNodeId===e,c=this.edges[i].targetNodeId===e;u&&o.moveStartPoint(n,r),c&&o.moveEndPoint(n,r),(u||c)&&this.handleEdgeTextMove(o,s,l)}},t.prototype.handleEdgeTextMove=function(e,n,r){var i;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===Ye.POLYLINE_EDGE&&(!((i=e.text)===null||i===void 0)&&i.value)){var o=e.text,a=G_(o,e.points);e.moveText(a.x-o.x,a.y-o.y)}var s=e.textPosition,l=s.x,u=s.y;e.moveText(l-n,u-r)},t.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var i=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeById=function(e){var n=this.edgesMap[e];if(n){var r=this.edgesMap[e].index,i=this.edgesMap[e].model.getData();this.edges.splice(r,1),this.eventCenter.emit(be.EDGE_DELETE,{data:i})}},t.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(be.EDGE_DELETE,{data:r})}},t.prototype.setElementStateById=function(e,n,r){this.nodes.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)}),this.edges.forEach(function(i){i.id===e?i.setElementState(n,r):i.setElementState(lt.DEFAULT)})},t.prototype.updateText=function(e,n){var r=hi(zn(zn([],Wt(this.nodes),!1),Wt(this.edges),!1),function(i){return i.id===e});r==null||r.updateText(n)},t.prototype.selectNodeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.nodesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectEdgeById=function(e,n){var r;n===void 0&&(n=!1),n||this.clearSelectElements();var i=(r=this.edgesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},t.prototype.selectElementById=function(e,n){n===void 0&&(n=!1),n||this.clearSelectElements();var r=this.getElement(e);r==null||r.setSelected(!0)},t.prototype.deselectElementById=function(e){var n=this.getElement(e);n&&n.setSelected(!1)},t.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[Xt.DEFAULT,Xt.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},t.prototype.moveNodes=function(e,n,r,i){var o,a,s,l=this;i===void 0&&(i=!1);for(var u=e.reduce(function(E,b){var T,A=(T=l.nodesMap[b])===null||T===void 0?void 0:T.model;return A&&(E[b]=A.getMoveDistance(n,r,i)),E},{}),c=0;c<this.edges.length;c++){var d=this.edges[c],f=d.textPosition,h=f.x,v=f.y,g=u[d.sourceNodeId],m=u[d.targetNodeId],y=void 0,x=void 0;g&&m&&d.modelType===Ye.POLYLINE_EDGE?(o=Wt(g,2),y=o[0],x=o[1],d.updatePointsList(y,x)):(g&&(a=Wt(g,2),y=a[0],x=a[1],d.moveStartPoint(y,x)),m&&(s=Wt(m,2),y=s[0],x=s[1],d.moveEndPoint(y,x))),(g||m)&&this.handleEdgeTextMove(d,h,v)}},t.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},t.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},t.prototype.setDefaultEdgeType=function(e){this.edgeType=e},t.prototype.changeNodeType=function(e,n){var r=this.getNodeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的节点"));return}var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new o(i,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var u=tb(a,l.startPoint,a.width,a.height);l.updateStartPoint(u)}if(l.targetNodeId===e){var u=tb(a,l.endPoint,a.width,a.height);l.updateEndPoint(u)}})},t.prototype.changeEdgeType=function(e,n){var r=this.getEdgeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的边"));return}if(r.type!==n){var i=r.getData();i.type=n;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete i.pointsList;var a=new o(i,this);this.edges.splice(this.edgesMap[e].index,1,a)}},t.prototype.getNodeIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetNodeId===e&&n.push(r)}),n},t.prototype.getNodeOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&n.push(r)}),n},t.prototype.getAnchorIncomingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.targetAnchorId===e&&n.push(r)}),n},t.prototype.getAnchorOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(r){r.sourceAnchorId===e&&n.push(r)}),n},t.prototype.getNodeIncomingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){var o;i.targetNodeId===e&&r.push((o=n.nodesMap[i.sourceNodeId])===null||o===void 0?void 0:o.model)}),r},t.prototype.getNodeOutgoingNode=function(e){var n=this,r=[];return this.edges.forEach(function(i){i.sourceNodeId===e&&r.push(n.nodesMap[i.targetNodeId].model)}),r},t.prototype.setTheme=function(e,n){var r;if(n&&(Wa[n]&&this.updateBackgroundOptions(ln(ln({},typeof this.background=="object"?this.background:{}),Wa[n])),Ua[n]&&this.updateGridOptions(Vo.getGridOptions(ln(ln({},this.grid),Ua[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var i=Vo.getGridOptions((r=e.grid)!==null&&r!==void 0?r:!1);this.updateGridOptions(i)}this.theme=i3(ln(ln({},this.customStyles),e),n),this.customStyles=ln(ln({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,r=e.grid,i=ln(ln({},Pe(this.theme)),{background:n,grid:r});return i},t.prototype.updateGridOptions=function(e){zi(this.grid,e)},t.prototype.updateGridSize=function(e){this.gridSize=e},t.prototype.updateBackgroundOptions=function(e){Js(e)||Js(this.background)?this.background=e:this.background=ln(ln({},this.background),e)},t.prototype.resize=function(e,n){if(this.rootEl){var r=document.body.contains(this.rootEl);if(r){var i=this.rootEl.offsetParent!==null;if(i)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=pn(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=pn(n),i&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(o){console.warn("获取画布宽高时发生错误:",o)}}}},t.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},t.prototype.getVirtualRectSize=function(){var e=this.nodes,n=[],r=[];e.forEach(function(f){var h=f.x,v=f.y,g=f.width,m=f.height,y=f.getNodeStyle().strokeWidth,x=y===void 0?0:y,E=h+g/2+x,b=h-g/2-x,T=v+m/2+x,A=v-m/2-x;n=n.concat([E,b].filter(function(S){return!Number.isNaN(S)})),r=r.concat([T,A].filter(function(S){return!Number.isNaN(S)}))});var i=Math.min.apply(Math,zn([],Wt(n),!1)),o=Math.max.apply(Math,zn([],Wt(n),!1)),a=Math.min.apply(Math,zn([],Wt(r),!1)),s=Math.max.apply(Math,zn([],Wt(r),!1)),l=o-i||0,u=s-a||0,c=i+l/2,d=a+u/2;return{width:l,height:u,x:c,y:d}},t.prototype.translateCenter=function(){var e=this,n=e.nodes,r=e.width,i=e.height,o=e.rootEl,a=e.transformModel;if(n.length){var s=r||o.clientWidth,l=i||o.clientHeight,u=this.getVirtualRectSize(),c=u.x,d=u.y;a.focusOn(c,d,s,l)}},t.prototype.fitView=function(e,n){e===void 0&&(e=20),n===void 0&&(n=20);var r=this,i=r.nodes,o=r.width,a=r.height,s=r.rootEl,l=r.transformModel;if(i.length){var u=o||s.clientWidth,c=a||s.clientHeight,d=this.getVirtualRectSize(),f=d.width,h=d.height,v=d.x,g=d.y,m=(f+n)/u,y=(h+e)/c,x=1/Math.max(m,y),E=[u/2,c/2];l.zoom(x,E),l.focusOn(v,g,u,c)}},t.prototype.openEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(e){this.partial=e},t.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},_e([X],t.prototype,"width",void 0),_e([X],t.prototype,"height",void 0),_e([X],t.prototype,"theme",void 0),_e([X],t.prototype,"grid",void 0),_e([X],t.prototype,"edgeType",void 0),_e([X],t.prototype,"nodes",void 0),_e([X],t.prototype,"edges",void 0),_e([X],t.prototype,"fakeNode",void 0),_e([X],t.prototype,"overlapMode",void 0),_e([X],t.prototype,"background",void 0),_e([X],t.prototype,"gridSize",void 0),_e([X],t.prototype,"transformModel",void 0),_e([X],t.prototype,"editConfigModel",void 0),_e([X],t.prototype,"partial",void 0),_e([Et],t.prototype,"nodesMap",null),_e([Et],t.prototype,"edgesMap",null),_e([Et],t.prototype,"modelsMap",null),_e([Et],t.prototype,"sortElements",null),_e([Et],t.prototype,"textEditElement",null),_e([Et],t.prototype,"selectElements",null),_e([Et],t.prototype,"selectNodes",null),_e([U],t.prototype,"setOverlapMode",null),_e([U],t.prototype,"setTextMode",null),_e([U],t.prototype,"setFakeNode",null),_e([U],t.prototype,"removeFakeNode",null),_e([U],t.prototype,"setModel",null),_e([U],t.prototype,"toFront",null),_e([U],t.prototype,"setElementZIndex",null),_e([U],t.prototype,"deleteNode",null),_e([U],t.prototype,"addNode",null),_e([U],t.prototype,"cloneNode",null),_e([U],t.prototype,"moveNode",null),_e([U],t.prototype,"moveNode2Coordinate",null),_e([U],t.prototype,"editText",null),_e([U],t.prototype,"addEdge",null),_e([U],t.prototype,"moveEdge",null),_e([U],t.prototype,"deleteEdgeBySourceAndTarget",null),_e([U],t.prototype,"deleteEdgeById",null),_e([U],t.prototype,"deleteEdgeBySource",null),_e([U],t.prototype,"deleteEdgeByTarget",null),_e([U],t.prototype,"setElementStateById",null),_e([U],t.prototype,"updateText",null),_e([U],t.prototype,"selectNodeById",null),_e([U],t.prototype,"selectEdgeById",null),_e([U],t.prototype,"selectElementById",null),_e([U],t.prototype,"deselectElementById",null),_e([U],t.prototype,"clearSelectElements",null),_e([U],t.prototype,"moveNodes",null),_e([U],t.prototype,"setDefaultEdgeType",null),_e([U],t.prototype,"changeNodeType",null),_e([U],t.prototype,"changeEdgeType",null),_e([U],t.prototype,"getNodeIncomingEdge",null),_e([U],t.prototype,"getNodeOutgoingEdge",null),_e([U],t.prototype,"getAnchorIncomingEdge",null),_e([U],t.prototype,"getAnchorOutgoingEdge",null),_e([U],t.prototype,"getNodeIncomingNode",null),_e([U],t.prototype,"getNodeOutgoingNode",null),_e([U],t.prototype,"setTheme",null),_e([U],t.prototype,"getTheme",null),_e([U],t.prototype,"resize",null),_e([U],t.prototype,"clearData",null),_e([U],t.prototype,"translateCenter",null),_e([U],t.prototype,"fitView",null),_e([U],t.prototype,"openEdgeAnimation",null),_e([U],t.prototype,"closeEdgeAnimation",null),_e([U],t.prototype,"setPartial",null),t}(),Zi=function(){return Zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zi.apply(this,arguments)},ns=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},r4=function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Zi({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var r=e.x,i=e.y,o=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==e.id&&(Sr(r,l.x,this.epsilon)&&(o=!0),Sr(i,l.y,this.epsilon)&&(a=!0),o&&a))break}return{isShowVertical:o,isShowHorizontal:a,position:{x:r,y:i}}},t.prototype.getHorizontalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minY,a==null?void 0:a.minY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.minY,this.epsilon)){r=!0,i=a.minY;break}if(Sr(d.minY,a==null?void 0:a.maxY,this.epsilon)||Sr(d.maxY,a==null?void 0:a.maxY,this.epsilon)){r=!0,i=a.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Zi(Zi({},this.position),{y:i})}},t.prototype.getVerticalSnapline=function(e,n){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Hn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Hn(l))}}for(var u=0;u<n.length;u++){var c=n[u];if(c.id!==e.id){var d=Hn(c);if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.minX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(Sr(d.minX,a==null?void 0:a.maxX,this.epsilon)||Sr(d.maxX,a==null?void 0:a.maxX,this.epsilon)){r=!0,i=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Zi(Zi({},this.position),{x:i})}},t.prototype.getSnapLinePosition=function(e,n){var r=this.getCenterSnapLine(e,n),i=r.isShowHorizontal,o=r.isShowVertical;if(!i){var a=this.getHorizontalSnapline(e,n);a.isShowHorizontal&&(r.isShowHorizontal=a.isShowHorizontal,r.position.y=a.position.y)}if(!o){var s=this.getVerticalSnapline(e,n);s.isShowVertical&&(r.isShowVertical=s.isShowVertical,r.position.x=s.position.x)}return r},t.prototype.setSnaplineInfo=function(e){var n=e.isShowHorizontal,r=e.isShowVertical,i=e.position;this.position=i,this.isShowHorizontal=n,this.isShowVertical=r},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(e){var n=this.graphModel.nodes,r=this.getSnapLinePosition(e,n);this.setSnaplineInfo(r)},ns([X],t.prototype,"isShowHorizontal",void 0),ns([X],t.prototype,"isShowVertical",void 0),ns([X],t.prototype,"position",void 0),ns([U],t.prototype,"clearSnapline",null),ns([U],t.prototype,"setNodeSnapLine",null),t}();function Sr(t,e,n){return Math.abs(t-e)<=n}var i4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),o4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},a4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},s4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},l4=function(t){i4(e,t);function e(){var n=t.apply(this,s4([],a4(arguments),!1))||this;return n.handleResize=function(){var r=n.props,i=r.graphModel,o=r.options,a=i.width,s=i.height,l=i.isContainerWidth,u=i.isContainerHeight,c=a,d=s,f=!1;l&&(c=void 0,f=!0),u&&(d=void 0,f=!0),f&&i.resize(c,d),o.width=a,o.height=s},n.throttleResize=gm(n.handleResize,200),n}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(be.GRAPH_UPDATED,{data:n})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(n,r,i){i===void 0&&(i="canvas-overlay");var o=this.props.getView,a=o(n.type);return a?V(a,{model:n,graphModel:r,overlay:i},n.id):null},e.prototype.render=function(){var n=this,r=this.props,i=r.graphModel,o=r.tool,a=r.options,s=r.dnd,l=r.snaplineModel,u={};a.width&&(u.width="".concat(i.width,"px")),a.height&&(u.height="".concat(i.height,"px"));var c=i.fakeNode,d=i.editConfigModel,f=i.background,h=d.adjustEdge;return V("div",{className:"lf-graph","flow-id":i.flowId,style:u,children:[V(M3,{graphModel:i,dnd:s,children:[V("g",{className:"lf-base",children:Bn(i.sortElements,function(v){return n.getComponent(v,i)})}),c?this.getComponent(c,i):""]}),V(H3,{graphModel:i,children:[V(U3,{graphModel:i}),h?V(R3,{graphModel:i}):"",a.snapline!==!1?V(G3,{snaplineModel:l}):""]}),V(q3,{graphModel:i,tool:o}),f&&V(k3,{background:f}),V(Vo,{graphModel:i})]})},e=o4([vn],e),e}(Qe),u4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(){return jr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jr.apply(this,arguments)},c4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},d4=function(t){u4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(r){var i=r.event,o=n.props,a=o.anchorData,s=o.nodeModel,l=o.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(be.ANCHOR_DRAGSTART,{data:a,e:i,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(r){var i=r.event,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=a.transformModel,c=a.eventCenter,d=a.width,f=a.height,h=a.editConfigModel,v=h.autoExpand,g=h.stopMoveGraph;if(i){var m=i.clientX,y=i.clientY,x=a.getPointByClient({x:m,y}),E=x.domOverlayPosition,b=E.x,T=E.y,A=x.canvasOverlayPosition,S=A.x,M=A.y;n.t&&Ql(n.t);var C=[],G=10;b<10?C=[G,0]:b+10>d?C=[-10,0]:T<10?C=[0,G]:T+10>f&&(C=[0,-10]),n.setState({endX:S,endY:M,dragging:!0}),n.moveAnchorEnd(S,M),C.length>0&&!g&&v&&(n.t=ob(function(){var K=c4(C,2),J=K[0],R=K[1];u.translate(J,R);var k=n.state,B=k.endX,Z=k.endY;n.setState({endX:B-J,endY:Z-R}),n.moveAnchorEnd(B-J,Z-R)})),c.emit(be.ANCHOR_DRAG,{data:l,e:i,nodeModel:s})}},n.onDragEnd=function(r){var i=r.event;n.t&&Ql(n.t);var o=n.checkEnd(i);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData;s.eventCenter.emit(be.ANCHOR_DRAGEND,{data:u,e:i,nodeModel:l,edgeModel:o??void 0})},n.checkEnd=function(r){var i,o=n.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=l.x,c=l.y,d=l.id,f=n.state,h=f.endX,v=f.endY,g=f.dragging,m=Kl({x:h,y:v},a);if(n.preTargetNode&&n.preTargetNode.state!==lt.DEFAULT&&n.preTargetNode.setElementState(lt.DEFAULT),!!g&&m&&m.node){var y=m.node,x=m.anchor.id,E="".concat(s.id,"_").concat(y.id,"_").concat(x,"_").concat(d),b=n.sourceRuleResults.get(E)||{},T=b.isAllPass,A=b.msg,S=n.targetRuleResults.get(E)||{},M=S.isAllPass,C=S.msg;if(T&&M){y.setElementState(lt.DEFAULT);var G=a.getNodeModelById(m.node.id),K=(i=a.edgeGenerator)===null||i===void 0?void 0:i.call(a,s.getData(),G==null?void 0:G.getData()),J=a.addEdge(jr(jr({},K),{sourceNodeId:s.id,sourceAnchorId:d,startPoint:{x:u,y:c},targetNodeId:m.node.id,targetAnchorId:m.anchor.id,endPoint:{x:m.anchor.x,y:m.anchor.y}})),R=n.props.anchorData;return a.eventCenter.emit(be.ANCHOR_DROP,{data:R,e:r,nodeModel:s,edgeModel:J}),J}var k=y.getData();return a.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:k,msg:C||A||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,r=n.anchorData,i=n.style,o=n.node,a=o.getAnchorShape(r);if(a)return a;var s=r.x,l=r.y,u=jr(jr({},i),i==null?void 0:i.hover);return V("g",{children:[V(zo,jr({className:"lf-node-anchor-hover"},u,{x:s,y:l})),V(zo,jr({className:"lf-node-anchor"},i,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,r=n.graphModel,i=r.getAnchorIncomingEdge,o=r.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:i(a),outgoingEdgeList:o(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,r){var i,o,a=this.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData,c=Kl({x:n,y:r},s);if(c){var d=c.node,f=c.anchor.id;if(this.preTargetNode&&this.preTargetNode!==c.node&&this.preTargetNode.setElementState(lt.DEFAULT),u.id===f)return;this.preTargetNode=d;var h="".concat(l.id,"_").concat(d.id,"_").concat(f,"_").concat(u.id);if(!this.targetRuleResults.has(h)){var v=c.anchor,g=l.isAllowConnectedAsSource(d,u,v),m=d.isAllowConnectedAsTarget(l,u,v);this.sourceRuleResults.set(h,Zl(g)),this.targetRuleResults.set(h,Zl(m))}var y=((i=this.sourceRuleResults.get(h))!==null&&i!==void 0?i:{}).isAllPass,x=((o=this.targetRuleResults.get(h))!==null&&o!==void 0?o:{}).isAllPass;y&&x?d.setElementState(lt.ALLOW_CONNECT):d.setElementState(lt.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==lt.DEFAULT&&this.preTargetNode.setElementState(lt.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,r=n.startX,i=n.startY,o=n.endX,a=n.endY,s=Er(r,i,o,a);return s>10},e.prototype.render=function(){var n=this,r=this.state,i=r.startX,o=r.startY,a=r.endX,s=r.endY,l=this.props,u=l.anchorData,c=l.edgeStyle,d=l.nodeModel,f=l.graphModel,h=u.edgeAddable;return V("g",{className:"lf-anchor",children:[V("g",{onClick:function(v){v.stopPropagation(),f.eventCenter.emit(be.ANCHOR_CLICK,{data:u,e:v,nodeModel:d})},onMouseDown:function(v){f.eventCenter.emit(be.ANCHOR_MOUSEDOWN,{data:u,e:v,nodeModel:d}),h!==!1&&n.dragHandler.handleMouseDown(v)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(jr({sourcePoint:{x:i,y:o},targetPoint:{x:a,y:s}},c)):V(Ho,jr({x1:i,y1:o,x2:a,y2:s},c,{"pointer-events":"none"})))]})},e}(Qe),f4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lf=function(){return Lf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Lf.apply(this,arguments)},p4=function(t){f4(e,t);function e(n){var r=t.call(this,n)||this;return r.style={},r.onDragging=function(i){var o,a=i.event,s=r.props,l=s.graphModel,u=s.nodeModel,c=s.eventCenter,d=l.selectNodes,f=u.x,h=u.y,v=a.clientX,g=a.clientY,m=l.getPointByClient({x:v,y:g}).canvasOverlayPosition,y=m.x,x=m.y,E=new Zt(y-f,x-h),b=((o=r.normal)===null||o===void 0?void 0:o.angle(E))-r.defaultAngle,T=new Gl(-f,-h).rotate(b).translate(f,h).toString();u.transform=T,u.rotate=b;var A=Bn(d,function(M){return M.id});A.indexOf(u.id)===-1&&(A=[u.id]);var S=sm(A,function(M,C){var G=l.getNodeModelById(C);return M[C]=G==null?void 0:G.getMoveDistance(0,0,!1),M},{});A.forEach(function(M){var C=l.getNodeEdges(M);C.forEach(function(G){if(S[G.sourceNodeId]){var K=l.getNodeModelById(G.sourceNodeId),J=K.anchors.find(function(R){return R.id===G.sourceAnchorId});G.updateStartPoint(J)}if(S[G.targetNodeId]){var K=l.getNodeModelById(G.targetNodeId),J=K.anchors.find(function(B){return B.id===G.targetAnchorId});G.updateEndPoint(J)}})}),c.emit(be.NODE_ROTATE,{e:a,model:u,data:u.getData()})},r.style=n.style,r.stepperDrag=new tr({onDragging:r.onDragging}),r}return e.prototype.render=function(){var n=this,r=this.props.nodeModel,i=r.x,o=r.y,a=r.width,s=r.height,l=i+a/2+20,u=o-s/2-20;return this.normal=new Zt(1,0),this.defaultAngle=this.normal.angle(new Zt(l-i,u-o)),r.defaultAngle=this.defaultAngle,V("g",{className:"lf-rotate-control",children:V("g",{onMouseDown:function(c){n.stepperDrag.handleMouseDown(c)},children:V(zo,Lf({},this.style,{cx:l,cy:u}))})})},e}(Qe),If={exports:{}};/*!
67
67
  Copyright (c) 2018 Jed Watson.
68
68
  Licensed under the MIT License (MIT), see
69
69
  http://jedwatson.github.io/classnames
70
- */var xb;function h4(){return xb||(xb=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(o=i(o,r(s)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var s in o)e.call(o,s)&&o[s]&&(a=i(a,s));return a}function i(o,a){return a?o?o+" "+a:o+a:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(If)),If.exports}var g4=h4();const kf=ul(g4);var v4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bf=function(){return Bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bf.apply(this,arguments)},m4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Eb=function(t){v4(e,t);function e(n){var r=t.call(this)||this;r.mouseDownHandler=function(o){var a=r.props,s=a.draggable,l=a.model,u=a.graphModel,c=u.editConfigModel.nodeTextDraggable;(s??c)&&(o.stopPropagation(),r.stepperDrag.model=l,r.stepperDrag.handleMouseDown(o))},r.onDragging=function(o){var a=o.deltaX,s=o.deltaY,l=r.props,u=l.model,c=l.graphModel.transformModel;if(a||s){var d=m4(c.fixDeltaXY(a,s),2),f=d[0],h=d[1];u.moveText(f,h)}},r.dbClickHandler=function(){var o=r.props,a=o.editable,s=o.graphModel.eventCenter,l=o.model;a&&l.setElementState(lt.TEXT_EDIT),s.emit(be.TEXT_DBCLICK,{data:l.text,model:l})};var i=n.draggable;return r.stepperDrag=new tr({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:i}),r}return e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=r.text,s=a.value,l=a.x,u=a.y,c=a.editable,d=a.draggable,f={x:l,y:u,className:"",value:s},h=r.getTextStyle(),v=o.nodeTextDraggable||d;return V(ab,Bf({},f,h,{className:kf({"lf-element-text":c,"lf-text-draggable":!c&&v,"lf-text-disabled":!c&&!v}),model:r}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return V("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(Qe),y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cr=function(){return Cr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Cr.apply(this,arguments)},lu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},_4=function(t){y4(e,t);function e(n){var r=t.call(this,n)||this;return r.setHoverOn=function(){r.setState({isHovered:!0})},r.setHoverOff=function(){r.setState({isHovered:!1})},r.state={isHovered:!1},r}return e.prototype.getBackground=function(){var n=this.state.isHovered,r=this.props.model,i=r.text,o=r.getTextStyle(),a=o.background||{};if(n&&o.hover&&o.hover.background&&(a=Cr(Cr({},a),o.hover.background)),i!=null&&i.value&&(a==null?void 0:a.fill)!=="transparent"){var s=o.fontSize,l=o.textWidth,u=o.lineHeight,c=o.overflowMode,d=a.wrapPadding,f=i==null?void 0:i.value.split(/[\r\n]/g),h=f.length,v=i.x,g=i.y,m={};if(c==="autoWrap"&&l){var y=nb({rows:f,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:u,padding:d},rowsLength:h,className:"lf-get-text-height"});m=Cr(Cr({},a),{x:v,y:g,width:l,height:y})}else{var x=nj({rows:f,rowsLength:h,fontSize:s}),E=x.width,b=x.height;if(c==="ellipsis"&&(E=l,b=s+2),typeof a.wrapPadding=="string"){var T=a.wrapPadding.split(",").filter(function(Be){return Be.trim()}).map(function(Be){return parseFloat(Be.trim())});if(T.length>0&&T.length<=4){if(T.length===1){var A=lu(T,1),S=A[0];T=[S,S,S,S]}else if(T.length===2){var M=lu(T,2),C=M[0],G=M[1];T=[C,G,C,G]}else if(T.length===3){var K=lu(T,3),J=K[0],G=K[1],R=K[2];T=[J,G,R,G]}var k=lu(T,4),B=k[0],Z=k[1],ee=k[2],ce=k[3];E+=Z+ce,b+=B+ee,v=v+(Z-ce)/2,g=g+(ee-B)/2}}m=Cr(Cr({},a),{x:v-1,y:g-1,width:E,height:b})}return V(rr,Cr({},m))}return null},e.prototype.getShape=function(){var n=this.props.model,r=n.text,i=r.x,o=r.y,a=r.value;if(!a)return null;var s=n.getTextStyle(),l=Cr({x:i,y:o,value:a,model:n,className:"lf-element-text"},s);return V("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),V(ab,Cr({},l))]})},e}(Eb),b4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uu=function(){return uu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uu.apply(this,arguments)},x4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},cu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ti=function(t){b4(e,t);function e(n){var r=t.call(this)||this;r.onDragStart=function(l){var u=l.event,c=r.props,d=c.model,f=c.graphModel;if(u){var h=f.getPointByClient({x:u.clientX,y:u.clientY}).canvasOverlayPosition,v=h.x,g=h.y;r.moveOffset={dx:d.x-v,dy:d.y-g}}},r.onDragging=function(l){var u,c,d,f,h=l.event,v=r.props,g=v.model,m=v.graphModel,y=m.editConfigModel,x=y.stopMoveGraph,E=y.autoExpand,b=y.snapGrid,T=m.transformModel,A=m.selectNodes,S=m.width,M=m.height,C=m.gridSize;g.isDragging=!0;var G=h,K=G.clientX,J=G.clientY,R=r.mouseDownPosition,k=R.x,B=R.y;(K-k>C||J-B>C)&&(g.isDragging=!0);var Z=m.getPointByClient({x:K,y:J}).canvasOverlayPosition,ee=Z.x,ce=Z.y,Be=cu(T.CanvasPointToHtmlPoint([ee,ce]),2),me=Be[0],de=Be[1];if(ee=ee+((c=(u=r.moveOffset)===null||u===void 0?void 0:u.dx)!==null&&c!==void 0?c:0),ce=ce+((f=(d=r.moveOffset)===null||d===void 0?void 0:d.dy)!==null&&f!==void 0?f:0),ee=Fo(ee,C,b),ce=Fo(ce,C,b),!S||!M){m.moveNode2Coordinate(g.id,ee,ce);return}var Se=me<0||de<0||me>S||de>M;if(!(E&&!x&&Se)){var je=cu(T.CanvasPointToHtmlPoint([ee-g.width/2,ce-g.height/2]),2),he=je[0],Ve=je[1],$=cu(T.CanvasPointToHtmlPoint([ee+g.width/2,ce+g.height/2]),2),w=$[0],_=$[1],F=Math.max(C,20),L=[];he<0?L=[F,0]:w>m.width?L=[-F,0]:Ve<0?L=[0,F]:_>m.height&&(L=[0,-F]),r.t&&Jl(r.t);var se=A.map(function(fe){return fe.id});se.indexOf(g.id)===-1&&(se=[g.id]),L.length>0&&!x&&E?r.t=ob(function(){var fe=cu(L,2),Ne=fe[0],ze=fe[1];T.translate(Ne??0,ze??0);var rt=-(Ne??0)/T.SCALE_X,Ze=-(ze??0)/T.SCALE_X;m.moveNodes(se,rt,Ze)}):m.moveNodes(se,ee-g.x,ce-g.y)}},r.onDragEnd=function(){r.t&&Jl(r.t);var l=r.props.model;l.isDragging=!1},r.onMouseOut=function(l){PB()&&r.setHoverOff(l)},r.handleMouseUp=function(){var l=r.props.model;r.mouseUpDrag=l.isDragging},r.handleClick=function(l){var u=r.mouseUpDrag===!1,c=new Date().getTime();if(r.startTime){var d=c-r.startTime,f=r.props,h=f.model,v=f.graphModel;if(!(!u&&d>300)){u||(r.onDragEnd(),r.handleMouseUp());var g=h.getData(),m=v.getPointByClient({x:l.clientX,y:l.clientY}),y={data:g,e:l,position:m,isSelected:!1,isMultiple:!1},x=l.button===2,E=l.detail===2;if(!x){var b=v.editConfigModel,T=K_(l,b);if(y.isMultiple=T,h.isSelected&&!E&&T?(y.isSelected=!1,h.setSelected(!1)):(v.selectNodeById(h.id,T),y.isSelected=!0,b.isSilentMode||r.toFront()),E)b.nodeTextEdit&&h.text.editable&&b.textMode===er.TEXT&&(h.setSelected(!1),v.setElementStateById(h.id,lt.TEXT_EDIT)),v.eventCenter.emit(be.NODE_DBCLICK,y);else{v.eventCenter.emit(be.ELEMENT_CLICK,y),v.eventCenter.emit(be.NODE_CLICK,y);var A=l.currentTarget,S=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(M){return setTimeout(M,0)};S(function(){A.focus()})}}}}},r.handleContextMenu=function(l){l.preventDefault();var u=r.props,c=u.model,d=u.graphModel,f=d.editConfigModel,h=c.getData(),v=d.getPointByClient({x:l.clientX,y:l.clientY});d.setElementStateById(c.id,lt.SHOW_MENU,v.domOverlayPosition),c.isSelected||d.selectNodeById(c.id),d.eventCenter.emit(be.NODE_CONTEXTMENU,{data:h,e:l,position:v}),f.isSilentMode||r.toFront()},r.handleMouseDown=function(l){var u=r.props,c=u.model,d=u.graphModel;r.mouseDownPosition={x:l.clientX,y:l.clientY},r.startTime=new Date().getTime();var f=d.editConfigModel;f.adjustNodePosition&&c.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.handleFocus=function(){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_FOCUS,{data:u.getData()})},r.handleBlur=function(){if(r.props){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_BLUR,{data:u.getData()})}},r.setHoverOn=function(l){var u=r.props,c=u.model,d=u.graphModel;if(!c.isHovered){var f=c.getData();c.setHovered(!0),d.eventCenter.emit(be.NODE_MOUSEENTER,{data:f,e:l})}},r.setHoverOff=function(l){var u=r.props,c=u.model,d=u.graphModel,f=c.getData();c.isHovered&&(c.setHovered(!1),d.eventCenter.emit(be.NODE_MOUSELEAVE,{data:f,e:l}))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter,s=n.model;return r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=Ny(function(){return r.props},function(l){l&&l.model&&r.stepDrag.setModel(l.model)}),r}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.isSelected,s=i.isHitable,l=i.isDragging,u=i.isShowAnchor;return s&&(a||u)&&!l?Bn(i.anchors,function(c,d){var f=i.getAnchorLineStyle(c),h=i.getAnchorStyle(c);return V(d4,{anchorData:c,node:n,style:h,edgeStyle:f,anchorIndex:d,nodeModel:i,graphModel:o,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowRotate,l=r.isSelected,u=r.isHitable,c=r.rotatable,d=r.isHovered,f=s&&c,h=r.getRotateControlStyle();if(!a&&u&&(l||d)&&f)return V(p4,{graphModel:i,nodeModel:r,eventCenter:i.eventCenter,style:h})},e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowResize,l=r.isSelected,u=r.isHitable,c=r.resizable,d=r.isHovered,f=s&&c,h=r.getResizeControlStyle();return!a&&u&&(l||d)&&f?V(Dj,{style:h,model:r,graphModel:i}):null},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.nodeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.nodeTextDraggable&&i.text.draggable&&(s=!0),V(Eb,{editable:a.nodeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,r=n.state,i=n.isDragging,o=n.isSelected,a="lf-node";switch(r){case lt.ALLOW_CONNECT:a+=" lf-node-allow";break;case lt.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return i&&(a+=" lf-dragging"),o&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,r=n.model,i=n.graphModel;r.autoToFront&&i.toFront(r.id)},e.prototype.render=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.hideAnchors,s=o.adjustNodePosition,l=o.allowRotate,u=o.allowResize,c=i.gridSize,d=i.transformModel.SCALE_X,f=r.isHitable,h=r.draggable,v=r.transform,g=r.getOuterGAttributes(),m=g.className,y=m===void 0?"":m,x=x4(g,["className"]),E=V("g",{className:"lf-node-content",children:[V("g",{transform:v,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),u&&this.getResizeControl()]}),!a&&this.getAnchors()]}),b;return f?(s&&h&&this.stepDrag.setStep(c*d),b=V("g",uu({className:"".concat(this.getStateClassName()," ").concat(y),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},x,{children:E}))):b=V("g",uu({className:"".concat(this.getStateClassName()," ").concat(y)},x,{children:E})),b},e.isObserved=!1,e}(Qe),E4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jf=function(){return jf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jf.apply(this,arguments)},Ji=function(t){E4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(rr,jf({},r,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},e}(Ti),w4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(){return Ff=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ff.apply(this,arguments)},du=function(t){w4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.r,a=n.getNodeStyle();return V(zo,Ff({},a,{x:r,y:i,r:o}))},e}(Ti),S4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fu=function(){return fu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fu.apply(this,arguments)},pu=function(t){S4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle(),c={transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")};return V("g",fu({},c,{children:V(wf,fu({},u,{points:l,x:i,y:o}))}))},e}(Ti),C4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$f=function(){return $f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$f.apply(this,arguments)},Hf=function(t){C4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V("g",{children:V(wf,$f({},r,{points:n.points,x:n.x,y:n.y}))})},e}(Ti),A4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zf=function(){return zf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zf.apply(this,arguments)},Wf=function(t){A4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(wj,zf({},r,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},e}(Ti),O4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rs=function(){return rs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},rs.apply(this,arguments)},wb=function(t){O4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBackground=function(){var n=this.props.model,r=n.getTextStyle(),i=n.width,o=n.height,a=n.x,s=n.y,l=rs(rs({},r.background),{x:a,y:s,width:i,height:o});return V(rr,rs({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return V("g",{children:this.getBackground()})},e}(Ti),T4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uf=function(){return Uf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uf.apply(this,arguments)},N4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},M4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Vf=function(t){T4(e,t);function e(){var n=t.apply(this,M4([],N4(arguments),!1))||this;return n.ref=pl(),n}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(n){this.setHtml(n)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),V("foreignObject",Uf({},s,{x:r-a/2,y:i-o/2,width:a,height:o,ref:this.ref}))},e}(Ti),D4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ar=function(){return Ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ar.apply(this,arguments)},P4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},R4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Fr;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Fr||(Fr={}));var Sb=function(t){D4(e,t);function e(n){var r=t.call(this)||this;r.handleMouseDown=function(l){r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.onDragStart=function(){var l=r.props,u=l.x,c=l.y,d=l.edgeModel,f=d.startPoint,h=d.endPoint,v=d.pointsList;r.oldEdge={startPoint:f,endPoint:h,pointsList:v},r.setState({endX:u,endY:c,dragging:!0})},r.onDragging=function(l){var u=l.deltaX,c=l.deltaY,d=r.state,f=d.endX,h=d.endY,v=r.props,g=v.graphModel,m=v.type,y=g.transformModel,x=g.editConfigModel,E=R4(y.moveCanvasPointByHtml([f,h],u,c),2),b=E[0],T=E[1];r.setState({endX:b,endY:T,dragging:!0});var A=r.props.edgeModel,S=Yl({x:f,y:h},g);if(S&&S.node&&r.isAllowAdjust(S).pass){var M=A.startPoint,C=A.endPoint,G=A.sourceNode,K=A.targetNode,J=m===Fr.SOURCE?{startPoint:{x:S.anchor.x,y:S.anchor.y},endPoint:{x:C.x,y:C.y},sourceNode:S.node,targetNode:K}:{startPoint:{x:M.x,y:M.y},endPoint:{x:S.anchor.x,y:S.anchor.y},sourceNode:G,targetNode:S.node};A.updateAfterAdjustStartAndEnd(J)}else m===Fr.SOURCE?A.updateStartPoint({x:b,y:T}):A.updateEndPoint({x:b,y:T});A.text.value&&x.adjustEdge&&A.setText(Object.assign({},A.text,A.textPosition))},r.onDragEnd=function(l){var u,c,d,f=l.event;try{r.setState({dragging:!1});var h=r.props,v=h.graphModel,g=h.edgeModel,m=h.type,y=r.state,x=y.endX,E=y.endY,b=y.dragging,T=Yl({x,y:E},v);if(!b)return;var A=!1,S=void 0;if(T&&T.node){var M=r.isAllowAdjust(T),C=M.pass,G=M.msg,K=M.newTargetNode;if(C){var J=g.getData(),R=J.text,k=J.sourceAnchorId,B=k===void 0?"":k,Z=J.targetAnchorId,ee=Z===void 0?"":Z,ce=P4(J,["text","sourceAnchorId","targetAnchorId"]);if(S=Ar(Ar({sourceAnchorId:B,targetAnchorId:ee},ce),{text:(R==null?void 0:R.value)||""}),m===Fr.SOURCE){var Be=v.getNodeModelById(T.node.id),me=v.getNodeModelById(g.targetNodeId),de=(u=v.edgeGenerator)===null||u===void 0?void 0:u.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:T.node.id,sourceAnchorId:T.anchor.id,startPoint:{x:T.anchor.x,y:T.anchor.y},targetNodeId:g.targetNodeId,endPoint:Ar({},g.endPoint)}),g.sourceNodeId===T.node.id&&g.sourceAnchorId===T.anchor.id&&(A=!0)}else if(m===Fr.TARGET){var Be=v.getNodeModelById(g.sourceNodeId),me=v.getNodeModelById(T.node.id),de=(c=v.edgeGenerator)===null||c===void 0?void 0:c.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:g.sourceNodeId,startPoint:Ar({},g.startPoint),targetNodeId:T.node.id,targetAnchorId:T.anchor.id,endPoint:{x:T.anchor.x,y:T.anchor.y}}),g.targetNodeId===T.node.id&&g.targetAnchorId===T.anchor.id&&(A=!0)}}else{A=!0;var Se=K.getData();v.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:Se,msg:G})}}else A=!0;if(A)r.recoveryEdge();else{var je=g.getData();v.deleteEdgeById(g.id);var he=v.addEdge(Ar({},S));v.eventCenter.emit(be.EDGE_EXCHANGE_NODE,{data:{newEdge:he.getData(),oldEdge:je}})}(d=r.preTargetNode)===null||d===void 0||d.setElementState(lt.DEFAULT)}finally{var v=r.props.graphModel;v.eventCenter.emit(be.ADJUST_POINT_DRAGEND,{e:f,data:r.stepDragData})}},r.recoveryEdge=function(){var l=r.props.edgeModel,u=r.oldEdge,c=u.startPoint,d=u.endPoint,f=u.pointsList;l.updateStartPoint(c),l.updateEndPoint(d),l.modelType!==Ye.LINE_EDGE&&(l.pointsList=f??[],l.initPoints())},r.getAdjustPointStyle=function(){var l=r.props.graphModel.theme,u=l.edgeAdjust;return u},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var i=n.type,o=n.edgeModel,a=n.graphModel,s=a.eventCenter;return r.stepDragData={type:i,edgeData:o.getData()},r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:r.stepDragData}),r}return e.prototype.isAllowAdjust=function(n){var r=this.props,i=r.edgeModel,o=i.id,a=i.sourceNode,s=i.targetNode,l=i.sourceAnchorId,u=i.targetAnchorId,c=r.type,d,f,h,v;if(c===Fr.SOURCE?(d=n.node,f=s,h=n.anchor,v=s.getAnchorInfo(u)):(d=a,f=n.node,v=n.anchor,h=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(lt.DEFAULT),this.preTargetNode=n.node,v.id===h.id)return{pass:!1,msg:"",newTargetNode:f};var g="".concat(d.id,"_").concat(f.id,"_").concat(h.id,"_").concat(v.id);if(!this.targetRuleResults.has(g)){var m=d.isAllowConnectedAsSource(f,h,v,o),y=f.isAllowConnectedAsTarget(d,h,v,o);this.sourceRuleResults.set(g,ql(m)),this.targetRuleResults.set(g,ql(y))}var x=this.sourceRuleResults.get(g),E=x.isAllPass,b=x.msg,T=this.targetRuleResults.get(g),A=T.isAllPass,S=T.msg,M=E&&A?lt.ALLOW_CONNECT:lt.NOT_ALLOW_CONNECT;return c===Fr.SOURCE?d.setElementState(M):f.setElementState(M),{pass:E&&A,msg:S||b,newTargetNode:f}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return V("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":o(r,i,a)})},e}(Qe),L4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xf=function(){return Xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xf.apply(this,arguments)};(function(t){L4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var n=this.props,r=n.arrowInfo,i=n.style,o=r.start,a=r.end,s={start:o,end:a,offset:i.offset,verticalLength:i.verticalLength,type:"end"},l=Ra(s),u=l.leftX,c=l.leftY,d=l.rightX,f=l.rightY;return Xf({d:"M".concat(u," ").concat(c," L").concat(a.x," ").concat(a.y," L").concat(d," ").concat(f," z")},i)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),r=n.d,i=n.strokeWidth,o=n.stroke,a=n.fill;return V(Fa,{d:r,fill:a,strokeWidth:i,stroke:o})},e.prototype.render=function(){return V("g",{className:"lf-arrow",children:this.getShape()})},e})(Qe);var I4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},is.apply(this,arguments)},k4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},hu=function(t){I4(e,t);function e(){var n=t.call(this)||this;return n.textRef=pl(),n.handleHover=function(r,i){var o=n.props,a=o.model,s=o.graphModel.eventCenter;a.setHovered(r);var l=r?be.EDGE_MOUSEENTER:be.EDGE_MOUSELEAVE,u=a.getData();s.emit(l,{data:u,e:i})},n.setHoverOn=function(r){var i=n.props.model.isHovered;i||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,r))},n.setHoverOff=function(r){var i=n.props.model.isHovered;i&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,r))},n.handleContextMenu=function(r){r.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var i=n.props,o=i.model,a=i.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:r.clientX,y:r.clientY});a.setElementStateById(o.id,lt.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),o.isSelected||a.selectEdgeById(o.id);var u=o==null?void 0:o.getData();a.eventCenter.emit(be.EDGE_CONTEXTMENU,{data:u,e:r,position:l})},n.handleMouseDown=function(r){r.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var r=n.props.model;n.mouseUpDrag=r.isDragging},n.handleClick=function(r){if(n.startTime&&!n.mouseUpDrag){var i=r.button===2;if(!i){var o=r.detail===2,a=n.props,s=a.model,l=a.graphModel,u=s==null?void 0:s.getData(),c=l.getPointByClient({x:r.clientX,y:r.clientY});if(o){var d=l.editConfigModel,f=l.textEditElement,h=s.id,v=s.text,g=s.modelType;if(f&&f.id===h&&l.setElementStateById(h,lt.DEFAULT),d.edgeTextEdit&&v.editable&&(s.setSelected(!1),l.setElementStateById(h,lt.TEXT_EDIT)),g===Ye.POLYLINE_EDGE){var m=s,y=l.getPointByClient({x:r.x,y:r.y}).canvasOverlayPosition,x=y.x,E=y.y;m.dbClickPosition=G_({x,y:E},m.points)}l.eventCenter.emit(be.EDGE_DBCLICK,{data:u,e:r,position:c})}else{l.eventCenter.emit(be.ELEMENT_CLICK,{data:u,e:r,position:c}),l.eventCenter.emit(be.EDGE_CLICK,{data:u,e:r,position:c});var b=r.currentTarget,T=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(S){return setTimeout(S,0)};T(function(){b.focus()})}var A=l.editConfigModel;l.selectEdgeById(s.id,K_(r,A)),A.isSilentMode||n.toFront()}}},n.handleFocus=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_FOCUS,{data:i.getData()})},n.handleBlur=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_BLUR,{data:i.getData()})},n}return e.prototype.getShape=function(){return V("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.edgeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.edgeTextDraggable&&i.text.draggable&&(s=!0),V(_4,{ref:this.textRef,editable:a.edgeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isSelected,a=this.state.hover;return{start:r,end:i,hover:a,isSelected:o}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint;return[r,i]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,r=n.id,i=n.getArrowStyle(),o=i.refY,a=o===void 0?0:o,s=i.refX,l=s===void 0?2:s,u=k4(this.getLastTwoPoints(),2),c=u[0],d=u[1],f="auto";if(c&&d){var h=d.x-c.x,v=d.y-c.y;if(h!==0||v!==0){var g=Gj(Xj({x:h,y:v}));Number.isFinite(g)&&!Number.isNaN(g)&&(f=g)}}return V("g",{children:V("defs",{children:[V("marker",{id:"marker-start-".concat(r),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),V("marker",{id:"marker-end-".concat(r),refX:l,refY:a,overflow:"visible",orient:f,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,r){var i=r.stroke,o=r.fill,a=o===void 0?i:o,s=r.strokeWidth,l=r.offset,u=l===void 0?10:l,c=r.verticalLength,d=r.strokeLinecap,f=r.strokeLinejoin,h=r.transform,v="";switch(n){case"solid":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(3*u/4,",-").concat(c," Z");break;case"hollow":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(-u/4,",0 L").concat(3*u/4,",-").concat(c," L").concat(-u/4,",0 Z");break;case"diamond":v="M".concat(-u/2,",0 L0,").concat(c," L").concat(u/2,",0 L0,-").concat(c," L").concat(-u/2,",0 Z");break;case"circle":v="M".concat(-u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(-u/2,",0 Z");break;default:v="";break}return V("path",{d:v,stroke:i,fill:a,strokeWidth:s,strokeLinecap:d,strokeLinejoin:f,transform:h})},e.prototype.getStartArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.startArrowType,u=l===void 0?"none":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d})},e.prototype.getEndArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.endArrowType,u=l===void 0?"solid":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,r,i){var o=i.getAdjustPointStyle();return V(zo,is({className:"lf-edge-adjust-point"},o,{x:n,y:r}))},e.prototype.getAdjustPoints=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.adjustEdgeStartAndEnd,s=o.adjustEdgeStart,l=o.adjustEdgeEnd,u=r.getAdjustStart(),c=r.getAdjustEnd();return V("g",{children:[a&&s&&V(Sb,is({type:Fr.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i})),a&&l&&V(Sb,is({type:Fr.TARGET},c,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return V("g",{})},e.prototype.getAppend=function(){return V("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,r=n.graphModel,i=n.model;r.toFront(i.id)},e.prototype.render=function(){var n=this.props.model,r=n.isSelected,i=n.isHitable,o=n.isShowAdjustPoint;return V("g",{children:[V("g",{className:["lf-edge",!i&&"pointer-none",r&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),o&&r?this.getAdjustPoints():""]})},e.isObserved=!1,e}(Qe),B4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gf=function(){return Gf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gf.apply(this,arguments)},j4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Cb=function(t){B4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.getEdgeStyle(),i=n,o=i.path,a=i.isAnimation,s=i.arrowConfig,l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Fa,Gf({d:o},r,s,a?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return V(Fa,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,r=this.state.hover,i=n.isSelected,o=n.getArrowStyle().offset,a=n.pointsList.map(function(d){return{x:d.x,y:d.y}}),s=j4(X_(a,o),2),l=s[0],u=s[1],c={start:l,end:u,hover:r,isSelected:i};return c},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.getArrowStyle().offset,i=n.pointsList.map(function(o){return{x:o.x,y:o.y}});return X_(i,r)},e}(hu),F4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yf=function(){return Yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yf.apply(this,arguments)},Ab=function(t){F4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Ho,Yf({},s,{x1:r.x,y1:r.y,x2:i.x,y2:i.y},a,o?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o={start:r,end:i},a=QB(o),s=a.d,l=a.strokeWidth,u=a.fill,c=a.strokeDasharray,d=a.stroke;return V(Fa,{d:s,fill:u,strokeWidth:l,stroke:d,strokeDasharray:c})},e}(hu),$4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qi=function(){return Qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qi.apply(this,arguments)},H4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},os=function(t){$4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var r=n.props.model;r.dragAppendStart(),n.isShowAdjustPointTemp=r.isShowAdjustPoint,r.isShowAdjustPoint=!1},n.onDragging=function(r){var i=r.deltaX,o=r.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var u=l.transformModel,c=l.editConfigModel,d=H4(u.fixDeltaXY(i,o),2),f=d[0],h=d[1],v=s,g=c.adjustEdgeMiddle;g?n.appendInfo=v.dragAppendSimple(n.appendInfo,{x:f,y:h}):n.appendInfo=v.dragAppend(n.appendInfo,{x:f,y:h})},n.onDragEnd=function(){var r,i=n.props,o=i.model,a=i.graphModel.eventCenter,s=o;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(r=n.isShowAdjustPointTemp)!==null&&r!==void 0?r:!1,n.appendInfo=void 0,a.emit(be.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(r,i){i.draggable&&n.drag.handleMouseDown(r),n.appendInfo=i},n.drag=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,u=s.stroke,c=s.strokeDashoffset,d=s.animationName,f=s.animationDuration,h=s.animationIterationCount,v=s.animationTimingFunction,g=s.animationDirection;return V(Oj,Qi({points:r},a,o,i?{strokeDasharray:l,stroke:u,style:{strokeDashoffset:c,animationName:d,animationDuration:f,animationIterationCount:h,animationTimingFunction:v,animationDirection:g}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.points,i=n.isSelected,o=this.state.hover,a=Ki(r),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:o,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.points,i=Ki(r),o=i[0],a=i[0];return i.length>=2&&(o=i[i.length-2],a=i[i.length-1]),[o,a]},e.prototype.getAppendAttributes=function(n){var r=n.start,i=n.end,o;if(r.x===i.x&&r.y===i.y)o="";else{var a={start:r,end:i,offset:10,verticalLength:5},s=Ra(Qi(Qi({},a),{type:"start"})),l=Ra(Qi(Qi({},a),{type:"end"}));o="M".concat(s.leftX," ").concat(s.leftY,`
70
+ */var xb;function h4(){return xb||(xb=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(o=i(o,r(s)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var s in o)e.call(o,s)&&o[s]&&(a=i(a,s));return a}function i(o,a){return a?o?o+" "+a:o+a:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(If)),If.exports}var g4=h4();const kf=cl(g4);var v4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bf=function(){return Bf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bf.apply(this,arguments)},m4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Eb=function(t){v4(e,t);function e(n){var r=t.call(this)||this;r.mouseDownHandler=function(o){var a=r.props,s=a.draggable,l=a.model,u=a.graphModel,c=u.editConfigModel.nodeTextDraggable;(s??c)&&(o.stopPropagation(),r.stepperDrag.model=l,r.stepperDrag.handleMouseDown(o))},r.onDragging=function(o){var a=o.deltaX,s=o.deltaY,l=r.props,u=l.model,c=l.graphModel.transformModel;if(a||s){var d=m4(c.fixDeltaXY(a,s),2),f=d[0],h=d[1];u.moveText(f,h)}},r.dbClickHandler=function(){var o=r.props,a=o.editable,s=o.graphModel.eventCenter,l=o.model;a&&l.setElementState(lt.TEXT_EDIT),s.emit(be.TEXT_DBCLICK,{data:l.text,model:l})};var i=n.draggable;return r.stepperDrag=new tr({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:i}),r}return e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=r.text,s=a.value,l=a.x,u=a.y,c=a.editable,d=a.draggable,f={x:l,y:u,className:"",value:s},h=r.getTextStyle(),v=o.nodeTextDraggable||d;return V(ab,Bf({},f,h,{className:kf({"lf-element-text":c,"lf-text-draggable":!c&&v,"lf-text-disabled":!c&&!v}),model:r}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return V("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(Qe),y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cr=function(){return Cr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Cr.apply(this,arguments)},uu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},_4=function(t){y4(e,t);function e(n){var r=t.call(this,n)||this;return r.setHoverOn=function(){r.setState({isHovered:!0})},r.setHoverOff=function(){r.setState({isHovered:!1})},r.state={isHovered:!1},r}return e.prototype.getBackground=function(){var n=this.state.isHovered,r=this.props.model,i=r.text,o=r.getTextStyle(),a=o.background||{};if(n&&o.hover&&o.hover.background&&(a=Cr(Cr({},a),o.hover.background)),i!=null&&i.value&&(a==null?void 0:a.fill)!=="transparent"){var s=o.fontSize,l=o.textWidth,u=o.lineHeight,c=o.overflowMode,d=a.wrapPadding,f=i==null?void 0:i.value.split(/[\r\n]/g),h=f.length,v=i.x,g=i.y,m={};if(c==="autoWrap"&&l){var y=nb({rows:f,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:u,padding:d},rowsLength:h,className:"lf-get-text-height"});m=Cr(Cr({},a),{x:v,y:g,width:l,height:y})}else{var x=nj({rows:f,rowsLength:h,fontSize:s}),E=x.width,b=x.height;if(c==="ellipsis"&&(E=l,b=s+2),typeof a.wrapPadding=="string"){var T=a.wrapPadding.split(",").filter(function(Be){return Be.trim()}).map(function(Be){return parseFloat(Be.trim())});if(T.length>0&&T.length<=4){if(T.length===1){var A=uu(T,1),S=A[0];T=[S,S,S,S]}else if(T.length===2){var M=uu(T,2),C=M[0],G=M[1];T=[C,G,C,G]}else if(T.length===3){var K=uu(T,3),J=K[0],G=K[1],R=K[2];T=[J,G,R,G]}var k=uu(T,4),B=k[0],Z=k[1],ee=k[2],ce=k[3];E+=Z+ce,b+=B+ee,v=v+(Z-ce)/2,g=g+(ee-B)/2}}m=Cr(Cr({},a),{x:v-1,y:g-1,width:E,height:b})}return V(rr,Cr({},m))}return null},e.prototype.getShape=function(){var n=this.props.model,r=n.text,i=r.x,o=r.y,a=r.value;if(!a)return null;var s=n.getTextStyle(),l=Cr({x:i,y:o,value:a,model:n,className:"lf-element-text"},s);return V("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),V(ab,Cr({},l))]})},e}(Eb),b4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cu=function(){return cu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},cu.apply(this,arguments)},x4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},du=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ti=function(t){b4(e,t);function e(n){var r=t.call(this)||this;r.onDragStart=function(l){var u=l.event,c=r.props,d=c.model,f=c.graphModel;if(u){var h=f.getPointByClient({x:u.clientX,y:u.clientY}).canvasOverlayPosition,v=h.x,g=h.y;r.moveOffset={dx:d.x-v,dy:d.y-g}}},r.onDragging=function(l){var u,c,d,f,h=l.event,v=r.props,g=v.model,m=v.graphModel,y=m.editConfigModel,x=y.stopMoveGraph,E=y.autoExpand,b=y.snapGrid,T=m.transformModel,A=m.selectNodes,S=m.width,M=m.height,C=m.gridSize;g.isDragging=!0;var G=h,K=G.clientX,J=G.clientY,R=r.mouseDownPosition,k=R.x,B=R.y;(K-k>C||J-B>C)&&(g.isDragging=!0);var Z=m.getPointByClient({x:K,y:J}).canvasOverlayPosition,ee=Z.x,ce=Z.y,Be=du(T.CanvasPointToHtmlPoint([ee,ce]),2),me=Be[0],de=Be[1];if(ee=ee+((c=(u=r.moveOffset)===null||u===void 0?void 0:u.dx)!==null&&c!==void 0?c:0),ce=ce+((f=(d=r.moveOffset)===null||d===void 0?void 0:d.dy)!==null&&f!==void 0?f:0),ee=Fo(ee,C,b),ce=Fo(ce,C,b),!S||!M){m.moveNode2Coordinate(g.id,ee,ce);return}var Se=me<0||de<0||me>S||de>M;if(!(E&&!x&&Se)){var je=du(T.CanvasPointToHtmlPoint([ee-g.width/2,ce-g.height/2]),2),he=je[0],Ve=je[1],$=du(T.CanvasPointToHtmlPoint([ee+g.width/2,ce+g.height/2]),2),w=$[0],_=$[1],F=Math.max(C,20),L=[];he<0?L=[F,0]:w>m.width?L=[-F,0]:Ve<0?L=[0,F]:_>m.height&&(L=[0,-F]),r.t&&Ql(r.t);var se=A.map(function(fe){return fe.id});se.indexOf(g.id)===-1&&(se=[g.id]),L.length>0&&!x&&E?r.t=ob(function(){var fe=du(L,2),Ne=fe[0],ze=fe[1];T.translate(Ne??0,ze??0);var rt=-(Ne??0)/T.SCALE_X,Ze=-(ze??0)/T.SCALE_X;m.moveNodes(se,rt,Ze)}):m.moveNodes(se,ee-g.x,ce-g.y)}},r.onDragEnd=function(){r.t&&Ql(r.t);var l=r.props.model;l.isDragging=!1},r.onMouseOut=function(l){PB()&&r.setHoverOff(l)},r.handleMouseUp=function(){var l=r.props.model;r.mouseUpDrag=l.isDragging},r.handleClick=function(l){var u=r.mouseUpDrag===!1,c=new Date().getTime();if(r.startTime){var d=c-r.startTime,f=r.props,h=f.model,v=f.graphModel;if(!(!u&&d>300)){u||(r.onDragEnd(),r.handleMouseUp());var g=h.getData(),m=v.getPointByClient({x:l.clientX,y:l.clientY}),y={data:g,e:l,position:m,isSelected:!1,isMultiple:!1},x=l.button===2,E=l.detail===2;if(!x){var b=v.editConfigModel,T=K_(l,b);if(y.isMultiple=T,h.isSelected&&!E&&T?(y.isSelected=!1,h.setSelected(!1)):(v.selectNodeById(h.id,T),y.isSelected=!0,b.isSilentMode||r.toFront()),E)b.nodeTextEdit&&h.text.editable&&b.textMode===er.TEXT&&(h.setSelected(!1),v.setElementStateById(h.id,lt.TEXT_EDIT)),v.eventCenter.emit(be.NODE_DBCLICK,y);else{v.eventCenter.emit(be.ELEMENT_CLICK,y),v.eventCenter.emit(be.NODE_CLICK,y);var A=l.currentTarget,S=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(M){return setTimeout(M,0)};S(function(){A.focus()})}}}}},r.handleContextMenu=function(l){l.preventDefault();var u=r.props,c=u.model,d=u.graphModel,f=d.editConfigModel,h=c.getData(),v=d.getPointByClient({x:l.clientX,y:l.clientY});d.setElementStateById(c.id,lt.SHOW_MENU,v.domOverlayPosition),c.isSelected||d.selectNodeById(c.id),d.eventCenter.emit(be.NODE_CONTEXTMENU,{data:h,e:l,position:v}),f.isSilentMode||r.toFront()},r.handleMouseDown=function(l){var u=r.props,c=u.model,d=u.graphModel;r.mouseDownPosition={x:l.clientX,y:l.clientY},r.startTime=new Date().getTime();var f=d.editConfigModel;f.adjustNodePosition&&c.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.handleFocus=function(){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_FOCUS,{data:u.getData()})},r.handleBlur=function(){if(r.props){var l=r.props,u=l.model,c=l.graphModel;c.eventCenter.emit(be.NODE_BLUR,{data:u.getData()})}},r.setHoverOn=function(l){var u=r.props,c=u.model,d=u.graphModel;if(!c.isHovered){var f=c.getData();c.setHovered(!0),d.eventCenter.emit(be.NODE_MOUSEENTER,{data:f,e:l})}},r.setHoverOff=function(l){var u=r.props,c=u.model,d=u.graphModel,f=c.getData();c.isHovered&&(c.setHovered(!1),d.eventCenter.emit(be.NODE_MOUSELEAVE,{data:f,e:l}))};var i=n.graphModel,o=i.gridSize,a=i.eventCenter,s=n.model;return r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=Ny(function(){return r.props},function(l){l&&l.model&&r.stepDrag.setModel(l.model)}),r}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.isSelected,s=i.isHitable,l=i.isDragging,u=i.isShowAnchor;return s&&(a||u)&&!l?Bn(i.anchors,function(c,d){var f=i.getAnchorLineStyle(c),h=i.getAnchorStyle(c);return V(d4,{anchorData:c,node:n,style:h,edgeStyle:f,anchorIndex:d,nodeModel:i,graphModel:o,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowRotate,l=r.isSelected,u=r.isHitable,c=r.rotatable,d=r.isHovered,f=s&&c,h=r.getRotateControlStyle();if(!a&&u&&(l||d)&&f)return V(p4,{graphModel:i,nodeModel:r,eventCenter:i.eventCenter,style:h})},e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowResize,l=r.isSelected,u=r.isHitable,c=r.resizable,d=r.isHovered,f=s&&c,h=r.getResizeControlStyle();return!a&&u&&(l||d)&&f?V(Dj,{style:h,model:r,graphModel:i}):null},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.nodeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.nodeTextDraggable&&i.text.draggable&&(s=!0),V(Eb,{editable:a.nodeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,r=n.state,i=n.isDragging,o=n.isSelected,a="lf-node";switch(r){case lt.ALLOW_CONNECT:a+=" lf-node-allow";break;case lt.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return i&&(a+=" lf-dragging"),o&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,r=n.model,i=n.graphModel;r.autoToFront&&i.toFront(r.id)},e.prototype.render=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.hideAnchors,s=o.adjustNodePosition,l=o.allowRotate,u=o.allowResize,c=i.gridSize,d=i.transformModel.SCALE_X,f=r.isHitable,h=r.draggable,v=r.transform,g=r.getOuterGAttributes(),m=g.className,y=m===void 0?"":m,x=x4(g,["className"]),E=V("g",{className:"lf-node-content",children:[V("g",{transform:v,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),u&&this.getResizeControl()]}),!a&&this.getAnchors()]}),b;return f?(s&&h&&this.stepDrag.setStep(c*d),b=V("g",cu({className:"".concat(this.getStateClassName()," ").concat(y),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},x,{children:E}))):b=V("g",cu({className:"".concat(this.getStateClassName()," ").concat(y)},x,{children:E})),b},e.isObserved=!1,e}(Qe),E4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jf=function(){return jf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},jf.apply(this,arguments)},Ji=function(t){E4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(rr,jf({},r,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},e}(Ti),w4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ff=function(){return Ff=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ff.apply(this,arguments)},fu=function(t){w4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.r,a=n.getNodeStyle();return V(zo,Ff({},a,{x:r,y:i,r:o}))},e}(Ti),S4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pu=function(){return pu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},pu.apply(this,arguments)},hu=function(t){S4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle(),c={transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")};return V("g",pu({},c,{children:V(wf,pu({},u,{points:l,x:i,y:o}))}))},e}(Ti),C4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$f=function(){return $f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$f.apply(this,arguments)},Hf=function(t){C4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V("g",{children:V(wf,$f({},r,{points:n.points,x:n.x,y:n.y}))})},e}(Ti),A4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zf=function(){return zf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},zf.apply(this,arguments)},Wf=function(t){A4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle();return V(wj,zf({},r,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},e}(Ti),O4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rs=function(){return rs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},rs.apply(this,arguments)},wb=function(t){O4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBackground=function(){var n=this.props.model,r=n.getTextStyle(),i=n.width,o=n.height,a=n.x,s=n.y,l=rs(rs({},r.background),{x:a,y:s,width:i,height:o});return V(rr,rs({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return V("g",{children:this.getBackground()})},e}(Ti),T4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uf=function(){return Uf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Uf.apply(this,arguments)},N4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},M4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Vf=function(t){T4(e,t);function e(){var n=t.apply(this,M4([],N4(arguments),!1))||this;return n.ref=hl(),n}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(n){this.setHtml(n)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),V("foreignObject",Uf({},s,{x:r-a/2,y:i-o/2,width:a,height:o,ref:this.ref}))},e}(Ti),D4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ar=function(){return Ar=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ar.apply(this,arguments)},P4=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},R4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Fr;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Fr||(Fr={}));var Sb=function(t){D4(e,t);function e(n){var r=t.call(this)||this;r.handleMouseDown=function(l){r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.onDragStart=function(){var l=r.props,u=l.x,c=l.y,d=l.edgeModel,f=d.startPoint,h=d.endPoint,v=d.pointsList;r.oldEdge={startPoint:f,endPoint:h,pointsList:v},r.setState({endX:u,endY:c,dragging:!0})},r.onDragging=function(l){var u=l.deltaX,c=l.deltaY,d=r.state,f=d.endX,h=d.endY,v=r.props,g=v.graphModel,m=v.type,y=g.transformModel,x=g.editConfigModel,E=R4(y.moveCanvasPointByHtml([f,h],u,c),2),b=E[0],T=E[1];r.setState({endX:b,endY:T,dragging:!0});var A=r.props.edgeModel,S=Kl({x:f,y:h},g);if(S&&S.node&&r.isAllowAdjust(S).pass){var M=A.startPoint,C=A.endPoint,G=A.sourceNode,K=A.targetNode,J=m===Fr.SOURCE?{startPoint:{x:S.anchor.x,y:S.anchor.y},endPoint:{x:C.x,y:C.y},sourceNode:S.node,targetNode:K}:{startPoint:{x:M.x,y:M.y},endPoint:{x:S.anchor.x,y:S.anchor.y},sourceNode:G,targetNode:S.node};A.updateAfterAdjustStartAndEnd(J)}else m===Fr.SOURCE?A.updateStartPoint({x:b,y:T}):A.updateEndPoint({x:b,y:T});A.text.value&&x.adjustEdge&&A.setText(Object.assign({},A.text,A.textPosition))},r.onDragEnd=function(l){var u,c,d,f=l.event;try{r.setState({dragging:!1});var h=r.props,v=h.graphModel,g=h.edgeModel,m=h.type,y=r.state,x=y.endX,E=y.endY,b=y.dragging,T=Kl({x,y:E},v);if(!b)return;var A=!1,S=void 0;if(T&&T.node){var M=r.isAllowAdjust(T),C=M.pass,G=M.msg,K=M.newTargetNode;if(C){var J=g.getData(),R=J.text,k=J.sourceAnchorId,B=k===void 0?"":k,Z=J.targetAnchorId,ee=Z===void 0?"":Z,ce=P4(J,["text","sourceAnchorId","targetAnchorId"]);if(S=Ar(Ar({sourceAnchorId:B,targetAnchorId:ee},ce),{text:(R==null?void 0:R.value)||""}),m===Fr.SOURCE){var Be=v.getNodeModelById(T.node.id),me=v.getNodeModelById(g.targetNodeId),de=(u=v.edgeGenerator)===null||u===void 0?void 0:u.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:T.node.id,sourceAnchorId:T.anchor.id,startPoint:{x:T.anchor.x,y:T.anchor.y},targetNodeId:g.targetNodeId,endPoint:Ar({},g.endPoint)}),g.sourceNodeId===T.node.id&&g.sourceAnchorId===T.anchor.id&&(A=!0)}else if(m===Fr.TARGET){var Be=v.getNodeModelById(g.sourceNodeId),me=v.getNodeModelById(T.node.id),de=(c=v.edgeGenerator)===null||c===void 0?void 0:c.call(v,Be==null?void 0:Be.getData(),me==null?void 0:me.getData(),S);S=Ar(Ar({},de),{sourceNodeId:g.sourceNodeId,startPoint:Ar({},g.startPoint),targetNodeId:T.node.id,targetAnchorId:T.anchor.id,endPoint:{x:T.anchor.x,y:T.anchor.y}}),g.targetNodeId===T.node.id&&g.targetAnchorId===T.anchor.id&&(A=!0)}}else{A=!0;var Se=K.getData();v.eventCenter.emit(be.CONNECTION_NOT_ALLOWED,{data:Se,msg:G})}}else A=!0;if(A)r.recoveryEdge();else{var je=g.getData();v.deleteEdgeById(g.id);var he=v.addEdge(Ar({},S));v.eventCenter.emit(be.EDGE_EXCHANGE_NODE,{data:{newEdge:he.getData(),oldEdge:je}})}(d=r.preTargetNode)===null||d===void 0||d.setElementState(lt.DEFAULT)}finally{var v=r.props.graphModel;v.eventCenter.emit(be.ADJUST_POINT_DRAGEND,{e:f,data:r.stepDragData})}},r.recoveryEdge=function(){var l=r.props.edgeModel,u=r.oldEdge,c=u.startPoint,d=u.endPoint,f=u.pointsList;l.updateStartPoint(c),l.updateEndPoint(d),l.modelType!==Ye.LINE_EDGE&&(l.pointsList=f??[],l.initPoints())},r.getAdjustPointStyle=function(){var l=r.props.graphModel.theme,u=l.edgeAdjust;return u},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var i=n.type,o=n.edgeModel,a=n.graphModel,s=a.eventCenter;return r.stepDragData={type:i,edgeData:o.getData()},r.stepDrag=new tr({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:r.stepDragData}),r}return e.prototype.isAllowAdjust=function(n){var r=this.props,i=r.edgeModel,o=i.id,a=i.sourceNode,s=i.targetNode,l=i.sourceAnchorId,u=i.targetAnchorId,c=r.type,d,f,h,v;if(c===Fr.SOURCE?(d=n.node,f=s,h=n.anchor,v=s.getAnchorInfo(u)):(d=a,f=n.node,v=n.anchor,h=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(lt.DEFAULT),this.preTargetNode=n.node,v.id===h.id)return{pass:!1,msg:"",newTargetNode:f};var g="".concat(d.id,"_").concat(f.id,"_").concat(h.id,"_").concat(v.id);if(!this.targetRuleResults.has(g)){var m=d.isAllowConnectedAsSource(f,h,v,o),y=f.isAllowConnectedAsTarget(d,h,v,o);this.sourceRuleResults.set(g,Zl(m)),this.targetRuleResults.set(g,Zl(y))}var x=this.sourceRuleResults.get(g),E=x.isAllPass,b=x.msg,T=this.targetRuleResults.get(g),A=T.isAllPass,S=T.msg,M=E&&A?lt.ALLOW_CONNECT:lt.NOT_ALLOW_CONNECT;return c===Fr.SOURCE?d.setElementState(M):f.setElementState(M),{pass:E&&A,msg:S||b,newTargetNode:f}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return V("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":o(r,i,a)})},e}(Qe),L4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xf=function(){return Xf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xf.apply(this,arguments)};(function(t){L4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var n=this.props,r=n.arrowInfo,i=n.style,o=r.start,a=r.end,s={start:o,end:a,offset:i.offset,verticalLength:i.verticalLength,type:"end"},l=Ra(s),u=l.leftX,c=l.leftY,d=l.rightX,f=l.rightY;return Xf({d:"M".concat(u," ").concat(c," L").concat(a.x," ").concat(a.y," L").concat(d," ").concat(f," z")},i)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),r=n.d,i=n.strokeWidth,o=n.stroke,a=n.fill;return V(Fa,{d:r,fill:a,strokeWidth:i,stroke:o})},e.prototype.render=function(){return V("g",{className:"lf-arrow",children:this.getShape()})},e})(Qe);var I4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),is=function(){return is=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},is.apply(this,arguments)},k4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gu=function(t){I4(e,t);function e(){var n=t.call(this)||this;return n.textRef=hl(),n.handleHover=function(r,i){var o=n.props,a=o.model,s=o.graphModel.eventCenter;a.setHovered(r);var l=r?be.EDGE_MOUSEENTER:be.EDGE_MOUSELEAVE,u=a.getData();s.emit(l,{data:u,e:i})},n.setHoverOn=function(r){var i=n.props.model.isHovered;i||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,r))},n.setHoverOff=function(r){var i=n.props.model.isHovered;i&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,r))},n.handleContextMenu=function(r){r.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var i=n.props,o=i.model,a=i.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:r.clientX,y:r.clientY});a.setElementStateById(o.id,lt.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),o.isSelected||a.selectEdgeById(o.id);var u=o==null?void 0:o.getData();a.eventCenter.emit(be.EDGE_CONTEXTMENU,{data:u,e:r,position:l})},n.handleMouseDown=function(r){r.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var r=n.props.model;n.mouseUpDrag=r.isDragging},n.handleClick=function(r){if(n.startTime&&!n.mouseUpDrag){var i=r.button===2;if(!i){var o=r.detail===2,a=n.props,s=a.model,l=a.graphModel,u=s==null?void 0:s.getData(),c=l.getPointByClient({x:r.clientX,y:r.clientY});if(o){var d=l.editConfigModel,f=l.textEditElement,h=s.id,v=s.text,g=s.modelType;if(f&&f.id===h&&l.setElementStateById(h,lt.DEFAULT),d.edgeTextEdit&&v.editable&&(s.setSelected(!1),l.setElementStateById(h,lt.TEXT_EDIT)),g===Ye.POLYLINE_EDGE){var m=s,y=l.getPointByClient({x:r.x,y:r.y}).canvasOverlayPosition,x=y.x,E=y.y;m.dbClickPosition=G_({x,y:E},m.points)}l.eventCenter.emit(be.EDGE_DBCLICK,{data:u,e:r,position:c})}else{l.eventCenter.emit(be.ELEMENT_CLICK,{data:u,e:r,position:c}),l.eventCenter.emit(be.EDGE_CLICK,{data:u,e:r,position:c});var b=r.currentTarget,T=!pn(window)&&lr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(S){return setTimeout(S,0)};T(function(){b.focus()})}var A=l.editConfigModel;l.selectEdgeById(s.id,K_(r,A)),A.isSilentMode||n.toFront()}}},n.handleFocus=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_FOCUS,{data:i.getData()})},n.handleBlur=function(){var r=n.props,i=r.model,o=r.graphModel;o.eventCenter.emit(be.EDGE_BLUR,{data:i.getData()})},n}return e.prototype.getShape=function(){return V("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.edgeTextMode!==er.TEXT||i.state===lt.TEXT_EDIT)return null;if(i.text){var s=!1;return a.edgeTextDraggable&&i.text.draggable&&(s=!0),V(_4,{ref:this.textRef,editable:a.edgeTextEdit&&((n=i.text.editable)!==null&&n!==void 0?n:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isSelected,a=this.state.hover;return{start:r,end:i,hover:a,isSelected:o}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint;return[r,i]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,r=n.id,i=n.getArrowStyle(),o=i.refY,a=o===void 0?0:o,s=i.refX,l=s===void 0?2:s,u=k4(this.getLastTwoPoints(),2),c=u[0],d=u[1],f="auto";if(c&&d){var h=d.x-c.x,v=d.y-c.y;if(h!==0||v!==0){var g=Gj(Xj({x:h,y:v}));Number.isFinite(g)&&!Number.isNaN(g)&&(f=g)}}return V("g",{children:V("defs",{children:[V("marker",{id:"marker-start-".concat(r),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),V("marker",{id:"marker-end-".concat(r),refX:l,refY:a,overflow:"visible",orient:f,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,r){var i=r.stroke,o=r.fill,a=o===void 0?i:o,s=r.strokeWidth,l=r.offset,u=l===void 0?10:l,c=r.verticalLength,d=r.strokeLinecap,f=r.strokeLinejoin,h=r.transform,v="";switch(n){case"solid":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(3*u/4,",-").concat(c," Z");break;case"hollow":v="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(c," L").concat(-u/4,",0 L").concat(3*u/4,",-").concat(c," L").concat(-u/4,",0 Z");break;case"diamond":v="M".concat(-u/2,",0 L0,").concat(c," L").concat(u/2,",0 L0,-").concat(c," L").concat(-u/2,",0 Z");break;case"circle":v="M".concat(-u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(-u/2,",0 Z");break;default:v="";break}return V("path",{d:v,stroke:i,fill:a,strokeWidth:s,strokeLinecap:d,strokeLinejoin:f,transform:h})},e.prototype.getStartArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.startArrowType,u=l===void 0?"none":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d})},e.prototype.getEndArrow=function(){var n=this.props.model,r=n.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.endArrowType,u=l===void 0?"solid":l,c=r.strokeLinecap,d=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:c,strokeLinejoin:d,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,r,i){var o=i.getAdjustPointStyle();return V(zo,is({className:"lf-edge-adjust-point"},o,{x:n,y:r}))},e.prototype.getAdjustPoints=function(){var n=this.props,r=n.model,i=n.graphModel,o=i.editConfigModel,a=o.adjustEdgeStartAndEnd,s=o.adjustEdgeStart,l=o.adjustEdgeEnd,u=r.getAdjustStart(),c=r.getAdjustEnd();return V("g",{children:[a&&s&&V(Sb,is({type:Fr.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i})),a&&l&&V(Sb,is({type:Fr.TARGET},c,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return V("g",{})},e.prototype.getAppend=function(){return V("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,r=n.graphModel,i=n.model;r.toFront(i.id)},e.prototype.render=function(){var n=this.props.model,r=n.isSelected,i=n.isHitable,o=n.isShowAdjustPoint;return V("g",{children:[V("g",{className:["lf-edge",!i&&"pointer-none",r&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),o&&r?this.getAdjustPoints():""]})},e.isObserved=!1,e}(Qe),B4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gf=function(){return Gf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gf.apply(this,arguments)},j4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Cb=function(t){B4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.getEdgeStyle(),i=n,o=i.path,a=i.isAnimation,s=i.arrowConfig,l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Fa,Gf({d:o},r,s,a?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return V(Fa,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,r=this.state.hover,i=n.isSelected,o=n.getArrowStyle().offset,a=n.pointsList.map(function(d){return{x:d.x,y:d.y}}),s=j4(X_(a,o),2),l=s[0],u=s[1],c={start:l,end:u,hover:r,isSelected:i};return c},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.getArrowStyle().offset,i=n.pointsList.map(function(o){return{x:o.x,y:o.y}});return X_(i,r)},e}(gu),F4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yf=function(){return Yf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yf.apply(this,arguments)},Ab=function(t){F4(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),u=l.strokeDasharray,c=l.stroke,d=l.strokeDashoffset,f=l.animationName,h=l.animationDuration,v=l.animationIterationCount,g=l.animationTimingFunction,m=l.animationDirection;return V(Ho,Yf({},s,{x1:r.x,y1:r.y,x2:i.x,y2:i.y},a,o?{strokeDasharray:u,stroke:c,style:{strokeDashoffset:d,animationName:f,animationDuration:h,animationIterationCount:v,animationTimingFunction:g,animationDirection:m}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model,r=n.startPoint,i=n.endPoint,o={start:r,end:i},a=QB(o),s=a.d,l=a.strokeWidth,u=a.fill,c=a.strokeDasharray,d=a.stroke;return V(Fa,{d:s,fill:u,strokeWidth:l,stroke:d,strokeDasharray:c})},e}(gu),$4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qi=function(){return Qi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qi.apply(this,arguments)},H4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},os=function(t){$4(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var r=n.props.model;r.dragAppendStart(),n.isShowAdjustPointTemp=r.isShowAdjustPoint,r.isShowAdjustPoint=!1},n.onDragging=function(r){var i=r.deltaX,o=r.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var u=l.transformModel,c=l.editConfigModel,d=H4(u.fixDeltaXY(i,o),2),f=d[0],h=d[1],v=s,g=c.adjustEdgeMiddle;g?n.appendInfo=v.dragAppendSimple(n.appendInfo,{x:f,y:h}):n.appendInfo=v.dragAppend(n.appendInfo,{x:f,y:h})},n.onDragEnd=function(){var r,i=n.props,o=i.model,a=i.graphModel.eventCenter,s=o;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(r=n.isShowAdjustPointTemp)!==null&&r!==void 0?r:!1,n.appendInfo=void 0,a.emit(be.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(r,i){i.draggable&&n.drag.handleMouseDown(r),n.appendInfo=i},n.drag=new tr({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,u=s.stroke,c=s.strokeDashoffset,d=s.animationName,f=s.animationDuration,h=s.animationIterationCount,v=s.animationTimingFunction,g=s.animationDirection;return V(Oj,Qi({points:r},a,o,i?{strokeDasharray:l,stroke:u,style:{strokeDashoffset:c,animationName:d,animationDuration:f,animationIterationCount:h,animationTimingFunction:v,animationDirection:g}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,r=n.points,i=n.isSelected,o=this.state.hover,a=Ki(r),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:o,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,r=n.points,i=Ki(r),o=i[0],a=i[0];return i.length>=2&&(o=i[i.length-2],a=i[i.length-1]),[o,a]},e.prototype.getAppendAttributes=function(n){var r=n.start,i=n.end,o;if(r.x===i.x&&r.y===i.y)o="";else{var a={start:r,end:i,offset:10,verticalLength:5},s=Ra(Qi(Qi({},a),{type:"start"})),l=Ra(Qi(Qi({},a),{type:"end"}));o="M".concat(s.leftX," ").concat(s.leftY,`
71
71
  L`).concat(s.rightX," ").concat(s.rightY,`
72
72
  L`).concat(l.rightX," ").concat(l.rightY,`
73
- L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var r=this.getAppendAttributes(n),i=r.d,o=r.strokeWidth,a=r.fill,s=r.strokeDasharray,l=r.stroke;return V(Fa,{d:i,fill:a,strokeWidth:o,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.pointsList,s=i.draggable,l=[],u=a.length,c=function(h){var v="lf-polyline-append",g={start:{x:a[h].x,y:a[h].y},end:{x:a[h+1].x,y:a[h+1].y},startIndex:h,endIndex:h+1,direction:Tt.HORIZONTAL,draggable:!0},m=V("g",{className:v,children:d.getAppendShape(g)}),y=o.editConfigModel,x=y.adjustEdge,E=y.adjustEdgeMiddle;if(x&&s){var b=g.startIndex,T=g.endIndex,A=E&&(b===0||T===u-1);g.draggable=!A,g.start.x===g.end.x?(g.draggable&&(v+="-ew-resize"),g.direction=Tt.VERTICAL):g.start.y===g.end.y&&(g.draggable&&(v+="-ns-resize"),g.direction=Tt.HORIZONTAL),m=V("g",{className:d.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(S){return n.beforeDragStart(S,g)},children:V("g",{className:v,children:d.getAppendShape(g)})})}l.push(m)},d=this,f=0;f<u-1;f++)c(f);return V("g",{children:l})},e}(hu),Go=function(){return Go=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Go.apply(this,arguments)},z4=function(){function t(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(i){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY}))))},this.onDragOver=function(i){if(n.lf.graphModel.eventCenter.emit(be.BLANK_CANVAS_MOUSEMOVE,{e:i}),i.preventDefault(),n.fakeNode){var o=n.clientToLocalPoint({x:i.clientX,y:i.clientY}),a=o.x,s=o.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(be.NODE_DND_DRAG,{data:l,e:i})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(i){!n.lf.graphModel||!i||!n.nodeConfig||(n.lf.addNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY})),be.NODE_DND_ADD,i),i.preventDefault(),i.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return t.prototype.clientToLocalPoint=function(e){var n=e.x,r=e.y,i=ui(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:n,y:r}),a=o.canvasOverlayPosition,s=a.x,l=a.y,u=this.lf.graphModel.editConfigModel.snapGrid;return{x:Fo(s,i,u),y:Fo(l,i,u)}},t.prototype.startDrag=function(e){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}();function W4(t,e){t.on("node:mousemove",function(n){var r=n.data;e.setNodeSnapLine(r)}),t.on("node:mouseup",function(){e.clearSnapline()})}var U4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ri=function(){return ri=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ri.apply(this,arguments)},V4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},X4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},G4=function(t){U4(e,t);function e(n){var r=t.call(this,n)||this;return r.ref=pl(),r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(i){var o=r.props.graphModel.textEditElement;i.key==="Enter"&&i.altKey&&(o==null||o.setElementState(lt.DEFAULT))},r.inputHandler=function(i){var o=i.target.innerText,a=r.props.graphModel.textEditElement;a&&(r.__prevText={type:a.type,text:o.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},r.keydownHandler=function(i){i.stopPropagation()},r.state={style:{left:0,top:0}},r}return e.getDerivedStateFromProps=function(n){var r,i=n.textEditElement,o=n.graphModel,a=o.transformModel,s=o.theme,l=s.inputText,u;if(i){if(!(!((r=i.text)===null||r===void 0)&&r.value)&&i.BaseType===Lt.EDGE){var c=i.text,d=i.textPosition,f=d.x,h=d.y;c.x=f,c.y=h,i.setText(c)}var v={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(i.BaseType===Lt.EDGE){var g=s.edgeText,m=g.overflowMode,y=g.lineHeight,x=g.wrapPadding,E=g.textWidth;E&&m==="autoWrap"&&(u=ri(ri({},v),{width:E,minWidth:E,lineHeight:y,padding:x}))}else if(i.BaseType===Lt.NODE){var b=s.nodeText,m=b.overflowMode,y=b.lineHeight,x=b.wrapPadding,E=b.textWidth,T=i.width,A=i.modelType,S=i.textWidth,M=S||E||T;(A!==Ye.TEXT_NODE&&m==="autoWrap"||A===Ye.TEXT_NODE&&E)&&(u=ri(ri({},v),{width:M,minWidth:M,lineHeight:y,padding:x}))}var C=i.text,G=C.x,K=C.y,J=X4(a.CanvasPointToHtmlPoint([G,K]),2),R=J[0],k=J[1];return{style:ri(ri({left:R,top:k},u),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var r=this.__prevText,i=r.text,o=r.id;n.updateText(o,i),n.eventCenter.emit(be.TEXT_UPDATE,{data:ri({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var r=document.createRange();r.selectNodeContents(n),r.collapse(!1);var i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}},e.prototype.render=function(){var n,r=this.props.graphModel.textEditElement,i=this.state.style;return r?V("div",{contentEditable:!0,className:"lf-text-input",style:i,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=r.text)===null||n===void 0?void 0:n.value},r.id):null},e.toolName="text-edit-tool",e=V4([vn],e),e}(Qe),Y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Kf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},q4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Z4=function(t){Y4(e,t);function e(n){var r=t.call(this,n)||this;r.handleMouseDown=function(s){r.stepDrag.handleMouseDown(s)},r.handleWheelEvent=function(s){var l,u;s.preventDefault();var c=s.deltaX,d=s.deltaY,f=s.clientX,h=s.clientY,v=s.ctrlKey,g=new WheelEvent("wheel",{deltaX:c,deltaY:d,clientX:f,clientY:h,ctrlKey:v});(u=(l=r.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||u===void 0||u.dispatchEvent(g)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.props,d=c.graphModel,f=c.lf,h=f.getTransform(),v=h.SCALE_X,g=h.SCALE_Y,m=d.getSelectElements(!0);d.moveNodes(m.nodes.map(function(y){return y.id}),l/v,u/g)},r.handleContextMenu=function(s){s.preventDefault();var l=r.props,u=l.graphModel,c=l.graphModel,d=c.eventCenter,f=c.selectElements,h=u.getPointByClient({x:s.clientX,y:s.clientY}),v={nodes:[],edges:[]},g=q4([],Kf(f.values()),!1);g.forEach(function(m){m.BaseType===Lt.NODE&&v.nodes.push(m.getData()),m.BaseType===Lt.EDGE&&v.edges.push(m.getData())}),d.emit(be.SELECTION_CONTEXTMENU,{data:v,e:s,position:h})};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,step:o,eventType:"SELECTION",eventCenter:a}),r}return e.prototype.render=function(){var n,r,i=this.props.graphModel,o=i.selectElements,a=i.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,u=s.SCALE_Y;if(!(o.size<=1)){var c=Number.MAX_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER;o.forEach(function(g){var m;g.BaseType===Lt.NODE&&(m=kB(g)),g.BaseType===Lt.EDGE&&(m=$B(g)),m!==void 0&&(c=Math.min(c,m.x),d=Math.min(d,m.y),f=Math.max(f,m.x1),h=Math.max(h,m.y1))}),n=Kf(a.CanvasPointToHtmlPoint([c,d]),2),c=n[0],d=n[1],r=Kf(a.CanvasPointToHtmlPoint([f,h]),2),f=r[0],h=r[1];var v={left:"".concat(c-20*l/2,"px"),top:"".concat(d-20*u/2,"px"),width:"".concat(f-c+20*l,"px"),height:"".concat(h-d+20*u,"px"),"border-width":"".concat(2*l,"px")};return V("div",{className:"lf-multiple-select",style:v,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=K4([vn],e),e}(Qe),qf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},J4=[G4,Z4],Q4=function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,gt(J4,function(o){n.isDisabled(o.toolName)||n.registerTool(o.toolName,o)});var r=e.graphModel,i=r.eventCenter;i.on("".concat(be.GRAPH_TRANSFORM,",").concat(be.NODE_CLICK,",").concat(be.BLANK_CLICK," "),function(){var o,a=r.textEditElement,s=r.editConfigModel,l=s.edgeTextEdit,u=s.nodeTextEdit;(l||u)&&a&&((o=r.textEditElement)===null||o===void 0||o.setElementState(lt.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},qf([X],t.prototype,"toolMap",void 0),qf([U],t.prototype,"disableTool",null),qf([U],t.prototype,"enableTool",null),t}();function e8(t){throw new Error("[mobx-utils] "+t)}function gu(t,e){e===void 0&&(e="Illegal state"),t||e8(e)}var Ob=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(Ob(Object.getPrototypeOf(t))||[])},t8=function(t){var e=Ob(t),n=e.filter(function(r,i){return e.indexOf(r)===i});return n},n8=function(t){return t8(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},Tb="pending",vu="fulfilled",Zf="rejected";function r8(t){switch(this.state){case Tb:return t.pending&&t.pending(this.value);case Zf:return t.rejected&&t.rejected(this.value);case vu:return t.fulfilled?t.fulfilled(this.value):this.value}}function Nb(t,e){if(gu(arguments.length<=2,"fromPromise expects up to two arguments"),gu(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(U("observableFromPromise-resolve",function(i){n.value=i,n.state=vu}),U("observableFromPromise-reject",function(i){n.value=i,n.state=Zf})),n.isPromiseBasedObservable=!0,n.case=r8;var r=e&&e.state===vu?e.value:void 0;return Zd(n,{value:r,state:Tb},{},{deep:!1}),n}(function(t){t.reject=U("fromPromise.reject",function(n){var r=t(Promise.reject(n));return r.state=Zf,r.value=n,r});function e(n){n===void 0&&(n=void 0);var r=t(Promise.resolve(n));return r.state=vu,r.value=n,r}t.resolve=U("fromPromise.resolve",e)})(Nb||(Nb={}));var mu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};(function(){function t(e,n){var r=this;Pk(function(){r.current=n,r.subscription=e.subscribe(r)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},mu([X.ref],t.prototype,"current",void 0),mu([U.bound],t.prototype,"next",null),mu([U.bound],t.prototype,"complete",null),mu([U.bound],t.prototype,"error",null),t})();var yu=function(){return yu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yu.apply(this,arguments)},as=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},i8=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=X.map({}),this.localComputedValues=X.map({}),this.isPropertyDirty=function(r){return n.localValues.has(r)},gu(xr(e),"createViewModel expects an observable object"),n8(e).forEach(function(r){if(!(r===ke||r==="__mobxDidRunLazyInitializers")){if(gu(i8.indexOf(r)===-1,"The propertyname "+r+" is reserved and cannot be used with viewModels"),By(e,r)){var i=Ll(e,r).derivation;n.localComputedValues.set(r,Et(i.bind(n)))}var o=Object.getOwnPropertyDescriptor(e,r),a=o?{enumerable:o.enumerable}:{};Object.defineProperty(n,r,yu(yu({},a),{configurable:!0,get:function(){return By(e,r)?n.localComputedValues.get(r).get():n.isPropertyDirty(r)?n.localValues.get(r):n.model[r]},set:U(function(s){s!==n.model[r]?n.localValues.set(r,s):n.localValues.delete(r)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Io(this.localValues).forEach(function(n){var r=e.localValues.get(n),i=e.model[n];kr(i)?i.replace(r):gn(i)?(i.clear(),i.merge(r)):ky(r)||(e.model[n]=r)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},as([Et],t.prototype,"isDirty",null),as([Et],t.prototype,"changedValues",null),as([U.bound],t.prototype,"submit",null),as([U.bound],t.prototype,"reset",null),as([U.bound],t.prototype,"resetProperty",null),t})();function Jf(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function Qf(t){return xr(t)||kr(t)||gn(t)}function o8(t,e){var n=new WeakMap;function r(s){var l=n.get(s.object);i(s,l),e(s,Jf(l),t)}function i(s,l){switch(s.type){case"add":o(s.newValue,l,s.name);break;case"update":a(s.oldValue),o(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(d,f){return o(d,l,""+(s.index+f))});for(var u=s.index+s.addedCount;u<s.object.length;u++)if(Qf(s.object[u])){var c=n.get(s.object[u]);c&&(c.path=""+u)}break}}function o(s,l,u){if(Qf(s)){var c=n.get(s);if(c){if(c.parent!==l||c.path!==u)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+Jf(l)+"/"+u+"',")+(" but it already exists at '"+Jf(c.parent)+"/"+c.path+"'"))}else{var d={parent:l,path:u,dispose:jy(s,r)};n.set(s,d),zk(s).forEach(function(f){var h=f[0],v=f[1];return o(v,d,h)})}}}function a(s){if(Qf(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),Hk(s).forEach(a)}}return o(t,void 0,""),function(){a(t)}}var a8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){a8(e,t);function e(n,r,i){var o=i===void 0?{}:i,a=o.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=o.keyToName,u=l===void 0?function(f){return""+f}:l,c=t.call(this)||this;c._keyToName=u,c._groupBy=r,c._ogmInfoKey=Symbol("ogmInfo"+s),c._base=n;for(var d=0;d<n.length;d++)c._addItem(n[d]);return c._disposeBaseObserver=jy(c._base,function(f){if(f.type==="splice")yr(function(){for(var h=0,v=f.removed;h<v.length;h++){var g=v[h];c._removeItem(g)}for(var m=0,y=f.added;m<y.length;m++){var x=y[m];c._addItem(x)}});else if(f.type==="update")yr(function(){c._removeItem(f.oldValue),c._addItem(f.newValue)});else throw new Error("illegal state")}),c}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(n){throw new Error("not supported")},e.prototype.set=function(n,r){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var r=this._base[n],i=r[this._ogmInfoKey];i.reaction(),delete r[this._ogmInfoKey]}},e.prototype._getGroupArr=function(n){var r=t.prototype.get.call(this,n);return r===void 0&&(r=X([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),t.prototype.set.call(this,n,r)),r},e.prototype._removeFromGroupArr=function(n,r){var i=t.prototype.get.call(this,n);i.length===1?t.prototype.delete.call(this,n):(r===i.length-1||(i[r]=i[i.length-1],i[r][this._ogmInfoKey].groupArrIndex=r),i.length--)},e.prototype._addItem=function(n){var r=this,i=this._groupBy(n),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:Ny(function(){return r._groupBy(n)},function(s,l){var u=n[r._ogmInfoKey];r._removeFromGroupArr(u.groupByValue,u.groupArrIndex);var c=r._getGroupArr(s),d=c.length;c.push(n),u.groupByValue=s,u.groupArrIndex=d})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(n)},e.prototype._removeItem=function(n){var r=n[this._ogmInfoKey];this._removeFromGroupArr(r.groupByValue,r.groupArrIndex),r.reaction(),delete n[this._ogmInfoKey]},e})(Qd),Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var ep=function(){return ep=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ep.apply(this,arguments)},s8=function(){function t(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return t.prototype.add=function(e){Qc(kn(this.undos),e)||(this.undos.push(e),Qc(this.curData,e)||(this.redos=[]),this.eventCenter.emit(be.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=Pe(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=Pe(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=o8(e,Us(function(){var r=e.modelToHistoryData();r&&n.add(ep({},r))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t}(),tp={exports:{}},Mb;function l8(){return Mb||(Mb=1,function(t){(function(e,n,r){if(!e)return;for(var i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)i[111+u]="f"+u;for(u=0;u<=9;++u)i[u+96]=u.toString();function c(S,M,C){if(S.addEventListener){S.addEventListener(M,C,!1);return}S.attachEvent("on"+M,C)}function d(S){if(S.type=="keypress"){var M=String.fromCharCode(S.which);return S.shiftKey||(M=M.toLowerCase()),M}return i[S.which]?i[S.which]:o[S.which]?o[S.which]:String.fromCharCode(S.which).toLowerCase()}function f(S,M){return S.sort().join(",")===M.sort().join(",")}function h(S){var M=[];return S.shiftKey&&M.push("shift"),S.altKey&&M.push("alt"),S.ctrlKey&&M.push("ctrl"),S.metaKey&&M.push("meta"),M}function v(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function g(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function m(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function y(){if(!l){l={};for(var S in i)S>95&&S<112||i.hasOwnProperty(S)&&(l[i[S]]=S)}return l}function x(S,M,C){return C||(C=y()[S]?"keydown":"keypress"),C=="keypress"&&M.length&&(C="keydown"),C}function E(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function b(S,M){var C,G,K,J=[];for(C=E(S),K=0;K<C.length;++K)G=C[K],s[G]&&(G=s[G]),M&&M!="keypress"&&a[G]&&(G=a[G],J.push("shift")),m(G)&&J.push(G);return M=x(G,J,M),{key:G,modifiers:J,action:M}}function T(S,M){return S===null||S===n?!1:S===M?!0:T(S.parentNode,M)}function A(S){var M=this;if(S=S||n,!(M instanceof A))return new A(S);M.target=S,M._callbacks={},M._directMap={};var C={},G,K=!1,J=!1,R=!1;function k(de){de=de||{};var Se=!1,je;for(je in C){if(de[je]){Se=!0;continue}C[je]=0}Se||(R=!1)}function B(de,Se,je,he,Ve,$){var w,_,F=[],L=je.type;if(!M._callbacks[de])return[];for(L=="keyup"&&m(de)&&(Se=[de]),w=0;w<M._callbacks[de].length;++w)if(_=M._callbacks[de][w],!(!he&&_.seq&&C[_.seq]!=_.level)&&L==_.action&&(L=="keypress"&&!je.metaKey&&!je.ctrlKey||f(Se,_.modifiers))){var se=!he&&_.combo==Ve,fe=he&&_.seq==he&&_.level==$;(se||fe)&&M._callbacks[de].splice(w,1),F.push(_)}return F}function Z(de,Se,je,he){M.stopCallback(Se,Se.target||Se.srcElement,je,he)||de(Se,je)===!1&&(v(Se),g(Se))}M._handleKey=function(de,Se,je){var he=B(de,Se,je),Ve,$={},w=0,_=!1;for(Ve=0;Ve<he.length;++Ve)he[Ve].seq&&(w=Math.max(w,he[Ve].level));for(Ve=0;Ve<he.length;++Ve){if(he[Ve].seq){if(he[Ve].level!=w)continue;_=!0,$[he[Ve].seq]=1,Z(he[Ve].callback,je,he[Ve].combo,he[Ve].seq);continue}_||Z(he[Ve].callback,je,he[Ve].combo)}var F=je.type=="keypress"&&J;je.type==R&&!m(de)&&!F&&k($),J=_&&je.type=="keydown"};function ee(de){typeof de.which!="number"&&(de.which=de.keyCode);var Se=d(de);if(Se){if(de.type=="keyup"&&K===Se){K=!1;return}M.handleKey(Se,h(de),de)}}function ce(){clearTimeout(G),G=setTimeout(k,1e3)}function Be(de,Se,je,he){C[de]=0;function Ve(L){return function(){R=L,++C[de],ce()}}function $(L){Z(je,L,de),he!=="keyup"&&(K=d(L)),setTimeout(k,10)}for(var w=0;w<Se.length;++w){var _=w+1===Se.length,F=_?$:Ve(he||b(Se[w+1]).action);me(Se[w],F,he,de,w)}}function me(de,Se,je,he,Ve){M._directMap[de+":"+je]=Se,de=de.replace(/\s+/g," ");var $=de.split(" "),w;if($.length>1){Be(de,$,Se,je);return}w=b(de,je),M._callbacks[w.key]=M._callbacks[w.key]||[],B(w.key,w.modifiers,{type:w.action},he,de,Ve),M._callbacks[w.key][he?"unshift":"push"]({callback:Se,modifiers:w.modifiers,action:w.action,seq:he,level:Ve,combo:de})}M._bindMultiple=function(de,Se,je){for(var he=0;he<de.length;++he)me(de[he],Se,je)},c(S,"keypress",ee),c(S,"keydown",ee),c(S,"keyup",ee)}A.prototype.bind=function(S,M,C){var G=this;return S=S instanceof Array?S:[S],G._bindMultiple.call(G,S,M,C),G},A.prototype.unbind=function(S,M){var C=this;return C.bind.call(C,S,function(){},M)},A.prototype.trigger=function(S,M){var C=this;return C._directMap[S+":"+M]&&C._directMap[S+":"+M]({},S),C},A.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},A.prototype.stopCallback=function(S,M){var C=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||T(M,C.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var G=S.composedPath()[0];G!==S.target&&(M=G)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},A.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},A.addKeycodes=function(S){for(var M in S)S.hasOwnProperty(M)&&(i[M]=S[M]);l=null},A.init=function(){var S=A(n);for(var M in S)M.charAt(0)!=="_"&&(A[M]=function(C){return function(){return S[C].apply(S,arguments)}}(M))},A.init(),e.Mousetrap=A,t.exports&&(t.exports=A)})(typeof window<"u"?window:null,typeof window<"u"?document:null)}(tp)),tp.exports}var u8=l8();const c8=ul(u8);var Db=function(){return Db=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Db.apply(this,arguments)},$r=null;function Pb(t,e){var n,r;return t.x+=e,t.y+=e,Js(t.text)||(t.text.x+=e,t.text.y+=e),Js((n=t.properties)===null||n===void 0?void 0:n._label)||(r=t.properties)===null||r===void 0||r._label.forEach(function(i){i.x+=e,i.y+=e}),t}function Rb(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),Js(t.text)||(t.text.x+=e,t.text.y+=e),t}var Yo=40,_u=40;function d8(t,e){var n=t.keyboard,r=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(_u=Yo,!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=t.options.guards,o=e.getSelectElements(!1),a=i&&i.beforeClone?i.beforeClone(o):!0;return!a||o.nodes.length===0&&o.edges.length===0?($r=null,!0):($r=o,$r.nodes.forEach(function(s){return Pb(s,Yo)}),$r.edges.forEach(function(s){return Rb(s,Yo)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;if($r&&($r.nodes||$r.edges)){t.clearSelectElements();var i=t.addElements($r,_u);if(!i)return!0;i.nodes.forEach(function(o){return t.selectElementById(o.id,!0)}),i.edges.forEach(function(o){return t.selectElementById(o.id,!0)}),$r.nodes.forEach(function(o){return Pb(o,Yo)}),$r.edges.forEach(function(o){return Rb(o,Yo)}),_u=_u+Yo}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=e.getSelectElements(!0);return t.clearSelectElements(),i.edges.forEach(function(o){return o.id&&t.deleteEdge(o.id)}),i.nodes.forEach(function(o){return o.id&&t.deleteNode(o.id)}),!1})}var f8=function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new c8(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,r=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(r)if(We(r))r.forEach(function(s){var l=s.keys,u=s.callback,c=s.action;return e.on(l,u,c)});else{var i=r.keys,o=r.callback,a=r.action;this.on(i,o,a)}},t.prototype.on=function(e,n,r){this.mousetrap.bind(this.getKeys(e),n,r)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(r){return n.formatKey(r)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}(),Ni=function(){return Ni=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ni.apply(this,arguments)},bu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},np=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},rp=Symbol("plugin registered by Logicflow.use"),ip=function(){function t(e){var n=this,r;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(u,c){return n.viewMap.set(u,c)},this.getView=function(u){return n.viewMap.get(u)};var i=Da.get(e),o=i.container,a=i.width,s=i.height;this.options=i,this.container=this.initContainer(o,a,s),this.graphModel=new n4(Ni(Ni({},i),{container:this.container})),this.plugins=(r=i.plugins)!==null&&r!==void 0?r:[];var l=this.graphModel.eventCenter;this.tool=new Q4(this),this.dnd=new z4({lf:this}),this.history=new s8(l),this.keyboard=new f8({lf:this,keyboard:i.keyboard}),i.snapline!==!1&&(this.snaplineModel=new r4(this.graphModel,i.snaplineEpsilon),W4(l,this.snaplineModel)),i.isSilentMode||(d8(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(i.disabledPlugins)}return t.prototype.initContainer=function(e,n,r){var i=document.createElement("div");return i.style.position="relative",i.style.width=n?"".concat(n,"px"):"100%",i.style.height=r?"".concat(r,"px"):"100%",e.innerHTML="",e.appendChild(i),i},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(e,n,r){if(r===void 0&&(r=!0),typeof e!="string"){this.registerElement(e);return}var i={BaseEdge:hu,BaseEdgeModel:eu,BaseNode:Ti,BaseNodeModel:Ci,RectNode:Ji,RectNodeModel:Uo,CircleNode:du,CircleNodeModel:tu,PolygonNode:pu,PolygonNodeModel:au,TextNode:wb,TextNodeModel:yb,LineEdge:Ab,LineEdgeModel:hb,DiamondNode:Hf,DiamondNodeModel:Nf,PolylineEdge:os,PolylineEdgeModel:Ya,BezierEdge:Cb,BezierEdgeModel:fb,EllipseNode:Wf,EllipseNodeModel:Mf,HtmlNode:Vf,HtmlNodeModel:Df,h:Te,type:e};if(this.viewMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),this.graphModel.modelMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),n){var o=n(i),a=o.view,s=o.model,l=a;r&&!l.isObserved&&(l.isObserved=!0,l=vn(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=vn(n)),this.setView(e.type,n),this.graphModel.setModel(e.type,e.model)},t.prototype.batchRegister=function(e){var n=this;e===void 0&&(e=[]),gt(e,function(r){n.registerElement(r)})},t.prototype.defaultRegister=function(){var e=[{type:"rect",view:Ji,model:Uo},{type:"circle",view:du,model:tu},{type:"polygon",view:pu,model:au},{type:"text",view:wb,model:yb},{type:"ellipse",view:Wf,model:Mf},{type:"diamond",view:Hf,model:Nf},{type:"html",view:Vf,model:Df},{type:"line",view:Ab,model:hb},{type:"polyline",view:os,model:Ya},{type:"bezier",view:Cb,model:fb}];this.batchRegister(e)},t.prototype.addNode=function(e,n,r){return n===void 0&&(n=be.NODE_ADD),this.graphModel.addNode(e,n,r)},t.prototype.deleteNode=function(e){var n=this.graphModel.getNodeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteNode(e),o},t.prototype.cloneNode=function(e){var n=this.graphModel.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){var i=this.options.guards,o=i!=null&&i.beforeClone?i.beforeClone(r):!0;if(o)return this.graphModel.cloneNode(e)}},t.prototype.changeNodeId=function(e,n){return this.graphModel.changeNodeId(e,n)},t.prototype.changeNodeType=function(e,n){this.graphModel.changeNodeType(e,n)},t.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},t.prototype.getNodeDataById=function(e){var n=this.getNodeModelById(e);return n==null?void 0:n.getData()},t.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},t.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},t.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},t.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},t.prototype.createFakeNode=function(e){var n=this.graphModel.modelMap.get(e.type);if(!n)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var r=new n(Ni(Ni({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(r),r},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(e){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(e)},t.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},t.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},t.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},t.prototype.getEdgeDataById=function(e){var n=this.getEdgeModelById(e);return n==null?void 0:n.getData()},t.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},t.prototype.getEdgeModels=function(e){var n=e.sourceNodeId,r=e.targetNodeId,i=[],o=this.graphModel.edges;return n&&r?gt(o,function(a){a.sourceNodeId===n&&a.targetNodeId===r&&i.push(a)}):n?gt(o,function(a){a.sourceNodeId===n&&i.push(a)}):r&&gt(o,function(a){a.targetNodeId===r&&i.push(a)}),i},t.prototype.changeEdgeId=function(e,n){return this.graphModel.changeEdgeId(e,n)},t.prototype.changeEdgeType=function(e,n){this.graphModel.changeEdgeType(e,n)},t.prototype.deleteEdge=function(e){var n=this.graphModel.getEdgeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteEdgeById(e),o},t.prototype.deleteEdgeByNodeId=function(e){var n=e.sourceNodeId,r=e.targetNodeId;n&&r?this.graphModel.deleteEdgeBySourceAndTarget(n,r):n?this.graphModel.deleteEdgeBySource(n):r&&this.graphModel.deleteEdgeByTarget(r)},t.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},t.prototype.addElements=function(e,n){var r=this,i=e.nodes,o=e.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return gt(i,function(l){var u=l.id,c=r.addNode(l);u&&(a[u]=c.id),s.nodes.push(c)}),gt(o,function(l){var u=l.sourceNodeId,c=l.targetNodeId;a[u]&&(u=a[u]),a[c]&&(c=a[c]);var d=r.graphModel.addEdge(Ni(Ni({},l),{sourceNodeId:u,targetNodeId:c}));s.edges.push(d)}),s},t.prototype.selectElementById=function(e,n,r){n===void 0&&(n=!1),r===void 0&&(r=!0),this.graphModel.selectElementById(e,n),!n&&r&&this.graphModel.toFront(e)},t.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},t.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(e){return this.graphModel.getElement(e)},t.prototype.getDataById=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getData()},t.prototype.deleteElement=function(e){var n,r,i,o=this.getModelById(e);if(!o)return!1;var a=(n={},n[Lt.NODE]=this.deleteNode,n[Lt.EDGE]=this.deleteEdge,n);return(i=(r=a[o.BaseType])===null||r===void 0?void 0:r.call(this,e))!==null&&i!==void 0?i:!1},t.prototype.setElementZIndex=function(e,n){return this.graphModel.setElementZIndex(e,n)},t.prototype.getAreaElement=function(e,n,r,i,o){return r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1),this.graphModel.getAreaElement(e,n,r,i,o).map(function(a){return a.getData()})},t.prototype.setProperties=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.setProperties(sn(n))},t.prototype.getProperties=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getProperties()},t.prototype.deleteProperty=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.deleteProperty(n)},t.prototype.updateAttributes=function(e,n){this.graphModel.updateAttributes(e,n)},t.prototype.editText=function(e){this.graphModel.editText(e)},t.prototype.updateText=function(e,n){this.graphModel.updateText(e,n)},t.prototype.updateEditConfig=function(e){var n=this.graphModel,r=n.editConfigModel,i=n.transformModel,o=r.snapGrid;if(r.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&i.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!pn(e==null?void 0:e.snapGrid)&&e.snapGrid!==o){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(be.EDIT_CONFIG_CHANGED,{data:r.getConfig()})},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(e,n){this.graphModel.setTheme(e,n)},t.prototype.getTheme=function(){return this.graphModel.getTheme()},t.prototype.focusByElement=function(e){var n=void 0,r=this.getNodeModelById(e);if(r){var i=r.getData(),o=i.x,a=i.y;n={x:o,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,o=l.x,a=l.y;n={x:o,y:a}}n&&this.focusByCoordinate(n)},t.prototype.focusByCoordinate=function(e){var n=this.graphModel,r=n.transformModel,i=n.width,o=n.height,a=e.x,s=e.y;r.focusOn(a,s,i,o)},t.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var n=e.id,r=e.coordinate;n&&this.focusByElement(n),r&&this.focusByCoordinate(r)}},t.prototype.resize=function(e,n){this.graphModel.resize(e,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(e){this.graphModel.toFront(e)},t.prototype.getPointByClient=function(e,n){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof n=="number")return this.graphModel.getPointByClient({x:e,y:n})},t.prototype.getGraphData=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,np([r],bu(e),!1)):r},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},t.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},t.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(sn(e)),this.options.history!==!1&&this.history.watch(this.graphModel),A_(V(l4,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(be.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(e){var n=Pe(e);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},t.prototype.undo=function(){if(this.history.undoAble()){var e=sn(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=sn(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.zoom=function(e,n){var r=this.graphModel.transformModel;return r.zoom(e,n)},t.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},t.prototype.setZoomMiniSize=function(e){var n=this.graphModel.transformModel;n.setZoomMiniSize(e)},t.prototype.setZoomMaxSize=function(e){var n=this.graphModel.transformModel;n.setZoomMaxSize(e)},t.prototype.getTransform=function(){var e=this.graphModel.transformModel,n=e.SCALE_X,r=e.SCALE_Y,i=e.TRANSLATE_X,o=e.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:r,TRANSLATE_X:i,TRANSLATE_Y:o}},t.prototype.translate=function(e,n){var r=this.graphModel.transformModel;r.translate(e,n)},t.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,n=e.TRANSLATE_X,r=e.TRANSLATE_Y;this.translate(-n,-r)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(e,n){n===void 0&&(n=e),this.graphModel.fitView(e,n)},t.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},t.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},t.prototype.on=function(e,n){this.graphModel.eventCenter.on(e,n)},t.prototype.off=function(e,n){this.graphModel.eventCenter.off(e,n)},t.prototype.once=function(e,n){this.graphModel.eventCenter.once(e,n)},t.prototype.emit=function(e,n){this.graphModel.eventCenter.emit(e,n)},t.use=function(e,n){var r,i=e.pluginName;if(!i)throw new Error("请给插件指定 pluginName!");this.extensions.set(i,(r={},r[rp]=rp,r.extension=e,r.props=n,r))},t.addThemeMode=function(e,n){t3(e,n)},t.removeThemeMode=function(e){n3(e)},t.clearThemeMode=function(){r3()},t.prototype.installPlugins=function(e){var n=this;e===void 0&&(e=[]);var r=Array.from(t.extensions,function(o){var a=bu(o,2),s=a[1];return s}),i=np(np([],bu(this.plugins),!1),bu(r),!1);gt(i,function(o){var a,s;rp in o?(a=o.extension,s=o.props):a=o;var l=a==null?void 0:a.pluginName;Pv(e,l)===-1&&n.installPlugin(a,s)})},t.prototype.installPlugin=function(e,n){var r,i;if("pluginName"in e&&"install"in e){var o=e.pluginName,a=e.install,s=e.render;o&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[o]=e);return}var l=e,u=l.pluginName,c=new l({lf:this,LogicFlow:t,props:n,options:(i=(r=this.options.pluginsOptions)===null||r===void 0?void 0:r[u])!==null&&i!==void 0?i:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[u]=c},t.prototype.destroy=function(){var e;this.clearData(),A_(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var r=this.extension[n];"destroy"in r&&((e=r.destroy)===null||e===void 0||e.call(r))}},t.extensions=new Map,t}();(function(t){t.toStringTag="LF.".concat(t.name)})(ip||(ip={}));const p8=ip;function vn(t){return rf(t)}var Lb={width:40,height:40},Ib={width:40,height:40},kb={width:40,height:40},Bb={width:100,height:80},jb={width:100,height:80},h8={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},g8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),v8=(globalThis==null?void 0:globalThis._ids)||new g8;function Ko(){return v8.next()}var Fb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m8=function(t){Fb(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(r),n},e.extendKey="StartEventModel",e}(tu),y8=function(t){Fb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e}(du),_8={type:"bpmn:startEvent",view:y8,model:m8},$b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xu=function(){return xu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xu.apply(this,arguments)},b8=function(t){$b(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(r),n},e.extendKey="EndEventModel",e}(tu),x8=function(t){$b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,a=i.y,s=i.r,l=t.prototype.getShape.call(this);return Te("g",{},l,Te("circle",xu(xu({},r),{cx:o,cy:a,r:s-5})))},e.extendKey="EndEventView",e}(du),E8={type:"bpmn:endEvent",view:x8,model:b8},Hb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w8=function(t){Hb(e,t);function e(n,r){return n.id||(n.id="Flow_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="SequenceFlowModel",e}(Ya),S8=function(t){Hb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e}(os),C8={type:"bpmn:sequenceFlow",view:S8,model:w8},zb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ss=function(){return ss=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ss.apply(this,arguments)},A8=function(t){zb(e,t);function e(n,r){var i=this;return n.id||(n.id="Gateway_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),i=t.call(this,n,r)||this,i.points=[[25,0],[50,25],[25,50],[0,25]],i}return e.extendKey="ExclusiveGatewayModel",e}(au),O8=function(t){zb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle();return Te("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")},Te("polygon",ss(ss({},u),{x:i,y:o,points:l})),Te("path",ss({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},u)))},e.extendKey="ExclusiveGatewayNode",e}(pu),T8={type:"bpmn:exclusiveGateway",view:O8,model:A8},Wb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),op=function(){return op=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},op.apply(this,arguments)},N8=function(t){Wb(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="ServiceTaskModel",e}(Uo),M8=function(t){Wb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",op({x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(Ji),D8={type:"bpmn:serviceTask",view:M8,model:N8},Ub=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eu=function(){return Eu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Eu.apply(this,arguments)},P8=function(t){Ub(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="UserTaskModel",e}(Uo),R8=function(t){Ub(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",Eu(Eu({},l),{x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(Ji),L8={type:"bpmn:userTask",view:R8,model:P8},I8={pluginName:"bpmnElement",install:function(t){t.setTheme(h8),t.register(_8),t.register(E8),t.register(T8),t.register(L8),t.register(D8),t.options.customBpmnEdge||(t.register(C8),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},k8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),B8=(globalThis==null?void 0:globalThis._ids)||new k8;function Vb(){return B8.next()}function Xb(t){return Object.prototype.toString.call(t)}function j8(t){return" ".repeat(t)}function wu(t){var e=t;return Xb(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var r=n;n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=wu(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,r){e[r]=wu(n)})),e}function Su(t){return t==null?"":t.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function F8(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(wu(t)).replace(/"/g,"'")}return Su(String(e))}var eo=`
74
- `;function Cu(t,e,n){var r=j8(n);if(t!==0&&t!==!1&&!t)return eo+r+"<".concat(e," />");var i="";if(e==="#text")return eo+r+Su(String(t));if(e==="#cdata-section")return eo+r+"<![CDATA["+t+"]]>";if(e==="#comment")return eo+r+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+F8(t)+'"';if(Array.isArray(t))t.forEach(function(l){i+=Cu(l,e,n+1)});else if(Xb(t)==="[object Object]"){var o=Object.keys(t),a="",s="";i+=(n===0?"":eo+r)+"<"+e,o.forEach(function(l){l.charAt(0)==="-"?a+=Cu(t[l],l,n+1):s+=Cu(t[l],l,n+1)}),i+=a+(s!==""?">".concat(s).concat(eo+r,"</").concat(e,">"):" />")}else i+=eo+r+"<".concat(e,">").concat(Su(String(t)),"</").concat(e,">");return i}function $8(t){var e="";for(var n in t)e+=Cu(t[n],n,0);return e}var mn=function(){};mn.ObjTree=function(){return this},mn.ObjTree.VERSION="0.23",mn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
73
+ L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var r=this.getAppendAttributes(n),i=r.d,o=r.strokeWidth,a=r.fill,s=r.strokeDasharray,l=r.stroke;return V(Fa,{d:i,fill:a,strokeWidth:o,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,r=this.props,i=r.model,o=r.graphModel,a=i.pointsList,s=i.draggable,l=[],u=a.length,c=function(h){var v="lf-polyline-append",g={start:{x:a[h].x,y:a[h].y},end:{x:a[h+1].x,y:a[h+1].y},startIndex:h,endIndex:h+1,direction:Tt.HORIZONTAL,draggable:!0},m=V("g",{className:v,children:d.getAppendShape(g)}),y=o.editConfigModel,x=y.adjustEdge,E=y.adjustEdgeMiddle;if(x&&s){var b=g.startIndex,T=g.endIndex,A=E&&(b===0||T===u-1);g.draggable=!A,g.start.x===g.end.x?(g.draggable&&(v+="-ew-resize"),g.direction=Tt.VERTICAL):g.start.y===g.end.y&&(g.draggable&&(v+="-ns-resize"),g.direction=Tt.HORIZONTAL),m=V("g",{className:d.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(S){return n.beforeDragStart(S,g)},children:V("g",{className:v,children:d.getAppendShape(g)})})}l.push(m)},d=this,f=0;f<u-1;f++)c(f);return V("g",{children:l})},e}(gu),Go=function(){return Go=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Go.apply(this,arguments)},z4=function(){function t(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(i){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY}))))},this.onDragOver=function(i){if(n.lf.graphModel.eventCenter.emit(be.BLANK_CANVAS_MOUSEMOVE,{e:i}),i.preventDefault(),n.fakeNode){var o=n.clientToLocalPoint({x:i.clientX,y:i.clientY}),a=o.x,s=o.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(be.NODE_DND_DRAG,{data:l,e:i})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(i){!n.lf.graphModel||!i||!n.nodeConfig||(n.lf.addNode(Go(Go({},n.nodeConfig),n.clientToLocalPoint({x:i.clientX,y:i.clientY})),be.NODE_DND_ADD,i),i.preventDefault(),i.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return t.prototype.clientToLocalPoint=function(e){var n=e.x,r=e.y,i=ui(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:n,y:r}),a=o.canvasOverlayPosition,s=a.x,l=a.y,u=this.lf.graphModel.editConfigModel.snapGrid;return{x:Fo(s,i,u),y:Fo(l,i,u)}},t.prototype.startDrag=function(e){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}();function W4(t,e){t.on("node:mousemove",function(n){var r=n.data;e.setNodeSnapLine(r)}),t.on("node:mouseup",function(){e.clearSnapline()})}var U4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ri=function(){return ri=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ri.apply(this,arguments)},V4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},X4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},G4=function(t){U4(e,t);function e(n){var r=t.call(this,n)||this;return r.ref=hl(),r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(i){var o=r.props.graphModel.textEditElement;i.key==="Enter"&&i.altKey&&(o==null||o.setElementState(lt.DEFAULT))},r.inputHandler=function(i){var o=i.target.innerText,a=r.props.graphModel.textEditElement;a&&(r.__prevText={type:a.type,text:o.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},r.keydownHandler=function(i){i.stopPropagation()},r.state={style:{left:0,top:0}},r}return e.getDerivedStateFromProps=function(n){var r,i=n.textEditElement,o=n.graphModel,a=o.transformModel,s=o.theme,l=s.inputText,u;if(i){if(!(!((r=i.text)===null||r===void 0)&&r.value)&&i.BaseType===Lt.EDGE){var c=i.text,d=i.textPosition,f=d.x,h=d.y;c.x=f,c.y=h,i.setText(c)}var v={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(i.BaseType===Lt.EDGE){var g=s.edgeText,m=g.overflowMode,y=g.lineHeight,x=g.wrapPadding,E=g.textWidth;E&&m==="autoWrap"&&(u=ri(ri({},v),{width:E,minWidth:E,lineHeight:y,padding:x}))}else if(i.BaseType===Lt.NODE){var b=s.nodeText,m=b.overflowMode,y=b.lineHeight,x=b.wrapPadding,E=b.textWidth,T=i.width,A=i.modelType,S=i.textWidth,M=S||E||T;(A!==Ye.TEXT_NODE&&m==="autoWrap"||A===Ye.TEXT_NODE&&E)&&(u=ri(ri({},v),{width:M,minWidth:M,lineHeight:y,padding:x}))}var C=i.text,G=C.x,K=C.y,J=X4(a.CanvasPointToHtmlPoint([G,K]),2),R=J[0],k=J[1];return{style:ri(ri({left:R,top:k},u),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var r=this.__prevText,i=r.text,o=r.id;n.updateText(o,i),n.eventCenter.emit(be.TEXT_UPDATE,{data:ri({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var r=document.createRange();r.selectNodeContents(n),r.collapse(!1);var i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}},e.prototype.render=function(){var n,r=this.props.graphModel.textEditElement,i=this.state.style;return r?V("div",{contentEditable:!0,className:"lf-text-input",style:i,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=r.text)===null||n===void 0?void 0:n.value},r.id):null},e.toolName="text-edit-tool",e=V4([vn],e),e}(Qe),Y4=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K4=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Kf=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},q4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Z4=function(t){Y4(e,t);function e(n){var r=t.call(this,n)||this;r.handleMouseDown=function(s){r.stepDrag.handleMouseDown(s)},r.handleWheelEvent=function(s){var l,u;s.preventDefault();var c=s.deltaX,d=s.deltaY,f=s.clientX,h=s.clientY,v=s.ctrlKey,g=new WheelEvent("wheel",{deltaX:c,deltaY:d,clientX:f,clientY:h,ctrlKey:v});(u=(l=r.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||u===void 0||u.dispatchEvent(g)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,c=r.props,d=c.graphModel,f=c.lf,h=f.getTransform(),v=h.SCALE_X,g=h.SCALE_Y,m=d.getSelectElements(!0);d.moveNodes(m.nodes.map(function(y){return y.id}),l/v,u/g)},r.handleContextMenu=function(s){s.preventDefault();var l=r.props,u=l.graphModel,c=l.graphModel,d=c.eventCenter,f=c.selectElements,h=u.getPointByClient({x:s.clientX,y:s.clientY}),v={nodes:[],edges:[]},g=q4([],Kf(f.values()),!1);g.forEach(function(m){m.BaseType===Lt.NODE&&v.nodes.push(m.getData()),m.BaseType===Lt.EDGE&&v.edges.push(m.getData())}),d.emit(be.SELECTION_CONTEXTMENU,{data:v,e:s,position:h})};var i=n.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new tr({onDragging:r.onDragging,step:o,eventType:"SELECTION",eventCenter:a}),r}return e.prototype.render=function(){var n,r,i=this.props.graphModel,o=i.selectElements,a=i.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,u=s.SCALE_Y;if(!(o.size<=1)){var c=Number.MAX_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER;o.forEach(function(g){var m;g.BaseType===Lt.NODE&&(m=kB(g)),g.BaseType===Lt.EDGE&&(m=$B(g)),m!==void 0&&(c=Math.min(c,m.x),d=Math.min(d,m.y),f=Math.max(f,m.x1),h=Math.max(h,m.y1))}),n=Kf(a.CanvasPointToHtmlPoint([c,d]),2),c=n[0],d=n[1],r=Kf(a.CanvasPointToHtmlPoint([f,h]),2),f=r[0],h=r[1];var v={left:"".concat(c-20*l/2,"px"),top:"".concat(d-20*u/2,"px"),width:"".concat(f-c+20*l,"px"),height:"".concat(h-d+20*u,"px"),"border-width":"".concat(2*l,"px")};return V("div",{className:"lf-multiple-select",style:v,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=K4([vn],e),e}(Qe),qf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},J4=[G4,Z4],Q4=function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,gt(J4,function(o){n.isDisabled(o.toolName)||n.registerTool(o.toolName,o)});var r=e.graphModel,i=r.eventCenter;i.on("".concat(be.GRAPH_TRANSFORM,",").concat(be.NODE_CLICK,",").concat(be.BLANK_CLICK," "),function(){var o,a=r.textEditElement,s=r.editConfigModel,l=s.edgeTextEdit,u=s.nodeTextEdit;(l||u)&&a&&((o=r.textEditElement)===null||o===void 0||o.setElementState(lt.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},qf([X],t.prototype,"toolMap",void 0),qf([U],t.prototype,"disableTool",null),qf([U],t.prototype,"enableTool",null),t}();function e8(t){throw new Error("[mobx-utils] "+t)}function vu(t,e){e===void 0&&(e="Illegal state"),t||e8(e)}var Ob=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(Ob(Object.getPrototypeOf(t))||[])},t8=function(t){var e=Ob(t),n=e.filter(function(r,i){return e.indexOf(r)===i});return n},n8=function(t){return t8(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},Tb="pending",mu="fulfilled",Zf="rejected";function r8(t){switch(this.state){case Tb:return t.pending&&t.pending(this.value);case Zf:return t.rejected&&t.rejected(this.value);case mu:return t.fulfilled?t.fulfilled(this.value):this.value}}function Nb(t,e){if(vu(arguments.length<=2,"fromPromise expects up to two arguments"),vu(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(U("observableFromPromise-resolve",function(i){n.value=i,n.state=mu}),U("observableFromPromise-reject",function(i){n.value=i,n.state=Zf})),n.isPromiseBasedObservable=!0,n.case=r8;var r=e&&e.state===mu?e.value:void 0;return Zd(n,{value:r,state:Tb},{},{deep:!1}),n}(function(t){t.reject=U("fromPromise.reject",function(n){var r=t(Promise.reject(n));return r.state=Zf,r.value=n,r});function e(n){n===void 0&&(n=void 0);var r=t(Promise.resolve(n));return r.state=mu,r.value=n,r}t.resolve=U("fromPromise.resolve",e)})(Nb||(Nb={}));var yu=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};(function(){function t(e,n){var r=this;Pk(function(){r.current=n,r.subscription=e.subscribe(r)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},yu([X.ref],t.prototype,"current",void 0),yu([U.bound],t.prototype,"next",null),yu([U.bound],t.prototype,"complete",null),yu([U.bound],t.prototype,"error",null),t})();var _u=function(){return _u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_u.apply(this,arguments)},as=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},i8=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=X.map({}),this.localComputedValues=X.map({}),this.isPropertyDirty=function(r){return n.localValues.has(r)},vu(xr(e),"createViewModel expects an observable object"),n8(e).forEach(function(r){if(!(r===ke||r==="__mobxDidRunLazyInitializers")){if(vu(i8.indexOf(r)===-1,"The propertyname "+r+" is reserved and cannot be used with viewModels"),By(e,r)){var i=Il(e,r).derivation;n.localComputedValues.set(r,Et(i.bind(n)))}var o=Object.getOwnPropertyDescriptor(e,r),a=o?{enumerable:o.enumerable}:{};Object.defineProperty(n,r,_u(_u({},a),{configurable:!0,get:function(){return By(e,r)?n.localComputedValues.get(r).get():n.isPropertyDirty(r)?n.localValues.get(r):n.model[r]},set:U(function(s){s!==n.model[r]?n.localValues.set(r,s):n.localValues.delete(r)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Io(this.localValues).forEach(function(n){var r=e.localValues.get(n),i=e.model[n];kr(i)?i.replace(r):gn(i)?(i.clear(),i.merge(r)):ky(r)||(e.model[n]=r)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},as([Et],t.prototype,"isDirty",null),as([Et],t.prototype,"changedValues",null),as([U.bound],t.prototype,"submit",null),as([U.bound],t.prototype,"reset",null),as([U.bound],t.prototype,"resetProperty",null),t})();function Jf(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function Qf(t){return xr(t)||kr(t)||gn(t)}function o8(t,e){var n=new WeakMap;function r(s){var l=n.get(s.object);i(s,l),e(s,Jf(l),t)}function i(s,l){switch(s.type){case"add":o(s.newValue,l,s.name);break;case"update":a(s.oldValue),o(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(d,f){return o(d,l,""+(s.index+f))});for(var u=s.index+s.addedCount;u<s.object.length;u++)if(Qf(s.object[u])){var c=n.get(s.object[u]);c&&(c.path=""+u)}break}}function o(s,l,u){if(Qf(s)){var c=n.get(s);if(c){if(c.parent!==l||c.path!==u)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+Jf(l)+"/"+u+"',")+(" but it already exists at '"+Jf(c.parent)+"/"+c.path+"'"))}else{var d={parent:l,path:u,dispose:jy(s,r)};n.set(s,d),zk(s).forEach(function(f){var h=f[0],v=f[1];return o(v,d,h)})}}}function a(s){if(Qf(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),Hk(s).forEach(a)}}return o(t,void 0,""),function(){a(t)}}var a8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){a8(e,t);function e(n,r,i){var o=i===void 0?{}:i,a=o.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=o.keyToName,u=l===void 0?function(f){return""+f}:l,c=t.call(this)||this;c._keyToName=u,c._groupBy=r,c._ogmInfoKey=Symbol("ogmInfo"+s),c._base=n;for(var d=0;d<n.length;d++)c._addItem(n[d]);return c._disposeBaseObserver=jy(c._base,function(f){if(f.type==="splice")yr(function(){for(var h=0,v=f.removed;h<v.length;h++){var g=v[h];c._removeItem(g)}for(var m=0,y=f.added;m<y.length;m++){var x=y[m];c._addItem(x)}});else if(f.type==="update")yr(function(){c._removeItem(f.oldValue),c._addItem(f.newValue)});else throw new Error("illegal state")}),c}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(n){throw new Error("not supported")},e.prototype.set=function(n,r){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var r=this._base[n],i=r[this._ogmInfoKey];i.reaction(),delete r[this._ogmInfoKey]}},e.prototype._getGroupArr=function(n){var r=t.prototype.get.call(this,n);return r===void 0&&(r=X([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),t.prototype.set.call(this,n,r)),r},e.prototype._removeFromGroupArr=function(n,r){var i=t.prototype.get.call(this,n);i.length===1?t.prototype.delete.call(this,n):(r===i.length-1||(i[r]=i[i.length-1],i[r][this._ogmInfoKey].groupArrIndex=r),i.length--)},e.prototype._addItem=function(n){var r=this,i=this._groupBy(n),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:Ny(function(){return r._groupBy(n)},function(s,l){var u=n[r._ogmInfoKey];r._removeFromGroupArr(u.groupByValue,u.groupArrIndex);var c=r._getGroupArr(s),d=c.length;c.push(n),u.groupByValue=s,u.groupArrIndex=d})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(n)},e.prototype._removeItem=function(n){var r=n[this._ogmInfoKey];this._removeFromGroupArr(r.groupByValue,r.groupArrIndex),r.reaction(),delete n[this._ogmInfoKey]},e})(Qd),Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var ep=function(){return ep=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ep.apply(this,arguments)},s8=function(){function t(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return t.prototype.add=function(e){Qc(kn(this.undos),e)||(this.undos.push(e),Qc(this.curData,e)||(this.redos=[]),this.eventCenter.emit(be.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=Pe(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=Pe(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=o8(e,Vs(function(){var r=e.modelToHistoryData();r&&n.add(ep({},r))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t}(),tp={exports:{}},Mb;function l8(){return Mb||(Mb=1,function(t){(function(e,n,r){if(!e)return;for(var i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)i[111+u]="f"+u;for(u=0;u<=9;++u)i[u+96]=u.toString();function c(S,M,C){if(S.addEventListener){S.addEventListener(M,C,!1);return}S.attachEvent("on"+M,C)}function d(S){if(S.type=="keypress"){var M=String.fromCharCode(S.which);return S.shiftKey||(M=M.toLowerCase()),M}return i[S.which]?i[S.which]:o[S.which]?o[S.which]:String.fromCharCode(S.which).toLowerCase()}function f(S,M){return S.sort().join(",")===M.sort().join(",")}function h(S){var M=[];return S.shiftKey&&M.push("shift"),S.altKey&&M.push("alt"),S.ctrlKey&&M.push("ctrl"),S.metaKey&&M.push("meta"),M}function v(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function g(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function m(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function y(){if(!l){l={};for(var S in i)S>95&&S<112||i.hasOwnProperty(S)&&(l[i[S]]=S)}return l}function x(S,M,C){return C||(C=y()[S]?"keydown":"keypress"),C=="keypress"&&M.length&&(C="keydown"),C}function E(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function b(S,M){var C,G,K,J=[];for(C=E(S),K=0;K<C.length;++K)G=C[K],s[G]&&(G=s[G]),M&&M!="keypress"&&a[G]&&(G=a[G],J.push("shift")),m(G)&&J.push(G);return M=x(G,J,M),{key:G,modifiers:J,action:M}}function T(S,M){return S===null||S===n?!1:S===M?!0:T(S.parentNode,M)}function A(S){var M=this;if(S=S||n,!(M instanceof A))return new A(S);M.target=S,M._callbacks={},M._directMap={};var C={},G,K=!1,J=!1,R=!1;function k(de){de=de||{};var Se=!1,je;for(je in C){if(de[je]){Se=!0;continue}C[je]=0}Se||(R=!1)}function B(de,Se,je,he,Ve,$){var w,_,F=[],L=je.type;if(!M._callbacks[de])return[];for(L=="keyup"&&m(de)&&(Se=[de]),w=0;w<M._callbacks[de].length;++w)if(_=M._callbacks[de][w],!(!he&&_.seq&&C[_.seq]!=_.level)&&L==_.action&&(L=="keypress"&&!je.metaKey&&!je.ctrlKey||f(Se,_.modifiers))){var se=!he&&_.combo==Ve,fe=he&&_.seq==he&&_.level==$;(se||fe)&&M._callbacks[de].splice(w,1),F.push(_)}return F}function Z(de,Se,je,he){M.stopCallback(Se,Se.target||Se.srcElement,je,he)||de(Se,je)===!1&&(v(Se),g(Se))}M._handleKey=function(de,Se,je){var he=B(de,Se,je),Ve,$={},w=0,_=!1;for(Ve=0;Ve<he.length;++Ve)he[Ve].seq&&(w=Math.max(w,he[Ve].level));for(Ve=0;Ve<he.length;++Ve){if(he[Ve].seq){if(he[Ve].level!=w)continue;_=!0,$[he[Ve].seq]=1,Z(he[Ve].callback,je,he[Ve].combo,he[Ve].seq);continue}_||Z(he[Ve].callback,je,he[Ve].combo)}var F=je.type=="keypress"&&J;je.type==R&&!m(de)&&!F&&k($),J=_&&je.type=="keydown"};function ee(de){typeof de.which!="number"&&(de.which=de.keyCode);var Se=d(de);if(Se){if(de.type=="keyup"&&K===Se){K=!1;return}M.handleKey(Se,h(de),de)}}function ce(){clearTimeout(G),G=setTimeout(k,1e3)}function Be(de,Se,je,he){C[de]=0;function Ve(L){return function(){R=L,++C[de],ce()}}function $(L){Z(je,L,de),he!=="keyup"&&(K=d(L)),setTimeout(k,10)}for(var w=0;w<Se.length;++w){var _=w+1===Se.length,F=_?$:Ve(he||b(Se[w+1]).action);me(Se[w],F,he,de,w)}}function me(de,Se,je,he,Ve){M._directMap[de+":"+je]=Se,de=de.replace(/\s+/g," ");var $=de.split(" "),w;if($.length>1){Be(de,$,Se,je);return}w=b(de,je),M._callbacks[w.key]=M._callbacks[w.key]||[],B(w.key,w.modifiers,{type:w.action},he,de,Ve),M._callbacks[w.key][he?"unshift":"push"]({callback:Se,modifiers:w.modifiers,action:w.action,seq:he,level:Ve,combo:de})}M._bindMultiple=function(de,Se,je){for(var he=0;he<de.length;++he)me(de[he],Se,je)},c(S,"keypress",ee),c(S,"keydown",ee),c(S,"keyup",ee)}A.prototype.bind=function(S,M,C){var G=this;return S=S instanceof Array?S:[S],G._bindMultiple.call(G,S,M,C),G},A.prototype.unbind=function(S,M){var C=this;return C.bind.call(C,S,function(){},M)},A.prototype.trigger=function(S,M){var C=this;return C._directMap[S+":"+M]&&C._directMap[S+":"+M]({},S),C},A.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},A.prototype.stopCallback=function(S,M){var C=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||T(M,C.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var G=S.composedPath()[0];G!==S.target&&(M=G)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},A.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},A.addKeycodes=function(S){for(var M in S)S.hasOwnProperty(M)&&(i[M]=S[M]);l=null},A.init=function(){var S=A(n);for(var M in S)M.charAt(0)!=="_"&&(A[M]=function(C){return function(){return S[C].apply(S,arguments)}}(M))},A.init(),e.Mousetrap=A,t.exports&&(t.exports=A)})(typeof window<"u"?window:null,typeof window<"u"?document:null)}(tp)),tp.exports}var u8=l8();const c8=cl(u8);var Db=function(){return Db=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Db.apply(this,arguments)},$r=null;function Pb(t,e){var n,r;return t.x+=e,t.y+=e,Qs(t.text)||(t.text.x+=e,t.text.y+=e),Qs((n=t.properties)===null||n===void 0?void 0:n._label)||(r=t.properties)===null||r===void 0||r._label.forEach(function(i){i.x+=e,i.y+=e}),t}function Rb(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),Qs(t.text)||(t.text.x+=e,t.text.y+=e),t}var Yo=40,bu=40;function d8(t,e){var n=t.keyboard,r=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(bu=Yo,!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=t.options.guards,o=e.getSelectElements(!1),a=i&&i.beforeClone?i.beforeClone(o):!0;return!a||o.nodes.length===0&&o.edges.length===0?($r=null,!0):($r=o,$r.nodes.forEach(function(s){return Pb(s,Yo)}),$r.edges.forEach(function(s){return Rb(s,Yo)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;if($r&&($r.nodes||$r.edges)){t.clearSelectElements();var i=t.addElements($r,bu);if(!i)return!0;i.nodes.forEach(function(o){return t.selectElementById(o.id,!0)}),i.edges.forEach(function(o){return t.selectElementById(o.id,!0)}),$r.nodes.forEach(function(o){return Pb(o,Yo)}),$r.edges.forEach(function(o){return Rb(o,Yo)}),bu=bu+Yo}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=e.getSelectElements(!0);return t.clearSelectElements(),i.edges.forEach(function(o){return o.id&&t.deleteEdge(o.id)}),i.nodes.forEach(function(o){return o.id&&t.deleteNode(o.id)}),!1})}var f8=function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new c8(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,r=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(r)if(We(r))r.forEach(function(s){var l=s.keys,u=s.callback,c=s.action;return e.on(l,u,c)});else{var i=r.keys,o=r.callback,a=r.action;this.on(i,o,a)}},t.prototype.on=function(e,n,r){this.mousetrap.bind(this.getKeys(e),n,r)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(r){return n.formatKey(r)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}(),Ni=function(){return Ni=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ni.apply(this,arguments)},xu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},np=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},rp=Symbol("plugin registered by Logicflow.use"),ip=function(){function t(e){var n=this,r;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(u,c){return n.viewMap.set(u,c)},this.getView=function(u){return n.viewMap.get(u)};var i=Da.get(e),o=i.container,a=i.width,s=i.height;this.options=i,this.container=this.initContainer(o,a,s),this.graphModel=new n4(Ni(Ni({},i),{container:this.container})),this.plugins=(r=i.plugins)!==null&&r!==void 0?r:[];var l=this.graphModel.eventCenter;this.tool=new Q4(this),this.dnd=new z4({lf:this}),this.history=new s8(l),this.keyboard=new f8({lf:this,keyboard:i.keyboard}),i.snapline!==!1&&(this.snaplineModel=new r4(this.graphModel,i.snaplineEpsilon),W4(l,this.snaplineModel)),i.isSilentMode||(d8(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(i.disabledPlugins)}return t.prototype.initContainer=function(e,n,r){var i=document.createElement("div");return i.style.position="relative",i.style.width=n?"".concat(n,"px"):"100%",i.style.height=r?"".concat(r,"px"):"100%",e.innerHTML="",e.appendChild(i),i},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(e,n,r){if(r===void 0&&(r=!0),typeof e!="string"){this.registerElement(e);return}var i={BaseEdge:gu,BaseEdgeModel:tu,BaseNode:Ti,BaseNodeModel:Ci,RectNode:Ji,RectNodeModel:Uo,CircleNode:fu,CircleNodeModel:nu,PolygonNode:hu,PolygonNodeModel:su,TextNode:wb,TextNodeModel:yb,LineEdge:Ab,LineEdgeModel:hb,DiamondNode:Hf,DiamondNodeModel:Nf,PolylineEdge:os,PolylineEdgeModel:Ya,BezierEdge:Cb,BezierEdgeModel:fb,EllipseNode:Wf,EllipseNodeModel:Mf,HtmlNode:Vf,HtmlNodeModel:Df,h:Te,type:e};if(this.viewMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),this.graphModel.modelMap.forEach(function(u){var c=u.extendKey;c&&(i[c]=u)}),n){var o=n(i),a=o.view,s=o.model,l=a;r&&!l.isObserved&&(l.isObserved=!0,l=vn(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=vn(n)),this.setView(e.type,n),this.graphModel.setModel(e.type,e.model)},t.prototype.batchRegister=function(e){var n=this;e===void 0&&(e=[]),gt(e,function(r){n.registerElement(r)})},t.prototype.defaultRegister=function(){var e=[{type:"rect",view:Ji,model:Uo},{type:"circle",view:fu,model:nu},{type:"polygon",view:hu,model:su},{type:"text",view:wb,model:yb},{type:"ellipse",view:Wf,model:Mf},{type:"diamond",view:Hf,model:Nf},{type:"html",view:Vf,model:Df},{type:"line",view:Ab,model:hb},{type:"polyline",view:os,model:Ya},{type:"bezier",view:Cb,model:fb}];this.batchRegister(e)},t.prototype.addNode=function(e,n,r){return n===void 0&&(n=be.NODE_ADD),this.graphModel.addNode(e,n,r)},t.prototype.deleteNode=function(e){var n=this.graphModel.getNodeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteNode(e),o},t.prototype.cloneNode=function(e){var n=this.graphModel.getNodeModelById(e),r=n==null?void 0:n.getData();if(r){var i=this.options.guards,o=i!=null&&i.beforeClone?i.beforeClone(r):!0;if(o)return this.graphModel.cloneNode(e)}},t.prototype.changeNodeId=function(e,n){return this.graphModel.changeNodeId(e,n)},t.prototype.changeNodeType=function(e,n){this.graphModel.changeNodeType(e,n)},t.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},t.prototype.getNodeDataById=function(e){var n=this.getNodeModelById(e);return n==null?void 0:n.getData()},t.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},t.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},t.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},t.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},t.prototype.createFakeNode=function(e){var n=this.graphModel.modelMap.get(e.type);if(!n)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var r=new n(Ni(Ni({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(r),r},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(e){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(e)},t.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},t.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},t.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},t.prototype.getEdgeDataById=function(e){var n=this.getEdgeModelById(e);return n==null?void 0:n.getData()},t.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},t.prototype.getEdgeModels=function(e){var n=e.sourceNodeId,r=e.targetNodeId,i=[],o=this.graphModel.edges;return n&&r?gt(o,function(a){a.sourceNodeId===n&&a.targetNodeId===r&&i.push(a)}):n?gt(o,function(a){a.sourceNodeId===n&&i.push(a)}):r&&gt(o,function(a){a.targetNodeId===r&&i.push(a)}),i},t.prototype.changeEdgeId=function(e,n){return this.graphModel.changeEdgeId(e,n)},t.prototype.changeEdgeType=function(e,n){this.graphModel.changeEdgeType(e,n)},t.prototype.deleteEdge=function(e){var n=this.graphModel.getEdgeModelById(e);if(!n)return!1;var r=n.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteEdgeById(e),o},t.prototype.deleteEdgeByNodeId=function(e){var n=e.sourceNodeId,r=e.targetNodeId;n&&r?this.graphModel.deleteEdgeBySourceAndTarget(n,r):n?this.graphModel.deleteEdgeBySource(n):r&&this.graphModel.deleteEdgeByTarget(r)},t.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},t.prototype.addElements=function(e,n){var r=this,i=e.nodes,o=e.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return gt(i,function(l){var u=l.id,c=r.addNode(l);u&&(a[u]=c.id),s.nodes.push(c)}),gt(o,function(l){var u=l.sourceNodeId,c=l.targetNodeId;a[u]&&(u=a[u]),a[c]&&(c=a[c]);var d=r.graphModel.addEdge(Ni(Ni({},l),{sourceNodeId:u,targetNodeId:c}));s.edges.push(d)}),s},t.prototype.selectElementById=function(e,n,r){n===void 0&&(n=!1),r===void 0&&(r=!0),this.graphModel.selectElementById(e,n),!n&&r&&this.graphModel.toFront(e)},t.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},t.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(e){return this.graphModel.getElement(e)},t.prototype.getDataById=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getData()},t.prototype.deleteElement=function(e){var n,r,i,o=this.getModelById(e);if(!o)return!1;var a=(n={},n[Lt.NODE]=this.deleteNode,n[Lt.EDGE]=this.deleteEdge,n);return(i=(r=a[o.BaseType])===null||r===void 0?void 0:r.call(this,e))!==null&&i!==void 0?i:!1},t.prototype.setElementZIndex=function(e,n){return this.graphModel.setElementZIndex(e,n)},t.prototype.getAreaElement=function(e,n,r,i,o){return r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1),this.graphModel.getAreaElement(e,n,r,i,o).map(function(a){return a.getData()})},t.prototype.setProperties=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.setProperties(sn(n))},t.prototype.getProperties=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getProperties()},t.prototype.deleteProperty=function(e,n){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.deleteProperty(n)},t.prototype.updateAttributes=function(e,n){this.graphModel.updateAttributes(e,n)},t.prototype.editText=function(e){this.graphModel.editText(e)},t.prototype.updateText=function(e,n){this.graphModel.updateText(e,n)},t.prototype.updateEditConfig=function(e){var n=this.graphModel,r=n.editConfigModel,i=n.transformModel,o=r.snapGrid;if(r.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&i.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!pn(e==null?void 0:e.snapGrid)&&e.snapGrid!==o){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(be.EDIT_CONFIG_CHANGED,{data:r.getConfig()})},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(e,n){this.graphModel.setTheme(e,n)},t.prototype.getTheme=function(){return this.graphModel.getTheme()},t.prototype.focusByElement=function(e){var n=void 0,r=this.getNodeModelById(e);if(r){var i=r.getData(),o=i.x,a=i.y;n={x:o,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,o=l.x,a=l.y;n={x:o,y:a}}n&&this.focusByCoordinate(n)},t.prototype.focusByCoordinate=function(e){var n=this.graphModel,r=n.transformModel,i=n.width,o=n.height,a=e.x,s=e.y;r.focusOn(a,s,i,o)},t.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var n=e.id,r=e.coordinate;n&&this.focusByElement(n),r&&this.focusByCoordinate(r)}},t.prototype.resize=function(e,n){this.graphModel.resize(e,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(e){this.graphModel.toFront(e)},t.prototype.getPointByClient=function(e,n){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof n=="number")return this.graphModel.getPointByClient({x:e,y:n})},t.prototype.getGraphData=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,np([r],xu(e),!1)):r},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},t.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},t.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(sn(e)),this.options.history!==!1&&this.history.watch(this.graphModel),A_(V(l4,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(be.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(e){var n=Pe(e);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},t.prototype.undo=function(){if(this.history.undoAble()){var e=sn(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=sn(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.zoom=function(e,n){var r=this.graphModel.transformModel;return r.zoom(e,n)},t.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},t.prototype.setZoomMiniSize=function(e){var n=this.graphModel.transformModel;n.setZoomMiniSize(e)},t.prototype.setZoomMaxSize=function(e){var n=this.graphModel.transformModel;n.setZoomMaxSize(e)},t.prototype.getTransform=function(){var e=this.graphModel.transformModel,n=e.SCALE_X,r=e.SCALE_Y,i=e.TRANSLATE_X,o=e.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:r,TRANSLATE_X:i,TRANSLATE_Y:o}},t.prototype.translate=function(e,n){var r=this.graphModel.transformModel;r.translate(e,n)},t.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,n=e.TRANSLATE_X,r=e.TRANSLATE_Y;this.translate(-n,-r)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(e,n){n===void 0&&(n=e),this.graphModel.fitView(e,n)},t.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},t.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},t.prototype.on=function(e,n){this.graphModel.eventCenter.on(e,n)},t.prototype.off=function(e,n){this.graphModel.eventCenter.off(e,n)},t.prototype.once=function(e,n){this.graphModel.eventCenter.once(e,n)},t.prototype.emit=function(e,n){this.graphModel.eventCenter.emit(e,n)},t.use=function(e,n){var r,i=e.pluginName;if(!i)throw new Error("请给插件指定 pluginName!");this.extensions.set(i,(r={},r[rp]=rp,r.extension=e,r.props=n,r))},t.addThemeMode=function(e,n){t3(e,n)},t.removeThemeMode=function(e){n3(e)},t.clearThemeMode=function(){r3()},t.prototype.installPlugins=function(e){var n=this;e===void 0&&(e=[]);var r=Array.from(t.extensions,function(o){var a=xu(o,2),s=a[1];return s}),i=np(np([],xu(this.plugins),!1),xu(r),!1);gt(i,function(o){var a,s;rp in o?(a=o.extension,s=o.props):a=o;var l=a==null?void 0:a.pluginName;Pv(e,l)===-1&&n.installPlugin(a,s)})},t.prototype.installPlugin=function(e,n){var r,i;if("pluginName"in e&&"install"in e){var o=e.pluginName,a=e.install,s=e.render;o&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[o]=e);return}var l=e,u=l.pluginName,c=new l({lf:this,LogicFlow:t,props:n,options:(i=(r=this.options.pluginsOptions)===null||r===void 0?void 0:r[u])!==null&&i!==void 0?i:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[u]=c},t.prototype.destroy=function(){var e;this.clearData(),A_(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var r=this.extension[n];"destroy"in r&&((e=r.destroy)===null||e===void 0||e.call(r))}},t.extensions=new Map,t}();(function(t){t.toStringTag="LF.".concat(t.name)})(ip||(ip={}));const p8=ip;function vn(t){return rf(t)}var Lb={width:40,height:40},Ib={width:40,height:40},kb={width:40,height:40},Bb={width:100,height:80},jb={width:100,height:80},h8={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},g8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),v8=(globalThis==null?void 0:globalThis._ids)||new g8;function Ko(){return v8.next()}var Fb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m8=function(t){Fb(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(r),n},e.extendKey="StartEventModel",e}(nu),y8=function(t){Fb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e}(fu),_8={type:"bpmn:startEvent",view:y8,model:m8},$b=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eu=function(){return Eu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Eu.apply(this,arguments)},b8=function(t){$b(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(r),n},e.extendKey="EndEventModel",e}(nu),x8=function(t){$b(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,a=i.y,s=i.r,l=t.prototype.getShape.call(this);return Te("g",{},l,Te("circle",Eu(Eu({},r),{cx:o,cy:a,r:s-5})))},e.extendKey="EndEventView",e}(fu),E8={type:"bpmn:endEvent",view:x8,model:b8},Hb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w8=function(t){Hb(e,t);function e(n,r){return n.id||(n.id="Flow_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="SequenceFlowModel",e}(Ya),S8=function(t){Hb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e}(os),C8={type:"bpmn:sequenceFlow",view:S8,model:w8},zb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ss=function(){return ss=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ss.apply(this,arguments)},A8=function(t){zb(e,t);function e(n,r){var i=this;return n.id||(n.id="Gateway_".concat(Ko())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),i=t.call(this,n,r)||this,i.points=[[25,0],[50,25],[25,50],[0,25]],i}return e.extendKey="ExclusiveGatewayModel",e}(su),O8=function(t){zb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,r=n,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=n.getNodeStyle();return Te("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")},Te("polygon",ss(ss({},u),{x:i,y:o,points:l})),Te("path",ss({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},u)))},e.extendKey="ExclusiveGatewayNode",e}(hu),T8={type:"bpmn:exclusiveGateway",view:O8,model:A8},Wb=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),op=function(){return op=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},op.apply(this,arguments)},N8=function(t){Wb(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="ServiceTaskModel",e}(Uo),M8=function(t){Wb(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",op({x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(Ji),D8={type:"bpmn:serviceTask",view:M8,model:N8},Ub=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wu=function(){return wu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wu.apply(this,arguments)},P8=function(t){Ub(e,t);function e(n,r){return n.id||(n.id="Activity_".concat(Ko())),t.call(this,n,r)||this}return e.extendKey="UserTaskModel",e}(Uo),R8=function(t){Ub(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getNodeStyle();return Te("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Te("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Te("g",{},[Te("rect",wu(wu({},l),{x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(Ji),L8={type:"bpmn:userTask",view:R8,model:P8},I8={pluginName:"bpmnElement",install:function(t){t.setTheme(h8),t.register(_8),t.register(E8),t.register(T8),t.register(L8),t.register(D8),t.options.customBpmnEdge||(t.register(C8),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},k8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,r=e==="x"?n:n&3|8;return r.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),B8=(globalThis==null?void 0:globalThis._ids)||new k8;function Vb(){return B8.next()}function Xb(t){return Object.prototype.toString.call(t)}function j8(t){return" ".repeat(t)}function Su(t){var e=t;return Xb(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var r=n;n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Su(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,r){e[r]=Su(n)})),e}function Cu(t){return t==null?"":t.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function F8(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Su(t)).replace(/"/g,"'")}return Cu(String(e))}var eo=`
74
+ `;function Au(t,e,n){var r=j8(n);if(t!==0&&t!==!1&&!t)return eo+r+"<".concat(e," />");var i="";if(e==="#text")return eo+r+Cu(String(t));if(e==="#cdata-section")return eo+r+"<![CDATA["+t+"]]>";if(e==="#comment")return eo+r+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+F8(t)+'"';if(Array.isArray(t))t.forEach(function(l){i+=Au(l,e,n+1)});else if(Xb(t)==="[object Object]"){var o=Object.keys(t),a="",s="";i+=(n===0?"":eo+r)+"<"+e,o.forEach(function(l){l.charAt(0)==="-"?a+=Au(t[l],l,n+1):s+=Au(t[l],l,n+1)}),i+=a+(s!==""?">".concat(s).concat(eo+r,"</").concat(e,">"):" />")}else i+=eo+r+"<".concat(e,">").concat(Cu(String(t)),"</").concat(e,">");return i}function $8(t){var e="";for(var n in t)e+=Au(t[n],n,0);return e}var mn=function(){};mn.ObjTree=function(){return this},mn.ObjTree.VERSION="0.23",mn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
75
75
  `,mn.ObjTree.prototype.attr_prefix="-",mn.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},mn.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,a=n,s=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),a(d,c),s&&s(c)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(l=u.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},mn.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!=11){var r={};r[t.nodeName]=n,n=r}return n}},mn.ObjTree.prototype.parseElement=function(t){if(t.nodeType!=7){if(t.nodeType==3||t.nodeType==4||t.nodeType==8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var a=t.attributes[i].nodeValue;try{a=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[i].nodeValue}a&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var i=0;i<t.childNodes.length&&s;i++){var l=t.childNodes[i].nodeType;l==3||l==4||l==8||(s=!1)}if(s){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(t.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}}else n===null&&(n={});return n}},mn.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=r):n==1?t[e]=r:n==2?t[e]=[t[e],r]:t[e][t[e].length]=r},mn.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},mn.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?typeof o>"u"||o==null?n[n.length]="<"+i+" />":typeof o=="object"&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var a=r.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<"+t+a+`>
76
76
  `+s+"</"+t+`>
77
77
  `:s="<"+t+a+">"+s+"</"+t+`>
78
78
  `:s="<"+t+a+` />
79
79
  `),s},mn.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?n[n.length]="<"+t+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")},mn.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
80
- `},mn.ObjTree.prototype.xml_escape=Su;var H8=function(t){return new mn.ObjTree().parseXML(t)},z8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(){return ap=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ap.apply(this,arguments)},Au=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Hr;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Hr||(Hr={}));var Gb=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],Yb=["properties","startPoint","endPoint","pointsList"],Kb=function(t){return String(t||"").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'")};function qb(t){var e=t?Yb.concat(t):Yb;return function(n){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(a){return r(a)}):(Object.entries(i).forEach(function(a){var s=Au(a,2),l=s[0],u=s[1];typeof u!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?o[l]=u:o["-".concat(l)]=u:e.includes(l)?o["-".concat(l)]=r(u):o[l]=r(u)}),o)}return r(n)}}function Ou(t){var e={};return Object.entries(t).forEach(function(n){var r=Au(n,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=wu(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=Ou(o):Array.isArray(o)?e[i]=o.map(function(a){return Ou(a)}):e[i]=o}),e}function W8(t,e,n){var r=new Map;e.nodes.forEach(function(o){var a,s={"-id":o.id};if(!((a=o.text)===null||a===void 0)&&a.value&&(s["-name"]=o.text.value),o.properties){var l=qb(n)(o.properties);Object.assign(s,l)}r.set(o.id,s),t[o.type]?Array.isArray(t[o.type])?t[o.type].push(s):t[o.type]=[t[o.type],s]:t[o.type]=s});var i=e.edges.map(function(o){var a,s,l=r.get(o.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(o.id):l["bpmn:incoming"]=[l["bpmn:incoming"],o.id]:l["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((a=o.text)===null||a===void 0)&&a.value&&(u["-name"]=(s=o.text)===null||s===void 0?void 0:s.value),o.properties){var c=qb(n)(o.properties);Object.assign(u,c)}return u});e.edges.forEach(function(o){var a=r.get(o.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(o.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],o.id]:a["bpmn:outgoing"]=o.id}),t[Hr.FLOW]=i}function U8(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Mi.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}function V8(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],a=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!a)return{nodes:e,edges:n};Object.keys(i).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=i[s];if(s===Hr.FLOW){var u=a["bpmndi:BPMNEdge"],c=(Array.isArray(u),u);n=G8(l,c)}else{var d=a["bpmndi:BPMNShape"],f=(Array.isArray(d),d);e=e.concat(X8(l,f,s))}}})}return{nodes:e,edges:n}}function X8(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=Zb(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=Zb(i,n,t);r.push(o)}return r}function Zb(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=Kb(n["-name"]),a=Mi.shapeConfigMap.get(e);a&&(r+=a.width/2,i+=a.height/2);var s;Object.entries(n).forEach(function(d){var f=Au(d,2),h=f[0],v=f[1];Gb.indexOf(h)===-1&&(s||(s={}),s[h]=v)}),s&&(s=Ou(s));var l;if(o&&(l={x:r,y:i,value:o},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(u["-x"])+Number(u["-width"])/2,l.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:i,properties:s};return l&&(c.text=l),c}function G8(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(Jb(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(Jb(r,t))}return n}function Jb(t,e){var n,r=e["-name"]?Kb("".concat(e["-name"])):"";if(r){var i=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(`
81
- `).forEach(function(h){o<h.length&&(o=h.length)}),i)n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7};else{var a=t["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,u=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,c=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:r,x:u,y:c}}}var d;Object.entries(e).forEach(function(h){var v=Au(h,2),g=v[0],m=v[1];Gb.indexOf(g)===-1&&(d||(d={}),d[g]=m)}),d&&(d=Ou(d));var f={id:e["-id"],type:Hr.FLOW,pointsList:t["di:waypoint"].map(function(h){return{x:Number(h["-x"]),y:Number(h["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:d};return n&&(f.text=n),f}var Mi=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a=ap({},r.processAttributes);W8(a,i,o);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};U8(s,i);var l=r.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var u={"bpmn:definitions":l};return u},this.adapterIn=function(i){if(i)return V8(i)},n.adapterIn=function(i){return r.adapterIn(i)},n.adapterOut=function(i,o){return r.adapterOut(i,o)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(Vb())},this.definitionAttributes={"-id":"Definitions_".concat(Vb()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Mi.shapeConfigMap.set(Hr.START,{width:Lb.width,height:Lb.height}),Mi.shapeConfigMap.set(Hr.END,{width:Ib.width,height:Ib.height}),Mi.shapeConfigMap.set(Hr.GATEWAY,{width:kb.width,height:kb.height}),Mi.shapeConfigMap.set(Hr.SYSTEM,{width:Bb.width,height:Bb.height}),Mi.shapeConfigMap.set(Hr.USER,{width:jb.width,height:jb.height});var Y8=function(t){z8(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(o){var a=typeof o=="string"?r.sanitizeNameAttributes(o):o,s=H8(a);return r.adapterIn(s)},r.adapterXmlOut=function(o,a){var s=r.adapterOut(o,a);return $8(s)};var i=n.lf;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(r,i){var o=i.replace(/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e}(Mi),K8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var r=Math.random()*16|0,i=n==="x"?r:r&3|8;return i.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),q8=(globalThis==null?void 0:globalThis._ids)||new K8;function Z8(){return q8.next()}var Qb=function(){return Qb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qb.apply(this,arguments)},e0=function(){return e0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},e0.apply(this,arguments)},t0=function(){return t0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t0.apply(this,arguments)},n0=function(){return n0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},n0.apply(this,arguments)},r0=function(){return r0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},r0.apply(this,arguments)};Te("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Te("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"}),Te("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var i0=function(){return i0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i0.apply(this,arguments)},o0=function(){return o0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o0.apply(this,arguments)},J8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),to=function(){return to=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},to.apply(this,arguments)},Q8=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},eF=tr,tF=function(t){J8(e,t);function e(n){var r=t.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y;r.nodeModel.x=l+o/2,r.nodeModel.y=u+a/2,r.nodeModel.moveText(o/2,a/2)},r.getResize=function(i){var o=i.index,a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo,d=i.pct,f=d===void 0?1:d,h=i.freezeWidth,v=h===void 0?!1:h,g=i.freezeHeight,m=g===void 0?!1:g,y={width:l,height:u,deltaX:a,deltaY:s};if(c){var x=4,E=0,b=0;switch(o){case 0:b=(a*-1-s)/x;break;case 1:b=(a-s)/x;break;case 2:b=(a+s)/x;break;case 3:b=(a*-1+s)/x;break}b!==0&&(E=Math.round(b/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var T=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),A=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(o){case 0:a=l-T,s=u-A;break;case 1:a=T-l,s=u-A;break;case 2:a=T-l,s=A-u;break;case 3:a=l-T,s=A-u;break}return y.width=T,y.height=A,y.deltaX=a/f,y.deltaY=s/f,y}switch(o){case 0:y.width=v?l:l-a*f,y.height=m?u:u-s*f;break;case 1:y.width=v?l:l+a*f,y.height=m?u:u-s*f;break;case 2:y.width=v?l:l+a*f,y.height=m?u:u+s*f;break;case 3:y.width=v?l:l-a*f,y.height=m?u:u+s*f;break}return y},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,a=i.anchors,s=r.getNodeEdges(o);s.sourceEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.sourceAnchorId});u&&l.updateStartPoint({x:u.x,y:u.y})}),s.targetEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.targetAnchorId});u&&l.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y,c=s.width,d=s.height,f=s.radius,h=s.PCTResizeInfo,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=r.index,b=g===y,T=m===x,A=r.getResize({index:E,deltaX:o,deltaY:a,width:c,height:d,PCTResizeInfo:h,pct:1,freezeWidth:b,freezeHeight:T});if(A.width<g||A.width>y||A.height<m||A.height>x){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:b?0:A.deltaX,deltaY:T?0:A.deltaY}),r.nodeModel.width=A.width,r.nodeModel.height=A.height,r.nodeModel.setProperties({nodeSize:{width:A.width,height:A.height}});var S={x:l,y:u,width:c,height:d,radius:f},M={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:f};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:S,afterNode:M})},r.updateEllipse=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:to(to({},M),{rx:l,ry:u}),afterNode:C})},r.updateDiamond=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d,rx:l,ry:u},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:M,afterNode:C})},r.eventEmit=function(i){var o=i.deltaX,a=i.deltaY,s=i.beforeNode,l=i.afterNode,u=r.nodeModel,c=u.id,d=u.modelType,f=u.type,h=to({id:c,modelType:d,type:f},s),v=to({id:c,modelType:d,type:f},l);r.graphModel.eventCenter.emit("node:resize",{preData:h,data:v,deltaX:o,deltaY:a,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,a=i.deltaX,s=i.deltaY,l=r.graphModel.transformModel,u=r.nodeModel.modelType;o=Q8(l.fixDeltaXY(a,s),2),a=o[0],s=o[1],u===Ye.RECT_NODE||u===Ye.HTML_NODE?r.updateRect({deltaX:a,deltaY:s}):u===Ye.ELLIPSE_NODE?r.updateEllipse({deltaX:a,deltaY:s}):u===Ye.DIAMOND_NODE&&r.updateDiamond({deltaX:a,deltaY:s})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,a=o*Math.round(r.nodeModel.x/o),s=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(a,s),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new eF({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(n){for(var r=this.graphModel,i=r.edges,o=[],a=[],s=0;s<i.length;s++){var l=i[s];l.sourceNodeId===n?o.push(l):i[s].targetNodeId===n&&a.push(l)}return{sourceEdges:o,targetEdges:a}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.index,a=n.model,s=a.getControlPointStyle();return V("g",{className:"lf-resize-control-".concat(o),children:V(rr,to({className:"lf-node-control",x:r,y:i},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(Qe),nF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tu=function(){return Tu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Tu.apply(this,arguments)},Nu=function(t){nF(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=r.x,a=r.y,s=r.width,l=r.height,u={minX:o-s/2,minY:a-l/2,maxX:o+s/2,maxY:a+l/2},c=u.minX,d=u.minY,f=u.maxX,h=u.maxY,v=[{x:c,y:d},{x:f,y:d},{x:f,y:h},{x:c,y:h}];return v.map(function(g,m){return V(tF,Tu({index:m},g,{model:r,graphModel:i}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,Tu({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(Qe),a0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rF=function(t){a0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Mf),iF=function(t){a0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r.isSelected&&!i?this.getControlGroup():""]})},e}(Wf),oF={type:"ellipse",view:iF,model:rF},s0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=function(){return sp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sp.apply(this,arguments)},aF=function(t){s0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Nf),sF=function(t){s0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){var n=this.props.model,r=n.points,i=n.getNodeStyle();return V("g",{children:V(wf,sp({},i,{points:r}))})},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Hf),lF={type:"diamond",view:sF,model:aF},l0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uF=function(t){l0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Df),cF=function(t){l0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Vf),dF={type:"html",view:cF,model:uF},u0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c0=function(t){u0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Uo),d0=function(t){u0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Nu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Ji),fF={type:"rect",view:d0,model:c0},pF={pluginName:"nodeResize",step:0,install:function(t){t.register(oF),t.register(lF),t.register(dF),t.register(fF)}},f0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mu=function(){return Mu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Mu.apply(this,arguments)},no=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ro=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},p0=500,h0=300,hF=-1e4;(function(t){f0(e,t);function e(){var n=t.apply(this,ro([],no(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=p0,n.unfoldedHeight=h0,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var r=this;t.prototype.initNodeData.call(this,n);var i=[];We(n.children)&&(i=n.children),this.children=new Set(i),this.width=p0,this.height=h0,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=hF,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){r.isFolded&&r.foldGroup(r.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var r=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var i=ro(ro([],no(this.incoming.edges),!1),no(this.outgoing.edges),!1);this.children.forEach(function(o){var a=r.graphModel.getElement(o);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=r.childrenLastFoldStatus[o];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}r.childrenLastFoldStatus[o]=!!s,a.visible=!n;var u=a.incoming.edges,c=a.outgoing.edges;i=ro(ro(ro([],no(i),!1),no(u),!1),no(c),!1)}}),this.foldEdge(n,i)}},e.prototype.getAnchorStyle=function(n){var r=t.prototype.getAnchorStyle.call(this,n);return r.stroke="transparent",r.fill="transparent",r.hover.fill="transparent",r.hover.stroke="transparent",r},e.prototype.foldEdge=function(n,r){var i=this;r.forEach(function(o,a){var s=o.id,l=o.sourceNodeId,u=o.targetNodeId,c=o.startPoint,d=o.endPoint,f=o.type,h=o.text,v=o.getProperties(),g={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:u,startPoint:c,endPoint:d,type:f,properties:v,text:h==null?void 0:h.value};o.virtual&&i.graphModel.deleteEdgeById(o.id);var m=i.graphModel.group.getNodeGroup(u);m||(m=i.graphModel.getNodeModelById(u));var y=i.graphModel.group.getNodeGroup(l);y||(y=i.graphModel.getNodeModelById(l)),n&&o.visible!==!1&&(i.children.has(l)||i.id===l?(g.startPoint=void 0,g.sourceNodeId=i.id):(g.endPoint=void 0,g.targetNodeId=i.id),(m.id!==i.id||y.id!==i.id)&&i.createVirtualEdge(g),o.visible=!1),!n&&o.visible===!1&&(m&&m.isGroup&&m.isFolded?(g.targetNodeId=m.id,g.endPoint=void 0,i.createVirtualEdge(g)):y&&y.isGroup&&y.isFolded?(g.sourceNodeId=y.id,g.startPoint=void 0,i.createVirtualEdge(g)):o.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isFoldedEdge=!0},e.prototype.isInRange=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return r>=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=ro([],no(this.children),!1),n.isGroup=!0;var r=n.properties;return r==null||delete r.groupAddable,r!=null&&r.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(c0),function(t){f0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,r=n.resizable,i=n.properties;return r&&!i.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.properties,u=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var c=this.props.model.getNodeStyle().strokeWidth,d=c===void 0?0:c,f=u(),h=r+d+8,v=i+d+8;return Te("rect",Mu(Mu({},f),{width:h,height:v,x:o-h/2,y:a-v/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,r=n.x-n.width/2+5,i=n.y-n.height/2+5;if(!n.foldable)return null;var o=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return Te("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(d0);var g0=function(){return g0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},g0.apply(this,arguments)},v0=function(){return v0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},v0.apply(this,arguments)},m0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(){return ls=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ls.apply(this,arguments)};function gF(t){var e=function(r){m0(i,r);function i(o,a){o.id||(o.id="Flow_".concat(Z8()));var s=ls(ls(ls({},{}),o.properties),{isDefaultFlow:!1});return o.properties=s,r.call(this,o,a)||this}return i.extendKey="SequenceFlowModel",i}(Ya),n=function(r){m0(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i.prototype.getStartArrow=function(){var o=this.props.model,a=o.properties.isDefaultFlow;return a?Te("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Te("path",{d:""})},i.extendKey="SequenceFlowEdge",i}(os);return{type:"bpmn:sequenceFlow",view:n,model:e}}gF();var y0={width:40,height:40},_0={width:40,height:40},b0={width:100,height:80},Du={width:100,height:80},x0={width:100,height:80},E0={width:100,height:80},w0={width:100,height:80},S0={width:100,height:80},C0={width:100,height:80},A0={width:100,height:80},yn=function(){};yn.ObjTree=function(){return this},yn.ObjTree.VERSION="0.23",yn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
82
- `,yn.ObjTree.prototype.attr_prefix="-",yn.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var i=this.parseDOM(e);return i}},yn.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,a=n,s=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),a(d,c),s&&s(c)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(l=u.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},yn.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var r={};r[t.nodeName]=n,n=r}return n}},yn.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var a=t.attributes[i].nodeValue;try{a=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[i].nodeValue}a!=null&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var i=0;i<t.childNodes.length&&s;i++){var l=t.childNodes[i].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(t.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}}else n===null&&(n={});return n}},yn.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=r):n===1?t[e]=r:n===2?t[e]=[t[e],r]:t[e][t[e].length]=r},yn.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},yn.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(Ks(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?typeof o>"u"||o==null?n[n.length]="<".concat(i," />"):typeof o=="object"&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`>
80
+ `},mn.ObjTree.prototype.xml_escape=Cu;var H8=function(t){return new mn.ObjTree().parseXML(t)},z8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ap=function(){return ap=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ap.apply(this,arguments)},Ou=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Hr;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Hr||(Hr={}));var Gb=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],Yb=["properties","startPoint","endPoint","pointsList"],Kb=function(t){return String(t||"").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'")};function qb(t){var e=t?Yb.concat(t):Yb;return function(n){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(a){return r(a)}):(Object.entries(i).forEach(function(a){var s=Ou(a,2),l=s[0],u=s[1];typeof u!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?o[l]=u:o["-".concat(l)]=u:e.includes(l)?o["-".concat(l)]=r(u):o[l]=r(u)}),o)}return r(n)}}function Tu(t){var e={};return Object.entries(t).forEach(function(n){var r=Ou(n,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=Su(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=Tu(o):Array.isArray(o)?e[i]=o.map(function(a){return Tu(a)}):e[i]=o}),e}function W8(t,e,n){var r=new Map;e.nodes.forEach(function(o){var a,s={"-id":o.id};if(!((a=o.text)===null||a===void 0)&&a.value&&(s["-name"]=o.text.value),o.properties){var l=qb(n)(o.properties);Object.assign(s,l)}r.set(o.id,s),t[o.type]?Array.isArray(t[o.type])?t[o.type].push(s):t[o.type]=[t[o.type],s]:t[o.type]=s});var i=e.edges.map(function(o){var a,s,l=r.get(o.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(o.id):l["bpmn:incoming"]=[l["bpmn:incoming"],o.id]:l["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((a=o.text)===null||a===void 0)&&a.value&&(u["-name"]=(s=o.text)===null||s===void 0?void 0:s.value),o.properties){var c=qb(n)(o.properties);Object.assign(u,c)}return u});e.edges.forEach(function(o){var a=r.get(o.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(o.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],o.id]:a["bpmn:outgoing"]=o.id}),t[Hr.FLOW]=i}function U8(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Mi.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}function V8(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],a=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!a)return{nodes:e,edges:n};Object.keys(i).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=i[s];if(s===Hr.FLOW){var u=a["bpmndi:BPMNEdge"],c=(Array.isArray(u),u);n=G8(l,c)}else{var d=a["bpmndi:BPMNShape"],f=(Array.isArray(d),d);e=e.concat(X8(l,f,s))}}})}return{nodes:e,edges:n}}function X8(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=Zb(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=Zb(i,n,t);r.push(o)}return r}function Zb(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=Kb(n["-name"]),a=Mi.shapeConfigMap.get(e);a&&(r+=a.width/2,i+=a.height/2);var s;Object.entries(n).forEach(function(d){var f=Ou(d,2),h=f[0],v=f[1];Gb.indexOf(h)===-1&&(s||(s={}),s[h]=v)}),s&&(s=Tu(s));var l;if(o&&(l={x:r,y:i,value:o},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(u["-x"])+Number(u["-width"])/2,l.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:i,properties:s};return l&&(c.text=l),c}function G8(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(Jb(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(Jb(r,t))}return n}function Jb(t,e){var n,r=e["-name"]?Kb("".concat(e["-name"])):"";if(r){var i=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(`
81
+ `).forEach(function(h){o<h.length&&(o=h.length)}),i)n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7};else{var a=t["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,u=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,c=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:r,x:u,y:c}}}var d;Object.entries(e).forEach(function(h){var v=Ou(h,2),g=v[0],m=v[1];Gb.indexOf(g)===-1&&(d||(d={}),d[g]=m)}),d&&(d=Tu(d));var f={id:e["-id"],type:Hr.FLOW,pointsList:t["di:waypoint"].map(function(h){return{x:Number(h["-x"]),y:Number(h["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:d};return n&&(f.text=n),f}var Mi=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a=ap({},r.processAttributes);W8(a,i,o);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};U8(s,i);var l=r.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var u={"bpmn:definitions":l};return u},this.adapterIn=function(i){if(i)return V8(i)},n.adapterIn=function(i){return r.adapterIn(i)},n.adapterOut=function(i,o){return r.adapterOut(i,o)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(Vb())},this.definitionAttributes={"-id":"Definitions_".concat(Vb()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Mi.shapeConfigMap.set(Hr.START,{width:Lb.width,height:Lb.height}),Mi.shapeConfigMap.set(Hr.END,{width:Ib.width,height:Ib.height}),Mi.shapeConfigMap.set(Hr.GATEWAY,{width:kb.width,height:kb.height}),Mi.shapeConfigMap.set(Hr.SYSTEM,{width:Bb.width,height:Bb.height}),Mi.shapeConfigMap.set(Hr.USER,{width:jb.width,height:jb.height});var Y8=function(t){z8(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(o){var a=typeof o=="string"?r.sanitizeNameAttributes(o):o,s=H8(a);return r.adapterIn(s)},r.adapterXmlOut=function(o,a){var s=r.adapterOut(o,a);return $8(s)};var i=n.lf;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(r,i){var o=i.replace(/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e}(Mi),K8=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var r=Math.random()*16|0,i=n==="x"?r:r&3|8;return i.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t}(),q8=(globalThis==null?void 0:globalThis._ids)||new K8;function Z8(){return q8.next()}var Qb=function(){return Qb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Qb.apply(this,arguments)},e0=function(){return e0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},e0.apply(this,arguments)},t0=function(){return t0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},t0.apply(this,arguments)},n0=function(){return n0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},n0.apply(this,arguments)},r0=function(){return r0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},r0.apply(this,arguments)};Te("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Te("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Te("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"}),Te("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var i0=function(){return i0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i0.apply(this,arguments)},o0=function(){return o0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o0.apply(this,arguments)},J8=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),to=function(){return to=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},to.apply(this,arguments)},Q8=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},eF=tr,tF=function(t){J8(e,t);function e(n){var r=t.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y;r.nodeModel.x=l+o/2,r.nodeModel.y=u+a/2,r.nodeModel.moveText(o/2,a/2)},r.getResize=function(i){var o=i.index,a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo,d=i.pct,f=d===void 0?1:d,h=i.freezeWidth,v=h===void 0?!1:h,g=i.freezeHeight,m=g===void 0?!1:g,y={width:l,height:u,deltaX:a,deltaY:s};if(c){var x=4,E=0,b=0;switch(o){case 0:b=(a*-1-s)/x;break;case 1:b=(a-s)/x;break;case 2:b=(a+s)/x;break;case 3:b=(a*-1+s)/x;break}b!==0&&(E=Math.round(b/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+E,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var T=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),A=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(o){case 0:a=l-T,s=u-A;break;case 1:a=T-l,s=u-A;break;case 2:a=T-l,s=A-u;break;case 3:a=l-T,s=A-u;break}return y.width=T,y.height=A,y.deltaX=a/f,y.deltaY=s/f,y}switch(o){case 0:y.width=v?l:l-a*f,y.height=m?u:u-s*f;break;case 1:y.width=v?l:l+a*f,y.height=m?u:u-s*f;break;case 2:y.width=v?l:l+a*f,y.height=m?u:u+s*f;break;case 3:y.width=v?l:l-a*f,y.height=m?u:u+s*f;break}return y},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,a=i.anchors,s=r.getNodeEdges(o);s.sourceEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.sourceAnchorId});u&&l.updateStartPoint({x:u.x,y:u.y})}),s.targetEdges.forEach(function(l){var u=a.find(function(c){return c.id===l.targetAnchorId});u&&l.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y,c=s.width,d=s.height,f=s.radius,h=s.PCTResizeInfo,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=r.index,b=g===y,T=m===x,A=r.getResize({index:E,deltaX:o,deltaY:a,width:c,height:d,PCTResizeInfo:h,pct:1,freezeWidth:b,freezeHeight:T});if(A.width<g||A.width>y||A.height<m||A.height>x){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:b?0:A.deltaX,deltaY:T?0:A.deltaY}),r.nodeModel.width=A.width,r.nodeModel.height=A.height,r.nodeModel.setProperties({nodeSize:{width:A.width,height:A.height}});var S={x:l,y:u,width:c,height:d,radius:f},M={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:f};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:S,afterNode:M})},r.updateEllipse=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:to(to({},M),{rx:l,ry:u}),afterNode:C})},r.updateDiamond=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,c=s.x,d=s.y,f=s.PCTResizeInfo,h=r.index,v=r.nodeModel,g=v.minWidth,m=v.minHeight,y=v.maxWidth,x=v.maxHeight,E=g===y,b=m===x,T=l,A=u,S=r.getResize({index:h,deltaX:o,deltaY:a,width:T,height:A,PCTResizeInfo:f,pct:1/2,freezeWidth:E,freezeHeight:b});if(S.width<g/2||S.width>y/2||S.height<m/2||S.height>x/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:E?0:S.deltaX,deltaY:b?0:S.deltaY}),r.nodeModel.rx=S.width,r.nodeModel.ry=S.height,r.nodeModel.setProperties({nodeSize:{rx:S.width,ry:S.height}});var M={x:c,y:d,rx:l,ry:u},C={rx:S.width,ry:S.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:M,afterNode:C})},r.eventEmit=function(i){var o=i.deltaX,a=i.deltaY,s=i.beforeNode,l=i.afterNode,u=r.nodeModel,c=u.id,d=u.modelType,f=u.type,h=to({id:c,modelType:d,type:f},s),v=to({id:c,modelType:d,type:f},l);r.graphModel.eventCenter.emit("node:resize",{preData:h,data:v,deltaX:o,deltaY:a,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,a=i.deltaX,s=i.deltaY,l=r.graphModel.transformModel,u=r.nodeModel.modelType;o=Q8(l.fixDeltaXY(a,s),2),a=o[0],s=o[1],u===Ye.RECT_NODE||u===Ye.HTML_NODE?r.updateRect({deltaX:a,deltaY:s}):u===Ye.ELLIPSE_NODE?r.updateEllipse({deltaX:a,deltaY:s}):u===Ye.DIAMOND_NODE&&r.updateDiamond({deltaX:a,deltaY:s})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,a=o*Math.round(r.nodeModel.x/o),s=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(a,s),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new eF({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(n){for(var r=this.graphModel,i=r.edges,o=[],a=[],s=0;s<i.length;s++){var l=i[s];l.sourceNodeId===n?o.push(l):i[s].targetNodeId===n&&a.push(l)}return{sourceEdges:o,targetEdges:a}},e.prototype.render=function(){var n=this.props,r=n.x,i=n.y,o=n.index,a=n.model,s=a.getControlPointStyle();return V("g",{className:"lf-resize-control-".concat(o),children:V(rr,to({className:"lf-node-control",x:r,y:i},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(Qe),nF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nu=function(){return Nu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Nu.apply(this,arguments)},Mu=function(t){nF(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,r=n.model,i=n.graphModel,o=r.x,a=r.y,s=r.width,l=r.height,u={minX:o-s/2,minY:a-l/2,maxX:o+s/2,maxY:a+l/2},c=u.minX,d=u.minY,f=u.maxX,h=u.maxY,v=[{x:c,y:d},{x:f,y:d},{x:f,y:h},{x:c,y:h}];return v.map(function(g,m){return V(tF,Nu({index:m},g,{model:r,graphModel:i}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.getResizeOutlineStyle();return V(rr,Nu({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return V("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(Qe),a0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rF=function(t){a0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Mf),iF=function(t){a0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Mu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r.isSelected&&!i?this.getControlGroup():""]})},e}(Wf),oF={type:"ellipse",view:iF,model:rF},s0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=function(){return sp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sp.apply(this,arguments)},aF=function(t){s0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Nf),sF=function(t){s0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Mu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){var n=this.props.model,r=n.points,i=n.getNodeStyle();return V("g",{children:V(wf,sp({},i,{points:r}))})},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Hf),lF={type:"diamond",view:sF,model:aF},l0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uF=function(t){l0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Df),cF=function(t){l0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Mu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Vf),dF={type:"html",view:cF,model:uF},u0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c0=function(t){u0(e,t);function e(n,r){var i=t.call(this,n,r)||this,o=n.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e}(Uo),d0=function(t){u0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,r=n.model,i=n.graphModel;return V(Mu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,r=n.model.isSelected,i=n.graphModel.editConfigModel.isSilentMode;return V("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e}(Ji),fF={type:"rect",view:d0,model:c0},pF={pluginName:"nodeResize",step:0,install:function(t){t.register(oF),t.register(lF),t.register(dF),t.register(fF)}},f0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Du=function(){return Du=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Du.apply(this,arguments)},no=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ro=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},p0=500,h0=300,hF=-1e4;(function(t){f0(e,t);function e(){var n=t.apply(this,ro([],no(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=p0,n.unfoldedHeight=h0,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var r=this;t.prototype.initNodeData.call(this,n);var i=[];We(n.children)&&(i=n.children),this.children=new Set(i),this.width=p0,this.height=h0,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=hF,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){r.isFolded&&r.foldGroup(r.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var r=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var i=ro(ro([],no(this.incoming.edges),!1),no(this.outgoing.edges),!1);this.children.forEach(function(o){var a=r.graphModel.getElement(o);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=r.childrenLastFoldStatus[o];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}r.childrenLastFoldStatus[o]=!!s,a.visible=!n;var u=a.incoming.edges,c=a.outgoing.edges;i=ro(ro(ro([],no(i),!1),no(u),!1),no(c),!1)}}),this.foldEdge(n,i)}},e.prototype.getAnchorStyle=function(n){var r=t.prototype.getAnchorStyle.call(this,n);return r.stroke="transparent",r.fill="transparent",r.hover.fill="transparent",r.hover.stroke="transparent",r},e.prototype.foldEdge=function(n,r){var i=this;r.forEach(function(o,a){var s=o.id,l=o.sourceNodeId,u=o.targetNodeId,c=o.startPoint,d=o.endPoint,f=o.type,h=o.text,v=o.getProperties(),g={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:u,startPoint:c,endPoint:d,type:f,properties:v,text:h==null?void 0:h.value};o.virtual&&i.graphModel.deleteEdgeById(o.id);var m=i.graphModel.group.getNodeGroup(u);m||(m=i.graphModel.getNodeModelById(u));var y=i.graphModel.group.getNodeGroup(l);y||(y=i.graphModel.getNodeModelById(l)),n&&o.visible!==!1&&(i.children.has(l)||i.id===l?(g.startPoint=void 0,g.sourceNodeId=i.id):(g.endPoint=void 0,g.targetNodeId=i.id),(m.id!==i.id||y.id!==i.id)&&i.createVirtualEdge(g),o.visible=!1),!n&&o.visible===!1&&(m&&m.isGroup&&m.isFolded?(g.targetNodeId=m.id,g.endPoint=void 0,i.createVirtualEdge(g)):y&&y.isGroup&&y.isFolded?(g.sourceNodeId=y.id,g.startPoint=void 0,i.createVirtualEdge(g)):o.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isFoldedEdge=!0},e.prototype.isInRange=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return r>=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var r=n.minX,i=n.minY,o=n.maxX,a=n.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=ro([],no(this.children),!1),n.isGroup=!0;var r=n.properties;return r==null||delete r.groupAddable,r!=null&&r.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(c0),function(t){f0(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,r=n.resizable,i=n.properties;return r&&!i.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.properties,u=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var c=this.props.model.getNodeStyle().strokeWidth,d=c===void 0?0:c,f=u(),h=r+d+8,v=i+d+8;return Te("rect",Du(Du({},f),{width:h,height:v,x:o-h/2,y:a-v/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,r=n.x-n.width/2+5,i=n.y-n.height/2+5;if(!n.foldable)return null;var o=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return Te("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(d0);var g0=function(){return g0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},g0.apply(this,arguments)},v0=function(){return v0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},v0.apply(this,arguments)},m0=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(){return ls=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ls.apply(this,arguments)};function gF(t){var e=function(r){m0(i,r);function i(o,a){o.id||(o.id="Flow_".concat(Z8()));var s=ls(ls(ls({},{}),o.properties),{isDefaultFlow:!1});return o.properties=s,r.call(this,o,a)||this}return i.extendKey="SequenceFlowModel",i}(Ya),n=function(r){m0(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i.prototype.getStartArrow=function(){var o=this.props.model,a=o.properties.isDefaultFlow;return a?Te("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Te("path",{d:""})},i.extendKey="SequenceFlowEdge",i}(os);return{type:"bpmn:sequenceFlow",view:n,model:e}}gF();var y0={width:40,height:40},_0={width:40,height:40},b0={width:100,height:80},Pu={width:100,height:80},x0={width:100,height:80},E0={width:100,height:80},w0={width:100,height:80},S0={width:100,height:80},C0={width:100,height:80},A0={width:100,height:80},yn=function(){};yn.ObjTree=function(){return this},yn.ObjTree.VERSION="0.23",yn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
82
+ `,yn.ObjTree.prototype.attr_prefix="-",yn.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var i=this.parseDOM(e);return i}},yn.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,a=n,s=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),a(d,c),s&&s(c)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(l=u.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},yn.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var r={};r[t.nodeName]=n,n=r}return n}},yn.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,r={};if(t.attributes&&t.attributes.length){n={};for(var i=0;i<t.attributes.length;i++){var o=t.attributes[i].nodeName;if(typeof o=="string"){var a=t.attributes[i].nodeValue;try{a=JSON.parse(t.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[i].nodeValue}a!=null&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var i=0;i<t.childNodes.length&&s;i++){var l=t.childNodes[i].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var i=0;i<t.childNodes.length;i++)n+=t.childNodes[i].nodeValue}else{n||(n={});for(var i=0;i<t.childNodes.length;i++){var o=t.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(t.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(n,o,r[o],a))}}}}else n===null&&(n={});return n}},yn.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=r):n===1?t[e]=r:n===2?t[e]=[t[e],r]:t[e][t[e].length]=r},yn.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},yn.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(qs(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?typeof o>"u"||o==null?n[n.length]="<".concat(i," />"):typeof o=="object"&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`>
83
83
  `).concat(s,"</").concat(t,`>
84
84
  `):s="<".concat(t).concat(a,">").concat(s,"</").concat(t,`>
85
85
  `):s="<".concat(t).concat(a,` />
86
86
  `)),s},yn.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?n[n.length]="<".concat(t," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")},yn.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
87
- `)},yn.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var vF=function(t){return new yn.ObjTree().parseXML(t)};function O0(t){return Object.prototype.toString.call(t)}function T0(t){return" ".repeat(t)}function Pu(t){return O0(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var r=n;return n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Pu(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return Pu(e)}):t}function mF(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Pu(t)).replace(/"/g,"'")}return e}var N0=`
88
- `;function Ru(t,e,n){var r=T0(n),i="",o=N0+r;if(e==="-json")return"";if(e==="#text")return o+t;if(e==="#cdata-section")return"".concat(o,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(o,"<!--").concat(t,"-->");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(mF(t),'"');if(Array.isArray(t))i+=t.map(function(u){return Ru(u,e,n+1)}).join("");else if(O0(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?N0+T0(n+1)+t["-json"]:"";i+="".concat(n===0?"":o,"<").concat(e),a.forEach(function(u){u.charAt(0)==="-"?s+=Ru(t[u],u,n+1):l+=Ru(t[u],u,n+1)}),i+=s+(l!==""?">".concat(l).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function yF(t){var e="";for(var n in t)e+=Ru(t[n],n,0);return e}var _F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lp=function(){return lp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lp.apply(this,arguments)},M0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},up=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},un=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Or=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},_n;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(_n||(_n={}));var D0=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],bF=["properties","startPoint","endPoint","pointsList"],Lu={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},P0=function(t,e){var n=Object.keys(e||{});return n.forEach(function(r){if(t[r]){var i=e[r],o=i.in,a=i.out;o&&(t[r].in=o),a&&(t[r].out=a)}else t[r]=e[r]}),t},or={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat(o(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o,a=t,s=e["-id"],l="",u="";try{for(var c=up(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;f.includes("bpmn:")&&(i=un(f.split(":"),2),l=i[1],u=(o=e[f])===null||o===void 0?void 0:o["#text"])}}catch(h){n={error:h}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function xF(t){var e=t??{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(Or(Or([],un(bF),!1),un(n||[]),!1)),a={in:new Set(Or(Or([],un(Lu.in),!1),un((r==null?void 0:r.in)||[]),!1)),out:new Set(Or(Or([],un(Lu.out),!1),un((r==null?void 0:r.out)||[]),!1))};return or=P0(or,i),function(s){var l=s.nodes,u=s.edges;function c(d,f){var h,v;if((d==null?void 0:d.flag)!==1){var g;if((g=or[d.type])&&g.out){var m=g.out(d),y=Object.keys(m);y.length>0&&y.forEach(function(C){d[C]=m[C]})}d!=null&&d.children&&(d.children=d.children.map(function(C){var G=l.find(function(K){return K.id===C})||u.find(function(K){return K.id===C});return G||{}}));var x={};if(typeof d=="string")return d;if(Array.isArray(d))return d.map(function(C){return c(C,"")}).filter(function(C){return C!=null});try{for(var E=up(Object.entries(d)),b=E.next();!b.done;b=E.next()){var T=un(b.value,2),A=T[0],S=T[1];if((S==null?void 0:S.flag)===1)return;var M=[f,A].filter(function(C){return C}).join(".");a.out.has(M)||(typeof S!="object"?A.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(A)?x[A]=S:x["-".concat(A)]=S:o.has(M)?x["-".concat(A)]=c(S,M):x[A]=c(S,M))}}catch(C){h={error:C}}finally{try{b&&!b.done&&(v=E.return)&&v.call(E)}finally{if(h)throw h.error}}return x}}return c(s,"")}}function Iu(t){var e,n,r={};try{for(var i=up(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=un(o.value,2),s=a[0],l=a[1];s.indexOf("-")===0?r[s.substring(1)]=Pu(l):typeof l=="string"?r[s]=l:Object.prototype.toString.call(l)==="[object Object]"?r[s]=Iu(l):Array.isArray(l)?r[s]=l.map(function(u){return Iu(u)}):r[s]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function EF(t,e,n){var r,i=new Map,o=xF(n)(e);o.nodes.forEach(function(s){var l=s["-id"],u=s["-type"],c=s.text,d=s.children,f=M0(s,["-id","-type","text","children"]),h={"-id":l};c!=null&&c["-value"]&&(h["-name"]=c["-value"]),f["-json"]&&(h["-json"]=f["-json"]),f["-properties"]&&Object.assign(h,f["-properties"]),d&&(h.children=d),t[u]||(t[u]=[]),t[u].push(h),i.set(l,h)});var a=o.edges.map(function(s){var l=s["-id"],u=s["-sourceNodeId"],c=s["-targetNodeId"],d=s.text,f=M0(s,["-id","-sourceNodeId","-targetNodeId","text"]),h=i.get(c);h["bpmn:incoming"]||(h["bpmn:incoming"]=[]),h["bpmn:incoming"].push(l);var v={"-id":l,"-sourceRef":u,"-targetRef":c};return d!=null&&d["-value"]&&(v["-name"]=d["-value"]),f["-json"]&&(v["-json"]=f["-json"]),f["-properties"]&&Object.assign(v,f["-properties"]),v});return e.edges.forEach(function(s){var l=s.sourceNodeId,u=s.id,c=i.get(l);c["bpmn:outgoing"]||(c["bpmn:outgoing"]=[]),c["bpmn:outgoing"].push(u)}),(r=t["bpmn:subProcess"])===null||r===void 0||r.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];s.children.forEach(function(g){var m,y=i.get(g["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(E){y[E]&&y[E].forEach(function(b){l[E].add(b)})});var x=(m=t[g["-type"]])===null||m===void 0?void 0:m.findIndex(function(E){return E["-id"]===g["-id"]});x>=0&&t[g["-type"]].splice(x,1),i.delete(g["-id"]),s[g["-type"]]||(s[g["-type"]]=[]),s[g["-type"]].push(y)});var c=l["bpmn:incoming"],d=l["bpmn:outgoing"];d.forEach(function(g){c.has(g)&&u.push(g)});for(var f=function(g){var m=a.findIndex(function(y){return y["-id"]===u[g]});m>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[m]),a.splice(m,1)):g++,h=g},h,v=0;v<u.length;)f(v),v=h;delete s.children}),t[_n.FLOW]=a,t}function wF(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Tn.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}var SF=["bpmn:incoming","bpmn:outgoing"];function CF(t,e){var n=[],r=[],i=new Map,o=e??{},a=o.transformer,s=o.excludeFields,l={in:new Set(Or(Or([],un(Lu.in),!1),un((s==null?void 0:s.in)||[]),!1)),out:new Set(Or(Or([],un(Lu.out),!1),un((s==null?void 0:s.out)||[]),!1))};or=P0(or,a);var u=t["bpmn:definitions"];if(u){var c=u["bpmn:process"];(function(f,h){h.forEach(function(v){try{Object.keys(f).forEach(function(g){try{v(g)}catch(m){console.error(m)}})}catch(g){console.error(g)}})})(c,[function(f){function h(g){g["-children"]||(g["-children"]=[]),Object.keys(g).forEach(function(m){var y;m.indexOf("bpmn:")===0&&!SF.includes(m)&&(c[m]||(c[m]=[]),!Array.isArray(c[m])&&(c[m]=[c[m]]),Array.isArray(g[m])?(y=c[m]).push.apply(y,Or([],un(g[m]),!1)):c[m].push(g[m]),Array.isArray(g[m])?g[m].forEach(function(x){!m.includes("Flow")&&g["-children"].push(x["-id"])}):!m.includes("Flow")&&g["-children"].push(g[m]["-id"]),delete g[m])})}if(f==="bpmn:subProcess"){var v=c[f];Array.isArray(v)?v.forEach(function(g){f==="bpmn:subProcess"&&h(g)}):h(v)}},function(f){var h=function(g){Object.keys(g).forEach(function(m){var y,x;if(m.includes("bpmn:")){var E={};or[m]&&or[m].in?(E=(x=(y=or[m]).in)===null||x===void 0?void 0:x.call(y,m,O.cloneDeep(g[m])),delete g[m]):v(g[m]);var b=void 0;(b=Reflect.ownKeys(E)).length>0&&b.forEach(function(T){Reflect.set(g,T,E[T])})}})};function v(g){i.set(g["-id"],g),Array.isArray(g)?g.forEach(function(m){v(m)}):typeof g=="object"&&h(g)}v(c[f])},function(f){if(f.indexOf("bpmn:")===0){var h=c[f];if(f==="bpmn:sequenceFlow"){var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=OF(h,v)}else{var g=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(f==="bpmn:boundaryEvent"){var m=c[f],y=function(x){var E=x["-attachedToRef"],b=i.get(E);b["-boundaryEvents"]||(b["-boundaryEvents"]=[]),b["-boundaryEvents"].push(x["-id"])};Array.isArray(m)?m.forEach(function(x){y(x)}):y(m)}n=n.concat(AF(h,g,f))}}}])}var d=function(f,h,v){Object.keys(f).forEach(function(g){var m=v?"".concat(v,".").concat(g):g;h.has(m)?delete f[g]:typeof f[g]=="object"&&d(f[g],h,m)})};return n.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),r.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),{nodes:n,edges:r}}function AF(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=R0(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=R0(i,n,t);r.push(o)}return r}function R0(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],s=Tn.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l={};Object.entries(n).forEach(function(f){var h=un(f,2),v=h[0],g=h[1];D0.includes(v)||(l[v]=g)}),l=Iu(l);var u;if(a&&(u={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),u&&(d.text=u),d}function OF(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(L0(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(L0(r,t))}return n}function L0(t,e){var n,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(`
89
- `).forEach(function(u){o<u.length&&(o=u.length)}),n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach(function(u){var c=un(u,2),d=c[0],f=c[1];D0.includes(d)||(a[d]=f)}),a=Iu(a);var s=t["di:waypoint"].map(function(u){return{x:Number(u["-x"]),y:Number(u["-y"])}}),l={id:e["-id"],type:_n.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var Tn=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a,s,l=lp({},r.processAttributes);EF(l,i,o);var u={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};wF(u,i);var c=r.definitionAttributes;c["bpmn:process"]=l,c["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":u};var d={"bpmn:definitions":c};if(!((a=o==null?void 0:o.mapping)===null||a===void 0)&&a.out){var f=(s=o==null?void 0:o.mapping)===null||s===void 0?void 0:s.out,h=function(v){Array.isArray(v)&&v.forEach(function(g){return h(g)}),typeof v=="object"&&Object.keys(v).forEach(function(g){var m;(m=f[g])?(v[m]=O.cloneDeep(v[g]),delete v[g],h(v[m])):h(v[g])})};h(d)}return d},this.adapterIn=function(i,o){if(i)return CF(i,o)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Tn.shapeConfigMap.set(_n.START,{width:y0.width,height:y0.height}),Tn.shapeConfigMap.set(_n.END,{width:_0.width,height:_0.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_CATCH,{width:Du.width,height:Du.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_THROW,{width:Du.width,height:Du.height}),Tn.shapeConfigMap.set(_n.BOUNDARY,{width:b0.width,height:b0.height}),Tn.shapeConfigMap.set(_n.PARALLEL_GATEWAY,{width:x0.width,height:x0.height}),Tn.shapeConfigMap.set(_n.INCLUSIVE_GATEWAY,{width:E0.width,height:E0.height}),Tn.shapeConfigMap.set(_n.EXCLUSIVE_GATEWAY,{width:w0.width,height:w0.height}),Tn.shapeConfigMap.set(_n.SYSTEM,{width:S0.width,height:S0.height}),Tn.shapeConfigMap.set(_n.USER,{width:C0.width,height:C0.height}),Tn.shapeConfigMap.set(_n.SUBPROCESS,{width:A0.width,height:A0.height}),function(t){_F(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(a){var s=vF(a);return r.adapterIn(s,r.props)},r.adapterXmlOut=function(a){var s=r.adapterOut(a,r.props);return yF(s)};var i=n.lf,o=n.props;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r.props=o,r}return e.pluginName="BPMNAdapter",e}(Tn);var I0=function(){return I0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},I0.apply(this,arguments)};function TF(t,e,n){var r=e.x,i=e.y,o=t.x,a=t.y,s=o-r,l=a-i,u=s*Math.cos(n)-l*Math.sin(n),c=s*Math.sin(n)+l*Math.cos(n),d=u+r,f=c+i;return{x:d,y:f}}var NF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(){return ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ku.apply(this,arguments)},MF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},DF=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){NF(e,t);function e(){var n=t.apply(this,DF([],MF(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(r){var i=r.model,o=n.props,a=o.model,s=o.graphModel,l=a.transformWithContainer,u=a.isRestrict,c=n.childrenPositionMap;if(!(!l||u)&&i.id===a.id){var d={x:a.x,y:a.y};gt(Array.from(a.children),function(f){var h=s.getNodeModelById(f);if(h){var v={x:h.x,y:h.y};c.has(h.id)?v=c.get(h.id):c.set(h.id,v);var g=i.rotate*(180/Math.PI);g<0&&(g+=360);var m=g*(Math.PI/180),y=TF(v,d,m);h.moveTo(y.x,y.y),h.rotate=i.rotate}})}},n.onNodeResize=function(r){var i=r.deltaX,o=r.deltaY,a=r.index,s=r.model,l=r.preData,u=n.props,c=u.model,d=u.graphModel,f=c.transformWithContainer,h=c.isRestrict;if(!(!f||h)&&s.id===c.id){var v=l.properties,g=v||{},m=g.width,y=g.height;gt(Array.from(c.children),function(x){var E=d.getNodeModelById(x);if(E){var b=E.width/m*i,T=E.height/y*o;lb({deltaX:b,deltaY:T,index:a,nodeModel:E,graphModel:d,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var r=n.props.model;r.isCollapsed&&r.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,r){var i=this,o=[];return n.isGroup&&gt(Array.from(n.children),function(a){o.push(a);var s=r.getNodeModelById(a);s!=null&&s.isGroup&&(o=o.concat(i.getNodesInGroup(s,r)))}),o},e.prototype.getResizeControl=function(){var n=this.props.model,r=n.resizable,i=n.isCollapsed,o=r&&!i;return o?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var u=n.getNodeStyle().strokeWidth,c=u===void 0?0:u,d=n.getAddableOutlineStyle(),f=r+c+8,h=i+c+8;return Te("rect",ku(ku({},d),{width:f,height:h,x:o-f/2,y:a-h/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10)},e.prototype.getExpandIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=r-o/2+10,l=i-a/2+10;if(!n.collapsible)return null;var u=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),c=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),c])},e.prototype.getShape=function(){return Te("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(Ji);var PF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bu.apply(this,arguments)},cp=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},us=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},RF=400,LF=230,IF=80,kF=60,BF=-1e4;(function(t){PF(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.isGroup=!0,i.isRestrict=!1,i.autoResize=!1,i.collapsible=!0,i.isCollapsed=!1,i.groupAddable=!1,i.transformWithContainer=!1,i.childrenLastCollapseStateDict=new Map,i.childrenLastCollapseStateDict=new Map,i.initNodeData(n),i.setAttributes(),i}return e.prototype.initNodeData=function(n){var r;t.prototype.initNodeData.call(this,n);var i=(r=n.properties)!==null&&r!==void 0?r:{},o=i.children,a=i.width,s=i.height,l=i.collapsedWidth,u=i.collapsedHeight,c=i.collapsible,d=i.isCollapsed,f=i.zIndex,h=i.isRestrict,v=i.autoResize,g=i.autoToFront,m=i.transformWithContainer;this.children=o?new Set(o):new Set,this.zIndex=f??BF,this.isCollapsed=d??!1,this.setProperties({isCollapsed:d??!1});var y=a??RF,x=s??LF;this.width=y,this.height=x,this.expandWidth=y,this.expandHeight=x,this.collapsedWidth=l??IF,this.collapsedHeight=u??kF,this.isRestrict=h??!1,this.transformWithContainer=m??!1,this.autoResize=v??!1,this.collapsible=c??!0,this.autoToFront=g??!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this),i=[];return gt(Array.from(this.children),function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&i.push(o)}),r.children=i,r.properties&&(r.properties.children=i,r.properties.isCollapsed=this.isCollapsed),r},e.prototype.getNodesInGroup=function(n){var r=[];return n.isGroup&&gt(Array.from(n.children),function(i){r.push(i)}),r},e.prototype.getMoveDistance=function(n,r,i){i===void 0&&(i=!1);var o=qo(t.prototype.getMoveDistance.call(this,n,r,i),2),a=o[0],s=o[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,r,i),[a,s]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var r=this,i=r.x,o=r.y,a=r.collapsedWidth,s=r.collapsedHeight,l=r.expandWidth,u=r.expandHeight,c=r.isCollapsed;return c&&(n.x=i+l/2-a/2,n.y=o+u/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+u/2-s/2)),n},e.prototype.toggleCollapse=function(n){var r=this,i=this.graphModel,o=!!n;this.isCollapsed=o,this.setProperties({isCollapsed:o}),i.eventCenter.emit("dynamicGroup:collapse",{collapse:o,nodeModel:this}),o?this.collapse():this.expand();var a=us(us([],qo(this.incoming.edges),!1),qo(this.outgoing.edges),!1),s=Array.from(this.children);gt(s,function(l){var u,c,d=r.graphModel.elementsModelMap.get(l);if(d){var f=d.isCollapsed;if(d.isGroup){var h=d;if(h.isCollapsed||h.toggleCollapse(n),!n){var v=(u=r.childrenLastCollapseStateDict)===null||u===void 0?void 0:u.get(l);v!==void 0&&v!==d.isCollapsed&&h.toggleCollapse(v)}}if((c=r.childrenLastCollapseStateDict)===null||c===void 0||c.set(l,!!f),d.visible=!n,d.BaseType===Lt.NODE){var g=d.incoming.edges,m=d.outgoing.edges;a=us(us(us([],qo(a),!1),qo(g),!1),qo(m),!1)}}}),this.collapseEdge(o,a)},e.prototype.collapse=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.width,s=n.height,l=n.collapsedWidth,u=n.collapsedHeight;this.x=r-a/2+l/2,this.y=i-s/2+u/2,this.text.x=o.x-a/2+l/2,this.text.y=o.y-s/2+u/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=u},e.prototype.expand=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,u=n.collapsedHeight;this.width=a,this.height=s,this.x=r+this.width/2-l/2,this.y=i+this.height/2-u/2,this.text.x=o.x+this.width/2-l/2,this.text.y=o.y+this.height/2-u/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,r){var i=this,o=this.graphModel;gt(r,function(a,s){var l,u=a.getData(),c=u.targetNodeId,d=u.sourceNodeId,f=Bu(Bu({},u),{id:"".concat(u.id,"__").concat(s),text:(l=u.text)===null||l===void 0?void 0:l.value});a.virtual&&o.deleteEdgeById(a.id);var h=o.dynamicGroup.getGroupByNodeId(c);h||(h=o.getNodeModelById(c));var v=o.dynamicGroup.getGroupByNodeId(d);v||(v=o.getNodeModelById(d)),n&&a.visible&&(i.children.has(d)||i.id===d?(f.startPoint=void 0,f.sourceNodeId=i.id):(f.endPoint=void 0,f.targetNodeId=i.id),(h.id!==i.id||v.id!==i.id)&&i.createVirtualEdge(f),a.visible=!1),!n&&!a.visible&&(h&&h.isGroup&&h.isCollapsed?(f.targetNodeId=h.id,f.endPoint=void 0,i.createVirtualEdge(f)):v&&v.isGroup&&v.isCollapsed?(f.sourceNodeId=v.id,f.startPoint=void 0,i.createVirtualEdge(f)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var r=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:r,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var r=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:r})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},cp([X],e.prototype,"isCollapsed",void 0),cp([X],e.prototype,"groupAddable",void 0),cp([X],e.prototype,"transformWithContainer",void 0),e})(Uo);var k0=function(){return k0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},k0.apply(this,arguments)},B0;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(B0||(B0={}));var jF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cs=function(){return cs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},cs.apply(this,arguments)},FF=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},$F=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},HF=function(t){jF(e,t);function e(n){var r=t.call(this,n)||this;r.textRef=pl(),r.setHoverOn=function(){var l=r.props.element;l.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),l.setHovered(!0))},r.setHoverOff=function(){var l=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),l.setHovered(!1))},r.handleMouseDown=function(l){var u,c=r.props,d=c.label,f=c.graphModel,h=f.editConfigModel.nodeTextDraggable;((u=d.draggable)!==null&&u!==void 0?u:h)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(l)},r.handleMouseUp=function(l){r.state.isDragging&&r.stepDrag.handleMouseUp(l)},r.handleDragging=function(l){var u=l.deltaX,c=l.deltaY;r.state.isDragging||r.setState({isDragging:!0});var d=r.props,f=d.label,h=d.graphModel,v=h.transformModel,g=$F(v.fixDeltaXY(u,c),2),m=g[0],y=g[1];r.setElementModelLabelInfo({x:f.x+m,y:f.y+y}),h.eventCenter.emit("label:drag",{data:f.getData(),model:f})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;d.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),f.eventCenter.emit("label:click",{data:c.getData(),e:l,model:d})},r.handleDbClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;if(f.eventCenter.emit("label:dblclick",{data:c.getData(),e:l,model:d}),!c.editable){d.setSelected(!0);return}if(d.setSelected(),d.setElementState(lt.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var h=document.createRange(),v=window.getSelection();h.selectNodeContents(r.textRef.current),h.collapse(!1),v==null||v.removeAllRanges(),v==null||v.addRange(h)}},r.handleBlur=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel.eventCenter;f.emit("label:blur",{e:l,model:d,data:c.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(l){var u=r.props,c=u.label,d=u.graphModel;d.eventCenter.emit("label:input",{e:l,data:c.getData()})},r.reCalcLabelSize=function(){};var i=n.label,o=n.graphModel,a=o.gridSize,s=o.eventCenter;return r.stepDrag=new tr({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(n){var r=this.props,i=r.label,o=r.element,a=r.graphModel,s=o.properties._label,l=s,u=Yc(l,function(f){return f.id===i.id}),c=l[u];l[u]=cs(cs({},c),n);var d=a.getElement(o.id);d==null||d.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,r=this.props,i=r.label,o=r.element,a=r.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,u,c,d,f=s.data;if(((f==null?void 0:f.type)!=="label"||f.type==="label"&&f.id!==i.id||n.state.isSelected)&&n.setState({isSelected:!1}),((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.state.isEditing){n.setState({isEditing:!1});var h=(u=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&u!==void 0?u:"",v=(d=(c=n.textRef.current)===null||c===void 0?void 0:c.innerHTML)!==null&&d!==void 0?d:"";n.setElementModelLabelInfo({value:h,content:v,isSelected:!1}),o.setElementState(lt.DEFAULT)}((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,r=this.props,i=r.label,o=r.element,a=r.graphModel,s=this.state,l=s.isDragging,u=s.isHovered,c=s.isSelected,d=s.isEditing,f=a.transformModel,h=f.getTransformStyle().transform,v=i.id,g=i.x,m=i.y,y=i.zIndex,x=i.vertical,E=i.style,b=i.rotate,T=i.content,A=i.labelWidth,S=i.textOverflowMode,M=A??(o.BaseType==="node"?o.width-20:80),C={left:"".concat(g-M/2,"px"),top:"".concat(m-10,"px"),width:"".concat(M,"px"),height:"20px",zIndex:y??1,transform:b?"".concat(h," rotate(").concat(b,"deg)"):"".concat(h," rotate(").concat(x?-.25:0,"turn)")};return V("div",{id:"element-container-".concat(v),className:kf("lf-label-editor-container"),style:C,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:V("div",{ref:this.textRef,id:"editor-container-".concat(v),className:kf("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":d,"lf-label-editor-hover":!d&&(u||c)},n["lf-label-editor-".concat(S)]=!d,n)),onInput:this.handleInput,style:cs({maxWidth:"".concat(M,"px"),boxSizing:"border-box",display:"inline-block",background:d||o.BaseType==="edge"?"#fff":"transparent"},E),dangerouslySetInnerHTML:{__html:T}})})},e=FF([vn],e),e}(Qe),ar=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},zF=Si,WF=function(){function t(e,n,r){var i;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=r,this.id=(i=e.id)!==null&&i!==void 0?i:zF(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){ut(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:mr(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},ar([X],t.prototype,"x",void 0),ar([X],t.prototype,"y",void 0),ar([X],t.prototype,"content",void 0),ar([X],t.prototype,"value",void 0),ar([X],t.prototype,"rotate",void 0),ar([X],t.prototype,"style",void 0),ar([X],t.prototype,"zIndex",void 0),ar([X],t.prototype,"vertical",void 0),ar([X],t.prototype,"editable",void 0),ar([X],t.prototype,"draggable",void 0),ar([X],t.prototype,"labelWidth",void 0),ar([X],t.prototype,"textOverflowMode",void 0),t}(),ju={exports:{}},dp=ju.exports,j0;function UF(){return j0||(j0=1,function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||function(e){if("Element"in e){var n="classList",r="prototype",i=e.Element[r],o=Object,a=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[r].indexOf||function(v){for(var g=0,m=this.length;g<m;g++)if(g in this&&this[g]===v)return g;return-1},l=function(v,g){this.name=v,this.code=DOMException[v],this.message=g},u=function(v,g){if(g==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(g))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(v,g)},c=function(v){for(var g=a.call(v.getAttribute("class")||""),m=g?g.split(/\s+/):[],y=0,x=m.length;y<x;y++)this.push(m[y]);this._updateClassName=function(){v.setAttribute("class",this.toString())}},d=c[r]=[],f=function(){return new c(this)};if(l[r]=Error[r],d.item=function(v){return this[v]||null},d.contains=function(v){return v+="",u(this,v)!==-1},d.add=function(){var v=arguments,g=0,m=v.length,y,x=!1;do y=v[g]+"",u(this,y)===-1&&(this.push(y),x=!0);while(++g<m);x&&this._updateClassName()},d.remove=function(){var v=arguments,g=0,m=v.length,y,x=!1,E;do for(y=v[g]+"",E=u(this,y);E!==-1;)this.splice(E,1),x=!0,E=u(this,y);while(++g<m);x&&this._updateClassName()},d.toggle=function(v,g){v+="";var m=this.contains(v),y=m?g!==!0&&"remove":g!==!1&&"add";return y&&this[y](v),g===!0||g===!1?g:!m},d.toString=function(){return this.join(" ")},o.defineProperty){var h={get:f,enumerable:!0,configurable:!0};try{o.defineProperty(i,n,h)}catch(v){v.number===-2146823252&&(h.enumerable=!1,o.defineProperty(i,n,h))}}else o[r].__defineGetter__&&i.__defineGetter__(n,f)}}(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(i){var o=function(S){return Object.prototype.toString.call(S).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(M,C,G){this.data=M,this.size=M.length,this.type=C,this.encoding=G},l=a.prototype,u=s.prototype,c=i.FileReaderSync,d=function(S){this.code=this[this.name=S]},f="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),h=f.length,v=i.URL||i.webkitURL||i,g=v.createObjectURL,m=v.revokeObjectURL,y=v,x=i.btoa,E=i.atob,b=i.ArrayBuffer,T=i.Uint8Array,A=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=u.fake=!0;h--;)d.prototype[f[h]]=h+1;return v.createObjectURL||(y=i.URL=function(S){var M=document.createElementNS("http://www.w3.org/1999/xhtml","a"),C;return M.href=S,"origin"in M||(M.protocol.toLowerCase()==="data:"?M.origin=null:(C=S.match(A),M.origin=C&&C[1])),M}),y.createObjectURL=function(S){var M=S.type,C;if(M===null&&(M="application/octet-stream"),S instanceof s)return C="data:"+M,S.encoding==="base64"?C+";base64,"+S.data:S.encoding==="URI"?C+","+decodeURIComponent(S.data):x?C+";base64,"+x(S.data):C+","+encodeURIComponent(S.data);if(g)return g.call(v,S)},y.revokeObjectURL=function(S){S.substring(0,5)!=="data:"&&m&&m.call(v,S)},l.append=function(S){var M=this.data;if(T&&(S instanceof b||S instanceof T)){for(var C="",G=new T(S),K=0,J=G.length;K<J;K++)C+=String.fromCharCode(G[K]);M.push(C)}else if(o(S)==="Blob"||o(S)==="File")if(c){var R=new c;M.push(R.readAsBinaryString(S))}else throw new d("NOT_READABLE_ERR");else S instanceof s?S.encoding==="base64"&&E?M.push(E(S.data)):S.encoding==="URI"?M.push(decodeURIComponent(S.data)):S.encoding==="raw"&&M.push(S.data):(typeof S!="string"&&(S+=""),M.push(unescape(encodeURIComponent(S))))},l.getBlob=function(S){return arguments.length||(S=null),new s(this.data.join(""),S,"raw")},l.toString=function(){return"[object BlobBuilder]"},u.slice=function(S,M,C){var G=arguments.length;return G<3&&(C=null),new s(this.data.slice(S,G>1?M:this.data.length),C,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},a}(e);e.Blob=function(i,o){var a=o&&o.type||"",s=new n;if(i)for(var l=0,u=i.length;l<u;l++)Uint8Array&&i[l]instanceof Uint8Array?s.append(i[l].buffer):s.append(i[l]);var c=s.getBlob(a);return!c.slice&&c.webkitSlice&&(c.slice=c.webkitSlice),c};var r=Object.getPrototypeOf||function(i){return i.__proto__};e.Blob.prototype=r(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||dp.content||dp),function(e,n){var r=typeof process<"u"&&process&&process.versions&&process.versions.electron;r?e.MediumEditor=n:t.exports=n}(dp,function(){function e(n,r){return this.init(n,r)}return e.extensions={},function(n){function r(l,u){var c,d=Array.prototype.slice.call(arguments,2);u=u||{};for(var f=0;f<d.length;f++){var h=d[f];if(h)for(c in h)h.hasOwnProperty(c)&&typeof h[c]<"u"&&(l||u.hasOwnProperty(c)===!1)&&(u[c]=h[c])}return u}var i=!1;try{var o=document.createElement("div"),a=document.createTextNode(" ");o.appendChild(a),i=o.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,u){var c=s.getKeyCode(l);return Array.isArray(u)===!1?c===u:u.indexOf(c)!==-1},getKeyCode:function(l){var u=l.which;return u===null&&(u=l.charCode!==null?l.charCode:l.keyCode),u},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var u=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},defaults:function(){var u=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},createLink:function(l,u,c,d){var f=l.createElement("a");return s.moveTextRangeIntoElement(u[0],u[u.length-1],f),f.setAttribute("href",c),d&&(d==="_blank"&&f.setAttribute("rel","noopener noreferrer"),f.setAttribute("target",d)),f},findOrCreateMatchingTextNodes:function(l,u,c){for(var d=l.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),f=[],h=0,v=!1,g=null,m=null;(g=d.nextNode())!==null;)if(!(g.nodeType>3))if(g.nodeType===3){if(!v&&c.start<h+g.nodeValue.length&&(v=!0,m=s.splitStartNodeIfNeeded(g,c.start,h)),v&&s.splitEndNodeIfNeeded(g,m,c.end,h),v&&h===c.end)break;if(v&&h>c.end+1)throw new Error("PerformLinking overshot the target!");v&&f.push(m||g),h+=g.nodeValue.length,m!==null&&(h+=m.nodeValue.length,d.nextNode()),m=null}else g.tagName.toLowerCase()==="img"&&(!v&&c.start<=h&&(v=!0),v&&f.push(g));return f},splitStartNodeIfNeeded:function(l,u,c){return u!==c?l.splitText(u-c):null},splitEndNodeIfNeeded:function(l,u,c,d){var f,h;f=d+l.nodeValue.length+(u?u.nodeValue.length:0)-1,h=c-d-(u?l.nodeValue.length:0),f>=c&&d!==f&&h!==0&&(u||l).splitText(h)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var u=[],c=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(c).length===0)return[l];for(var d=0;d<l.childNodes.length;d++){var f=l.childNodes[d];if(f.nodeType===3)u.push(f);else if(f.nodeType===1){var h=f.querySelectorAll(c);h.length===0?u.push(f):u=u.concat(e.util.splitByBlockElements(f))}}return u},findAdjacentTextNodeWithContent:function(u,c,d){var f=!1,h,v=d.createNodeIterator(u,NodeFilter.SHOW_TEXT,null,!1);for(h=v.nextNode();h;){if(h===c)f=!0;else if(f&&h.nodeType===3&&h.nodeValue&&h.nodeValue.trim().length>0)break;h=v.nextNode()}return h},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var u=l.previousSibling;!u&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,u=l.previousSibling;return u},isDescendant:function(u,c,d){if(!u||!c)return!1;if(u===c)return!!d;if(u.nodeType!==1)return!1;if(i||c.nodeType!==3)return u.contains(c);for(var f=c.parentNode;f!==null;){if(f===u)return!0;f=f.parentNode}return!1},isElement:function(u){return!!(u&&u.nodeType===1)},throttle:function(l,u){var c=50,d,f,h,v=null,g=0,m=function(){g=Date.now(),v=null,h=l.apply(d,f),v||(d=f=null)};return!u&&u!==0&&(u=c),function(){var y=Date.now(),x=u-(y-g);return d=this,f=arguments,x<=0||x>u?(v&&(clearTimeout(v),v=null),g=y,h=l.apply(d,f),v||(d=f=null)):v||(v=setTimeout(m,x)),h}},traverseUp:function(l,u){if(!l)return!1;do{if(l.nodeType===1){if(u(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},insertHTMLCommand:function(l,u){var c,d,f,h,v,g,m,y=!1,x=["insertHTML",!1,u];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,x)}catch{}if(c=l.getSelection(),c.rangeCount){if(d=c.getRangeAt(0),m=d.commonAncestorContainer,s.isMediumEditorElement(m)&&!m.firstChild)d.selectNode(m.appendChild(l.createTextNode("")));else if(m.nodeType===3&&d.startOffset===0&&d.endOffset===m.nodeValue.length||m.nodeType!==3&&m.innerHTML===d.toString()){for(;!s.isMediumEditorElement(m)&&m.parentNode&&m.parentNode.childNodes.length===1&&!s.isMediumEditorElement(m.parentNode);)m=m.parentNode;d.selectNode(m)}for(d.deleteContents(),f=l.createElement("div"),f.innerHTML=u,h=l.createDocumentFragment();f.firstChild;)v=f.firstChild,g=h.appendChild(v);d.insertNode(h),g&&(d=d.cloneRange(),d.setStartAfter(g),d.collapse(!0),e.selection.selectRange(l,d)),y=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(x,y),y},execFormatBlock:function(l,u){var c=s.getTopBlockContainer(e.selection.getSelectionStart(l)),d;if(u==="blockquote"){if(c&&(d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return s.isBlockContainer(f)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,u)}if(c&&u===c.nodeName.toLowerCase()&&(u="p"),s.isIE&&(u="<"+u+">"),c&&c.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&u==="<p>")return l.execCommand("outdent",!1,u);if((s.isFF||s.isEdge)&&u==="p")return d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return!s.isBlockContainer(f)})&&l.execCommand("formatBlock",!1,u),l.execCommand("outdent",!1,u)}return l.execCommand("formatBlock",!1,u)},setTargetBlank:function(l,u){var c,d=u||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)(d===!1||d===l[c].attributes.href.value)&&(l[c].target="_blank",l[c].rel="noopener noreferrer")},removeTargetBlank:function(l,u){var c;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)u===l[c].attributes.href.value&&(l[c].removeAttribute("target"),l[c].removeAttribute("rel"))},addClassToAnchors:function(l,u){var c=u.split(" "),d,f;if(l.nodeName.toLowerCase()==="a")for(f=0;f<c.length;f+=1)l.classList.add(c[f]);else{var h=l.getElementsByTagName("a");if(h.length===0){var v=s.getClosestTag(l,"a");l=v?[v]:[]}else l=h;for(d=0;d<l.length;d+=1)for(f=0;f<c.length;f+=1)l[d].classList.add(c[f])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var u=l.parentNode,c=u.nodeName.toLowerCase();c==="li"||!s.isBlockContainer(u)&&c!=="div";){if(c==="li")return!0;if(u=u.parentNode,u)c=u.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,u){if(u.nodeName.toLowerCase()==="li"){var c=u.parentElement;c.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(c.parentElement,l),e.selection.moveCursor(l,u.firstChild,u.firstChild.textContent.length))}},splitOffDOMTree:function(l,u,c){for(var d=u,f=null,h=!c;d!==l;){var v=d.parentNode,g=v.cloneNode(!1),m=h?d:v.firstChild,y;for(f&&(h?g.appendChild(f):y=f),f=g;m;){var x=m.nextSibling;m===d?(m.hasChildNodes()?m=m.cloneNode(!1):m.parentNode.removeChild(m),m.textContent&&f.appendChild(m),m=h?x:null):(m.parentNode.removeChild(m),(m.hasChildNodes()||m.textContent)&&f.appendChild(m),m=x)}y&&f.appendChild(y),d=v}return f},moveTextRangeIntoElement:function(l,u,c){if(!l||!u)return!1;var d=s.findCommonRoot(l,u);if(!d)return!1;if(u===l){var f=l.parentNode,h=l.nextSibling;return f.removeChild(l),c.appendChild(l),h?f.insertBefore(c,h):f.appendChild(c),c.hasChildNodes()}for(var v=[],g,m,y,x=0;x<d.childNodes.length;x++)if(y=d.childNodes[x],!g)s.isDescendant(y,l,!0)&&(g=y);else if(s.isDescendant(y,u,!0)){m=y;break}else v.push(y);var E=m.nextSibling,b=d.ownerDocument.createDocumentFragment();return g===l?(g.parentNode.removeChild(g),b.appendChild(g)):b.appendChild(s.splitOffDOMTree(g,l)),v.forEach(function(T){T.parentNode.removeChild(T),b.appendChild(T)}),m===u?(m.parentNode.removeChild(m),b.appendChild(m)):b.appendChild(s.splitOffDOMTree(m,u,!0)),c.appendChild(b),m.parentNode===d?d.insertBefore(c,m):E?d.insertBefore(c,E):d.appendChild(c),c.hasChildNodes()},depthOfNode:function(l){for(var u=0,c=l;c.parentNode!==null;)c=c.parentNode,u++;return u},findCommonRoot:function(l,u){for(var c=s.depthOfNode(l),d=s.depthOfNode(u),f=l,h=u;c!==d;)c>d?(f=f.parentNode,c-=1):(h=h.parentNode,d-=1);for(;f!==h;)f=f.parentNode,h=h.parentNode;return f},isElementAtBeginningOfBlock:function(l){for(var u,c;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(c=l;c=c.previousSibling;)if(u=c.nodeType===3?c.nodeValue:c.textContent,u.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(u){return s.isMediumEditorElement(u)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(u){return s.isBlockContainer(u)||s.isMediumEditorElement(u)})},getTopBlockContainer:function(l){var u=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(c){return s.isBlockContainer(c)&&(u=c),!u&&s.isMediumEditorElement(c)?(u=c,!0):!1}),u},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(c){return s.emptyElementNames.indexOf(c.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var u=l.querySelector("th, td");u&&(l=u)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var u=0;u<l.childNodes.length;u++){var c=s._getFirstTextNode(l.childNodes[u]);if(c!==null)return c}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,u,c){var d=l+" is deprecated, please use "+u+" instead.";c&&(d+=" Will be removed in "+c),s.warn(d)},deprecatedMethod:function(l,u,c,d){s.deprecated(l,u,d),typeof this[u]=="function"&&this[u].apply(this,c)},cleanupAttrs:function(l,u){u.forEach(function(c){l.removeAttribute(c)})},cleanupTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,u){return s.traverseUp(l,function(c){return c.nodeName.toLowerCase()===u.toLowerCase()})},unwrap:function(l,u){for(var c=u.createDocumentFragment(),d=Array.prototype.slice.call(l.childNodes),f=0;f<d.length;f++)c.appendChild(d[f]);c.childNodes.length?l.parentNode.replaceChild(c,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s}(window),function(){var n=function(r){e.util.extend(this,r)};n.extend=function(r){var i=this,o;r&&r.hasOwnProperty("constructor")?o=r.constructor:o=function(){return i.apply(this,arguments)},e.util.extend(o,i);var a=function(){this.constructor=o};return a.prototype=i.prototype,o.prototype=new a,r&&e.util.extend(o.prototype,r),o},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(r){return this.base.options[r]}},["execAction","on","off","subscribe","trigger"].forEach(function(r){n.prototype[r]=function(){return this.base[r].apply(this.base,arguments)}}),e.Extension=n}(),function(){function n(i){return e.util.isBlockContainer(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var r={findMatchingSelectionParent:function(i,o){var a=o.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,i))},getSelectionElement:function(i){return this.findMatchingSelectionParent(function(o){return e.util.isMediumEditorElement(o)},i)},exportSelection:function(i,o){if(!i)return null;var a=null,s=o.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),u=l.cloneRange(),c;u.selectNodeContents(i),u.setEnd(l.startContainer,l.startOffset),c=u.toString().length,a={start:c,end:c+l.toString().length},this.doesRangeStartWithImages(l,o)&&(a.startsWithImage=!0);var d=this.getTrailingImageCount(i,a,l.endContainer,l.endOffset);if(d&&(a.trailingImageCount=d),c!==0){var f=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,l.startContainer,l.startOffset);f!==-1&&(a.emptyBlocksIndex=f)}}return a},importSelection:function(i,o,a,s){if(!(!i||!o)){var l=a.createRange();l.setStart(o,0),l.collapse(!0);var u=o,c=[],d=0,f=!1,h=!1,v=0,g=!1,m,y=!1,x=null;for((s||i.startsWithImage||typeof i.emptyBlocksIndex<"u")&&(y=!0);!g&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=d+u.length,!f&&i.start>=d&&i.start<=m&&(y||i.start<m?(l.setStart(u,i.start-d),f=!0):x=u),f&&i.end>=d&&i.end<=m&&(i.trailingImageCount?h=!0:(l.setEnd(u,i.end-d),g=!0)),d=m;else{if(i.trailingImageCount&&h&&(u.nodeName.toLowerCase()==="img"&&v++,v===i.trailingImageCount)){for(var E=0;u.parentNode.childNodes[E]!==u;)E++;l.setEnd(u.parentNode,E+1),g=!0}if(!g&&u.nodeType===1)for(var b=u.childNodes.length-1;b>=0;)c.push(u.childNodes[b]),b-=1}g||(u=c.pop())}!f&&x&&(l.setStart(x,x.length),l.setEnd(x,x.length)),typeof i.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,o,i.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(i,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(i,o){var a=function(d){return d.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,a)){for(var s=o.startContainer,l=o.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var u=null,c=0;u===null&&c<l.parentNode.childNodes.length;c++)l.parentNode.childNodes[c]===l&&(u=c);o.setStart(l.parentNode,u+1),o.collapse(!0)}}return o},importSelectionMoveCursorPastBlocks:function(i,o,a,s){var l=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),u=s.startContainer,c,d,f=0;for(a=a||1,u.nodeType===3&&e.util.isBlockContainer(u.previousSibling)?c=u.previousSibling:c=e.util.getClosestBlockContainer(u);l.nextNode();)if(!d)c===l.currentNode&&(d=l.currentNode);else if(d=l.currentNode,f++,f===a||d.textContent.length>0)break;return d||(d=c),s.setStart(e.util.getFirstSelectableLeafNode(d),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var u=e.util.findPreviousSibling(l);if(u){if(u.nodeValue)return-1}else return-1}for(var c=e.util.getClosestBlockContainer(a),d=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),f=0;d.nextNode();){var h=d.currentNode.textContent==="";if((h||f>0)&&(f+=1),d.currentNode===c)return f;h||(f=0)}return f},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var a=i.startContainer.querySelector("img");if(!a)return!1;for(var s=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var u=i,c=[],d=0,f=!1,h=!1,v=!1,g,m=0;!v&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=0,g=d+u.length,!f&&o.start>=d&&o.start<=g&&(f=!0),f&&o.end>=d&&o.end<=g&&(h=!0),d=g;else if(u.nodeName.toLowerCase()==="img"&&m++,u===l)v=!0;else if(u.nodeType===1)for(var y=u.childNodes.length-1;y>=0;)c.push(u.childNodes[y]),y-=1;v||(u=c.pop())}return m},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(o.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(o=!0),s.nodeName!=="#text"&&l==="false"},i);return!o&&a},getSelectionHtml:function(o){var a,s="",l=o.getSelection(),u,c;if(l.rangeCount){for(c=o.createElement("div"),a=0,u=l.rangeCount;a<u;a+=1)c.appendChild(l.getRangeAt(a).cloneContents());s=c.innerHTML}return s},getCaretOffsets:function(o,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(o),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(o),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(i){var o=i.startContainer;return o===i.endContainer&&o.hasChildNodes()&&i.endOffset===i.startOffset+1},getSelectedParentElement:function(i){return i?this.rangeSelectsSingleNode(i)&&i.startContainer.childNodes[i.startOffset].nodeType!==3?i.startContainer.childNodes[i.startOffset]:i.startContainer.nodeType===3?i.startContainer.parentNode:i.startContainer:null},getSelectedElements:function(i){var o=i.getSelection(),a,s,l;if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(a=o.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(u){return typeof o.containsNode=="function"?o.containsNode(u,!0):!0})},selectNode:function(i,o){var a=o.createRange();a.selectNodeContents(i),this.selectRange(o,a)},select:function(i,o,a,s,l){var u=i.createRange();return u.setStart(o,a),s?u.setEnd(s,l):u.collapse(!0),this.selectRange(i,u),u},clearSelection:function(i,o){o?i.getSelection().collapseToStart():i.getSelection().collapseToEnd()},moveCursor:function(i,o,a){this.select(i,o,a)},getSelectionRange:function(i){var o=i.getSelection();return o.rangeCount===0?null:o.getRangeAt(0)},selectRange:function(i,o){var a=i.getSelection();a.removeAllRanges(),a.addRange(o)},getSelectionStart:function(i){var o=i.getSelection().anchorNode,a=o&&o.nodeType===3?o.parentNode:o;return a}};e.selection=r}(),function(){function n(i,o){return i?i.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,o,!0)})):!1}):!1}var r=function(i){this.base=i,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};r.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(i,o,a,s){var l=this.base.options.contentWindow,u=this.base.options.ownerDocument;i=e.util.isElement(i)||[l,u].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(c){c.addEventListener(o,a,s),this.events.push([c,o,a,s])}).bind(this))},detachDOMEvent:function(i,o,a,s){var l,u,c=this.base.options.contentWindow,d=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[c,d].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(f){l=this.indexOfListener(f,o,a,s),l!==-1&&(u=this.events.splice(l,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}).bind(this)))},indexOfListener:function(i,o,a,s){var l,u,c;for(l=0,u=this.events.length;l<u;l=l+1)if(c=this.events[l],c[0]===i&&c[1]===o&&c[2]===a&&c[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var i=this.events.pop();i;)i[0].removeEventListener(i[1],i[2],i[3]),i=this.events.pop()},detachAllEventsFromElement:function(i){for(var o=this.events.filter(function(u){return u&&u[0].getAttribute&&u[0].getAttribute("medium-editor-index")===i.getAttribute("medium-editor-index")}),a=0,s=o.length;a<s;a++){var l=o[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(i){this.listeners.editableInput&&(this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(o){this.attachDOMEvent(i,o.name,o.handler.bind(this))},this)},enableCustomEvent:function(i){this.disabledEvents[i]!==void 0&&delete this.disabledEvents[i]},disableCustomEvent:function(i){this.disabledEvents[i]=!0},attachCustomEvent:function(i,o){this.setupListener(i),this.customEvents[i]||(this.customEvents[i]=[]),this.customEvents[i].push(o)},detachCustomEvent:function(i,o){var a=this.indexOfCustomListener(i,o);a!==-1&&this.customEvents[i].splice(a,1)},indexOfCustomListener:function(i,o){return!this.customEvents[i]||!this.customEvents[i].length?-1:this.customEvents[i].indexOf(o)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(i,o,a){this.customEvents[i]&&!this.disabledEvents[i]&&this.customEvents[i].forEach(function(s){s(o,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(i){i.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(i){this.handleDocumentExecCommand(i)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var i=this.options.ownerDocument;if(!(!this.execCommandListener||!i.execCommand.listeners)){var o=i.execCommand.listeners.indexOf(this.execCommandListener);o!==-1&&i.execCommand.listeners.splice(o,1),i.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var i=this.options.ownerDocument;if(!i.execCommand.listeners){var o=function(s,l){i.execCommand.listeners&&i.execCommand.listeners.forEach(function(u){u({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=i.execCommand.orig.apply(this,arguments);if(!i.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return o(l,s),s};a.orig=i.execCommand,a.listeners=[],a.callListeners=o,i.execCommand=a}},unwrapExecCommand:function(){var i=this.options.ownerDocument;i.execCommand.orig&&(i.execCommand=i.execCommand.orig)},setupListener:function(i){if(!this.listeners[i]){switch(i){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(o){this.contentCache[o.getAttribute("medium-editor-index")]=o.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[i]=!0}},attachToEachElement:function(i,o){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,i,o.bind(this))},this),this.eventsCache.push({name:i,handler:o})},cleanupElement:function(i){var o=i.getAttribute("medium-editor-index");o&&(this.detachAllEventsFromElement(i),this.contentCache&&delete this.contentCache[o])},focusElement:function(i){i.focus(),this.updateFocus(i,{target:i,type:"focus"})},updateFocus:function(i,o){var a=this.base.getFocusedElement(),s;a&&o.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(u){return!s&&e.util.isDescendant(u,i,!0)&&(s=u),!!s},this);var l=!e.util.isDescendant(a,i,!0)&&!n(this.base.extensions,i);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,s))),l&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(i,o){if(this.contentCache){var a=i.getAttribute("medium-editor-index"),s=i.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",o,i),this.contentCache[a]=s}},handleDocumentSelectionChange:function(i){if(i.currentTarget&&i.currentTarget.activeElement){var o=i.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,o,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:o,currentTarget:a})}},handleDocumentExecCommand:function(){var i=this.base.getFocusedElement();i&&this.updateInput(i,{target:i,currentTarget:i})},handleBodyClick:function(i){this.updateFocus(i.target,i)},handleBodyFocus:function(i){this.updateFocus(i.target,i)},handleBodyMousedown:function(i){this.lastMousedownTarget=i.target},handleInput:function(i){this.updateInput(i.currentTarget,i)},handleClick:function(i){this.triggerCustomEvent("editableClick",i,i.currentTarget)},handleBlur:function(i){this.triggerCustomEvent("editableBlur",i,i.currentTarget)},handleKeypress:function(i){if(this.triggerCustomEvent("editableKeypress",i,i.currentTarget),this.keypressUpdateInput){var o={target:i.target,currentTarget:i.currentTarget};setTimeout((function(){this.updateInput(o.currentTarget,o)}).bind(this),0)}},handleKeyup:function(i){this.triggerCustomEvent("editableKeyup",i,i.currentTarget)},handleMouseover:function(i){this.triggerCustomEvent("editableMouseover",i,i.currentTarget)},handleDragging:function(i){this.triggerCustomEvent("editableDrag",i,i.currentTarget)},handleDrop:function(i){this.triggerCustomEvent("editableDrop",i,i.currentTarget)},handlePaste:function(i){this.triggerCustomEvent("editablePaste",i,i.currentTarget)},handleKeydown:function(i){if(this.triggerCustomEvent("editableKeydown",i,i.currentTarget),e.util.isKey(i,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.ENTER)||i.ctrlKey&&e.util.isKey(i,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",i,i.currentTarget);if(e.util.isKey(i,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",i,i.currentTarget)}},e.Events=r}(),function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(r){n.isBuiltInButton(r)?e.Extension.call(this,this.defaults[r]):e.Extension.call(this,r)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var r=this.document.createElement("button"),i=this.contentDefault,o=this.getAria(),a=this.getEditorOption("buttonLabels");return r.classList.add("medium-editor-action"),r.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){r.classList.add(s)}),r.setAttribute("data-action",this.getAction()),o&&(r.setAttribute("title",o),r.setAttribute("aria-label",o)),this.attrs&&Object.keys(this.attrs).forEach(function(s){r.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(i=this.contentFA),r.innerHTML=i,r},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=this.getAction();i&&this.execAction(i)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var r=null;return this.useQueryState&&(r=this.base.queryCommandState(this.getAction())),r},isAlreadyApplied:function(r){var i=!1,o=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(i=s.indexOf(l)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});n.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},e.extensions.button=n}(),function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>&bull;</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>&rarr;</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>&larr;</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>&ldquo;</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}}(),function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"&#10003;",formCloseLabel:"&times;",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.setToolbarPosition()}});e.extensions.form=n}(),function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return r.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),r.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),r.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),a){var s=r.buttonClass?r.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],a=i[1];return o+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=l[1],c=l[2],d=l[3];if(s.test(r))return"tel:"+r;if(!o){var f=u.split("/")[0];(f.match(/.+(\.|:).+/)||f==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(u)+(c===void 0?"":"?"+this.ensureEncodedQuery(c))+(d===void 0?"":"#"+d)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),a=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n}(),function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,a=r.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,u=this.getEditorOption("elementsContainer"),c=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,d={},f,h,v,g,m;f=this.anchorPreview.offsetWidth/2;var y=this.base.getExtensionByName("toolbar");y&&(s=y.diffLeft,l=y.diffTop),h=s-f,c?(g=u.getBoundingClientRect(),["top","left"].forEach(function(x){d[x]=a[x]-g[x]}),d.width=a.width,d.height=a.height,a=d,i=g.width,m=u.scrollTop):m=this.window.pageYOffset,v=a.left+a.width/2,m+=o+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(m)+"px",this.anchorPreview.style.right="initial",v<f?(this.anchorPreview.style.left=h+f+"px",this.anchorPreview.style.right="initial"):i-v<f?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=h+v+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(r){var i=this.base.getExtensionByName("anchor"),o=this.activeAnchor;i&&o&&(r.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(o){var a={value:o.attributes.href.value,target:o.getAttribute("target"),buttonClass:o.getAttribute("class")};i.showForm(a),o=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(r){var i=e.util.getClosestTag(r.target,"a");if(i!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(i.outerHTML)||/href=["']#\S+["']/.test(i.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==i&&this.detachPreviewHandlers(),this.anchorToPreview=i,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(r){(!r.relatedTarget||!/anchor-preview/.test(r.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var r=new Date().getTime()-this.lastOver;r>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n}(),function(){var n,r,i,o,a;n=[" "," ",`
90
- `,"\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),a=new RegExp(i,"gi");function s(u){return!e.util.getClosestTag(u,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var u=0,c=0;c<this.window._mediumEditors.length;c++){var d=this.window._mediumEditors[c];d!==null&&d.getExtensionByName("autoLink")!==void 0&&u++}return u===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(u,c){this.performLinking(c)},onKeypress:function(u){this.disableEventHandling||e.util.isKey(u,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var c=this.base.exportSelection();this.performLinking(u.target)&&this.base.importSelection(c,!0)}catch(d){window.console&&window.console.error("Failed to perform linking",d),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(u){var c=e.util.splitByBlockElements(u),d=!1;c.length===0&&(c=[u]);for(var f=0;f<c.length;f++)d=this.removeObsoleteAutoLinkSpans(c[f])||d,d=this.performLinkingWithinElement(c[f])||d;return this.base.events.updateInput(u,{target:u,currentTarget:u}),d},removeObsoleteAutoLinkSpans:function(u){if(!u||u.nodeType===3)return!1;for(var c=u.querySelectorAll('span[data-auto-link="true"]'),d=!1,f=0;f<c.length;f++){var h=c[f].textContent;if(h.indexOf("://")===-1&&(h=e.util.ensureUrlHasProtocol(h)),c[f].getAttribute("data-href")!==h&&s(c[f])){d=!0;var v=h.replace(/\s+$/,"");if(c[f].getAttribute("data-href")===v){var g=h.length-v.length,m=e.util.splitOffDOMTree(c[f],this.splitTextBeforeEnd(c[f],g));c[f].parentNode.insertBefore(m,c[f].nextSibling)}else e.util.unwrap(c[f],this.document)}}return d},splitTextBeforeEnd:function(u,c){for(var d=this.document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,!1),f=!0;f;)f=d.lastChild()!==null;for(var h,v,g;c>0&&g!==null;)h=d.currentNode,v=h.nodeValue,v.length>c?(g=h.splitText(v.length-c),c=0):(g=d.previousNode(),c-=v.length);return g},performLinkingWithinElement:function(u){for(var c=this.findLinkableText(u),d=!1,f=0;f<c.length;f++){var h=e.util.findOrCreateMatchingTextNodes(this.document,u,c[f]);this.shouldNotLink(h)||this.createAutoLink(h,c[f].href)}return d},shouldNotLink:function(u){for(var c=!1,d=0;d<u.length&&c===!1;d++)c=!!e.util.traverseUp(u[d],function(f){return f.nodeName.toLowerCase()==="a"||f.getAttribute&&f.getAttribute("data-auto-link")==="true"});return c},findLinkableText:function(u){for(var c=u.textContent,d=null,f=[];(d=a.exec(c))!==null;){var h=!0,v=d.index+d[0].length;h=(d.index===0||n.indexOf(c[d.index-1])!==-1)&&(v===c.length||n.indexOf(c[v])!==-1),h=h&&(d[0].indexOf("/")!==-1||o.test(d[0].split(".").pop().split("?").shift())),h&&f.push({href:d[0],start:d.index,end:v})}return f},createAutoLink:function(u,c){c=e.util.ensureUrlHasProtocol(c);var d=e.util.createLink(this.document,u,c,this.getEditorOption("targetBlank")?"_blank":null),f=this.document.createElement("span");for(f.setAttribute("data-auto-link","true"),f.setAttribute("data-href",c),d.insertBefore(f,d.firstChild);d.childNodes.length>1;)f.appendChild(d.childNodes[1])}});e.extensions.autoLink=l}(),function(){var n="medium-editor-dragover";function r(o){var a=e.util.getContainerEditorElement(o),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var a=o.target.classList?o.target:o.target.parentElement;r(a),o.type==="dragover"&&a.classList.add(n)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(a){return!!o.type.match(a)})},insertImageFile:function(o){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(o),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=i}(),function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),a=!!r.shiftKey,s=!!r.altKey;this.keys[i].forEach(function(l){l.meta===o&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n}(),function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("select"),a=r.createElement("a"),s=r.createElement("a"),l;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u<this.fonts.length;u++)l=r.createElement("option"),l.innerHTML=this.fonts[u],l.value=this.fonts[u],o.appendChild(l);return o.className="medium-editor-toolbar-select",i.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"&times;",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n}(),function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("input"),a=r.createElement("a"),s=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"&times;",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n}(),function(){var n="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|"|“|”)(((?!&quot;|&rdquo;|&ldquo;|"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|"|“|”)(?:(?!&gt;).)*&gt;/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(u,c,d){var f=u.clipboardData||c.clipboardData||d.dataTransfer,h={};if(!f)return h;if(f.getData){var v=f.getData("Text");v&&v.length>0&&(h["text/plain"]=v)}if(f.types)for(var g=0;g<f.types.length;g++){var m=f.types[g];h[m]=f.getData(m)}return h}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(u){this.on(u,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(u,c){this.on(c,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(u,c){if(!u.defaultPrevented){var d=s(u,this.window,this.document),f=d["text/html"],h=d["text/plain"];this.window.clipboardData&&u.clipboardData===void 0&&!f&&(f=h),(f||h)&&(u.preventDefault(),this.doPaste(f,h,c))}},doPaste:function(u,c,d){var f,h="",v;if(this.cleanPastedHTML&&u)return this.cleanPaste(u);if(c){if(this.getEditorOption("disableReturn")||d&&d.getAttribute("data-disable-return"))h=e.util.htmlEntities(c);else if(f=c.split(/[\r\n]+/g),f.length>1)for(v=0;v<f.length;v+=1)f[v]!==""&&(h+="<p>"+e.util.htmlEntities(f[v])+"</p>");else h=e.util.htmlEntities(f[0]);e.util.insertHTMLCommand(this.document,h)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var c=s(u,this.window,this.document),d=c["text/html"],f=c["text/plain"],h=i;if(!this.cleanPastedHTML||d){u.preventDefault(),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h);return}setTimeout((function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h)}).bind(this),0)},handleKeydown:function(u,c){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(u){var c,d=e.selection.getSelectionRange(this.document),f=this.window.pageYOffset;i=u,d&&(c=d.getClientRects(),c.length?f+=c[0].top:d.startContainer.getBoundingClientRect!==void 0?f+=d.startContainer.getBoundingClientRect().top:f+=d.getBoundingClientRect().top),r=d;var h=this.document.createElement("div");h.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),h.setAttribute("style","border: 1px red solid; position: absolute; top: "+f+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),h.setAttribute("contentEditable",!0),h.innerHTML=n,this.document.body.appendChild(h),this.on(h,"focus",o),this.on(h,"focusin",o),this.on(h,"focusout",o),h.focus(),e.selection.selectNode(h,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(h,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var c=u.innerHTML;return!c||c===n?!1:c},cleanPaste:function(u){var c,d,f,h,v=/<p|<br|<div/.test(u),g=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(c=0;c<g.length;c+=1)u=u.replace(g[c][0],g[c][1]);if(!v)return this.pasteHTML(u);for(f=this.document.createElement("div"),f.innerHTML="<p>"+u.split("<br><br>").join("</p><p>")+"</p>",d=f.querySelectorAll("a,p,div,br"),c=0;c<d.length;c+=1)switch(h=d[c],h.innerHTML=h.innerHTML.replace(/\n/gi," "),h.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(h);break;case"br":this.filterLineBreak(h);break}this.pasteHTML(f.innerHTML)},pasteHTML:function(u,c){c=e.util.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var d,f,h,v,g=this.document.createDocumentFragment();for(g.appendChild(this.document.createElement("body")),v=g.querySelector("body"),v.innerHTML=u,this.cleanupSpans(v),d=v.querySelectorAll("*"),h=0;h<d.length;h+=1)f=d[h],f.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(f),e.util.cleanupAttrs(f,c.cleanAttrs),e.util.cleanupTags(f,c.cleanTags),e.util.unwrapTags(f,c.unwrapTags);e.util.insertHTMLCommand(this.document,v.innerHTML.replace(/&nbsp;/g," "))},isCommonBlock:function(u){return u&&(u.nodeName.toLowerCase()==="p"||u.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(u){/^\s*$/.test(u.textContent)&&u.parentNode&&u.parentNode.removeChild(u)},filterLineBreak:function(u){this.isCommonBlock(u.previousElementSibling)?this.removeWithParent(u):this.isCommonBlock(u.parentNode)&&(u.parentNode.firstChild===u||u.parentNode.lastChild===u)?this.removeWithParent(u):u.parentNode&&u.parentNode.childElementCount===1&&u.parentNode.textContent===""&&this.removeWithParent(u)},removeWithParent:function(u){u&&u.parentNode&&(u.parentNode.parentNode&&u.parentNode.childElementCount===1?u.parentNode.parentNode.removeChild(u.parentNode):u.parentNode.removeChild(u))},cleanupSpans:function(u){var c,d,f,h=u.querySelectorAll(".replace-with"),v=function(g){return g&&g.nodeName!=="#text"&&g.getAttribute("contenteditable")==="false"};for(c=0;c<h.length;c+=1)d=h[c],f=this.document.createElement(d.classList.contains("bold")?"b":"i"),d.classList.contains("bold")&&d.classList.contains("italic")?f.innerHTML="<i>"+d.innerHTML+"</i>":f.innerHTML=d.innerHTML,d.parentNode.replaceChild(f,d);for(h=u.querySelectorAll("span"),c=0;c<h.length;c+=1){if(d=h[c],e.util.traverseUp(d,v))return!1;e.util.unwrap(d,this.document)}}});e.extensions.paste=l}(),function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(r,i){this.initElement(i)},initElement:function(r){r.getAttribute("data-placeholder")||r.setAttribute("data-placeholder",this.text),this.updatePlaceholder(r)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(r,i){this.cleanupElement(i)},cleanupElement:function(r){r.getAttribute("data-placeholder")===this.text&&r.removeAttribute("data-placeholder")},showPlaceholder:function(r){r&&(e.util.isFF&&r.childNodes.length===0?(r.classList.add("medium-editor-placeholder-relative"),r.classList.remove("medium-editor-placeholder")):(r.classList.add("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(r){r&&(r.classList.remove("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(r,i){if(r.querySelector("img, blockquote, ul, ol, table")||r.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(r);i||this.showPlaceholder(r)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(r,i){var o=this.hideOnClick&&i===this.base.getFocusedElement();this.updatePlaceholder(i,o)},handleFocus:function(r,i){this.hidePlaceholder(i)},handleBlur:function(r,i){this.updatePlaceholder(i)}});e.extensions.placeholder=n}(),function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(r,i){return this.base.extensions.forEach(function(o){if(o!==this)return r.apply(i||this,arguments)},this)},createToolbar:function(){var r=this.document.createElement("div");return r.id="medium-editor-toolbar-"+this.getEditorId(),r.className="medium-editor-toolbar",this.static?r.className+=" static-toolbar":this.relativeContainer?r.className+=" medium-editor-relative-toolbar":r.className+=" medium-editor-stalker-toolbar",r.appendChild(this.createToolbarButtons()),this.forEachExtension(function(i){i.hasForm&&r.appendChild(i.getForm())}),this.attachEventHandlers(),r},createToolbarButtons:function(){var r=this.document.createElement("ul"),i,o,a,s,l,u;return r.id="medium-editor-toolbar-actions"+this.getEditorId(),r.className="medium-editor-toolbar-actions",r.style.display="block",this.buttons.forEach(function(c){typeof c=="string"?(l=c,u=null):(l=c.name,u=c),s=this.base.addBuiltInExtension(l,u),s&&typeof s.getButton=="function"&&(o=s.getButton(this.base),i=this.document.createElement("li"),e.util.isElement(o)?i.appendChild(o):i.innerHTML=o,r.appendChild(i))},this),a=r.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),r},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),a=o.match(i);return!!a&&a.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var a=0;o.nodeValue.substr(a,1).trim().length===0;)a=a+1;i=e.selection.select(this.document,o,a,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(o&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(i=l.queryCommandState(),i!==null)){i&&typeof l.setActive=="function"&&l.setActive();return}r.push(l)}),a=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(r.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,a=this.getToolbarElement(),s=r.getBoundingClientRect(),l=s.top+i,u=s.left+s.width/2,c=a.offsetHeight,d=a.offsetWidth,f=d/2,h;switch(this.sticky?i>l+r.offsetHeight-c-this.stickyTopOffset?(a.style.top=l+r.offsetHeight-c+"px",a.classList.remove("medium-editor-sticky-toolbar")):i>l-c-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-c+"px"):a.style.top=l-c+"px",this.align){case"left":h=s.left;break;case"right":h=s.right-d;break;case"center":h=u-f;break}h<0?h=0:h+d>o&&(h=o-Math.ceil(d)-1),a.style.left=h+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,u=s.offsetWidth,c=u/2,d=50,f=this.diffLeft-c,h=this.getEditorOption("elementsContainer"),v=["absolute","fixed"].indexOf(window.getComputedStyle(h).getPropertyValue("position"))>-1,g={},m={},y,x;v?(x=h.getBoundingClientRect(),["top","left"].forEach(function(E){m[E]=o[E]-x[E]}),m.width=o.width,m.height=o.height,o=m,a=x.width,g.top=h.scrollTop):g.top=this.window.pageYOffset,y=o.left+o.width/2,g.top+=o.top-l,o.top<d?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),g.top+=d+o.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),g.top+=this.diffTop),y<c?(g.left=f+c,g.right="initial"):a-y<c?(g.left="auto",g.right=0):(g.left=f+y,g.right="initial"),["top","left","right"].forEach(function(E){s.style[E]=g[E]+(isNaN(g[E])?"":"px")})}});e.extensions.toolbar=n}(),function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(r){var i="medium-editor-dragover";r.preventDefault(),r.dataTransfer.dropEffect="copy",r.type==="dragover"?r.target.classList.add(i):r.type==="dragleave"&&r.target.classList.remove(i)},handleDrop:function(r){var i="medium-editor-dragover",o;r.preventDefault(),r.stopPropagation(),r.dataTransfer.files&&(o=Array.prototype.slice.call(r.dataTransfer.files,0),o.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var u=this.document.getElementById(l);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=s.result)}).bind(this)}}).bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=n}(),function(){function n(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k.textContent,Z=e.selection.getCaretOffsets(k);(B[Z.left-1]===void 0||B[Z.left-1].trim()===""||B[Z.left]!==void 0&&B[Z.left].trim()==="")&&R.preventDefault()}function r(R,k){if(this.options.disableReturn||k.getAttribute("data-disable-return"))R.preventDefault();else if(this.options.disableDoubleReturn||k.getAttribute("data-disable-double-return")){var B=e.selection.getSelectionStart(this.options.ownerDocument);(B&&B.textContent.trim()===""&&B.nodeName.toLowerCase()!=="li"||B.previousElementSibling&&B.previousElementSibling.nodeName.toLowerCase()!=="br"&&B.previousElementSibling.textContent.trim()==="")&&R.preventDefault()}}function i(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k&&k.nodeName.toLowerCase();B==="pre"&&(R.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(k)&&(R.preventDefault(),R.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(R){var k,B=e.selection.getSelectionStart(this.options.ownerDocument),Z=B.nodeName.toLowerCase(),ee=/^(\s+|<br\/?>)?$/i,ce=/h\d/i;e.util.isKey(R,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&B.previousElementSibling&&ce.test(Z)&&e.selection.getCaretOffsets(B).left===0?e.util.isKey(R,e.util.keyCode.BACKSPACE)&&ee.test(B.previousElementSibling.innerHTML)?(B.previousElementSibling.parentNode.removeChild(B.previousElementSibling),R.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(R,e.util.keyCode.ENTER)&&(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.previousElementSibling.parentNode.insertBefore(k,B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.DELETE)&&B.nextElementSibling&&B.previousElementSibling&&!ce.test(Z)&&ee.test(B.innerHTML)&&ce.test(B.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,B.nextElementSibling),B.previousElementSibling.parentNode.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&Z==="li"&&ee.test(B.innerHTML)&&!B.previousElementSibling&&!B.parentElement.previousElementSibling&&B.nextElementSibling&&B.nextElementSibling.nodeName.toLowerCase()==="li"?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.parentElement.insertBefore(k,B.parentElement),e.selection.moveCursor(this.options.ownerDocument,k),B.parentElement.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).left===0?(R.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(R,e.util.keyCode.ENTER)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).right===0?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.insertBefore(k,B.nextSibling),e.selection.moveCursor(this.options.ownerDocument,k),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(B.parentElement)&&!B.previousElementSibling&&B.nextElementSibling&&ee.test(B.innerHTML)&&(R.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,B.nextSibling),B.parentElement.removeChild(B))}function a(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B;k&&(e.util.isMediumEditorElement(k)&&k.children.length===0&&!e.util.isBlockContainer(k)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(R,e.util.keyCode.ENTER)&&!e.util.isListItem(k)&&!e.util.isBlockContainer(k)&&(B=k.nodeName.toLowerCase(),B==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!R.shiftKey&&!R.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(R,k){var B=k.parentNode.querySelector('textarea[medium-editor-textarea-id="'+k.getAttribute("medium-editor-textarea-id")+'"]');B&&(B.value=k.innerHTML.trim())}function l(R){R._mediumEditors||(R._mediumEditors=[null]),this.id||(this.id=R._mediumEditors.length),R._mediumEditors[this.id]=this}function u(R){!R._mediumEditors||!R._mediumEditors[this.id]||(R._mediumEditors[this.id]=null)}function c(R,k,B){var Z=[];if(R||(R=[]),typeof R=="string"&&(R=k.querySelectorAll(R)),e.util.isElement(R)&&(R=[R]),B)for(var ee=0;ee<R.length;ee++){var ce=R[ee];e.util.isElement(ce)&&!ce.getAttribute("data-medium-editor-element")&&!ce.getAttribute("medium-editor-textarea-id")&&Z.push(ce)}else Z=Array.prototype.slice.apply(R);return Z}function d(R){var k=R.parentNode.querySelector('textarea[medium-editor-textarea-id="'+R.getAttribute("medium-editor-textarea-id")+'"]');k&&(k.classList.remove("medium-editor-hidden"),k.removeAttribute("medium-editor-textarea-id")),R.parentNode&&R.parentNode.removeChild(R)}function f(R,k){return Object.keys(k).forEach(function(B){R[B]===void 0&&(R[B]=k[B])}),R}function h(R,k,B){var Z={window:B.options.contentWindow,document:B.options.ownerDocument,base:B};return R=f(R,Z),typeof R.init=="function"&&R.init(),R.name||(R.name=k),R}function v(){return this.elements.every(function(R){return!!R.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function g(){return v.call(this)?this.options.anchorPreview!==!1:!1}function m(){return this.options.placeholder!==!1}function y(){return this.options.autoLink!==!1}function x(){return this.options.imageDragging!==!1}function E(){return this.options.keyboardCommands!==!1}function b(){return!this.options.extensions.imageDragging}function T(R){for(var k=this.options.ownerDocument.createElement("div"),B=Date.now(),Z="medium-editor-"+B,ee=R.attributes;this.options.ownerDocument.getElementById(Z);)B++,Z="medium-editor-"+B;k.className=R.className,k.id=Z,k.innerHTML=R.value,R.setAttribute("medium-editor-textarea-id",Z);for(var ce=0,Be=ee.length;ce<Be;ce++)k.hasAttribute(ee[ce].nodeName)||k.setAttribute(ee[ce].nodeName,ee[ce].value);return R.form&&this.on(R.form,"reset",(function(me){me.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(Z))}).bind(this)),R.classList.add("medium-editor-hidden"),R.parentNode.insertBefore(k,R),k}function A(R,k){if(!R.getAttribute("data-medium-editor-element")){R.nodeName.toLowerCase()==="textarea"&&(R=T.call(this,R),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!R.getAttribute("data-disable-editing")&&(R.setAttribute("contentEditable",!0),R.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(R.getAttribute("data-disable-return")||R.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!R.getAttribute("data-disable-return")&&this.on(R,"keyup",a.bind(this));var B=e.util.guid();R.setAttribute("data-medium-editor-element",!0),R.classList.add("medium-editor-element"),R.setAttribute("role","textbox"),R.setAttribute("aria-multiline",!0),R.setAttribute("data-medium-editor-editor-index",k),R.setAttribute("medium-editor-index",B),J[B]=R.innerHTML,this.events.attachAllEventsToElement(R)}return R}function S(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function M(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(ee){ee!=="toolbar"&&this.options.extensions[ee]&&this.extensions.push(h(this.options.extensions[ee],ee,this))},this),b.call(this)){var R=this.options.fileDragging;R||(R={},x.call(this)||(R.allowedTypes=[])),this.addBuiltInExtension("fileDragging",R)}var k={paste:!0,"anchor-preview":g.call(this),autoLink:y.call(this),keyboardCommands:E.call(this),placeholder:m.call(this)};Object.keys(k).forEach(function(ee){k[ee]&&this.addBuiltInExtension(ee)},this);var B=this.options.extensions.toolbar;if(!B&&v.call(this)){var Z=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});B=new e.extensions.toolbar(Z)}B&&this.extensions.push(h(B,"toolbar",this))}function C(R,k){var B=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return k&&B.forEach(function(Z){k.hasOwnProperty(Z[0])&&k[Z[0]]!==void 0&&e.util.deprecated(Z[0],Z[1],"v6.0.0")}),e.util.defaults({},k,R)}function G(R,k){var B=/^append-(.+)$/gi,Z=/justify([A-Za-z]*)$/g,ee,ce;if(ee=B.exec(R),ee)return e.util.execFormatBlock(this.options.ownerDocument,ee[1]);if(R==="fontSize")return k.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),ce=k.value||k.size,this.options.ownerDocument.execCommand("fontSize",!1,ce);if(R==="fontName")return k.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),ce=k.value||k.name,this.options.ownerDocument.execCommand("fontName",!1,ce);if(R==="createLink")return this.createLink(k);if(R==="image"){var Be=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Be)}if(R==="html"){var me=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,me)}if(Z.exec(R)){var de=this.options.ownerDocument.execCommand(R,!1,null),Se=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Se&&K.call(this,e.util.getTopBlockContainer(Se)),de}return ce=k&&k.value,this.options.ownerDocument.execCommand(R,!1,ce)}function K(R){if(R){var k,B=Array.prototype.slice.call(R.childNodes).filter(function(Z){var ee=Z.nodeName.toLowerCase()==="div";return ee&&!k&&(k=Z.style.textAlign),ee});B.length&&(this.saveSelection(),B.forEach(function(Z){if(Z.style.textAlign===k){var ee=Z.lastChild;if(ee){e.util.unwrap(Z,this.options.ownerDocument);var ce=this.options.ownerDocument.createElement("BR");ee.parentNode.insertBefore(ce,ee.nextSibling)}}},this),R.style.textAlign=k,this.restoreSelection())}}var J={};e.prototype={init:function(R,k){return this.options=C.call(this,this.defaults,k),this.origElements=R,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,M.call(this),S.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(R){typeof R.destroy=="function"&&R.destroy()},this),this.events.destroy(),this.elements.forEach(function(R){this.options.spellcheck&&(R.innerHTML=R.innerHTML),R.removeAttribute("contentEditable"),R.removeAttribute("spellcheck"),R.removeAttribute("data-medium-editor-element"),R.classList.remove("medium-editor-element"),R.removeAttribute("role"),R.removeAttribute("aria-multiline"),R.removeAttribute("medium-editor-index"),R.removeAttribute("data-medium-editor-editor-index"),R.getAttribute("medium-editor-textarea-id")&&d(R)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,u.call(this,this.options.contentWindow))},on:function(R,k,B,Z){return this.events.attachDOMEvent(R,k,B,Z),this},off:function(R,k,B,Z){return this.events.detachDOMEvent(R,k,B,Z),this},subscribe:function(R,k){return this.events.attachCustomEvent(R,k),this},unsubscribe:function(R,k){return this.events.detachCustomEvent(R,k),this},trigger:function(R,k,B){return this.events.triggerCustomEvent(R,k,B),this},delay:function(R){var k=this;return setTimeout(function(){k.isActive&&R()},this.options.delay)},serialize:function(){var R,k,B={},Z=this.elements.length;for(R=0;R<Z;R+=1)k=this.elements[R].id!==""?this.elements[R].id:"element-"+R,B[k]={value:this.elements[R].innerHTML.trim()};return B},getExtensionByName:function(R){var k;return this.extensions&&this.extensions.length&&this.extensions.some(function(B){return B.name===R?(k=B,!0):!1}),k},addBuiltInExtension:function(R,k){var B=this.getExtensionByName(R),Z;if(B)return B;switch(R){case"anchor":Z=e.util.extend({},this.options.anchor,k),B=new e.extensions.anchor(Z);break;case"anchor-preview":B=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":B=new e.extensions.autoLink;break;case"fileDragging":B=new e.extensions.fileDragging(k);break;case"fontname":B=new e.extensions.fontName(this.options.fontName);break;case"fontsize":B=new e.extensions.fontSize(k);break;case"keyboardCommands":B=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":B=new e.extensions.paste(this.options.paste);break;case"placeholder":B=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(R)&&(k?(Z=e.util.defaults({},k,e.extensions.button.prototype.defaults[R]),B=new e.extensions.button(Z)):B=new e.extensions.button(R))}return B&&this.extensions.push(h(B,R,this)),B},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var R=this.getExtensionByName("toolbar");return R&&R.checkState(),this},queryCommandState:function(R){var k=/^full-(.+)$/gi,B,Z=null;B=k.exec(R),B&&(R=B[1]);try{Z=this.options.ownerDocument.queryCommandState(R)}catch{Z=null}return Z},execAction:function(R,k){var B=/^full-(.+)$/gi,Z,ee;return Z=B.exec(R),Z?(this.saveSelection(),this.selectAllContents(),ee=G.call(this,Z[1],k),this.restoreSelection()):ee=G.call(this,R,k),(R==="insertunorderedlist"||R==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),ee},getSelectedParentElement:function(R){return R===void 0&&(R=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(R)},selectAllContents:function(){var R=e.selection.getSelectionElement(this.options.contentWindow);if(R){for(;R.children.length===1;)R=R.children[0];this.selectElement(R)}},selectElement:function(R){e.selection.selectNode(R,this.options.ownerDocument);var k=e.selection.getSelectionElement(this.options.contentWindow);k&&this.events.focusElement(k)},getFocusedElement:function(){var R;return this.elements.some(function(k){return!R&&k.getAttribute("data-medium-focused")&&(R=k),!!R},this),R},exportSelection:function(){var R=e.selection.getSelectionElement(this.options.contentWindow),k=this.elements.indexOf(R),B=null;return k>=0&&(B=e.selection.exportSelection(R,this.options.ownerDocument)),B!==null&&k!==0&&(B.editableElementIndex=k),B},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(R,k){if(R){var B=this.elements[R.editableElementIndex||0];e.selection.importSelection(R,B,this.options.ownerDocument,k)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(R){var k=e.selection.getSelectionElement(this.options.contentWindow),B={},Z;if(this.elements.indexOf(k)!==-1){try{if(this.events.disableCustomEvent("editableInput"),R.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),Z=R.url||R.value,Z&&Z.trim().length>0){var ee=this.options.contentWindow.getSelection();if(ee){var ce=ee.getRangeAt(0),Be=ce.commonAncestorContainer,me,de,Se,je;if(ce.endContainer.nodeType===3&&ce.startContainer.nodeType!==3&&ce.startOffset===0&&ce.startContainer.firstChild===ce.endContainer&&(Be=ce.endContainer),de=e.util.getClosestBlockContainer(ce.startContainer),Se=e.util.getClosestBlockContainer(ce.endContainer),Be.nodeType!==3&&Be.textContent.length!==0&&de===Se){var he=de||k,Ve=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),me=this.exportSelection(),Ve.appendChild(he.cloneNode(!0)),k===he?e.selection.select(this.options.ownerDocument,he.firstChild,0,he.lastChild,he.lastChild.nodeType===3?he.lastChild.nodeValue.length:he.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,he,0,he,he.childNodes.length);var $=this.exportSelection();je=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,Ve,{start:me.start-$.start,end:me.end-$.start,editableElementIndex:me.editableElementIndex}),je.length===0&&(Ve=this.options.ownerDocument.createDocumentFragment(),Ve.appendChild(Be.cloneNode(!0)),je=[Ve.firstChild.firstChild,Ve.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,je,Z.trim());var w=(Ve.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,Ve.firstChild.innerHTML.replace(/^\s+/,"")),me.start-=w,me.end-=w,this.importSelection(me)}else this.options.ownerDocument.execCommand("createLink",!1,Z);this.options.targetBlank||R.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z),R.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),R.buttonClass)}}if(this.options.targetBlank||R.target==="_blank"||R.buttonClass){B=this.options.ownerDocument.createEvent("HTMLEvents"),B.initEvent("input",!0,!0,this.options.contentWindow);for(var _=0,F=this.elements.length;_<F;_+=1)this.elements[_].dispatchEvent(B)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",B,k)}},cleanPaste:function(R){this.getExtensionByName("paste").cleanPaste(R)},pasteHTML:function(R,k){this.getExtensionByName("paste").pasteHTML(R,k)},setContent:function(R,k){if(k=k||0,this.elements[k]){var B=this.elements[k];B.innerHTML=R,this.checkContentChanged(B)}},getContent:function(R){return R=R||0,this.elements[R]?this.elements[R].innerHTML.trim():null},checkContentChanged:function(R){R=R||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(R,{target:R,currentTarget:R})},resetContent:function(R){if(R){var k=this.elements.indexOf(R);k!==-1&&this.setContent(J[R.getAttribute("medium-editor-index")],k);return}this.elements.forEach(function(B,Z){this.setContent(J[B.getAttribute("medium-editor-index")],Z)},this)},addElements:function(R){var k=c(R,this.options.ownerDocument,!0);if(k.length===0)return!1;k.forEach(function(B){B=A.call(this,B,this.id),this.elements.push(B),this.trigger("addElement",{target:B,currentTarget:B},B)},this)},removeElements:function(R){var k=c(R,this.options.ownerDocument),B=k.map(function(Z){return Z.getAttribute("medium-editor-textarea-id")&&Z.parentNode?Z.parentNode.querySelector('div[medium-editor-textarea-id="'+Z.getAttribute("medium-editor-textarea-id")+'"]'):Z});this.elements=this.elements.filter(function(Z){return B.indexOf(Z)!==-1?(this.events.cleanupElement(Z),Z.getAttribute("medium-editor-textarea-id")&&d(Z),this.trigger("removeElement",{target:Z,currentTarget:Z},Z),!1):!0},this)}},e.getEditorFromElement=function(R){var k=R.getAttribute("data-medium-editor-editor-index"),B=R&&R.ownerDocument&&(R.ownerDocument.defaultView||R.ownerDocument.parentWindow);return B&&B._mediumEditors&&B._mediumEditors[k]?B._mediumEditors[k]:null}}(),function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}(),e.parseVersionString=function(n){var r=n.split("-"),i=r[0].split("."),o=r.length>1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e}())}(ju)),ju.exports}var VF=UF();const Fu=ul(VF);/*!
87
+ `)},yn.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var vF=function(t){return new yn.ObjTree().parseXML(t)};function O0(t){return Object.prototype.toString.call(t)}function T0(t){return" ".repeat(t)}function Ru(t){return O0(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var r=n;return n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Ru(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return Ru(e)}):t}function mF(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Ru(t)).replace(/"/g,"'")}return e}var N0=`
88
+ `;function Lu(t,e,n){var r=T0(n),i="",o=N0+r;if(e==="-json")return"";if(e==="#text")return o+t;if(e==="#cdata-section")return"".concat(o,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(o,"<!--").concat(t,"-->");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(mF(t),'"');if(Array.isArray(t))i+=t.map(function(u){return Lu(u,e,n+1)}).join("");else if(O0(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?N0+T0(n+1)+t["-json"]:"";i+="".concat(n===0?"":o,"<").concat(e),a.forEach(function(u){u.charAt(0)==="-"?s+=Lu(t[u],u,n+1):l+=Lu(t[u],u,n+1)}),i+=s+(l!==""?">".concat(l).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function yF(t){var e="";for(var n in t)e+=Lu(t[n],n,0);return e}var _F=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lp=function(){return lp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lp.apply(this,arguments)},M0=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},up=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},un=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Or=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},_n;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(_n||(_n={}));var D0=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],bF=["properties","startPoint","endPoint","pointsList"],Iu={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},P0=function(t,e){var n=Object.keys(e||{});return n.forEach(function(r){if(t[r]){var i=e[r],o=i.in,a=i.out;o&&(t[r].in=o),a&&(t[r].out=a)}else t[r]=e[r]}),t},or={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return((n=(e=or[r.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat(o(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o,a=t,s=e["-id"],l="",u="";try{for(var c=up(Object.keys(e)),d=c.next();!d.done;d=c.next()){var f=d.value;f.includes("bpmn:")&&(i=un(f.split(":"),2),l=i[1],u=(o=e[f])===null||o===void 0?void 0:o["#text"])}}catch(h){n={error:h}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function xF(t){var e=t??{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(Or(Or([],un(bF),!1),un(n||[]),!1)),a={in:new Set(Or(Or([],un(Iu.in),!1),un((r==null?void 0:r.in)||[]),!1)),out:new Set(Or(Or([],un(Iu.out),!1),un((r==null?void 0:r.out)||[]),!1))};return or=P0(or,i),function(s){var l=s.nodes,u=s.edges;function c(d,f){var h,v;if((d==null?void 0:d.flag)!==1){var g;if((g=or[d.type])&&g.out){var m=g.out(d),y=Object.keys(m);y.length>0&&y.forEach(function(C){d[C]=m[C]})}d!=null&&d.children&&(d.children=d.children.map(function(C){var G=l.find(function(K){return K.id===C})||u.find(function(K){return K.id===C});return G||{}}));var x={};if(typeof d=="string")return d;if(Array.isArray(d))return d.map(function(C){return c(C,"")}).filter(function(C){return C!=null});try{for(var E=up(Object.entries(d)),b=E.next();!b.done;b=E.next()){var T=un(b.value,2),A=T[0],S=T[1];if((S==null?void 0:S.flag)===1)return;var M=[f,A].filter(function(C){return C}).join(".");a.out.has(M)||(typeof S!="object"?A.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(A)?x[A]=S:x["-".concat(A)]=S:o.has(M)?x["-".concat(A)]=c(S,M):x[A]=c(S,M))}}catch(C){h={error:C}}finally{try{b&&!b.done&&(v=E.return)&&v.call(E)}finally{if(h)throw h.error}}return x}}return c(s,"")}}function ku(t){var e,n,r={};try{for(var i=up(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=un(o.value,2),s=a[0],l=a[1];s.indexOf("-")===0?r[s.substring(1)]=Ru(l):typeof l=="string"?r[s]=l:Object.prototype.toString.call(l)==="[object Object]"?r[s]=ku(l):Array.isArray(l)?r[s]=l.map(function(u){return ku(u)}):r[s]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function EF(t,e,n){var r,i=new Map,o=xF(n)(e);o.nodes.forEach(function(s){var l=s["-id"],u=s["-type"],c=s.text,d=s.children,f=M0(s,["-id","-type","text","children"]),h={"-id":l};c!=null&&c["-value"]&&(h["-name"]=c["-value"]),f["-json"]&&(h["-json"]=f["-json"]),f["-properties"]&&Object.assign(h,f["-properties"]),d&&(h.children=d),t[u]||(t[u]=[]),t[u].push(h),i.set(l,h)});var a=o.edges.map(function(s){var l=s["-id"],u=s["-sourceNodeId"],c=s["-targetNodeId"],d=s.text,f=M0(s,["-id","-sourceNodeId","-targetNodeId","text"]),h=i.get(c);h["bpmn:incoming"]||(h["bpmn:incoming"]=[]),h["bpmn:incoming"].push(l);var v={"-id":l,"-sourceRef":u,"-targetRef":c};return d!=null&&d["-value"]&&(v["-name"]=d["-value"]),f["-json"]&&(v["-json"]=f["-json"]),f["-properties"]&&Object.assign(v,f["-properties"]),v});return e.edges.forEach(function(s){var l=s.sourceNodeId,u=s.id,c=i.get(l);c["bpmn:outgoing"]||(c["bpmn:outgoing"]=[]),c["bpmn:outgoing"].push(u)}),(r=t["bpmn:subProcess"])===null||r===void 0||r.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];s.children.forEach(function(g){var m,y=i.get(g["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(E){y[E]&&y[E].forEach(function(b){l[E].add(b)})});var x=(m=t[g["-type"]])===null||m===void 0?void 0:m.findIndex(function(E){return E["-id"]===g["-id"]});x>=0&&t[g["-type"]].splice(x,1),i.delete(g["-id"]),s[g["-type"]]||(s[g["-type"]]=[]),s[g["-type"]].push(y)});var c=l["bpmn:incoming"],d=l["bpmn:outgoing"];d.forEach(function(g){c.has(g)&&u.push(g)});for(var f=function(g){var m=a.findIndex(function(y){return y["-id"]===u[g]});m>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[m]),a.splice(m,1)):g++,h=g},h,v=0;v<u.length;)f(v),v=h;delete s.children}),t[_n.FLOW]=a,t}function wF(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,a=80,s=n.x,l=n.y,u=Tn.shapeConfigMap.get(n.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),c})}var SF=["bpmn:incoming","bpmn:outgoing"];function CF(t,e){var n=[],r=[],i=new Map,o=e??{},a=o.transformer,s=o.excludeFields,l={in:new Set(Or(Or([],un(Iu.in),!1),un((s==null?void 0:s.in)||[]),!1)),out:new Set(Or(Or([],un(Iu.out),!1),un((s==null?void 0:s.out)||[]),!1))};or=P0(or,a);var u=t["bpmn:definitions"];if(u){var c=u["bpmn:process"];(function(f,h){h.forEach(function(v){try{Object.keys(f).forEach(function(g){try{v(g)}catch(m){console.error(m)}})}catch(g){console.error(g)}})})(c,[function(f){function h(g){g["-children"]||(g["-children"]=[]),Object.keys(g).forEach(function(m){var y;m.indexOf("bpmn:")===0&&!SF.includes(m)&&(c[m]||(c[m]=[]),!Array.isArray(c[m])&&(c[m]=[c[m]]),Array.isArray(g[m])?(y=c[m]).push.apply(y,Or([],un(g[m]),!1)):c[m].push(g[m]),Array.isArray(g[m])?g[m].forEach(function(x){!m.includes("Flow")&&g["-children"].push(x["-id"])}):!m.includes("Flow")&&g["-children"].push(g[m]["-id"]),delete g[m])})}if(f==="bpmn:subProcess"){var v=c[f];Array.isArray(v)?v.forEach(function(g){f==="bpmn:subProcess"&&h(g)}):h(v)}},function(f){var h=function(g){Object.keys(g).forEach(function(m){var y,x;if(m.includes("bpmn:")){var E={};or[m]&&or[m].in?(E=(x=(y=or[m]).in)===null||x===void 0?void 0:x.call(y,m,O.cloneDeep(g[m])),delete g[m]):v(g[m]);var b=void 0;(b=Reflect.ownKeys(E)).length>0&&b.forEach(function(T){Reflect.set(g,T,E[T])})}})};function v(g){i.set(g["-id"],g),Array.isArray(g)?g.forEach(function(m){v(m)}):typeof g=="object"&&h(g)}v(c[f])},function(f){if(f.indexOf("bpmn:")===0){var h=c[f];if(f==="bpmn:sequenceFlow"){var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=OF(h,v)}else{var g=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(f==="bpmn:boundaryEvent"){var m=c[f],y=function(x){var E=x["-attachedToRef"],b=i.get(E);b["-boundaryEvents"]||(b["-boundaryEvents"]=[]),b["-boundaryEvents"].push(x["-id"])};Array.isArray(m)?m.forEach(function(x){y(x)}):y(m)}n=n.concat(AF(h,g,f))}}}])}var d=function(f,h,v){Object.keys(f).forEach(function(g){var m=v?"".concat(v,".").concat(g):g;h.has(m)?delete f[g]:typeof f[g]=="object"&&d(f[g],h,m)})};return n.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),r.forEach(function(f){var h,v;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var g=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,m=f.type;g[m]&&(f.type=g[m])}d(f,l.in,"")}),{nodes:n,edges:r}}function AF(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=R0(s,n,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):i=e;var o=R0(i,n,t);r.push(o)}return r}function R0(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],s=Tn.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l={};Object.entries(n).forEach(function(f){var h=un(f,2),v=h[0],g=h[1];D0.includes(v)||(l[v]=g)}),l=ku(l);var u;if(a&&(u={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),u&&(d.text=u),d}function OF(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,n.push(L0(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(L0(r,t))}return n}function L0(t,e){var n,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(`
89
+ `).forEach(function(u){o<u.length&&(o=u.length)}),n={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach(function(u){var c=un(u,2),d=c[0],f=c[1];D0.includes(d)||(a[d]=f)}),a=ku(a);var s=t["di:waypoint"].map(function(u){return{x:Number(u["-x"]),y:Number(u["-y"])}}),l={id:e["-id"],type:_n.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var Tn=function(){function t(e){var n=e.lf,r=this;this.adapterOut=function(i,o){var a,s,l=lp({},r.processAttributes);EF(l,i,o);var u={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};wF(u,i);var c=r.definitionAttributes;c["bpmn:process"]=l,c["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":u};var d={"bpmn:definitions":c};if(!((a=o==null?void 0:o.mapping)===null||a===void 0)&&a.out){var f=(s=o==null?void 0:o.mapping)===null||s===void 0?void 0:s.out,h=function(v){Array.isArray(v)&&v.forEach(function(g){return h(g)}),typeof v=="object"&&Object.keys(v).forEach(function(g){var m;(m=f[g])?(v[m]=O.cloneDeep(v[g]),delete v[g],h(v[m])):h(v[g])})};h(d)}return d},this.adapterIn=function(i,o){if(i)return CF(i,o)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Tn.shapeConfigMap.set(_n.START,{width:y0.width,height:y0.height}),Tn.shapeConfigMap.set(_n.END,{width:_0.width,height:_0.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_CATCH,{width:Pu.width,height:Pu.height}),Tn.shapeConfigMap.set(_n.INTERMEDIATE_THROW,{width:Pu.width,height:Pu.height}),Tn.shapeConfigMap.set(_n.BOUNDARY,{width:b0.width,height:b0.height}),Tn.shapeConfigMap.set(_n.PARALLEL_GATEWAY,{width:x0.width,height:x0.height}),Tn.shapeConfigMap.set(_n.INCLUSIVE_GATEWAY,{width:E0.width,height:E0.height}),Tn.shapeConfigMap.set(_n.EXCLUSIVE_GATEWAY,{width:w0.width,height:w0.height}),Tn.shapeConfigMap.set(_n.SYSTEM,{width:S0.width,height:S0.height}),Tn.shapeConfigMap.set(_n.USER,{width:C0.width,height:C0.height}),Tn.shapeConfigMap.set(_n.SUBPROCESS,{width:A0.width,height:A0.height}),function(t){_F(e,t);function e(n){var r=t.call(this,n)||this;r.adapterXmlIn=function(a){var s=vF(a);return r.adapterIn(s,r.props)},r.adapterXmlOut=function(a){var s=r.adapterOut(a,r.props);return yF(s)};var i=n.lf,o=n.props;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r.props=o,r}return e.pluginName="BPMNAdapter",e}(Tn);var I0=function(){return I0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},I0.apply(this,arguments)};function TF(t,e,n){var r=e.x,i=e.y,o=t.x,a=t.y,s=o-r,l=a-i,u=s*Math.cos(n)-l*Math.sin(n),c=s*Math.sin(n)+l*Math.cos(n),d=u+r,f=c+i;return{x:d,y:f}}var NF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bu=function(){return Bu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Bu.apply(this,arguments)},MF=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},DF=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){NF(e,t);function e(){var n=t.apply(this,DF([],MF(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(r){var i=r.model,o=n.props,a=o.model,s=o.graphModel,l=a.transformWithContainer,u=a.isRestrict,c=n.childrenPositionMap;if(!(!l||u)&&i.id===a.id){var d={x:a.x,y:a.y};gt(Array.from(a.children),function(f){var h=s.getNodeModelById(f);if(h){var v={x:h.x,y:h.y};c.has(h.id)?v=c.get(h.id):c.set(h.id,v);var g=i.rotate*(180/Math.PI);g<0&&(g+=360);var m=g*(Math.PI/180),y=TF(v,d,m);h.moveTo(y.x,y.y),h.rotate=i.rotate}})}},n.onNodeResize=function(r){var i=r.deltaX,o=r.deltaY,a=r.index,s=r.model,l=r.preData,u=n.props,c=u.model,d=u.graphModel,f=c.transformWithContainer,h=c.isRestrict;if(!(!f||h)&&s.id===c.id){var v=l.properties,g=v||{},m=g.width,y=g.height;gt(Array.from(c.children),function(x){var E=d.getNodeModelById(x);if(E){var b=E.width/m*i,T=E.height/y*o;lb({deltaX:b,deltaY:T,index:a,nodeModel:E,graphModel:d,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var r=n.props.model;r.isCollapsed&&r.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,r){var i=this,o=[];return n.isGroup&&gt(Array.from(n.children),function(a){o.push(a);var s=r.getNodeModelById(a);s!=null&&s.isGroup&&(o=o.concat(i.getNodesInGroup(s,r)))}),o},e.prototype.getResizeControl=function(){var n=this.props.model,r=n.resizable,i=n.isCollapsed,o=r&&!i;return o?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var u=n.getNodeStyle().strokeWidth,c=u===void 0?0:u,d=n.getAddableOutlineStyle(),f=r+c+8,h=i+c+8;return Te("rect",Bu(Bu({},d),{width:f,height:h,x:o-f/2,y:a-h/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10)},e.prototype.getExpandIcon=function(n,r){return"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=r-o/2+10,l=i-a/2+10;if(!n.collapsible)return null;var u=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),c=Te("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u});return Te("g",{},[Te("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),c])},e.prototype.getShape=function(){return Te("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(Ji);var PF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ju=function(){return ju=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ju.apply(this,arguments)},cp=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},qo=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},us=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},RF=400,LF=230,IF=80,kF=60,BF=-1e4;(function(t){PF(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.isGroup=!0,i.isRestrict=!1,i.autoResize=!1,i.collapsible=!0,i.isCollapsed=!1,i.groupAddable=!1,i.transformWithContainer=!1,i.childrenLastCollapseStateDict=new Map,i.childrenLastCollapseStateDict=new Map,i.initNodeData(n),i.setAttributes(),i}return e.prototype.initNodeData=function(n){var r;t.prototype.initNodeData.call(this,n);var i=(r=n.properties)!==null&&r!==void 0?r:{},o=i.children,a=i.width,s=i.height,l=i.collapsedWidth,u=i.collapsedHeight,c=i.collapsible,d=i.isCollapsed,f=i.zIndex,h=i.isRestrict,v=i.autoResize,g=i.autoToFront,m=i.transformWithContainer;this.children=o?new Set(o):new Set,this.zIndex=f??BF,this.isCollapsed=d??!1,this.setProperties({isCollapsed:d??!1});var y=a??RF,x=s??LF;this.width=y,this.height=x,this.expandWidth=y,this.expandHeight=x,this.collapsedWidth=l??IF,this.collapsedHeight=u??kF,this.isRestrict=h??!1,this.transformWithContainer=m??!1,this.autoResize=v??!1,this.collapsible=c??!0,this.autoToFront=g??!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,r=t.prototype.getData.call(this),i=[];return gt(Array.from(this.children),function(o){var a=n.graphModel.getNodeModelById(o);a&&!a.virtual&&i.push(o)}),r.children=i,r.properties&&(r.properties.children=i,r.properties.isCollapsed=this.isCollapsed),r},e.prototype.getNodesInGroup=function(n){var r=[];return n.isGroup&&gt(Array.from(n.children),function(i){r.push(i)}),r},e.prototype.getMoveDistance=function(n,r,i){i===void 0&&(i=!1);var o=qo(t.prototype.getMoveDistance.call(this,n,r,i),2),a=o[0],s=o[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,r,i),[a,s]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var r=this,i=r.x,o=r.y,a=r.collapsedWidth,s=r.collapsedHeight,l=r.expandWidth,u=r.expandHeight,c=r.isCollapsed;return c&&(n.x=i+l/2-a/2,n.y=o+u/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+u/2-s/2)),n},e.prototype.toggleCollapse=function(n){var r=this,i=this.graphModel,o=!!n;this.isCollapsed=o,this.setProperties({isCollapsed:o}),i.eventCenter.emit("dynamicGroup:collapse",{collapse:o,nodeModel:this}),o?this.collapse():this.expand();var a=us(us([],qo(this.incoming.edges),!1),qo(this.outgoing.edges),!1),s=Array.from(this.children);gt(s,function(l){var u,c,d=r.graphModel.elementsModelMap.get(l);if(d){var f=d.isCollapsed;if(d.isGroup){var h=d;if(h.isCollapsed||h.toggleCollapse(n),!n){var v=(u=r.childrenLastCollapseStateDict)===null||u===void 0?void 0:u.get(l);v!==void 0&&v!==d.isCollapsed&&h.toggleCollapse(v)}}if((c=r.childrenLastCollapseStateDict)===null||c===void 0||c.set(l,!!f),d.visible=!n,d.BaseType===Lt.NODE){var g=d.incoming.edges,m=d.outgoing.edges;a=us(us(us([],qo(a),!1),qo(g),!1),qo(m),!1)}}}),this.collapseEdge(o,a)},e.prototype.collapse=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.width,s=n.height,l=n.collapsedWidth,u=n.collapsedHeight;this.x=r-a/2+l/2,this.y=i-s/2+u/2,this.text.x=o.x-a/2+l/2,this.text.y=o.y-s/2+u/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=u},e.prototype.expand=function(){var n=this,r=n.x,i=n.y,o=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,u=n.collapsedHeight;this.width=a,this.height=s,this.x=r+this.width/2-l/2,this.y=i+this.height/2-u/2,this.text.x=o.x+this.width/2-l/2,this.text.y=o.y+this.height/2-u/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var r=this.graphModel.addEdge(n);r.virtual=!0,r.text.editable=!1,r.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,r){var i=this,o=this.graphModel;gt(r,function(a,s){var l,u=a.getData(),c=u.targetNodeId,d=u.sourceNodeId,f=ju(ju({},u),{id:"".concat(u.id,"__").concat(s),text:(l=u.text)===null||l===void 0?void 0:l.value});a.virtual&&o.deleteEdgeById(a.id);var h=o.dynamicGroup.getGroupByNodeId(c);h||(h=o.getNodeModelById(c));var v=o.dynamicGroup.getGroupByNodeId(d);v||(v=o.getNodeModelById(d)),n&&a.visible&&(i.children.has(d)||i.id===d?(f.startPoint=void 0,f.sourceNodeId=i.id):(f.endPoint=void 0,f.targetNodeId=i.id),(h.id!==i.id||v.id!==i.id)&&i.createVirtualEdge(f),a.visible=!1),!n&&!a.visible&&(h&&h.isGroup&&h.isCollapsed?(f.targetNodeId=h.id,f.endPoint=void 0,i.createVirtualEdge(f)):v&&v.isGroup&&v.isCollapsed?(f.sourceNodeId=v.id,f.startPoint=void 0,i.createVirtualEdge(f)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var r=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:r,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var r=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:r})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},cp([X],e.prototype,"isCollapsed",void 0),cp([X],e.prototype,"groupAddable",void 0),cp([X],e.prototype,"transformWithContainer",void 0),e})(Uo);var k0=function(){return k0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},k0.apply(this,arguments)},B0;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(B0||(B0={}));var jF=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cs=function(){return cs=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},cs.apply(this,arguments)},FF=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},$F=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},HF=function(t){jF(e,t);function e(n){var r=t.call(this,n)||this;r.textRef=hl(),r.setHoverOn=function(){var l=r.props.element;l.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),l.setHovered(!0))},r.setHoverOff=function(){var l=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),l.setHovered(!1))},r.handleMouseDown=function(l){var u,c=r.props,d=c.label,f=c.graphModel,h=f.editConfigModel.nodeTextDraggable;((u=d.draggable)!==null&&u!==void 0?u:h)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(l)},r.handleMouseUp=function(l){r.state.isDragging&&r.stepDrag.handleMouseUp(l)},r.handleDragging=function(l){var u=l.deltaX,c=l.deltaY;r.state.isDragging||r.setState({isDragging:!0});var d=r.props,f=d.label,h=d.graphModel,v=h.transformModel,g=$F(v.fixDeltaXY(u,c),2),m=g[0],y=g[1];r.setElementModelLabelInfo({x:f.x+m,y:f.y+y}),h.eventCenter.emit("label:drag",{data:f.getData(),model:f})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;d.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),f.eventCenter.emit("label:click",{data:c.getData(),e:l,model:d})},r.handleDbClick=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel;if(f.eventCenter.emit("label:dblclick",{data:c.getData(),e:l,model:d}),!c.editable){d.setSelected(!0);return}if(d.setSelected(),d.setElementState(lt.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var h=document.createRange(),v=window.getSelection();h.selectNodeContents(r.textRef.current),h.collapse(!1),v==null||v.removeAllRanges(),v==null||v.addRange(h)}},r.handleBlur=function(l){var u=r.props,c=u.label,d=u.element,f=u.graphModel.eventCenter;f.emit("label:blur",{e:l,model:d,data:c.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(l){var u=r.props,c=u.label,d=u.graphModel;d.eventCenter.emit("label:input",{e:l,data:c.getData()})},r.reCalcLabelSize=function(){};var i=n.label,o=n.graphModel,a=o.gridSize,s=o.eventCenter;return r.stepDrag=new tr({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(n){var r=this.props,i=r.label,o=r.element,a=r.graphModel,s=o.properties._label,l=s,u=Yc(l,function(f){return f.id===i.id}),c=l[u];l[u]=cs(cs({},c),n);var d=a.getElement(o.id);d==null||d.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,r=this.props,i=r.label,o=r.element,a=r.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,u,c,d,f=s.data;if(((f==null?void 0:f.type)!=="label"||f.type==="label"&&f.id!==i.id||n.state.isSelected)&&n.setState({isSelected:!1}),((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.state.isEditing){n.setState({isEditing:!1});var h=(u=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&u!==void 0?u:"",v=(d=(c=n.textRef.current)===null||c===void 0?void 0:c.innerHTML)!==null&&d!==void 0?d:"";n.setElementModelLabelInfo({value:h,content:v,isSelected:!1}),o.setElementState(lt.DEFAULT)}((f==null?void 0:f.type)!=="label"||f.type=="label"&&f.id!==i.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,r=this.props,i=r.label,o=r.element,a=r.graphModel,s=this.state,l=s.isDragging,u=s.isHovered,c=s.isSelected,d=s.isEditing,f=a.transformModel,h=f.getTransformStyle().transform,v=i.id,g=i.x,m=i.y,y=i.zIndex,x=i.vertical,E=i.style,b=i.rotate,T=i.content,A=i.labelWidth,S=i.textOverflowMode,M=A??(o.BaseType==="node"?o.width-20:80),C={left:"".concat(g-M/2,"px"),top:"".concat(m-10,"px"),width:"".concat(M,"px"),height:"20px",zIndex:y??1,transform:b?"".concat(h," rotate(").concat(b,"deg)"):"".concat(h," rotate(").concat(x?-.25:0,"turn)")};return V("div",{id:"element-container-".concat(v),className:kf("lf-label-editor-container"),style:C,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:V("div",{ref:this.textRef,id:"editor-container-".concat(v),className:kf("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":d,"lf-label-editor-hover":!d&&(u||c)},n["lf-label-editor-".concat(S)]=!d,n)),onInput:this.handleInput,style:cs({maxWidth:"".concat(M,"px"),boxSizing:"border-box",display:"inline-block",background:d||o.BaseType==="edge"?"#fff":"transparent"},E),dangerouslySetInnerHTML:{__html:T}})})},e=FF([vn],e),e}(Qe),ar=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},zF=Si,WF=function(){function t(e,n,r){var i;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=r,this.id=(i=e.id)!==null&&i!==void 0?i:zF(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){ut(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:mr(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},ar([X],t.prototype,"x",void 0),ar([X],t.prototype,"y",void 0),ar([X],t.prototype,"content",void 0),ar([X],t.prototype,"value",void 0),ar([X],t.prototype,"rotate",void 0),ar([X],t.prototype,"style",void 0),ar([X],t.prototype,"zIndex",void 0),ar([X],t.prototype,"vertical",void 0),ar([X],t.prototype,"editable",void 0),ar([X],t.prototype,"draggable",void 0),ar([X],t.prototype,"labelWidth",void 0),ar([X],t.prototype,"textOverflowMode",void 0),t}(),Fu={exports:{}},dp=Fu.exports,j0;function UF(){return j0||(j0=1,function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||function(e){if("Element"in e){var n="classList",r="prototype",i=e.Element[r],o=Object,a=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[r].indexOf||function(v){for(var g=0,m=this.length;g<m;g++)if(g in this&&this[g]===v)return g;return-1},l=function(v,g){this.name=v,this.code=DOMException[v],this.message=g},u=function(v,g){if(g==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(g))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(v,g)},c=function(v){for(var g=a.call(v.getAttribute("class")||""),m=g?g.split(/\s+/):[],y=0,x=m.length;y<x;y++)this.push(m[y]);this._updateClassName=function(){v.setAttribute("class",this.toString())}},d=c[r]=[],f=function(){return new c(this)};if(l[r]=Error[r],d.item=function(v){return this[v]||null},d.contains=function(v){return v+="",u(this,v)!==-1},d.add=function(){var v=arguments,g=0,m=v.length,y,x=!1;do y=v[g]+"",u(this,y)===-1&&(this.push(y),x=!0);while(++g<m);x&&this._updateClassName()},d.remove=function(){var v=arguments,g=0,m=v.length,y,x=!1,E;do for(y=v[g]+"",E=u(this,y);E!==-1;)this.splice(E,1),x=!0,E=u(this,y);while(++g<m);x&&this._updateClassName()},d.toggle=function(v,g){v+="";var m=this.contains(v),y=m?g!==!0&&"remove":g!==!1&&"add";return y&&this[y](v),g===!0||g===!1?g:!m},d.toString=function(){return this.join(" ")},o.defineProperty){var h={get:f,enumerable:!0,configurable:!0};try{o.defineProperty(i,n,h)}catch(v){v.number===-2146823252&&(h.enumerable=!1,o.defineProperty(i,n,h))}}else o[r].__defineGetter__&&i.__defineGetter__(n,f)}}(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(i){var o=function(S){return Object.prototype.toString.call(S).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(M,C,G){this.data=M,this.size=M.length,this.type=C,this.encoding=G},l=a.prototype,u=s.prototype,c=i.FileReaderSync,d=function(S){this.code=this[this.name=S]},f="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),h=f.length,v=i.URL||i.webkitURL||i,g=v.createObjectURL,m=v.revokeObjectURL,y=v,x=i.btoa,E=i.atob,b=i.ArrayBuffer,T=i.Uint8Array,A=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=u.fake=!0;h--;)d.prototype[f[h]]=h+1;return v.createObjectURL||(y=i.URL=function(S){var M=document.createElementNS("http://www.w3.org/1999/xhtml","a"),C;return M.href=S,"origin"in M||(M.protocol.toLowerCase()==="data:"?M.origin=null:(C=S.match(A),M.origin=C&&C[1])),M}),y.createObjectURL=function(S){var M=S.type,C;if(M===null&&(M="application/octet-stream"),S instanceof s)return C="data:"+M,S.encoding==="base64"?C+";base64,"+S.data:S.encoding==="URI"?C+","+decodeURIComponent(S.data):x?C+";base64,"+x(S.data):C+","+encodeURIComponent(S.data);if(g)return g.call(v,S)},y.revokeObjectURL=function(S){S.substring(0,5)!=="data:"&&m&&m.call(v,S)},l.append=function(S){var M=this.data;if(T&&(S instanceof b||S instanceof T)){for(var C="",G=new T(S),K=0,J=G.length;K<J;K++)C+=String.fromCharCode(G[K]);M.push(C)}else if(o(S)==="Blob"||o(S)==="File")if(c){var R=new c;M.push(R.readAsBinaryString(S))}else throw new d("NOT_READABLE_ERR");else S instanceof s?S.encoding==="base64"&&E?M.push(E(S.data)):S.encoding==="URI"?M.push(decodeURIComponent(S.data)):S.encoding==="raw"&&M.push(S.data):(typeof S!="string"&&(S+=""),M.push(unescape(encodeURIComponent(S))))},l.getBlob=function(S){return arguments.length||(S=null),new s(this.data.join(""),S,"raw")},l.toString=function(){return"[object BlobBuilder]"},u.slice=function(S,M,C){var G=arguments.length;return G<3&&(C=null),new s(this.data.slice(S,G>1?M:this.data.length),C,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},a}(e);e.Blob=function(i,o){var a=o&&o.type||"",s=new n;if(i)for(var l=0,u=i.length;l<u;l++)Uint8Array&&i[l]instanceof Uint8Array?s.append(i[l].buffer):s.append(i[l]);var c=s.getBlob(a);return!c.slice&&c.webkitSlice&&(c.slice=c.webkitSlice),c};var r=Object.getPrototypeOf||function(i){return i.__proto__};e.Blob.prototype=r(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||dp.content||dp),function(e,n){var r=typeof process<"u"&&process&&process.versions&&process.versions.electron;r?e.MediumEditor=n:t.exports=n}(dp,function(){function e(n,r){return this.init(n,r)}return e.extensions={},function(n){function r(l,u){var c,d=Array.prototype.slice.call(arguments,2);u=u||{};for(var f=0;f<d.length;f++){var h=d[f];if(h)for(c in h)h.hasOwnProperty(c)&&typeof h[c]<"u"&&(l||u.hasOwnProperty(c)===!1)&&(u[c]=h[c])}return u}var i=!1;try{var o=document.createElement("div"),a=document.createTextNode(" ");o.appendChild(a),i=o.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,u){var c=s.getKeyCode(l);return Array.isArray(u)===!1?c===u:u.indexOf(c)!==-1},getKeyCode:function(l){var u=l.which;return u===null&&(u=l.charCode!==null?l.charCode:l.keyCode),u},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var u=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},defaults:function(){var u=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},createLink:function(l,u,c,d){var f=l.createElement("a");return s.moveTextRangeIntoElement(u[0],u[u.length-1],f),f.setAttribute("href",c),d&&(d==="_blank"&&f.setAttribute("rel","noopener noreferrer"),f.setAttribute("target",d)),f},findOrCreateMatchingTextNodes:function(l,u,c){for(var d=l.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),f=[],h=0,v=!1,g=null,m=null;(g=d.nextNode())!==null;)if(!(g.nodeType>3))if(g.nodeType===3){if(!v&&c.start<h+g.nodeValue.length&&(v=!0,m=s.splitStartNodeIfNeeded(g,c.start,h)),v&&s.splitEndNodeIfNeeded(g,m,c.end,h),v&&h===c.end)break;if(v&&h>c.end+1)throw new Error("PerformLinking overshot the target!");v&&f.push(m||g),h+=g.nodeValue.length,m!==null&&(h+=m.nodeValue.length,d.nextNode()),m=null}else g.tagName.toLowerCase()==="img"&&(!v&&c.start<=h&&(v=!0),v&&f.push(g));return f},splitStartNodeIfNeeded:function(l,u,c){return u!==c?l.splitText(u-c):null},splitEndNodeIfNeeded:function(l,u,c,d){var f,h;f=d+l.nodeValue.length+(u?u.nodeValue.length:0)-1,h=c-d-(u?l.nodeValue.length:0),f>=c&&d!==f&&h!==0&&(u||l).splitText(h)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var u=[],c=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(c).length===0)return[l];for(var d=0;d<l.childNodes.length;d++){var f=l.childNodes[d];if(f.nodeType===3)u.push(f);else if(f.nodeType===1){var h=f.querySelectorAll(c);h.length===0?u.push(f):u=u.concat(e.util.splitByBlockElements(f))}}return u},findAdjacentTextNodeWithContent:function(u,c,d){var f=!1,h,v=d.createNodeIterator(u,NodeFilter.SHOW_TEXT,null,!1);for(h=v.nextNode();h;){if(h===c)f=!0;else if(f&&h.nodeType===3&&h.nodeValue&&h.nodeValue.trim().length>0)break;h=v.nextNode()}return h},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var u=l.previousSibling;!u&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,u=l.previousSibling;return u},isDescendant:function(u,c,d){if(!u||!c)return!1;if(u===c)return!!d;if(u.nodeType!==1)return!1;if(i||c.nodeType!==3)return u.contains(c);for(var f=c.parentNode;f!==null;){if(f===u)return!0;f=f.parentNode}return!1},isElement:function(u){return!!(u&&u.nodeType===1)},throttle:function(l,u){var c=50,d,f,h,v=null,g=0,m=function(){g=Date.now(),v=null,h=l.apply(d,f),v||(d=f=null)};return!u&&u!==0&&(u=c),function(){var y=Date.now(),x=u-(y-g);return d=this,f=arguments,x<=0||x>u?(v&&(clearTimeout(v),v=null),g=y,h=l.apply(d,f),v||(d=f=null)):v||(v=setTimeout(m,x)),h}},traverseUp:function(l,u){if(!l)return!1;do{if(l.nodeType===1){if(u(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},insertHTMLCommand:function(l,u){var c,d,f,h,v,g,m,y=!1,x=["insertHTML",!1,u];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,x)}catch{}if(c=l.getSelection(),c.rangeCount){if(d=c.getRangeAt(0),m=d.commonAncestorContainer,s.isMediumEditorElement(m)&&!m.firstChild)d.selectNode(m.appendChild(l.createTextNode("")));else if(m.nodeType===3&&d.startOffset===0&&d.endOffset===m.nodeValue.length||m.nodeType!==3&&m.innerHTML===d.toString()){for(;!s.isMediumEditorElement(m)&&m.parentNode&&m.parentNode.childNodes.length===1&&!s.isMediumEditorElement(m.parentNode);)m=m.parentNode;d.selectNode(m)}for(d.deleteContents(),f=l.createElement("div"),f.innerHTML=u,h=l.createDocumentFragment();f.firstChild;)v=f.firstChild,g=h.appendChild(v);d.insertNode(h),g&&(d=d.cloneRange(),d.setStartAfter(g),d.collapse(!0),e.selection.selectRange(l,d)),y=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(x,y),y},execFormatBlock:function(l,u){var c=s.getTopBlockContainer(e.selection.getSelectionStart(l)),d;if(u==="blockquote"){if(c&&(d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return s.isBlockContainer(f)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,u)}if(c&&u===c.nodeName.toLowerCase()&&(u="p"),s.isIE&&(u="<"+u+">"),c&&c.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&u==="<p>")return l.execCommand("outdent",!1,u);if((s.isFF||s.isEdge)&&u==="p")return d=Array.prototype.slice.call(c.childNodes),d.some(function(f){return!s.isBlockContainer(f)})&&l.execCommand("formatBlock",!1,u),l.execCommand("outdent",!1,u)}return l.execCommand("formatBlock",!1,u)},setTargetBlank:function(l,u){var c,d=u||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)(d===!1||d===l[c].attributes.href.value)&&(l[c].target="_blank",l[c].rel="noopener noreferrer")},removeTargetBlank:function(l,u){var c;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),c=0;c<l.length;c+=1)u===l[c].attributes.href.value&&(l[c].removeAttribute("target"),l[c].removeAttribute("rel"))},addClassToAnchors:function(l,u){var c=u.split(" "),d,f;if(l.nodeName.toLowerCase()==="a")for(f=0;f<c.length;f+=1)l.classList.add(c[f]);else{var h=l.getElementsByTagName("a");if(h.length===0){var v=s.getClosestTag(l,"a");l=v?[v]:[]}else l=h;for(d=0;d<l.length;d+=1)for(f=0;f<c.length;f+=1)l[d].classList.add(c[f])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var u=l.parentNode,c=u.nodeName.toLowerCase();c==="li"||!s.isBlockContainer(u)&&c!=="div";){if(c==="li")return!0;if(u=u.parentNode,u)c=u.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,u){if(u.nodeName.toLowerCase()==="li"){var c=u.parentElement;c.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(c.parentElement,l),e.selection.moveCursor(l,u.firstChild,u.firstChild.textContent.length))}},splitOffDOMTree:function(l,u,c){for(var d=u,f=null,h=!c;d!==l;){var v=d.parentNode,g=v.cloneNode(!1),m=h?d:v.firstChild,y;for(f&&(h?g.appendChild(f):y=f),f=g;m;){var x=m.nextSibling;m===d?(m.hasChildNodes()?m=m.cloneNode(!1):m.parentNode.removeChild(m),m.textContent&&f.appendChild(m),m=h?x:null):(m.parentNode.removeChild(m),(m.hasChildNodes()||m.textContent)&&f.appendChild(m),m=x)}y&&f.appendChild(y),d=v}return f},moveTextRangeIntoElement:function(l,u,c){if(!l||!u)return!1;var d=s.findCommonRoot(l,u);if(!d)return!1;if(u===l){var f=l.parentNode,h=l.nextSibling;return f.removeChild(l),c.appendChild(l),h?f.insertBefore(c,h):f.appendChild(c),c.hasChildNodes()}for(var v=[],g,m,y,x=0;x<d.childNodes.length;x++)if(y=d.childNodes[x],!g)s.isDescendant(y,l,!0)&&(g=y);else if(s.isDescendant(y,u,!0)){m=y;break}else v.push(y);var E=m.nextSibling,b=d.ownerDocument.createDocumentFragment();return g===l?(g.parentNode.removeChild(g),b.appendChild(g)):b.appendChild(s.splitOffDOMTree(g,l)),v.forEach(function(T){T.parentNode.removeChild(T),b.appendChild(T)}),m===u?(m.parentNode.removeChild(m),b.appendChild(m)):b.appendChild(s.splitOffDOMTree(m,u,!0)),c.appendChild(b),m.parentNode===d?d.insertBefore(c,m):E?d.insertBefore(c,E):d.appendChild(c),c.hasChildNodes()},depthOfNode:function(l){for(var u=0,c=l;c.parentNode!==null;)c=c.parentNode,u++;return u},findCommonRoot:function(l,u){for(var c=s.depthOfNode(l),d=s.depthOfNode(u),f=l,h=u;c!==d;)c>d?(f=f.parentNode,c-=1):(h=h.parentNode,d-=1);for(;f!==h;)f=f.parentNode,h=h.parentNode;return f},isElementAtBeginningOfBlock:function(l){for(var u,c;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(c=l;c=c.previousSibling;)if(u=c.nodeType===3?c.nodeValue:c.textContent,u.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(u){return s.isMediumEditorElement(u)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(u){return s.isBlockContainer(u)||s.isMediumEditorElement(u)})},getTopBlockContainer:function(l){var u=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(c){return s.isBlockContainer(c)&&(u=c),!u&&s.isMediumEditorElement(c)?(u=c,!0):!1}),u},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(c){return s.emptyElementNames.indexOf(c.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var u=l.querySelector("th, td");u&&(l=u)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var u=0;u<l.childNodes.length;u++){var c=s._getFirstTextNode(l.childNodes[u]);if(c!==null)return c}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,u,c){var d=l+" is deprecated, please use "+u+" instead.";c&&(d+=" Will be removed in "+c),s.warn(d)},deprecatedMethod:function(l,u,c,d){s.deprecated(l,u,d),typeof this[u]=="function"&&this[u].apply(this,c)},cleanupAttrs:function(l,u){u.forEach(function(c){l.removeAttribute(c)})},cleanupTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,u){return s.traverseUp(l,function(c){return c.nodeName.toLowerCase()===u.toLowerCase()})},unwrap:function(l,u){for(var c=u.createDocumentFragment(),d=Array.prototype.slice.call(l.childNodes),f=0;f<d.length;f++)c.appendChild(d[f]);c.childNodes.length?l.parentNode.replaceChild(c,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s}(window),function(){var n=function(r){e.util.extend(this,r)};n.extend=function(r){var i=this,o;r&&r.hasOwnProperty("constructor")?o=r.constructor:o=function(){return i.apply(this,arguments)},e.util.extend(o,i);var a=function(){this.constructor=o};return a.prototype=i.prototype,o.prototype=new a,r&&e.util.extend(o.prototype,r),o},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(r){return this.base.options[r]}},["execAction","on","off","subscribe","trigger"].forEach(function(r){n.prototype[r]=function(){return this.base[r].apply(this.base,arguments)}}),e.Extension=n}(),function(){function n(i){return e.util.isBlockContainer(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var r={findMatchingSelectionParent:function(i,o){var a=o.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,i))},getSelectionElement:function(i){return this.findMatchingSelectionParent(function(o){return e.util.isMediumEditorElement(o)},i)},exportSelection:function(i,o){if(!i)return null;var a=null,s=o.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),u=l.cloneRange(),c;u.selectNodeContents(i),u.setEnd(l.startContainer,l.startOffset),c=u.toString().length,a={start:c,end:c+l.toString().length},this.doesRangeStartWithImages(l,o)&&(a.startsWithImage=!0);var d=this.getTrailingImageCount(i,a,l.endContainer,l.endOffset);if(d&&(a.trailingImageCount=d),c!==0){var f=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,l.startContainer,l.startOffset);f!==-1&&(a.emptyBlocksIndex=f)}}return a},importSelection:function(i,o,a,s){if(!(!i||!o)){var l=a.createRange();l.setStart(o,0),l.collapse(!0);var u=o,c=[],d=0,f=!1,h=!1,v=0,g=!1,m,y=!1,x=null;for((s||i.startsWithImage||typeof i.emptyBlocksIndex<"u")&&(y=!0);!g&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=d+u.length,!f&&i.start>=d&&i.start<=m&&(y||i.start<m?(l.setStart(u,i.start-d),f=!0):x=u),f&&i.end>=d&&i.end<=m&&(i.trailingImageCount?h=!0:(l.setEnd(u,i.end-d),g=!0)),d=m;else{if(i.trailingImageCount&&h&&(u.nodeName.toLowerCase()==="img"&&v++,v===i.trailingImageCount)){for(var E=0;u.parentNode.childNodes[E]!==u;)E++;l.setEnd(u.parentNode,E+1),g=!0}if(!g&&u.nodeType===1)for(var b=u.childNodes.length-1;b>=0;)c.push(u.childNodes[b]),b-=1}g||(u=c.pop())}!f&&x&&(l.setStart(x,x.length),l.setEnd(x,x.length)),typeof i.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,o,i.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(i,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(i,o){var a=function(d){return d.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,a)){for(var s=o.startContainer,l=o.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var u=null,c=0;u===null&&c<l.parentNode.childNodes.length;c++)l.parentNode.childNodes[c]===l&&(u=c);o.setStart(l.parentNode,u+1),o.collapse(!0)}}return o},importSelectionMoveCursorPastBlocks:function(i,o,a,s){var l=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),u=s.startContainer,c,d,f=0;for(a=a||1,u.nodeType===3&&e.util.isBlockContainer(u.previousSibling)?c=u.previousSibling:c=e.util.getClosestBlockContainer(u);l.nextNode();)if(!d)c===l.currentNode&&(d=l.currentNode);else if(d=l.currentNode,f++,f===a||d.textContent.length>0)break;return d||(d=c),s.setStart(e.util.getFirstSelectableLeafNode(d),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var u=e.util.findPreviousSibling(l);if(u){if(u.nodeValue)return-1}else return-1}for(var c=e.util.getClosestBlockContainer(a),d=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),f=0;d.nextNode();){var h=d.currentNode.textContent==="";if((h||f>0)&&(f+=1),d.currentNode===c)return f;h||(f=0)}return f},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var a=i.startContainer.querySelector("img");if(!a)return!1;for(var s=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var u=i,c=[],d=0,f=!1,h=!1,v=!1,g,m=0;!v&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!h)m=0,g=d+u.length,!f&&o.start>=d&&o.start<=g&&(f=!0),f&&o.end>=d&&o.end<=g&&(h=!0),d=g;else if(u.nodeName.toLowerCase()==="img"&&m++,u===l)v=!0;else if(u.nodeType===1)for(var y=u.childNodes.length-1;y>=0;)c.push(u.childNodes[y]),y-=1;v||(u=c.pop())}return m},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(o.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(o=!0),s.nodeName!=="#text"&&l==="false"},i);return!o&&a},getSelectionHtml:function(o){var a,s="",l=o.getSelection(),u,c;if(l.rangeCount){for(c=o.createElement("div"),a=0,u=l.rangeCount;a<u;a+=1)c.appendChild(l.getRangeAt(a).cloneContents());s=c.innerHTML}return s},getCaretOffsets:function(o,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(o),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(o),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(i){var o=i.startContainer;return o===i.endContainer&&o.hasChildNodes()&&i.endOffset===i.startOffset+1},getSelectedParentElement:function(i){return i?this.rangeSelectsSingleNode(i)&&i.startContainer.childNodes[i.startOffset].nodeType!==3?i.startContainer.childNodes[i.startOffset]:i.startContainer.nodeType===3?i.startContainer.parentNode:i.startContainer:null},getSelectedElements:function(i){var o=i.getSelection(),a,s,l;if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(a=o.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(u){return typeof o.containsNode=="function"?o.containsNode(u,!0):!0})},selectNode:function(i,o){var a=o.createRange();a.selectNodeContents(i),this.selectRange(o,a)},select:function(i,o,a,s,l){var u=i.createRange();return u.setStart(o,a),s?u.setEnd(s,l):u.collapse(!0),this.selectRange(i,u),u},clearSelection:function(i,o){o?i.getSelection().collapseToStart():i.getSelection().collapseToEnd()},moveCursor:function(i,o,a){this.select(i,o,a)},getSelectionRange:function(i){var o=i.getSelection();return o.rangeCount===0?null:o.getRangeAt(0)},selectRange:function(i,o){var a=i.getSelection();a.removeAllRanges(),a.addRange(o)},getSelectionStart:function(i){var o=i.getSelection().anchorNode,a=o&&o.nodeType===3?o.parentNode:o;return a}};e.selection=r}(),function(){function n(i,o){return i?i.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,o,!0)})):!1}):!1}var r=function(i){this.base=i,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};r.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(i,o,a,s){var l=this.base.options.contentWindow,u=this.base.options.ownerDocument;i=e.util.isElement(i)||[l,u].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(c){c.addEventListener(o,a,s),this.events.push([c,o,a,s])}).bind(this))},detachDOMEvent:function(i,o,a,s){var l,u,c=this.base.options.contentWindow,d=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[c,d].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(f){l=this.indexOfListener(f,o,a,s),l!==-1&&(u=this.events.splice(l,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}).bind(this)))},indexOfListener:function(i,o,a,s){var l,u,c;for(l=0,u=this.events.length;l<u;l=l+1)if(c=this.events[l],c[0]===i&&c[1]===o&&c[2]===a&&c[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var i=this.events.pop();i;)i[0].removeEventListener(i[1],i[2],i[3]),i=this.events.pop()},detachAllEventsFromElement:function(i){for(var o=this.events.filter(function(u){return u&&u[0].getAttribute&&u[0].getAttribute("medium-editor-index")===i.getAttribute("medium-editor-index")}),a=0,s=o.length;a<s;a++){var l=o[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(i){this.listeners.editableInput&&(this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(o){this.attachDOMEvent(i,o.name,o.handler.bind(this))},this)},enableCustomEvent:function(i){this.disabledEvents[i]!==void 0&&delete this.disabledEvents[i]},disableCustomEvent:function(i){this.disabledEvents[i]=!0},attachCustomEvent:function(i,o){this.setupListener(i),this.customEvents[i]||(this.customEvents[i]=[]),this.customEvents[i].push(o)},detachCustomEvent:function(i,o){var a=this.indexOfCustomListener(i,o);a!==-1&&this.customEvents[i].splice(a,1)},indexOfCustomListener:function(i,o){return!this.customEvents[i]||!this.customEvents[i].length?-1:this.customEvents[i].indexOf(o)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(i,o,a){this.customEvents[i]&&!this.disabledEvents[i]&&this.customEvents[i].forEach(function(s){s(o,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(i){i.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(i){this.handleDocumentExecCommand(i)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var i=this.options.ownerDocument;if(!(!this.execCommandListener||!i.execCommand.listeners)){var o=i.execCommand.listeners.indexOf(this.execCommandListener);o!==-1&&i.execCommand.listeners.splice(o,1),i.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var i=this.options.ownerDocument;if(!i.execCommand.listeners){var o=function(s,l){i.execCommand.listeners&&i.execCommand.listeners.forEach(function(u){u({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=i.execCommand.orig.apply(this,arguments);if(!i.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return o(l,s),s};a.orig=i.execCommand,a.listeners=[],a.callListeners=o,i.execCommand=a}},unwrapExecCommand:function(){var i=this.options.ownerDocument;i.execCommand.orig&&(i.execCommand=i.execCommand.orig)},setupListener:function(i){if(!this.listeners[i]){switch(i){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(o){this.contentCache[o.getAttribute("medium-editor-index")]=o.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[i]=!0}},attachToEachElement:function(i,o){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,i,o.bind(this))},this),this.eventsCache.push({name:i,handler:o})},cleanupElement:function(i){var o=i.getAttribute("medium-editor-index");o&&(this.detachAllEventsFromElement(i),this.contentCache&&delete this.contentCache[o])},focusElement:function(i){i.focus(),this.updateFocus(i,{target:i,type:"focus"})},updateFocus:function(i,o){var a=this.base.getFocusedElement(),s;a&&o.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(u){return!s&&e.util.isDescendant(u,i,!0)&&(s=u),!!s},this);var l=!e.util.isDescendant(a,i,!0)&&!n(this.base.extensions,i);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,s))),l&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(i,o){if(this.contentCache){var a=i.getAttribute("medium-editor-index"),s=i.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",o,i),this.contentCache[a]=s}},handleDocumentSelectionChange:function(i){if(i.currentTarget&&i.currentTarget.activeElement){var o=i.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,o,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:o,currentTarget:a})}},handleDocumentExecCommand:function(){var i=this.base.getFocusedElement();i&&this.updateInput(i,{target:i,currentTarget:i})},handleBodyClick:function(i){this.updateFocus(i.target,i)},handleBodyFocus:function(i){this.updateFocus(i.target,i)},handleBodyMousedown:function(i){this.lastMousedownTarget=i.target},handleInput:function(i){this.updateInput(i.currentTarget,i)},handleClick:function(i){this.triggerCustomEvent("editableClick",i,i.currentTarget)},handleBlur:function(i){this.triggerCustomEvent("editableBlur",i,i.currentTarget)},handleKeypress:function(i){if(this.triggerCustomEvent("editableKeypress",i,i.currentTarget),this.keypressUpdateInput){var o={target:i.target,currentTarget:i.currentTarget};setTimeout((function(){this.updateInput(o.currentTarget,o)}).bind(this),0)}},handleKeyup:function(i){this.triggerCustomEvent("editableKeyup",i,i.currentTarget)},handleMouseover:function(i){this.triggerCustomEvent("editableMouseover",i,i.currentTarget)},handleDragging:function(i){this.triggerCustomEvent("editableDrag",i,i.currentTarget)},handleDrop:function(i){this.triggerCustomEvent("editableDrop",i,i.currentTarget)},handlePaste:function(i){this.triggerCustomEvent("editablePaste",i,i.currentTarget)},handleKeydown:function(i){if(this.triggerCustomEvent("editableKeydown",i,i.currentTarget),e.util.isKey(i,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.ENTER)||i.ctrlKey&&e.util.isKey(i,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",i,i.currentTarget);if(e.util.isKey(i,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",i,i.currentTarget)}},e.Events=r}(),function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(r){n.isBuiltInButton(r)?e.Extension.call(this,this.defaults[r]):e.Extension.call(this,r)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var r=this.document.createElement("button"),i=this.contentDefault,o=this.getAria(),a=this.getEditorOption("buttonLabels");return r.classList.add("medium-editor-action"),r.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){r.classList.add(s)}),r.setAttribute("data-action",this.getAction()),o&&(r.setAttribute("title",o),r.setAttribute("aria-label",o)),this.attrs&&Object.keys(this.attrs).forEach(function(s){r.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(i=this.contentFA),r.innerHTML=i,r},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=this.getAction();i&&this.execAction(i)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var r=null;return this.useQueryState&&(r=this.base.queryCommandState(this.getAction())),r},isAlreadyApplied:function(r){var i=!1,o=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(i=s.indexOf(l)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});n.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},e.extensions.button=n}(),function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>&bull;</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>&rarr;</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>&larr;</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>&ldquo;</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}}(),function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"&#10003;",formCloseLabel:"&times;",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.setToolbarPosition()}});e.extensions.form=n}(),function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return r.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),r.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),r.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),a){var s=r.buttonClass?r.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],a=i[1];return o+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=l[1],c=l[2],d=l[3];if(s.test(r))return"tel:"+r;if(!o){var f=u.split("/")[0];(f.match(/.+(\.|:).+/)||f==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(u)+(c===void 0?"":"?"+this.ensureEncodedQuery(c))+(d===void 0?"":"#"+d)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),a=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n}(),function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,a=r.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,u=this.getEditorOption("elementsContainer"),c=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,d={},f,h,v,g,m;f=this.anchorPreview.offsetWidth/2;var y=this.base.getExtensionByName("toolbar");y&&(s=y.diffLeft,l=y.diffTop),h=s-f,c?(g=u.getBoundingClientRect(),["top","left"].forEach(function(x){d[x]=a[x]-g[x]}),d.width=a.width,d.height=a.height,a=d,i=g.width,m=u.scrollTop):m=this.window.pageYOffset,v=a.left+a.width/2,m+=o+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(m)+"px",this.anchorPreview.style.right="initial",v<f?(this.anchorPreview.style.left=h+f+"px",this.anchorPreview.style.right="initial"):i-v<f?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=h+v+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(r){var i=this.base.getExtensionByName("anchor"),o=this.activeAnchor;i&&o&&(r.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(o){var a={value:o.attributes.href.value,target:o.getAttribute("target"),buttonClass:o.getAttribute("class")};i.showForm(a),o=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(r){var i=e.util.getClosestTag(r.target,"a");if(i!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(i.outerHTML)||/href=["']#\S+["']/.test(i.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==i&&this.detachPreviewHandlers(),this.anchorToPreview=i,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(r){(!r.relatedTarget||!/anchor-preview/.test(r.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var r=new Date().getTime()-this.lastOver;r>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n}(),function(){var n,r,i,o,a;n=[" "," ",`
90
+ `,"\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),a=new RegExp(i,"gi");function s(u){return!e.util.getClosestTag(u,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var u=0,c=0;c<this.window._mediumEditors.length;c++){var d=this.window._mediumEditors[c];d!==null&&d.getExtensionByName("autoLink")!==void 0&&u++}return u===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(u,c){this.performLinking(c)},onKeypress:function(u){this.disableEventHandling||e.util.isKey(u,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var c=this.base.exportSelection();this.performLinking(u.target)&&this.base.importSelection(c,!0)}catch(d){window.console&&window.console.error("Failed to perform linking",d),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(u){var c=e.util.splitByBlockElements(u),d=!1;c.length===0&&(c=[u]);for(var f=0;f<c.length;f++)d=this.removeObsoleteAutoLinkSpans(c[f])||d,d=this.performLinkingWithinElement(c[f])||d;return this.base.events.updateInput(u,{target:u,currentTarget:u}),d},removeObsoleteAutoLinkSpans:function(u){if(!u||u.nodeType===3)return!1;for(var c=u.querySelectorAll('span[data-auto-link="true"]'),d=!1,f=0;f<c.length;f++){var h=c[f].textContent;if(h.indexOf("://")===-1&&(h=e.util.ensureUrlHasProtocol(h)),c[f].getAttribute("data-href")!==h&&s(c[f])){d=!0;var v=h.replace(/\s+$/,"");if(c[f].getAttribute("data-href")===v){var g=h.length-v.length,m=e.util.splitOffDOMTree(c[f],this.splitTextBeforeEnd(c[f],g));c[f].parentNode.insertBefore(m,c[f].nextSibling)}else e.util.unwrap(c[f],this.document)}}return d},splitTextBeforeEnd:function(u,c){for(var d=this.document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,!1),f=!0;f;)f=d.lastChild()!==null;for(var h,v,g;c>0&&g!==null;)h=d.currentNode,v=h.nodeValue,v.length>c?(g=h.splitText(v.length-c),c=0):(g=d.previousNode(),c-=v.length);return g},performLinkingWithinElement:function(u){for(var c=this.findLinkableText(u),d=!1,f=0;f<c.length;f++){var h=e.util.findOrCreateMatchingTextNodes(this.document,u,c[f]);this.shouldNotLink(h)||this.createAutoLink(h,c[f].href)}return d},shouldNotLink:function(u){for(var c=!1,d=0;d<u.length&&c===!1;d++)c=!!e.util.traverseUp(u[d],function(f){return f.nodeName.toLowerCase()==="a"||f.getAttribute&&f.getAttribute("data-auto-link")==="true"});return c},findLinkableText:function(u){for(var c=u.textContent,d=null,f=[];(d=a.exec(c))!==null;){var h=!0,v=d.index+d[0].length;h=(d.index===0||n.indexOf(c[d.index-1])!==-1)&&(v===c.length||n.indexOf(c[v])!==-1),h=h&&(d[0].indexOf("/")!==-1||o.test(d[0].split(".").pop().split("?").shift())),h&&f.push({href:d[0],start:d.index,end:v})}return f},createAutoLink:function(u,c){c=e.util.ensureUrlHasProtocol(c);var d=e.util.createLink(this.document,u,c,this.getEditorOption("targetBlank")?"_blank":null),f=this.document.createElement("span");for(f.setAttribute("data-auto-link","true"),f.setAttribute("data-href",c),d.insertBefore(f,d.firstChild);d.childNodes.length>1;)f.appendChild(d.childNodes[1])}});e.extensions.autoLink=l}(),function(){var n="medium-editor-dragover";function r(o){var a=e.util.getContainerEditorElement(o),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var a=o.target.classList?o.target:o.target.parentElement;r(a),o.type==="dragover"&&a.classList.add(n)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(a){return!!o.type.match(a)})},insertImageFile:function(o){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(o),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=i}(),function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),a=!!r.shiftKey,s=!!r.altKey;this.keys[i].forEach(function(l){l.meta===o&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n}(),function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("select"),a=r.createElement("a"),s=r.createElement("a"),l;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u<this.fonts.length;u++)l=r.createElement("option"),l.innerHTML=this.fonts[u],l.value=this.fonts[u],o.appendChild(l);return o.className="medium-editor-toolbar-select",i.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"&times;",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n}(),function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"&#xB1;",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("input"),a=r.createElement("a"),s=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"&times;",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n}(),function(){var n="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|"|“|”)(((?!&quot;|&rdquo;|&ldquo;|"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|"|“|”)(?:(?!&gt;).)*&gt;/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(u,c,d){var f=u.clipboardData||c.clipboardData||d.dataTransfer,h={};if(!f)return h;if(f.getData){var v=f.getData("Text");v&&v.length>0&&(h["text/plain"]=v)}if(f.types)for(var g=0;g<f.types.length;g++){var m=f.types[g];h[m]=f.getData(m)}return h}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(u){this.on(u,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(u,c){this.on(c,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(u,c){if(!u.defaultPrevented){var d=s(u,this.window,this.document),f=d["text/html"],h=d["text/plain"];this.window.clipboardData&&u.clipboardData===void 0&&!f&&(f=h),(f||h)&&(u.preventDefault(),this.doPaste(f,h,c))}},doPaste:function(u,c,d){var f,h="",v;if(this.cleanPastedHTML&&u)return this.cleanPaste(u);if(c){if(this.getEditorOption("disableReturn")||d&&d.getAttribute("data-disable-return"))h=e.util.htmlEntities(c);else if(f=c.split(/[\r\n]+/g),f.length>1)for(v=0;v<f.length;v+=1)f[v]!==""&&(h+="<p>"+e.util.htmlEntities(f[v])+"</p>");else h=e.util.htmlEntities(f[0]);e.util.insertHTMLCommand(this.document,h)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var c=s(u,this.window,this.document),d=c["text/html"],f=c["text/plain"],h=i;if(!this.cleanPastedHTML||d){u.preventDefault(),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h);return}setTimeout((function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,f,h),this.trigger("editablePaste",{currentTarget:h,target:h},h)}).bind(this),0)},handleKeydown:function(u,c){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(u){var c,d=e.selection.getSelectionRange(this.document),f=this.window.pageYOffset;i=u,d&&(c=d.getClientRects(),c.length?f+=c[0].top:d.startContainer.getBoundingClientRect!==void 0?f+=d.startContainer.getBoundingClientRect().top:f+=d.getBoundingClientRect().top),r=d;var h=this.document.createElement("div");h.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),h.setAttribute("style","border: 1px red solid; position: absolute; top: "+f+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),h.setAttribute("contentEditable",!0),h.innerHTML=n,this.document.body.appendChild(h),this.on(h,"focus",o),this.on(h,"focusin",o),this.on(h,"focusout",o),h.focus(),e.selection.selectNode(h,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(h,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var c=u.innerHTML;return!c||c===n?!1:c},cleanPaste:function(u){var c,d,f,h,v=/<p|<br|<div/.test(u),g=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(c=0;c<g.length;c+=1)u=u.replace(g[c][0],g[c][1]);if(!v)return this.pasteHTML(u);for(f=this.document.createElement("div"),f.innerHTML="<p>"+u.split("<br><br>").join("</p><p>")+"</p>",d=f.querySelectorAll("a,p,div,br"),c=0;c<d.length;c+=1)switch(h=d[c],h.innerHTML=h.innerHTML.replace(/\n/gi," "),h.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(h);break;case"br":this.filterLineBreak(h);break}this.pasteHTML(f.innerHTML)},pasteHTML:function(u,c){c=e.util.defaults({},c,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var d,f,h,v,g=this.document.createDocumentFragment();for(g.appendChild(this.document.createElement("body")),v=g.querySelector("body"),v.innerHTML=u,this.cleanupSpans(v),d=v.querySelectorAll("*"),h=0;h<d.length;h+=1)f=d[h],f.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(f),e.util.cleanupAttrs(f,c.cleanAttrs),e.util.cleanupTags(f,c.cleanTags),e.util.unwrapTags(f,c.unwrapTags);e.util.insertHTMLCommand(this.document,v.innerHTML.replace(/&nbsp;/g," "))},isCommonBlock:function(u){return u&&(u.nodeName.toLowerCase()==="p"||u.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(u){/^\s*$/.test(u.textContent)&&u.parentNode&&u.parentNode.removeChild(u)},filterLineBreak:function(u){this.isCommonBlock(u.previousElementSibling)?this.removeWithParent(u):this.isCommonBlock(u.parentNode)&&(u.parentNode.firstChild===u||u.parentNode.lastChild===u)?this.removeWithParent(u):u.parentNode&&u.parentNode.childElementCount===1&&u.parentNode.textContent===""&&this.removeWithParent(u)},removeWithParent:function(u){u&&u.parentNode&&(u.parentNode.parentNode&&u.parentNode.childElementCount===1?u.parentNode.parentNode.removeChild(u.parentNode):u.parentNode.removeChild(u))},cleanupSpans:function(u){var c,d,f,h=u.querySelectorAll(".replace-with"),v=function(g){return g&&g.nodeName!=="#text"&&g.getAttribute("contenteditable")==="false"};for(c=0;c<h.length;c+=1)d=h[c],f=this.document.createElement(d.classList.contains("bold")?"b":"i"),d.classList.contains("bold")&&d.classList.contains("italic")?f.innerHTML="<i>"+d.innerHTML+"</i>":f.innerHTML=d.innerHTML,d.parentNode.replaceChild(f,d);for(h=u.querySelectorAll("span"),c=0;c<h.length;c+=1){if(d=h[c],e.util.traverseUp(d,v))return!1;e.util.unwrap(d,this.document)}}});e.extensions.paste=l}(),function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(r,i){this.initElement(i)},initElement:function(r){r.getAttribute("data-placeholder")||r.setAttribute("data-placeholder",this.text),this.updatePlaceholder(r)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(r,i){this.cleanupElement(i)},cleanupElement:function(r){r.getAttribute("data-placeholder")===this.text&&r.removeAttribute("data-placeholder")},showPlaceholder:function(r){r&&(e.util.isFF&&r.childNodes.length===0?(r.classList.add("medium-editor-placeholder-relative"),r.classList.remove("medium-editor-placeholder")):(r.classList.add("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(r){r&&(r.classList.remove("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(r,i){if(r.querySelector("img, blockquote, ul, ol, table")||r.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(r);i||this.showPlaceholder(r)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(r,i){var o=this.hideOnClick&&i===this.base.getFocusedElement();this.updatePlaceholder(i,o)},handleFocus:function(r,i){this.hidePlaceholder(i)},handleBlur:function(r,i){this.updatePlaceholder(i)}});e.extensions.placeholder=n}(),function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(r,i){return this.base.extensions.forEach(function(o){if(o!==this)return r.apply(i||this,arguments)},this)},createToolbar:function(){var r=this.document.createElement("div");return r.id="medium-editor-toolbar-"+this.getEditorId(),r.className="medium-editor-toolbar",this.static?r.className+=" static-toolbar":this.relativeContainer?r.className+=" medium-editor-relative-toolbar":r.className+=" medium-editor-stalker-toolbar",r.appendChild(this.createToolbarButtons()),this.forEachExtension(function(i){i.hasForm&&r.appendChild(i.getForm())}),this.attachEventHandlers(),r},createToolbarButtons:function(){var r=this.document.createElement("ul"),i,o,a,s,l,u;return r.id="medium-editor-toolbar-actions"+this.getEditorId(),r.className="medium-editor-toolbar-actions",r.style.display="block",this.buttons.forEach(function(c){typeof c=="string"?(l=c,u=null):(l=c.name,u=c),s=this.base.addBuiltInExtension(l,u),s&&typeof s.getButton=="function"&&(o=s.getButton(this.base),i=this.document.createElement("li"),e.util.isElement(o)?i.appendChild(o):i.innerHTML=o,r.appendChild(i))},this),a=r.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),r},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),a=o.match(i);return!!a&&a.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var a=0;o.nodeValue.substr(a,1).trim().length===0;)a=a+1;i=e.selection.select(this.document,o,a,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(o&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(i=l.queryCommandState(),i!==null)){i&&typeof l.setActive=="function"&&l.setActive();return}r.push(l)}),a=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(r.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,a=this.getToolbarElement(),s=r.getBoundingClientRect(),l=s.top+i,u=s.left+s.width/2,c=a.offsetHeight,d=a.offsetWidth,f=d/2,h;switch(this.sticky?i>l+r.offsetHeight-c-this.stickyTopOffset?(a.style.top=l+r.offsetHeight-c+"px",a.classList.remove("medium-editor-sticky-toolbar")):i>l-c-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-c+"px"):a.style.top=l-c+"px",this.align){case"left":h=s.left;break;case"right":h=s.right-d;break;case"center":h=u-f;break}h<0?h=0:h+d>o&&(h=o-Math.ceil(d)-1),a.style.left=h+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,u=s.offsetWidth,c=u/2,d=50,f=this.diffLeft-c,h=this.getEditorOption("elementsContainer"),v=["absolute","fixed"].indexOf(window.getComputedStyle(h).getPropertyValue("position"))>-1,g={},m={},y,x;v?(x=h.getBoundingClientRect(),["top","left"].forEach(function(E){m[E]=o[E]-x[E]}),m.width=o.width,m.height=o.height,o=m,a=x.width,g.top=h.scrollTop):g.top=this.window.pageYOffset,y=o.left+o.width/2,g.top+=o.top-l,o.top<d?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),g.top+=d+o.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),g.top+=this.diffTop),y<c?(g.left=f+c,g.right="initial"):a-y<c?(g.left="auto",g.right=0):(g.left=f+y,g.right="initial"),["top","left","right"].forEach(function(E){s.style[E]=g[E]+(isNaN(g[E])?"":"px")})}});e.extensions.toolbar=n}(),function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(r){var i="medium-editor-dragover";r.preventDefault(),r.dataTransfer.dropEffect="copy",r.type==="dragover"?r.target.classList.add(i):r.type==="dragleave"&&r.target.classList.remove(i)},handleDrop:function(r){var i="medium-editor-dragover",o;r.preventDefault(),r.stopPropagation(),r.dataTransfer.files&&(o=Array.prototype.slice.call(r.dataTransfer.files,0),o.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var u=this.document.getElementById(l);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=s.result)}).bind(this)}}).bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=n}(),function(){function n(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k.textContent,Z=e.selection.getCaretOffsets(k);(B[Z.left-1]===void 0||B[Z.left-1].trim()===""||B[Z.left]!==void 0&&B[Z.left].trim()==="")&&R.preventDefault()}function r(R,k){if(this.options.disableReturn||k.getAttribute("data-disable-return"))R.preventDefault();else if(this.options.disableDoubleReturn||k.getAttribute("data-disable-double-return")){var B=e.selection.getSelectionStart(this.options.ownerDocument);(B&&B.textContent.trim()===""&&B.nodeName.toLowerCase()!=="li"||B.previousElementSibling&&B.previousElementSibling.nodeName.toLowerCase()!=="br"&&B.previousElementSibling.textContent.trim()==="")&&R.preventDefault()}}function i(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B=k&&k.nodeName.toLowerCase();B==="pre"&&(R.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(k)&&(R.preventDefault(),R.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(R){var k,B=e.selection.getSelectionStart(this.options.ownerDocument),Z=B.nodeName.toLowerCase(),ee=/^(\s+|<br\/?>)?$/i,ce=/h\d/i;e.util.isKey(R,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&B.previousElementSibling&&ce.test(Z)&&e.selection.getCaretOffsets(B).left===0?e.util.isKey(R,e.util.keyCode.BACKSPACE)&&ee.test(B.previousElementSibling.innerHTML)?(B.previousElementSibling.parentNode.removeChild(B.previousElementSibling),R.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(R,e.util.keyCode.ENTER)&&(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.previousElementSibling.parentNode.insertBefore(k,B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.DELETE)&&B.nextElementSibling&&B.previousElementSibling&&!ce.test(Z)&&ee.test(B.innerHTML)&&ce.test(B.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,B.nextElementSibling),B.previousElementSibling.parentNode.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&Z==="li"&&ee.test(B.innerHTML)&&!B.previousElementSibling&&!B.parentElement.previousElementSibling&&B.nextElementSibling&&B.nextElementSibling.nodeName.toLowerCase()==="li"?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.parentElement.insertBefore(k,B.parentElement),e.selection.moveCursor(this.options.ownerDocument,k),B.parentElement.removeChild(B),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).left===0?(R.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(R,e.util.keyCode.ENTER)&&e.util.getClosestTag(B,"blockquote")!==!1&&e.selection.getCaretOffsets(B).right===0?(k=this.options.ownerDocument.createElement("p"),k.innerHTML="<br>",B.parentElement.insertBefore(k,B.nextSibling),e.selection.moveCursor(this.options.ownerDocument,k),R.preventDefault()):e.util.isKey(R,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(B.parentElement)&&!B.previousElementSibling&&B.nextElementSibling&&ee.test(B.innerHTML)&&(R.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,B.nextSibling),B.parentElement.removeChild(B))}function a(R){var k=e.selection.getSelectionStart(this.options.ownerDocument),B;k&&(e.util.isMediumEditorElement(k)&&k.children.length===0&&!e.util.isBlockContainer(k)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(R,e.util.keyCode.ENTER)&&!e.util.isListItem(k)&&!e.util.isBlockContainer(k)&&(B=k.nodeName.toLowerCase(),B==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!R.shiftKey&&!R.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(R,k){var B=k.parentNode.querySelector('textarea[medium-editor-textarea-id="'+k.getAttribute("medium-editor-textarea-id")+'"]');B&&(B.value=k.innerHTML.trim())}function l(R){R._mediumEditors||(R._mediumEditors=[null]),this.id||(this.id=R._mediumEditors.length),R._mediumEditors[this.id]=this}function u(R){!R._mediumEditors||!R._mediumEditors[this.id]||(R._mediumEditors[this.id]=null)}function c(R,k,B){var Z=[];if(R||(R=[]),typeof R=="string"&&(R=k.querySelectorAll(R)),e.util.isElement(R)&&(R=[R]),B)for(var ee=0;ee<R.length;ee++){var ce=R[ee];e.util.isElement(ce)&&!ce.getAttribute("data-medium-editor-element")&&!ce.getAttribute("medium-editor-textarea-id")&&Z.push(ce)}else Z=Array.prototype.slice.apply(R);return Z}function d(R){var k=R.parentNode.querySelector('textarea[medium-editor-textarea-id="'+R.getAttribute("medium-editor-textarea-id")+'"]');k&&(k.classList.remove("medium-editor-hidden"),k.removeAttribute("medium-editor-textarea-id")),R.parentNode&&R.parentNode.removeChild(R)}function f(R,k){return Object.keys(k).forEach(function(B){R[B]===void 0&&(R[B]=k[B])}),R}function h(R,k,B){var Z={window:B.options.contentWindow,document:B.options.ownerDocument,base:B};return R=f(R,Z),typeof R.init=="function"&&R.init(),R.name||(R.name=k),R}function v(){return this.elements.every(function(R){return!!R.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function g(){return v.call(this)?this.options.anchorPreview!==!1:!1}function m(){return this.options.placeholder!==!1}function y(){return this.options.autoLink!==!1}function x(){return this.options.imageDragging!==!1}function E(){return this.options.keyboardCommands!==!1}function b(){return!this.options.extensions.imageDragging}function T(R){for(var k=this.options.ownerDocument.createElement("div"),B=Date.now(),Z="medium-editor-"+B,ee=R.attributes;this.options.ownerDocument.getElementById(Z);)B++,Z="medium-editor-"+B;k.className=R.className,k.id=Z,k.innerHTML=R.value,R.setAttribute("medium-editor-textarea-id",Z);for(var ce=0,Be=ee.length;ce<Be;ce++)k.hasAttribute(ee[ce].nodeName)||k.setAttribute(ee[ce].nodeName,ee[ce].value);return R.form&&this.on(R.form,"reset",(function(me){me.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(Z))}).bind(this)),R.classList.add("medium-editor-hidden"),R.parentNode.insertBefore(k,R),k}function A(R,k){if(!R.getAttribute("data-medium-editor-element")){R.nodeName.toLowerCase()==="textarea"&&(R=T.call(this,R),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!R.getAttribute("data-disable-editing")&&(R.setAttribute("contentEditable",!0),R.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(R.getAttribute("data-disable-return")||R.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!R.getAttribute("data-disable-return")&&this.on(R,"keyup",a.bind(this));var B=e.util.guid();R.setAttribute("data-medium-editor-element",!0),R.classList.add("medium-editor-element"),R.setAttribute("role","textbox"),R.setAttribute("aria-multiline",!0),R.setAttribute("data-medium-editor-editor-index",k),R.setAttribute("medium-editor-index",B),J[B]=R.innerHTML,this.events.attachAllEventsToElement(R)}return R}function S(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function M(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(ee){ee!=="toolbar"&&this.options.extensions[ee]&&this.extensions.push(h(this.options.extensions[ee],ee,this))},this),b.call(this)){var R=this.options.fileDragging;R||(R={},x.call(this)||(R.allowedTypes=[])),this.addBuiltInExtension("fileDragging",R)}var k={paste:!0,"anchor-preview":g.call(this),autoLink:y.call(this),keyboardCommands:E.call(this),placeholder:m.call(this)};Object.keys(k).forEach(function(ee){k[ee]&&this.addBuiltInExtension(ee)},this);var B=this.options.extensions.toolbar;if(!B&&v.call(this)){var Z=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});B=new e.extensions.toolbar(Z)}B&&this.extensions.push(h(B,"toolbar",this))}function C(R,k){var B=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return k&&B.forEach(function(Z){k.hasOwnProperty(Z[0])&&k[Z[0]]!==void 0&&e.util.deprecated(Z[0],Z[1],"v6.0.0")}),e.util.defaults({},k,R)}function G(R,k){var B=/^append-(.+)$/gi,Z=/justify([A-Za-z]*)$/g,ee,ce;if(ee=B.exec(R),ee)return e.util.execFormatBlock(this.options.ownerDocument,ee[1]);if(R==="fontSize")return k.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),ce=k.value||k.size,this.options.ownerDocument.execCommand("fontSize",!1,ce);if(R==="fontName")return k.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),ce=k.value||k.name,this.options.ownerDocument.execCommand("fontName",!1,ce);if(R==="createLink")return this.createLink(k);if(R==="image"){var Be=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Be)}if(R==="html"){var me=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,me)}if(Z.exec(R)){var de=this.options.ownerDocument.execCommand(R,!1,null),Se=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Se&&K.call(this,e.util.getTopBlockContainer(Se)),de}return ce=k&&k.value,this.options.ownerDocument.execCommand(R,!1,ce)}function K(R){if(R){var k,B=Array.prototype.slice.call(R.childNodes).filter(function(Z){var ee=Z.nodeName.toLowerCase()==="div";return ee&&!k&&(k=Z.style.textAlign),ee});B.length&&(this.saveSelection(),B.forEach(function(Z){if(Z.style.textAlign===k){var ee=Z.lastChild;if(ee){e.util.unwrap(Z,this.options.ownerDocument);var ce=this.options.ownerDocument.createElement("BR");ee.parentNode.insertBefore(ce,ee.nextSibling)}}},this),R.style.textAlign=k,this.restoreSelection())}}var J={};e.prototype={init:function(R,k){return this.options=C.call(this,this.defaults,k),this.origElements=R,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,M.call(this),S.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(R){typeof R.destroy=="function"&&R.destroy()},this),this.events.destroy(),this.elements.forEach(function(R){this.options.spellcheck&&(R.innerHTML=R.innerHTML),R.removeAttribute("contentEditable"),R.removeAttribute("spellcheck"),R.removeAttribute("data-medium-editor-element"),R.classList.remove("medium-editor-element"),R.removeAttribute("role"),R.removeAttribute("aria-multiline"),R.removeAttribute("medium-editor-index"),R.removeAttribute("data-medium-editor-editor-index"),R.getAttribute("medium-editor-textarea-id")&&d(R)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,u.call(this,this.options.contentWindow))},on:function(R,k,B,Z){return this.events.attachDOMEvent(R,k,B,Z),this},off:function(R,k,B,Z){return this.events.detachDOMEvent(R,k,B,Z),this},subscribe:function(R,k){return this.events.attachCustomEvent(R,k),this},unsubscribe:function(R,k){return this.events.detachCustomEvent(R,k),this},trigger:function(R,k,B){return this.events.triggerCustomEvent(R,k,B),this},delay:function(R){var k=this;return setTimeout(function(){k.isActive&&R()},this.options.delay)},serialize:function(){var R,k,B={},Z=this.elements.length;for(R=0;R<Z;R+=1)k=this.elements[R].id!==""?this.elements[R].id:"element-"+R,B[k]={value:this.elements[R].innerHTML.trim()};return B},getExtensionByName:function(R){var k;return this.extensions&&this.extensions.length&&this.extensions.some(function(B){return B.name===R?(k=B,!0):!1}),k},addBuiltInExtension:function(R,k){var B=this.getExtensionByName(R),Z;if(B)return B;switch(R){case"anchor":Z=e.util.extend({},this.options.anchor,k),B=new e.extensions.anchor(Z);break;case"anchor-preview":B=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":B=new e.extensions.autoLink;break;case"fileDragging":B=new e.extensions.fileDragging(k);break;case"fontname":B=new e.extensions.fontName(this.options.fontName);break;case"fontsize":B=new e.extensions.fontSize(k);break;case"keyboardCommands":B=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":B=new e.extensions.paste(this.options.paste);break;case"placeholder":B=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(R)&&(k?(Z=e.util.defaults({},k,e.extensions.button.prototype.defaults[R]),B=new e.extensions.button(Z)):B=new e.extensions.button(R))}return B&&this.extensions.push(h(B,R,this)),B},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var R=this.getExtensionByName("toolbar");return R&&R.checkState(),this},queryCommandState:function(R){var k=/^full-(.+)$/gi,B,Z=null;B=k.exec(R),B&&(R=B[1]);try{Z=this.options.ownerDocument.queryCommandState(R)}catch{Z=null}return Z},execAction:function(R,k){var B=/^full-(.+)$/gi,Z,ee;return Z=B.exec(R),Z?(this.saveSelection(),this.selectAllContents(),ee=G.call(this,Z[1],k),this.restoreSelection()):ee=G.call(this,R,k),(R==="insertunorderedlist"||R==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),ee},getSelectedParentElement:function(R){return R===void 0&&(R=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(R)},selectAllContents:function(){var R=e.selection.getSelectionElement(this.options.contentWindow);if(R){for(;R.children.length===1;)R=R.children[0];this.selectElement(R)}},selectElement:function(R){e.selection.selectNode(R,this.options.ownerDocument);var k=e.selection.getSelectionElement(this.options.contentWindow);k&&this.events.focusElement(k)},getFocusedElement:function(){var R;return this.elements.some(function(k){return!R&&k.getAttribute("data-medium-focused")&&(R=k),!!R},this),R},exportSelection:function(){var R=e.selection.getSelectionElement(this.options.contentWindow),k=this.elements.indexOf(R),B=null;return k>=0&&(B=e.selection.exportSelection(R,this.options.ownerDocument)),B!==null&&k!==0&&(B.editableElementIndex=k),B},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(R,k){if(R){var B=this.elements[R.editableElementIndex||0];e.selection.importSelection(R,B,this.options.ownerDocument,k)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(R){var k=e.selection.getSelectionElement(this.options.contentWindow),B={},Z;if(this.elements.indexOf(k)!==-1){try{if(this.events.disableCustomEvent("editableInput"),R.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),Z=R.url||R.value,Z&&Z.trim().length>0){var ee=this.options.contentWindow.getSelection();if(ee){var ce=ee.getRangeAt(0),Be=ce.commonAncestorContainer,me,de,Se,je;if(ce.endContainer.nodeType===3&&ce.startContainer.nodeType!==3&&ce.startOffset===0&&ce.startContainer.firstChild===ce.endContainer&&(Be=ce.endContainer),de=e.util.getClosestBlockContainer(ce.startContainer),Se=e.util.getClosestBlockContainer(ce.endContainer),Be.nodeType!==3&&Be.textContent.length!==0&&de===Se){var he=de||k,Ve=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),me=this.exportSelection(),Ve.appendChild(he.cloneNode(!0)),k===he?e.selection.select(this.options.ownerDocument,he.firstChild,0,he.lastChild,he.lastChild.nodeType===3?he.lastChild.nodeValue.length:he.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,he,0,he,he.childNodes.length);var $=this.exportSelection();je=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,Ve,{start:me.start-$.start,end:me.end-$.start,editableElementIndex:me.editableElementIndex}),je.length===0&&(Ve=this.options.ownerDocument.createDocumentFragment(),Ve.appendChild(Be.cloneNode(!0)),je=[Ve.firstChild.firstChild,Ve.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,je,Z.trim());var w=(Ve.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,Ve.firstChild.innerHTML.replace(/^\s+/,"")),me.start-=w,me.end-=w,this.importSelection(me)}else this.options.ownerDocument.execCommand("createLink",!1,Z);this.options.targetBlank||R.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Z),R.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),R.buttonClass)}}if(this.options.targetBlank||R.target==="_blank"||R.buttonClass){B=this.options.ownerDocument.createEvent("HTMLEvents"),B.initEvent("input",!0,!0,this.options.contentWindow);for(var _=0,F=this.elements.length;_<F;_+=1)this.elements[_].dispatchEvent(B)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",B,k)}},cleanPaste:function(R){this.getExtensionByName("paste").cleanPaste(R)},pasteHTML:function(R,k){this.getExtensionByName("paste").pasteHTML(R,k)},setContent:function(R,k){if(k=k||0,this.elements[k]){var B=this.elements[k];B.innerHTML=R,this.checkContentChanged(B)}},getContent:function(R){return R=R||0,this.elements[R]?this.elements[R].innerHTML.trim():null},checkContentChanged:function(R){R=R||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(R,{target:R,currentTarget:R})},resetContent:function(R){if(R){var k=this.elements.indexOf(R);k!==-1&&this.setContent(J[R.getAttribute("medium-editor-index")],k);return}this.elements.forEach(function(B,Z){this.setContent(J[B.getAttribute("medium-editor-index")],Z)},this)},addElements:function(R){var k=c(R,this.options.ownerDocument,!0);if(k.length===0)return!1;k.forEach(function(B){B=A.call(this,B,this.id),this.elements.push(B),this.trigger("addElement",{target:B,currentTarget:B},B)},this)},removeElements:function(R){var k=c(R,this.options.ownerDocument),B=k.map(function(Z){return Z.getAttribute("medium-editor-textarea-id")&&Z.parentNode?Z.parentNode.querySelector('div[medium-editor-textarea-id="'+Z.getAttribute("medium-editor-textarea-id")+'"]'):Z});this.elements=this.elements.filter(function(Z){return B.indexOf(Z)!==-1?(this.events.cleanupElement(Z),Z.getAttribute("medium-editor-textarea-id")&&d(Z),this.trigger("removeElement",{target:Z,currentTarget:Z},Z),!1):!0},this)}},e.getEditorFromElement=function(R){var k=R.getAttribute("data-medium-editor-editor-index"),B=R&&R.ownerDocument&&(R.ownerDocument.defaultView||R.ownerDocument.parentWindow);return B&&B._mediumEditors&&B._mediumEditors[k]?B._mediumEditors[k]:null}}(),function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}}(),e.parseVersionString=function(n){var r=n.split("-"),i=r[0].split("."),o=r.length>1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e}())}(Fu)),Fu.exports}var VF=UF();const $u=cl(VF);/*!
91
91
  * vanilla-picker v2.12.3
92
92
  * https://vanilla-picker.js.org
93
93
  *
94
94
  * Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
95
95
  * Released under the ISC license.
96
- */var fp=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},pp=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),$u=function(){function t(e,n){var r=[],i=!0,o=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var XF={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function F0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var GF=function(){function t(e,n,r,i){fp(this,t);var o=this;function a(l){if(l.startsWith("hsl")){var u=l.match(/([\-\d\.e]+)/g).map(Number),c=$u(u,4),d=c[0],f=c[1],h=c[2],v=c[3];v===void 0&&(v=1),d/=360,f/=100,h/=100,o.hsla=[d,f,h,v]}else if(l.startsWith("rgb")){var g=l.match(/([\-\d\.e]+)/g).map(Number),m=$u(g,4),y=m[0],x=m[1],E=m[2],b=m[3];b===void 0&&(b=1),o.rgba=[y,x,E,b]}else l.startsWith("#")?o.rgba=t.hexToRgb(l):o.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,r,i===void 0?1:i]}return pp(t,[{key:"printRGB",value:function(n){var r=n?this.rgba:this.rgba.slice(0,3),i=r.map(function(o,a){return F0(o,a===3?3:0)});return n?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(n){var r=[360,100,100,1],i=["","%","%",""],o=n?this.hsla:this.hsla.slice(0,3),a=o.map(function(s,l){return F0(s*r[l],l===3?3:1)+i[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var r=this.hex;return n?r:r.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,r=n.map(function(i,o){return o<3?i.toString(16):Math.round(i*255).toString(16)});return"#"+r.map(function(i){return i.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var r=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!r.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var i=r.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(o){return parseInt(o,16)});return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(n){var r=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=XF[r];return i===void 0?i:t.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var r=$u(n,4),i=r[0],o=r[1],a=r[2],s=r[3];i/=255,o/=255,a/=255;var l=Math.max(i,o,a),u=Math.min(i,o,a),c=void 0,d=void 0,f=(l+u)/2;if(l===u)c=d=0;else{var h=l-u;switch(d=f>.5?h/(2-l-u):h/(l+u),l){case i:c=(o-a)/h+(o<a?6:0);break;case o:c=(a-i)/h+2;break;case a:c=(i-o)/h+4;break}c/=6}return[c,d,f,s]}},{key:"hslToRgb",value:function(n){var r=$u(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=void 0,u=void 0,c=void 0;if(o===0)l=u=c=a;else{var d=function(m,y,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?m+(y-m)*6*x:x<.5?y:x<.6666666666666666?m+(y-m)*(.6666666666666666-x)*6:m},f=a<.5?a*(1+o):a+o-a*o,h=2*a-f;l=d(h,f,i+1/3),u=d(h,f,i),c=d(h,f,i-1/3)}var v=[l*255,u*255,c*255].map(Math.round);return v[3]=s,v}}]),t}(),YF=function(){function t(){fp(this,t),this._events=[]}return pp(t,[{key:"add",value:function(n,r,i){n.addEventListener(r,i,!1),this._events.push({target:n,type:r,handler:i})}},{key:"remove",value:function(n,r,i){this._events=this._events.filter(function(o){var a=!0;return n&&n!==o.target&&(a=!1),r&&r!==o.type&&(a=!1),i&&i!==o.handler&&(a=!1),a&&t._doRemove(o.target,o.type,o.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,r,i){n.removeEventListener(r,i,!1)}}]),t}();function KF(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function hp(t,e,n){var r=!1;function i(l,u,c){return Math.max(u,Math.min(l,c))}function o(l,u,c){if(c&&(r=!0),!!r){l.preventDefault();var d=e.getBoundingClientRect(),f=d.width,h=d.height,v=u.clientX,g=u.clientY,m=i(v-d.left,0,f),y=i(g-d.top,0,h);n(m/f,y/h)}}function a(l,u){var c=l.buttons===void 0?l.which:l.buttons;c===1?o(l,l,u):r=!1}function s(l,u){l.touches.length===1?o(l,l.touches[0],u):r=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){r=!1}),t.add(e,"touchend",function(l){r=!1}),t.add(e,"touchcancel",function(l){r=!1})}var qF=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
97
- linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,ZF=360,$0="keydown",Hu="mousedown",gp="focusin";function zr(t,e){return(e||document).querySelector(t)}function JF(t){t.preventDefault(),t.stopPropagation()}function vp(t,e,n,r,i){t.add(e,$0,function(o){n.indexOf(o.key)>=0&&r(o)})}var H0=function(){function t(e){fp(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new YF,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return pp(t,[{key:"setOptions",value:function(n){var r=this;if(!n)return;var i=this.settings;function o(u,c,d){for(var f in u)c[f]=u[f]}if(n instanceof HTMLElement)i.parent=n;else{i.parent&&n.parent&&i.parent!==n.parent&&(this._events.remove(i.parent),this._popupInited=!1),o(n,i),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=i.parent;if(s&&i.popup&&!this._popupInited){var l=function(c){return r.openHandler(c)};this._events.add(s,"click",l),vp(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!i.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var r=n&&n.type===$0?this._domEdit:this.domElement;setTimeout(function(){return r.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var r=n&&n.type,i=!1;if(!n)i=!0;else if(r===Hu||r===gp){var o=(this.__containedEvent||0)+100;n.timeStamp>o&&(i=!0)}else JF(n),i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",r!==Hu&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,r){this.closeHandler(),this.setOptions(n),r&&this.openHandler()}},{key:"setColor",value:function(n,r){this._setColor(n,{silent:r})}},{key:"_setColor",value:function(n,r){if(typeof n=="string"&&(n=n.trim()),!!n){r=r||{};var i=void 0;try{i=new GF(n)}catch(a){if(r.failSilently)return;throw a}if(!this.settings.alpha){var o=i.hsla;o[3]=1,i.hsla=o}this.colour=this.color=i,this._setHSLA(null,null,null,null,r)}}},{key:"setColour",value:function(n,r){this.setColor(n,r)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var r=this._toggleDOM(!0);return this._setPosition(),r}var i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=KF(i);return this.domElement=o,this._domH=zr(".picker_hue",o),this._domSL=zr(".picker_sl",o),this._domA=zr(".picker_alpha",o),this._domEdit=zr(".picker_editor input",o),this._domSample=zr(".picker_sample",o),this._domOkay=zr(".picker_done button",o),this._domCancel=zr(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup(function(){return o.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,r=this,i=this.domElement,o=this._events;function a(u,c,d){o.add(u,c,d)}a(i,"click",function(u){return u.preventDefault()}),hp(o,this._domH,function(u,c){return r._setHSLA(u)}),hp(o,this._domSL,function(u,c){return r._setHSLA(null,u,1-c)}),this.settings.alpha&&hp(o,this._domA,function(u,c){return r._setHSLA(null,null,null,1-c)});var s=this._domEdit;a(s,"input",function(u){r._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(u){var c=this;c.selectionStart===c.selectionEnd&&c.select()}),this._ifPopup(function(){var u=function(f){return n.closeHandler(f)};a(window,Hu,u),a(window,gp,u),vp(o,i,["Esc","Escape"],u);var c=function(f){n.__containedEvent=f.timeStamp};a(i,Hu,c),a(i,gp,c),a(n._domCancel,"click",u)});var l=function(c){n._ifPopup(function(){return n.closeHandler(c)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),vp(o,i,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,r=this.domElement;n!==r.parentNode&&n.appendChild(r),this._ifPopup(function(i){getComputedStyle(n).position==="static"&&(n.style.position="relative");var o=i===!0?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===o?r.classList.add(a):r.classList.remove(a)}),r.classList.add(o)})}},{key:"_setHSLA",value:function(n,r,i,o,a){a=a||{};var s=this.colour,l=s.hsla;[n,r,i,o].forEach(function(u,c){(u||u===0)&&(l[c]=u)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var r=this.colour,i=r.hsla,o="hsl("+i[0]*ZF+", 100%, 50%)",a=r.hslString,s=r.hslaString,l=this._domH,u=this._domSL,c=this._domA,d=zr(".picker_selector",l),f=zr(".picker_selector",u),h=zr(".picker_selector",c);function v(A,S,M){S.style.left=M*100+"%"}function g(A,S,M){S.style.top=M*100+"%"}v(l,d,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,v(u,f,i[1]),g(u,f,1-i[2]),u.style.color=a,g(c,h,1-i[3]);var m=a,y=m.replace("hsl","hsla").replace(")",", 0)"),x="linear-gradient("+[m,y]+")";if(this._domA.style.background=x+", "+qF,!n.fromEditor){var E=this.settings.editorFormat,b=this.settings.alpha,T=void 0;switch(E){case"rgb":T=r.printRGB(b);break;case"hsl":T=r.printHSL(b);break;default:T=r.printHex(b)}this._domEdit.value=T}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,r){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):r&&r()}},{key:"_toggleDOM",value:function(n){var r=this.domElement;if(!r)return!1;var i=n?"":"none",o=r.style.display!==i;return o&&(r.style.display=i),o}}]),t}();{var mp=document.createElement("style");mp.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(mp),H0.StyleElement=mp}var yp={exports:{}},z0;function W0(){return z0||(z0=1,function(t,e){(function(n,r){t.exports=n()})(function(){var n="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u($,w){var _=typeof $[w];return _==r||!!(_==n&&$[w])||_=="unknown"}function c($,w){return!!(typeof $[w]==n&&$[w])}function d($,w){return typeof $[w]!=i}function f($){return function(w,_){for(var F=_.length;F--;)if(!$(w,_[F]))return!1;return!0}}var h=f(u),v=f(c),g=f(d);function m($){return $&&h($,l)&&g($,s)}function y($){return c($,"body")?$.body:$.getElementsByTagName("body")[0]}var x=[].forEach?function($,w){$.forEach(w)}:function($,w){for(var _=0,F=$.length;_<F;++_)w($[_],_)},E={},b=typeof window!=i&&typeof document!=i,T={isHostMethod:u,isHostObject:c,isHostProperty:d,areHostMethods:h,areHostObjects:v,areHostProperties:g,isTextRange:m,getBody:y,forEach:x},A={version:"1.3.2",initialized:!1,isBrowser:b,supported:!0,util:T,features:{},modules:E,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i?!0:rangyAutoInitialize}};function S($){typeof console!=i&&u(console,"log")&&console.log($)}function M($,w){b&&w?alert($):S($)}function C($){A.initialized=!0,A.supported=!1,M("Rangy is not supported in this environment. Reason: "+$,A.config.alertOnFail)}A.fail=C;function G($){M("Rangy warning: "+$,A.config.alertOnWarn)}A.warn=G;var K;({}).hasOwnProperty?(T.extend=K=function($,w,_){var F,L;for(var se in w)se==="__proto__"||se==="constructor"||se==="prototype"||w.hasOwnProperty(se)&&(F=$[se],L=w[se],_&&F!==null&&typeof F=="object"&&L!==null&&typeof L=="object"&&K(F,L,!0),$[se]=L);return w.hasOwnProperty("toString")&&($.toString=w.toString),$},T.createOptions=function($,w){var _={};return K(_,w),$&&K(_,$),_}):C("hasOwnProperty not supported"),b||C("Rangy can only run in a browser"),function(){var $;if(b){var w=document.createElement("div");w.appendChild(document.createElement("span"));var _=[].slice;try{_.call(w.childNodes,0)[0].nodeType==1&&($=function(F){return _.call(F,0)})}catch{}}$||($=function(F){for(var L=[],se=0,fe=F.length;se<fe;++se)L[se]=F[se];return L}),T.toArray=$}();var J;b&&(u(document,"addEventListener")?J=function($,w,_){$.addEventListener(w,_,!1)}:u(document,"attachEvent")?J=function($,w,_){$.attachEvent("on"+w,_)}:C("Document does not have required addEventListener or attachEvent method"),T.addListener=J);var R=[];function k($){return $.message||$.description||String($)}function B(){if(!(!b||A.initialized)){var $,w=!1,_=!1;u(document,"createRange")&&($=document.createRange(),h($,a)&&g($,o)&&(w=!0));var F=y(document);if(!F||F.nodeName.toLowerCase()!="body"){C("No body element found");return}if(F&&u(F,"createTextRange")&&($=F.createTextRange(),m($)&&(_=!0)),!w&&!_){C("Neither Range nor TextRange are available");return}A.initialized=!0,A.features={implementsDomRange:w,implementsTextRange:_};var L,se;for(var fe in E)(L=E[fe])instanceof me&&L.init(L,A);for(var Ne=0,ze=R.length;Ne<ze;++Ne)try{R[Ne](A)}catch(rt){se="Rangy init listener threw an exception. Continuing. Detail: "+k(rt),S(se)}}}function Z($,w,_){_&&($+=" in module "+_.name),A.warn("DEPRECATED: "+$+" is deprecated. Please use "+w+" instead.")}function ee($,w,_,F){$[w]=function(){return Z(w,_,F),$[_].apply($,T.toArray(arguments))}}T.deprecationNotice=Z,T.createAliasForDeprecatedMethod=ee,A.init=B,A.addInitListener=function($){A.initialized?$(A):R.push($)};var ce=[];A.addShimListener=function($){ce.push($)};function Be($){$=$||window,B();for(var w=0,_=ce.length;w<_;++w)ce[w]($)}b&&(A.shim=A.createMissingNativeApi=Be,ee(A,"createMissingNativeApi","shim"));function me($,w,_){this.name=$,this.dependencies=w,this.initialized=!1,this.supported=!1,this.initializer=_}me.prototype={init:function(){for(var $=this.dependencies||[],w=0,_=$.length,F,L;w<_;++w){if(L=$[w],F=E[L],!F||!(F instanceof me))throw new Error("required module '"+L+"' not found");if(F.init(),!F.supported)throw new Error("required module '"+L+"' not supported")}this.initializer(this)},fail:function($){throw this.initialized=!0,this.supported=!1,new Error($)},warn:function($){A.warn("Module "+this.name+": "+$)},deprecationNotice:function($,w){A.warn("DEPRECATED: "+$+" in module "+this.name+" is deprecated. Please use "+w+" instead")},createError:function($){return new Error("Error in Rangy "+this.name+" module: "+$)}};function de($,w,_){var F=new me($,w,function(L){if(!L.initialized){L.initialized=!0;try{_(A,L),L.supported=!0}catch(fe){var se="Module '"+$+"' failed to load: "+k(fe);S(se),fe.stack&&S(fe.stack)}}});return E[$]=F,F}A.createModule=function($){var w,_;arguments.length==2?(w=arguments[1],_=[]):(w=arguments[2],_=arguments[1]);var F=de($,_,w);A.initialized&&A.supported&&F.init()},A.createCoreModule=function($,w,_){de($,w,_)};function Se(){}A.RangePrototype=Se,A.rangePrototype=new Se;function je(){}A.selectionPrototype=new je,A.createCoreModule("DomUtil",[],function($,w){var _="undefined",F=$.util,L=F.getBody;F.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||w.fail("document missing a Node creation method"),F.isHostMethod(document,"getElementsByTagName")||w.fail("document missing getElementsByTagName method");var se=document.createElement("div");F.areHostMethods(se,["insertBefore","appendChild","cloneNode"])||w.fail("Incomplete Element implementation"),F.isHostProperty(se,"innerHTML")||w.fail("Element is missing innerHTML property");var fe=document.createTextNode("test");F.areHostMethods(fe,["splitText","deleteData","insertData","appendData","cloneNode"])||w.fail("Incomplete Text Node implementation");var Ne=function(Y,ue){for(var Xe=Y.length;Xe--;)if(Y[Xe]===ue)return!0;return!1};function ze(Y){var ue;return typeof Y.namespaceURI==_||(ue=Y.namespaceURI)===null||ue=="http://www.w3.org/1999/xhtml"}function rt(Y){var ue=Y.parentNode;return ue.nodeType==1?ue:null}function Ze(Y){for(var ue=0;Y=Y.previousSibling;)++ue;return ue}function at(Y){switch(Y.nodeType){case 7:case 10:return 0;case 3:case 8:return Y.length;default:return Y.childNodes.length}}function Ct(Y,ue){var Xe=[],Me;for(Me=Y;Me;Me=Me.parentNode)Xe.push(Me);for(Me=ue;Me;Me=Me.parentNode)if(Ne(Xe,Me))return Me;return null}function P(Y,ue,Xe){for(var Me=Xe?ue:ue.parentNode;Me;){if(Me===Y)return!0;Me=Me.parentNode}return!1}function I(Y,ue){return P(Y,ue,!0)}function j(Y,ue,Xe){for(var Me,Dt=Xe?Y:Y.parentNode;Dt;){if(Me=Dt.parentNode,Me===ue)return Dt;Dt=Me}return null}function q(Y){var ue=Y.nodeType;return ue==3||ue==4||ue==8}function H(Y){if(!Y)return!1;var ue=Y.nodeType;return ue==3||ue==8}function re(Y,ue){var Xe=ue.nextSibling,Me=ue.parentNode;return Xe?Me.insertBefore(Y,Xe):Me.appendChild(Y),Y}function te(Y,ue,Xe){var Me=Y.cloneNode(!1);if(Me.deleteData(0,ue),Y.deleteData(ue,Y.length-ue),re(Me,Y),Xe)for(var Dt=0,yt;yt=Xe[Dt++];)yt.node==Y&&yt.offset>ue?(yt.node=Me,yt.offset-=ue):yt.node==Y.parentNode&&yt.offset>Ze(Y)&&++yt.offset;return Me}function oe(Y){if(Y.nodeType==9)return Y;if(typeof Y.ownerDocument!=_)return Y.ownerDocument;if(typeof Y.document!=_)return Y.document;if(Y.parentNode)return oe(Y.parentNode);throw w.createError("getDocument: no document found for node")}function Le(Y){var ue=oe(Y);if(typeof ue.defaultView!=_)return ue.defaultView;if(typeof ue.parentWindow!=_)return ue.parentWindow;throw w.createError("Cannot get a window object for node")}function we(Y){if(typeof Y.contentDocument!=_)return Y.contentDocument;if(typeof Y.contentWindow!=_)return Y.contentWindow.document;throw w.createError("getIframeDocument: No Document object found for iframe element")}function ge(Y){if(typeof Y.contentWindow!=_)return Y.contentWindow;if(typeof Y.contentDocument!=_)return Y.contentDocument.defaultView;throw w.createError("getIframeWindow: No Window object found for iframe element")}function st(Y){return Y&&F.isHostMethod(Y,"setTimeout")&&F.isHostObject(Y,"document")}function et(Y,ue,Xe){var Me;if(Y?F.isHostProperty(Y,"nodeType")?Me=Y.nodeType==1&&Y.tagName.toLowerCase()=="iframe"?we(Y):oe(Y):st(Y)&&(Me=Y.document):Me=document,!Me)throw ue.createError(Xe+"(): Parameter must be a Window object or DOM node");return Me}function nt(Y){for(var ue;ue=Y.parentNode;)Y=ue;return Y}function en(Y,ue,Xe,Me){var Dt,yt,Tr,Un,xn;if(Y==Xe)return ue===Me?0:ue<Me?-1:1;if(Dt=j(Xe,Y,!0))return ue<=Ze(Dt)?-1:1;if(Dt=j(Y,Xe,!0))return Ze(Dt)<Me?-1:1;if(yt=Ct(Y,Xe),!yt)throw new Error("comparePoints error: nodes have no common ancestor");if(Tr=Y===yt?yt:j(Y,yt,!0),Un=Xe===yt?yt:j(Xe,yt,!0),Tr===Un)throw w.createError("comparePoints got to case 4 and childA and childB are the same!");for(xn=yt.firstChild;xn;){if(xn===Tr)return-1;if(xn===Un)return 1;xn=xn.nextSibling}}var ve=!1;function Ae(Y){var ue;try{return ue=Y.parentNode,!1}catch{return!0}}(function(){var Y=document.createElement("b");Y.innerHTML="1";var ue=Y.firstChild;Y.innerHTML="<br />",ve=Ae(ue),$.features.crashyTextNodes=ve})();function dt(Y){if(!Y)return"[No node]";if(ve&&Ae(Y))return"[Broken node]";if(q(Y))return'"'+Y.data+'"';if(Y.nodeType==1){var ue=Y.id?' id="'+Y.id+'"':"";return"<"+Y.nodeName+ue+">[index:"+Ze(Y)+",length:"+Y.childNodes.length+"]["+(Y.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return Y.nodeName}function wt(Y){for(var ue=oe(Y).createDocumentFragment(),Xe;Xe=Y.firstChild;)ue.appendChild(Xe);return ue}var Ft;typeof window.getComputedStyle!=_?Ft=function(Y,ue){return Le(Y).getComputedStyle(Y,null)[ue]}:typeof document.documentElement.currentStyle!=_?Ft=function(Y,ue){return Y.currentStyle?Y.currentStyle[ue]:""}:w.fail("No means of obtaining computed style properties found");function Wn(Y,ue,Xe){var Me=L(Y),Dt=Y.createElement("div");Dt.contentEditable=""+!!Xe,ue&&(Dt.innerHTML=ue);var yt=Me.firstChild;return yt?Me.insertBefore(Dt,yt):Me.appendChild(Dt),Dt}function bn(Y){return Y.parentNode.removeChild(Y)}function tn(Y){this.root=Y,this._next=Y}tn.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var Y=this._current=this._next,ue,Xe;if(this._current)if(ue=Y.firstChild,ue)this._next=ue;else{for(Xe=null;Y!==this.root&&!(Xe=Y.nextSibling);)Y=Y.parentNode;this._next=Xe}return this._current},detach:function(){this._current=this._next=this.root=null}};function nn(Y){return new tn(Y)}function cn(Y,ue){this.node=Y,this.offset=ue}cn.prototype={equals:function(Y){return!!Y&&this.node===Y.node&&this.offset==Y.offset},inspect:function(){return"[DomPosition("+dt(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function Nn(Y){this.code=this[Y],this.codeName=Y,this.message="DOMException: "+this.codeName}Nn.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},Nn.prototype.toString=function(){return this.message},$.dom={arrayContains:Ne,isHtmlNamespace:ze,parentElement:rt,getNodeIndex:Ze,getNodeLength:at,getCommonAncestor:Ct,isAncestorOf:P,isOrIsAncestorOf:I,getClosestAncestorIn:j,isCharacterDataNode:q,isTextOrCommentNode:H,insertAfter:re,splitDataNode:te,getDocument:oe,getWindow:Le,getIframeWindow:ge,getIframeDocument:we,getBody:L,isWindow:st,getContentDocument:et,getRootContainer:nt,comparePoints:en,isBrokenNode:Ae,inspectNode:dt,getComputedStyleProperty:Ft,createTestElement:Wn,removeNode:bn,fragmentFromNodeChildren:wt,createIterator:nn,DomPosition:cn},$.DOMException=Nn}),A.createCoreModule("DomRange",["DomUtil"],function($,w){var _=$.dom,F=$.util,L=_.DomPosition,se=$.DOMException,fe=_.isCharacterDataNode,Ne=_.getNodeIndex,ze=_.isOrIsAncestorOf,rt=_.getDocument,Ze=_.comparePoints,at=_.splitDataNode,Ct=_.getClosestAncestorIn,P=_.getNodeLength,I=_.arrayContains,j=_.getRootContainer,q=$.features.crashyTextNodes,H=_.removeNode;function re(D,z){return D.nodeType!=3&&(ze(D,z.startContainer)||ze(D,z.endContainer))}function te(D){return D.document||rt(D.startContainer)}function oe(D){return j(D.startContainer)}function Le(D){return new L(D.parentNode,Ne(D))}function we(D){return new L(D.parentNode,Ne(D)+1)}function ge(D,z,Q){var le=D.nodeType==11?D.firstChild:D;return fe(z)?Q==z.length?_.insertAfter(D,z):z.parentNode.insertBefore(D,Q==0?z:at(z,Q)):Q>=z.childNodes.length?z.appendChild(D):z.insertBefore(D,z.childNodes[Q]),le}function st(D,z,Q){if(xt(D),xt(z),te(z)!=te(D))throw new se("WRONG_DOCUMENT_ERR");var le=Ze(D.startContainer,D.startOffset,z.endContainer,z.endOffset),Oe=Ze(D.endContainer,D.endOffset,z.startContainer,z.startOffset);return Q?le<=0&&Oe>=0:le<0&&Oe>0}function et(D){for(var z,Q,le=te(D.range).createDocumentFragment(),Oe;Q=D.next();){if(z=D.isPartiallySelectedSubtree(),Q=Q.cloneNode(!z),z&&(Oe=D.getSubtreeIterator(),Q.appendChild(et(Oe)),Oe.detach()),Q.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");le.appendChild(Q)}return le}function nt(D,z,Q){var le,Oe;Q=Q||{stop:!1};for(var it,ae;it=D.next();)if(D.isPartiallySelectedSubtree()){if(z(it)===!1){Q.stop=!0;return}else if(ae=D.getSubtreeIterator(),nt(ae,z,Q),ae.detach(),Q.stop)return}else for(le=_.createIterator(it);Oe=le.next();)if(z(Oe)===!1){Q.stop=!0;return}}function en(D){for(var z;D.next();)D.isPartiallySelectedSubtree()?(z=D.getSubtreeIterator(),en(z),z.detach()):D.remove()}function ve(D){for(var z,Q=te(D.range).createDocumentFragment(),le;z=D.next();){if(D.isPartiallySelectedSubtree()?(z=z.cloneNode(!1),le=D.getSubtreeIterator(),z.appendChild(ve(le)),le.detach()):D.remove(),z.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");Q.appendChild(z)}return Q}function Ae(D,z,Q){var le=!!(z&&z.length),Oe,it=!!Q;le&&(Oe=new RegExp("^("+z.join("|")+")$"));var ae=[];return nt(new wt(D,!1),function(Ee){if(!(le&&!Oe.test(Ee.nodeType))&&!(it&&!Q(Ee))){var Ie=D.startContainer;if(!(Ee==Ie&&fe(Ie)&&D.startOffset==Ie.length)){var tt=D.endContainer;Ee==tt&&fe(tt)&&D.endOffset==0||ae.push(Ee)}}}),ae}function dt(D){var z=typeof D.getName>"u"?"Range":D.getName();return"["+z+"("+_.inspectNode(D.startContainer)+":"+D.startOffset+", "+_.inspectNode(D.endContainer)+":"+D.endOffset+")]"}function wt(D,z){if(this.range=D,this.clonePartiallySelectedTextNodes=z,!D.collapsed){this.sc=D.startContainer,this.so=D.startOffset,this.ec=D.endContainer,this.eo=D.endOffset;var Q=D.commonAncestorContainer;this.sc===this.ec&&fe(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===Q&&!fe(this.sc)?this.sc.childNodes[this.so]:Ct(this.sc,Q,!0),this._last=this.ec===Q&&!fe(this.ec)?this.ec.childNodes[this.eo-1]:Ct(this.ec,Q,!0))}}wt.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var D=this._current=this._next;return D&&(this._next=D!==this._last?D.nextSibling:null,fe(D)&&this.clonePartiallySelectedTextNodes&&(D===this.ec&&(D=D.cloneNode(!0)).deleteData(this.eo,D.length-this.eo),this._current===this.sc&&(D=D.cloneNode(!0)).deleteData(0,this.so))),D},remove:function(){var D=this._current,z,Q;fe(D)&&(D===this.sc||D===this.ec)?(z=D===this.sc?this.so:0,Q=D===this.ec?this.eo:D.length,z!=Q&&D.deleteData(z,Q-z)):D.parentNode&&H(D)},isPartiallySelectedSubtree:function(){var D=this._current;return re(D,this.range)},getSubtreeIterator:function(){var D;if(this.isSingleCharacterDataNode)D=this.range.cloneRange(),D.collapse(!1);else{D=new $t(te(this.range));var z=this._current,Q=z,le=0,Oe=z,it=P(z);ze(z,this.sc)&&(Q=this.sc,le=this.so),ze(z,this.ec)&&(Oe=this.ec,it=this.eo),ft(D,Q,le,Oe,it)}return new wt(D,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var Ft=[1,3,4,5,7,8,10],Wn=[2,9,11],bn=[5,6,10,12],tn=[1,3,4,5,7,8,10,11],nn=[1,3,4,5,7,8];function cn(D){return function(z,Q){for(var le,Oe=Q?z:z.parentNode;Oe;){if(le=Oe.nodeType,I(D,le))return Oe;Oe=Oe.parentNode}return null}}var Nn=cn([9,11]),Y=cn(bn),ue=cn([6,10,12]),Xe=cn([1]);function Me(D,z){if(ue(D,z))throw new se("INVALID_NODE_TYPE_ERR")}function Dt(D,z){if(!I(z,D.nodeType))throw new se("INVALID_NODE_TYPE_ERR")}function yt(D,z){if(z<0||z>(fe(D)?D.length:D.childNodes.length))throw new se("INDEX_SIZE_ERR")}function Tr(D,z){if(Nn(D,!0)!==Nn(z,!0))throw new se("WRONG_DOCUMENT_ERR")}function Un(D){if(Y(D,!0))throw new se("NO_MODIFICATION_ALLOWED_ERR")}function xn(D,z){if(!D)throw new se(z)}function gs(D,z){return z<=(fe(D)?D.length:D.childNodes.length)}function io(D){return!!D.startContainer&&!!D.endContainer&&!(q&&(_.isBrokenNode(D.startContainer)||_.isBrokenNode(D.endContainer)))&&j(D.startContainer)==j(D.endContainer)&&gs(D.startContainer,D.startOffset)&&gs(D.endContainer,D.endOffset)}function xt(D){if(!io(D))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+D.inspect()+")")}var vs=document.createElement("style"),oi=!1;try{vs.innerHTML="<b>x</b>",oi=vs.firstChild.nodeType==3}catch{}$.features.htmlParsingConforms=oi;var ms=oi?function(D){var z=this.startContainer,Q=rt(z);if(!z)throw new se("INVALID_STATE_ERR");var le=null;return z.nodeType==1?le=z:fe(z)&&(le=_.parentElement(z)),le===null||le.nodeName=="HTML"&&_.isHtmlNamespace(rt(le).documentElement)&&_.isHtmlNamespace(le)?le=Q.createElement("body"):le=le.cloneNode(!1),le.innerHTML=D,_.fragmentFromNodeChildren(le)}:function(D){var z=te(this),Q=z.createElement("body");return Q.innerHTML=D,_.fragmentFromNodeChildren(Q)};function Qo(D,z){xt(D);var Q=D.startContainer,le=D.startOffset,Oe=D.endContainer,it=D.endOffset,ae=Q===Oe;fe(Oe)&&it>0&&it<Oe.length&&at(Oe,it,z),fe(Q)&&le>0&&le<Q.length&&(Q=at(Q,le,z),ae?(it-=le,Oe=Q):Oe==Q.parentNode&&it>=Ne(Q)&&it++,le=0),D.setStartAndEnd(Q,le,Oe,it)}function Ge(D){xt(D);var z=D.commonAncestorContainer.parentNode.cloneNode(!1);return z.appendChild(D.cloneContents()),z.innerHTML}var ea=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ta=0,oo=1,Ju=2,Pi=3,ao=0,ys=1,_s=2,na=3;F.extend($.rangePrototype,{compareBoundaryPoints:function(D,z){xt(this),Tr(this.startContainer,z.startContainer);var Q,le,Oe,it,ae=D==Pi||D==ta?"start":"end",Ee=D==oo||D==ta?"start":"end";return Q=this[ae+"Container"],le=this[ae+"Offset"],Oe=z[Ee+"Container"],it=z[Ee+"Offset"],Ze(Q,le,Oe,it)},insertNode:function(D){if(xt(this),Dt(D,tn),Un(this.startContainer),ze(D,this.startContainer))throw new se("HIERARCHY_REQUEST_ERR");var z=ge(D,this.startContainer,this.startOffset);this.setStartBefore(z)},cloneContents:function(){xt(this);var D,z;if(this.collapsed)return te(this).createDocumentFragment();if(this.startContainer===this.endContainer&&fe(this.startContainer))return D=this.startContainer.cloneNode(!0),D.data=D.data.slice(this.startOffset,this.endOffset),z=te(this).createDocumentFragment(),z.appendChild(D),z;var Q=new wt(this,!0);return D=et(Q),Q.detach(),D},canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var D=new wt(this,!0),z=D._first&&re(D._first,this)||D._last&&re(D._last,this);return D.detach(),!z},surroundContents:function(D){if(Dt(D,nn),!this.canSurroundContents())throw new se("INVALID_STATE_ERR");var z=this.extractContents();if(D.hasChildNodes())for(;D.lastChild;)D.removeChild(D.lastChild);ge(D,this.startContainer,this.startOffset),D.appendChild(z),this.selectNode(D)},cloneRange:function(){xt(this);for(var D=new $t(te(this)),z=ea.length,Q;z--;)Q=ea[z],D[Q]=this[Q];return D},toString:function(){xt(this);var D=this.startContainer;if(D===this.endContainer&&fe(D))return D.nodeType==3||D.nodeType==4?D.data.slice(this.startOffset,this.endOffset):"";var z=[],Q=new wt(this,!0);return nt(Q,function(le){(le.nodeType==3||le.nodeType==4)&&z.push(le.data)}),Q.detach(),z.join("")},compareNode:function(D){xt(this);var z=D.parentNode,Q=Ne(D);if(!z)throw new se("NOT_FOUND_ERR");var le=this.comparePoint(z,Q),Oe=this.comparePoint(z,Q+1);return le<0?Oe>0?_s:ao:Oe>0?ys:na},comparePoint:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)<0?-1:Ze(D,z,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:ms,toHtml:function(){return Ge(this)},intersectsNode:function(D,z){if(xt(this),j(D)!=oe(this))return!1;var Q=D.parentNode,le=Ne(D);if(!Q)return!0;var Oe=Ze(Q,le,this.endContainer,this.endOffset),it=Ze(Q,le+1,this.startContainer,this.startOffset);return z?Oe<=0&&it>=0:Oe<0&&it>0},isPointInRange:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)>=0&&Ze(D,z,this.endContainer,this.endOffset)<=0},intersectsRange:function(D){return st(this,D,!1)},intersectsOrTouchesRange:function(D){return st(this,D,!0)},intersection:function(D){if(this.intersectsRange(D)){var z=Ze(this.startContainer,this.startOffset,D.startContainer,D.startOffset),Q=Ze(this.endContainer,this.endOffset,D.endContainer,D.endOffset),le=this.cloneRange();return z==-1&&le.setStart(D.startContainer,D.startOffset),Q==1&&le.setEnd(D.endContainer,D.endOffset),le}return null},union:function(D){if(this.intersectsOrTouchesRange(D)){var z=this.cloneRange();return Ze(D.startContainer,D.startOffset,this.startContainer,this.startOffset)==-1&&z.setStart(D.startContainer,D.startOffset),Ze(D.endContainer,D.endOffset,this.endContainer,this.endOffset)==1&&z.setEnd(D.endContainer,D.endOffset),z}else throw new se("Ranges do not intersect")},containsNode:function(D,z){return z?this.intersectsNode(D,!1):this.compareNode(D)==na},containsNodeContents:function(D){return this.comparePoint(D,0)>=0&&this.comparePoint(D,P(D))<=0},containsRange:function(D){var z=this.intersection(D);return z!==null&&D.equals(z)},containsNodeText:function(D){var z=this.cloneRange();z.selectNode(D);var Q=z.getNodes([3]);if(Q.length>0){z.setStart(Q[0],0);var le=Q.pop();return z.setEnd(le,le.length),this.containsRange(z)}else return this.containsNodeContents(D)},getNodes:function(D,z){return xt(this),Ae(this,D,z)},getDocument:function(){return te(this)},collapseBefore:function(D){this.setEndBefore(D),this.collapse(!1)},collapseAfter:function(D){this.setStartAfter(D),this.collapse(!0)},getBookmark:function(D){var z=te(this),Q=$.createRange(z);D=D||_.getBody(z),Q.selectNodeContents(D);var le=this.intersection(Q),Oe=0,it=0;return le&&(Q.setEnd(le.startContainer,le.startOffset),Oe=Q.toString().length,it=Oe+le.toString().length),{start:Oe,end:it,containerNode:D}},moveToBookmark:function(D){var z=D.containerNode,Q=0;this.setStart(z,0),this.collapse(!0);for(var le=[z],Oe,it=!1,ae=!1,Ee,Ie,tt;!ae&&(Oe=le.pop());)if(Oe.nodeType==3)Ee=Q+Oe.length,!it&&D.start>=Q&&D.start<=Ee&&(this.setStart(Oe,D.start-Q),it=!0),it&&D.end>=Q&&D.end<=Ee&&(this.setEnd(Oe,D.end-Q),ae=!0),Q=Ee;else for(tt=Oe.childNodes,Ie=tt.length;Ie--;)le.push(tt[Ie])},getName:function(){return"DomRange"},equals:function(D){return $t.rangesEqual(this,D)},isValid:function(){return io(this)},inspect:function(){return dt(this)},detach:function(){}});function N(D){D.START_TO_START=ta,D.START_TO_END=oo,D.END_TO_END=Ju,D.END_TO_START=Pi,D.NODE_BEFORE=ao,D.NODE_AFTER=ys,D.NODE_BEFORE_AND_AFTER=_s,D.NODE_INSIDE=na}function W(D){N(D),N(D.prototype)}function ne(D,z){return function(){xt(this);var Q=this.startContainer,le=this.startOffset,Oe=this.commonAncestorContainer,it=new wt(this,!0),ae,Ee;Q!==Oe&&(ae=Ct(Q,Oe,!0),Ee=we(ae),Q=Ee.node,le=Ee.offset),nt(it,Un),it.reset();var Ie=D(it);return it.detach(),z(this,Q,le,Q,le),Ie}}function ye(D,z){function Q(ae,Ee){return function(Ie){Dt(Ie,Ft),Dt(j(Ie),Wn);var tt=(ae?Le:we)(Ie);(Ee?le:Oe)(this,tt.node,tt.offset)}}function le(ae,Ee,Ie){var tt=ae.endContainer,En=ae.endOffset;(Ee!==ae.startContainer||Ie!==ae.startOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==1)&&(tt=Ee,En=Ie),z(ae,Ee,Ie,tt,En))}function Oe(ae,Ee,Ie){var tt=ae.startContainer,En=ae.startOffset;(Ee!==ae.endContainer||Ie!==ae.endOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==-1)&&(tt=Ee,En=Ie),z(ae,tt,En,Ee,Ie))}var it=function(){};it.prototype=$.rangePrototype,D.prototype=new it,F.extend(D.prototype,{setStart:function(ae,Ee){Me(ae,!0),yt(ae,Ee),le(this,ae,Ee)},setEnd:function(ae,Ee){Me(ae,!0),yt(ae,Ee),Oe(this,ae,Ee)},setStartAndEnd:function(){var ae=arguments,Ee=ae[0],Ie=ae[1],tt=Ee,En=Ie;switch(ae.length){case 3:En=ae[2];break;case 4:tt=ae[2],En=ae[3];break}Me(Ee,!0),yt(Ee,Ie),Me(tt,!0),yt(tt,En),z(this,Ee,Ie,tt,En)},setBoundary:function(ae,Ee,Ie){this["set"+(Ie?"Start":"End")](ae,Ee)},setStartBefore:Q(!0,!0),setStartAfter:Q(!1,!0),setEndBefore:Q(!0,!1),setEndAfter:Q(!1,!1),collapse:function(ae){xt(this),ae?z(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):z(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(ae){Me(ae,!0),z(this,ae,0,ae,P(ae))},selectNode:function(ae){Me(ae,!1),Dt(ae,Ft);var Ee=Le(ae),Ie=we(ae);z(this,Ee.node,Ee.offset,Ie.node,Ie.offset)},extractContents:ne(ve,z),deleteContents:ne(en,z),canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var ae=new wt(this,!0),Ee=ae._first&&re(ae._first,this)||ae._last&&re(ae._last,this);return ae.detach(),!Ee},splitBoundaries:function(){Qo(this)},splitBoundariesPreservingPositions:function(ae){Qo(this,ae)},normalizeBoundaries:function(){xt(this);var ae=this.startContainer,Ee=this.startOffset,Ie=this.endContainer,tt=this.endOffset,En=function(Mn){var Wr=Mn.nextSibling;Wr&&Wr.nodeType==Mn.nodeType&&(Ie=Mn,tt=Mn.length,Mn.appendData(Wr.data),H(Wr))},Wx=function(Mn){var Wr=Mn.previousSibling;if(Wr&&Wr.nodeType==Mn.nodeType){ae=Mn;var e9=Mn.length;if(Ee=Wr.length,Mn.insertData(0,Wr.data),H(Wr),ae==Ie)tt+=Ee,Ie=ae;else if(Ie==Mn.parentNode){var Ux=Ne(Mn);tt==Ux?(Ie=Mn,tt=e9):tt>Ux&&tt--}}},Vp=!0,sr;if(fe(Ie))tt==Ie.length?En(Ie):tt==0&&(sr=Ie.previousSibling,sr&&sr.nodeType==Ie.nodeType&&(tt=sr.length,ae==Ie&&(Vp=!1),sr.appendData(Ie.data),H(Ie),Ie=sr));else{if(tt>0){var Xp=Ie.childNodes[tt-1];Xp&&fe(Xp)&&En(Xp)}Vp=!this.collapsed}if(Vp){if(fe(ae))Ee==0?Wx(ae):Ee==ae.length&&(sr=ae.nextSibling,sr&&sr.nodeType==ae.nodeType&&(Ie==sr&&(Ie=ae,tt+=ae.length),ae.appendData(sr.data),H(sr)));else if(Ee<ae.childNodes.length){var Gp=ae.childNodes[Ee];Gp&&fe(Gp)&&Wx(Gp)}}else ae=Ie,Ee=tt;z(this,ae,Ee,Ie,tt)},collapseToPoint:function(ae,Ee){Me(ae,!0),yt(ae,Ee),this.setStartAndEnd(ae,Ee)},parentElement:function(){xt(this);var ae=this.commonAncestorContainer;return ae?Xe(this.commonAncestorContainer,!0):null}}),W(D)}function Fe(D){D.collapsed=D.startContainer===D.endContainer&&D.startOffset===D.endOffset,D.commonAncestorContainer=D.collapsed?D.startContainer:_.getCommonAncestor(D.startContainer,D.endContainer)}function ft(D,z,Q,le,Oe){D.startContainer=z,D.startOffset=Q,D.endContainer=le,D.endOffset=Oe,D.document=_.getDocument(z),Fe(D)}function $t(D){ft(this,D,0,D,0)}ye($t,ft),F.extend($t,{rangeProperties:ea,RangeIterator:wt,copyComparisonConstants:W,createPrototypeRange:ye,inspect:dt,toHtml:Ge,getRangeDocument:te,rangesEqual:function(D,z){return D.startContainer===z.startContainer&&D.startOffset===z.startOffset&&D.endContainer===z.endContainer&&D.endOffset===z.endOffset}}),$.DomRange=$t}),A.createCoreModule("WrappedRange",["DomRange"],function($,w){var _,F,L=$.dom,se=$.util,fe=L.DomPosition,Ne=$.DomRange,ze=L.getBody,rt=L.getContentDocument,Ze=L.isCharacterDataNode;if($.features.implementsDomRange&&function(){var H,re=Ne.rangeProperties;function te(ve){for(var Ae=re.length,dt;Ae--;)dt=re[Ae],ve[dt]=ve.nativeRange[dt];ve.collapsed=ve.startContainer===ve.endContainer&&ve.startOffset===ve.endOffset}function oe(ve,Ae,dt,wt,Ft){var Wn=ve.startContainer!==Ae||ve.startOffset!=dt,bn=ve.endContainer!==wt||ve.endOffset!=Ft,tn=!ve.equals(ve.nativeRange);(Wn||bn||tn)&&(ve.setEnd(wt,Ft),ve.setStart(Ae,dt))}var Le;_=function(ve){if(!ve)throw w.createError("WrappedRange: Range must be specified");this.nativeRange=ve,te(this)},Ne.createPrototypeRange(_,oe),H=_.prototype,H.selectNode=function(ve){this.nativeRange.selectNode(ve),te(this)},H.cloneContents=function(){return this.nativeRange.cloneContents()},H.surroundContents=function(ve){this.nativeRange.surroundContents(ve),te(this)},H.collapse=function(ve){this.nativeRange.collapse(ve),te(this)},H.cloneRange=function(){return new _(this.nativeRange.cloneRange())},H.refresh=function(){te(this)},H.toString=function(){return this.nativeRange.toString()};var we=document.createTextNode("test");ze(document).appendChild(we);var ge=document.createRange();ge.setStart(we,0),ge.setEnd(we,0);try{ge.setStart(we,1),H.setStart=function(ve,Ae){this.nativeRange.setStart(ve,Ae),te(this)},H.setEnd=function(ve,Ae){this.nativeRange.setEnd(ve,Ae),te(this)},Le=function(ve){return function(Ae){this.nativeRange[ve](Ae),te(this)}}}catch{H.setStart=function(Ae,dt){try{this.nativeRange.setStart(Ae,dt)}catch{this.nativeRange.setEnd(Ae,dt),this.nativeRange.setStart(Ae,dt)}te(this)},H.setEnd=function(Ae,dt){try{this.nativeRange.setEnd(Ae,dt)}catch{this.nativeRange.setStart(Ae,dt),this.nativeRange.setEnd(Ae,dt)}te(this)},Le=function(Ae,dt){return function(wt){try{this.nativeRange[Ae](wt)}catch{this.nativeRange[dt](wt),this.nativeRange[Ae](wt)}te(this)}}}H.setStartBefore=Le("setStartBefore","setEndBefore"),H.setStartAfter=Le("setStartAfter","setEndAfter"),H.setEndBefore=Le("setEndBefore","setStartBefore"),H.setEndAfter=Le("setEndAfter","setStartAfter"),H.selectNodeContents=function(ve){this.setStartAndEnd(ve,0,L.getNodeLength(ve))},ge.selectNodeContents(we),ge.setEnd(we,3);var st=document.createRange();st.selectNodeContents(we),st.setEnd(we,4),st.setStart(we,2),ge.compareBoundaryPoints(ge.START_TO_END,st)==-1&&ge.compareBoundaryPoints(ge.END_TO_START,st)==1?H.compareBoundaryPoints=function(ve,Ae){return Ae=Ae.nativeRange||Ae,ve==Ae.START_TO_END?ve=Ae.END_TO_START:ve==Ae.END_TO_START&&(ve=Ae.START_TO_END),this.nativeRange.compareBoundaryPoints(ve,Ae)}:H.compareBoundaryPoints=function(ve,Ae){return this.nativeRange.compareBoundaryPoints(ve,Ae.nativeRange||Ae)};var et=document.createElement("div");et.innerHTML="123";var nt=et.firstChild,en=ze(document);en.appendChild(et),ge.setStart(nt,1),ge.setEnd(nt,2),ge.deleteContents(),nt.data=="13"&&(H.deleteContents=function(){this.nativeRange.deleteContents(),te(this)},H.extractContents=function(){var ve=this.nativeRange.extractContents();return te(this),ve}),en.removeChild(et),en=null,se.isHostMethod(ge,"createContextualFragment")&&(H.createContextualFragment=function(ve){return this.nativeRange.createContextualFragment(ve)}),ze(document).removeChild(we),H.getName=function(){return"WrappedRange"},$.WrappedRange=_,$.createNativeRange=function(ve){return ve=rt(ve,w,"createNativeRange"),ve.createRange()}}(),$.features.implementsTextRange){var at=function(H){var re=H.parentElement(),te=H.duplicate();te.collapse(!0);var oe=te.parentElement();te=H.duplicate(),te.collapse(!1);var Le=te.parentElement(),we=oe==Le?oe:L.getCommonAncestor(oe,Le);return we==re?we:L.getCommonAncestor(re,we)},Ct=function(H){return H.compareEndPoints("StartToEnd",H)==0},P=function(H,re,te,oe,Le){var we=H.duplicate();we.collapse(te);var ge=we.parentElement();if(L.isOrIsAncestorOf(re,ge)||(ge=re),!ge.canHaveHTML){var st=new fe(ge.parentNode,L.getNodeIndex(ge));return{boundaryPosition:st,nodeInfo:{nodeIndex:st.offset,containerElement:st.node}}}var et=L.getDocument(ge).createElement("span");et.parentNode&&L.removeNode(et);for(var nt,en=te?"StartToStart":"StartToEnd",ve,Ae,dt,wt,Ft=Le&&Le.containerElement==ge?Le.nodeIndex:0,Wn=ge.childNodes.length,bn=Wn,tn=bn;tn==Wn?ge.appendChild(et):ge.insertBefore(et,ge.childNodes[tn]),we.moveToElementText(et),nt=we.compareEndPoints(en,H),!(nt==0||Ft==bn);){if(nt==-1){if(bn==Ft+1)break;Ft=tn}else bn=bn==Ft+1?Ft:tn;tn=Math.floor((Ft+bn)/2),ge.removeChild(et)}if(wt=et.nextSibling,nt==-1&&wt&&Ze(wt)){we.setEndPoint(te?"EndToStart":"EndToEnd",H);var nn;if(/[\r\n]/.test(wt.data)){var cn=we.duplicate(),Nn=cn.text.replace(/\r\n/g,"\r").length;for(nn=cn.moveStart("character",Nn);(nt=cn.compareEndPoints("StartToEnd",cn))==-1;)nn++,cn.moveStart("character",1)}else nn=we.text.length;dt=new fe(wt,nn)}else ve=(oe||!te)&&et.previousSibling,Ae=(oe||te)&&et.nextSibling,Ae&&Ze(Ae)?dt=new fe(Ae,0):ve&&Ze(ve)?dt=new fe(ve,ve.data.length):dt=new fe(ge,L.getNodeIndex(et));return L.removeNode(et),{boundaryPosition:dt,nodeInfo:{nodeIndex:tn,containerElement:ge}}},I=function(H,re){var te,oe,Le=H.offset,we=L.getDocument(H.node),ge,st,et=ze(we).createTextRange(),nt=Ze(H.node);return nt?(te=H.node,oe=te.parentNode):(st=H.node.childNodes,te=Le<st.length?st[Le]:null,oe=H.node),ge=we.createElement("span"),ge.innerHTML="&#feff;",te?oe.insertBefore(ge,te):oe.appendChild(ge),et.moveToElementText(ge),et.collapse(!re),oe.removeChild(ge),nt&&et[re?"moveStart":"moveEnd"]("character",Le),et};F=function(H){this.textRange=H,this.refresh()},F.prototype=new Ne(document),F.prototype.refresh=function(){var H,re,te,oe=at(this.textRange);Ct(this.textRange)?re=H=P(this.textRange,oe,!0,!0).boundaryPosition:(te=P(this.textRange,oe,!0,!1),H=te.boundaryPosition,re=P(this.textRange,oe,!1,!1,te.nodeInfo).boundaryPosition),this.setStart(H.node,H.offset),this.setEnd(re.node,re.offset)},F.prototype.getName=function(){return"WrappedTextRange"},Ne.copyComparisonConstants(F);var j=function(H){if(H.collapsed)return I(new fe(H.startContainer,H.startOffset),!0);var re=I(new fe(H.startContainer,H.startOffset),!0),te=I(new fe(H.endContainer,H.endOffset),!1),oe=ze(Ne.getRangeDocument(H)).createTextRange();return oe.setEndPoint("StartToStart",re),oe.setEndPoint("EndToEnd",te),oe};if(F.rangeToTextRange=j,F.prototype.toTextRange=function(){return j(this)},$.WrappedTextRange=F,!$.features.implementsDomRange||$.config.preferTextRange){var q=function(H){return H("return this;")()}(Function);typeof q.Range>"u"&&(q.Range=F),$.createNativeRange=function(H){return H=rt(H,w,"createNativeRange"),ze(H).createTextRange()},$.WrappedRange=F}}$.createRange=function(H){return H=rt(H,w,"createRange"),new $.WrappedRange($.createNativeRange(H))},$.createRangyRange=function(H){return H=rt(H,w,"createRangyRange"),new Ne(H)},se.createAliasForDeprecatedMethod($,"createIframeRange","createRange"),se.createAliasForDeprecatedMethod($,"createIframeRangyRange","createRangyRange"),$.addShimListener(function(H){var re=H.document;typeof re.createRange>"u"&&(re.createRange=function(){return $.createRange(re)}),re=H=null})}),A.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function($,w){$.config.checkSelectionRanges=!0;var _="boolean",F="number",L=$.dom,se=$.util,fe=se.isHostMethod,Ne=$.DomRange,ze=$.WrappedRange,rt=$.DOMException,Ze=L.DomPosition,at,Ct,P=$.features,I="Control",j=L.getDocument,q=L.getBody,H=Ne.rangesEqual;function re(N){return typeof N=="string"?/^backward(s)?$/i.test(N):!!N}function te(N,W){if(N){if(L.isWindow(N))return N;if(N instanceof xt)return N.win;var ne=L.getContentDocument(N,w,W);return L.getWindow(ne)}else return window}function oe(N){return te(N,"getWinSelection").getSelection()}function Le(N){return te(N,"getDocSelection").document.selection}function we(N){var W=!1;return N.anchorNode&&(W=L.comparePoints(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset)==1),W}var ge=fe(window,"getSelection"),st=se.isHostObject(document,"selection");P.implementsWinGetSelection=ge,P.implementsDocSelection=st;var et=st&&(!ge||$.config.preferTextRange);if(et)at=Le,$.isSelectionValid=function(N){var W=te(N,"isSelectionValid").document,ne=W.selection;return ne.type!="None"||j(ne.createRange().parentElement())==W};else if(ge)at=oe,$.isSelectionValid=function(){return!0};else return w.fail("Neither document.selection or window.getSelection() detected."),!1;$.getNativeSelection=at;var nt=at();if(!nt)return w.fail("Native selection was null (possibly issue 138?)"),!1;var en=$.createNativeRange(document),ve=q(document),Ae=se.areHostProperties(nt,["anchorNode","focusNode","anchorOffset","focusOffset"]);P.selectionHasAnchorAndFocus=Ae;var dt=fe(nt,"extend");P.selectionHasExtend=dt;var wt=fe(nt,"setBaseAndExtent");P.selectionHasSetBaseAndExtent=wt;var Ft=typeof nt.rangeCount==F;P.selectionHasRangeCount=Ft;var Wn=!1,bn=!0,tn=dt?function(N,W){var ne=Ne.getRangeDocument(W),ye=$.createRange(ne);ye.collapseToPoint(W.endContainer,W.endOffset),N.addRange(Me(ye)),N.extend(W.startContainer,W.startOffset)}:null;se.areHostMethods(nt,["addRange","getRangeAt","removeAllRanges"])&&typeof nt.rangeCount==F&&P.implementsDomRange&&function(){var N=window.getSelection();if(N){for(var W=N.rangeCount,ne=W>1,ye=[],Fe=we(N),ft=0;ft<W;++ft)ye[ft]=N.getRangeAt(ft);var $t=L.createTestElement(document,"",!1),D=$t.appendChild(document.createTextNode("   ")),z=document.createRange();if(z.setStart(D,1),z.collapse(!0),N.removeAllRanges(),N.addRange(z),bn=N.rangeCount==1,N.removeAllRanges(),!ne){var Q=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(Q&&parseInt(Q[1])>=36)Wn=!1;else{var le=z.cloneRange();z.setStart(D,0),le.setEnd(D,3),le.setStart(D,2),N.addRange(z),N.addRange(le),Wn=N.rangeCount==2}}for(L.removeNode($t),N.removeAllRanges(),ft=0;ft<W;++ft)ft==0&&Fe?tn?tn(N,ye[ft]):($.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),N.addRange(ye[ft])):N.addRange(ye[ft])}}(),P.selectionSupportsMultipleRanges=Wn,P.collapsedNonEditableSelectionsSupported=bn;var nn=!1,cn;ve&&fe(ve,"createControlRange")&&(cn=ve.createControlRange(),se.areHostProperties(cn,["item","add"])&&(nn=!0)),P.implementsControlRange=nn,Ae?Ct=function(N){return N.anchorNode===N.focusNode&&N.anchorOffset===N.focusOffset}:Ct=function(N){return N.rangeCount?N.getRangeAt(N.rangeCount-1).collapsed:!1};function Nn(N,W,ne){var ye=ne?"end":"start",Fe=ne?"start":"end";N.anchorNode=W[ye+"Container"],N.anchorOffset=W[ye+"Offset"],N.focusNode=W[Fe+"Container"],N.focusOffset=W[Fe+"Offset"]}function Y(N){var W=N.nativeSelection;N.anchorNode=W.anchorNode,N.anchorOffset=W.anchorOffset,N.focusNode=W.focusNode,N.focusOffset=W.focusOffset}function ue(N){N.anchorNode=N.focusNode=null,N.anchorOffset=N.focusOffset=0,N.rangeCount=0,N.isCollapsed=!0,N._ranges.length=0,Xe(N)}function Xe(N){N.type=N.rangeCount==0?"None":Ct(N)?"Caret":"Range"}function Me(N){var W;return N instanceof Ne?(W=$.createNativeRange(N.getDocument()),W.setEnd(N.endContainer,N.endOffset),W.setStart(N.startContainer,N.startOffset)):N instanceof ze?W=N.nativeRange:P.implementsDomRange&&N instanceof L.getWindow(N.startContainer).Range&&(W=N),W}function Dt(N){if(!N.length||N[0].nodeType!=1)return!1;for(var W=1,ne=N.length;W<ne;++W)if(!L.isAncestorOf(N[0],N[W]))return!1;return!0}function yt(N){var W=N.getNodes();if(!Dt(W))throw w.createError("getSingleElementFromRange: range "+N.inspect()+" did not consist of a single element");return W[0]}function Tr(N){return!!N&&typeof N.text<"u"}function Un(N,W){var ne=new ze(W);N._ranges=[ne],Nn(N,ne,!1),N.rangeCount=1,N.isCollapsed=ne.collapsed,Xe(N)}function xn(N){if(N._ranges.length=0,N.docSelection.type=="None")ue(N);else{var W=N.docSelection.createRange();if(Tr(W))Un(N,W);else{N.rangeCount=W.length;for(var ne,ye=j(W.item(0)),Fe=0;Fe<N.rangeCount;++Fe)ne=$.createRange(ye),ne.selectNode(W.item(Fe)),N._ranges.push(ne);N.isCollapsed=N.rangeCount==1&&N._ranges[0].collapsed,Nn(N,N._ranges[N.rangeCount-1],!1),Xe(N)}}}function gs(N,W){for(var ne=N.docSelection.createRange(),ye=yt(W),Fe=j(ne.item(0)),ft=q(Fe).createControlRange(),$t=0,D=ne.length;$t<D;++$t)ft.add(ne.item($t));try{ft.add(ye)}catch{throw w.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}ft.select(),xn(N)}var io;fe(nt,"getRangeAt")?io=function(N,W){try{return N.getRangeAt(W)}catch{return null}}:Ae&&(io=function(N){var W=j(N.anchorNode),ne=$.createRange(W);return ne.setStartAndEnd(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset),ne.collapsed!==this.isCollapsed&&ne.setStartAndEnd(N.focusNode,N.focusOffset,N.anchorNode,N.anchorOffset),ne});function xt(N,W,ne){this.nativeSelection=N,this.docSelection=W,this._ranges=[],this.win=ne,this.refresh()}xt.prototype=$.selectionPrototype;function vs(N){N.win=N.anchorNode=N.focusNode=N._ranges=null,N.rangeCount=N.anchorOffset=N.focusOffset=0,N.detached=!0,Xe(N)}var oi=[];function ms(N,W){for(var ne=oi.length,ye,Fe;ne--;)if(ye=oi[ne],Fe=ye.selection,W=="deleteAll")vs(Fe);else if(ye.win==N)return W=="delete"?(oi.splice(ne,1),!0):Fe;return W=="deleteAll"&&(oi.length=0),null}var Qo=function(N){if(N&&N instanceof xt)return N.refresh(),N;N=te(N,"getNativeSelection");var W=ms(N),ne=at(N),ye=st?Le(N):null;return W?(W.nativeSelection=ne,W.docSelection=ye,W.refresh()):(W=new xt(ne,ye,N),oi.push({win:N,selection:W})),W};$.getSelection=Qo,se.createAliasForDeprecatedMethod($,"getIframeSelection","getSelection");var Ge=xt.prototype;function ea(N,W){for(var ne=j(W[0].startContainer),ye=q(ne).createControlRange(),Fe=0,ft,$t=W.length;Fe<$t;++Fe){ft=yt(W[Fe]);try{ye.add(ft)}catch{throw w.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}ye.select(),xn(N)}if(!et&&Ae&&se.areHostMethods(nt,["removeAllRanges","addRange"])){Ge.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),ue(this)};var ta=function(N,W){tn(N.nativeSelection,W),N.refresh()};Ft?Ge.addRange=function(N,W){if(nn&&st&&this.docSelection.type==I)gs(this,N);else if(re(W)&&dt)ta(this,N);else{var ne;Wn?ne=this.rangeCount:(this.removeAllRanges(),ne=0);var ye=Me(N).cloneRange();try{this.nativeSelection.addRange(ye)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==ne+1){if($.config.checkSelectionRanges){var Fe=io(this.nativeSelection,this.rangeCount-1);Fe&&!H(Fe,N)&&(N=new ze(Fe))}this._ranges[this.rangeCount-1]=N,Nn(this,N,Pi(this.nativeSelection)),this.isCollapsed=Ct(this),Xe(this)}else this.refresh()}}:Ge.addRange=function(N,W){re(W)&&dt?ta(this,N):(this.nativeSelection.addRange(Me(N)),this.refresh())},Ge.setRanges=function(N){if(nn&&st&&N.length>1)ea(this,N);else{this.removeAllRanges();for(var W=0,ne=N.length;W<ne;++W)this.addRange(N[W])}}}else if(fe(nt,"empty")&&fe(en,"select")&&nn&&et)Ge.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var N;if(this.anchorNode)N=j(this.anchorNode);else if(this.docSelection.type==I){var W=this.docSelection.createRange();W.length&&(N=j(W.item(0)))}if(N){var ne=q(N).createTextRange();ne.select(),this.docSelection.empty()}}}catch{}ue(this)},Ge.addRange=function(N){this.docSelection.type==I?gs(this,N):($.WrappedTextRange.rangeToTextRange(N).select(),this._ranges[0]=N,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,Nn(this,N,!1),Xe(this))},Ge.setRanges=function(N){this.removeAllRanges();var W=N.length;W>1?ea(this,N):W&&this.addRange(N[0])};else return w.fail("No means of selecting a Range or TextRange was found"),!1;Ge.getRangeAt=function(N){if(N<0||N>=this.rangeCount)throw new rt("INDEX_SIZE_ERR");return this._ranges[N].cloneRange()};var oo;if(et)oo=function(N){var W;$.isSelectionValid(N.win)?W=N.docSelection.createRange():(W=q(N.win.document).createTextRange(),W.collapse(!0)),N.docSelection.type==I?xn(N):Tr(W)?Un(N,W):ue(N)};else if(fe(nt,"getRangeAt")&&typeof nt.rangeCount==F)oo=function(N){if(nn&&st&&N.docSelection.type==I)xn(N);else if(N._ranges.length=N.rangeCount=N.nativeSelection.rangeCount,N.rangeCount){for(var W=0,ne=N.rangeCount;W<ne;++W)N._ranges[W]=new $.WrappedRange(N.nativeSelection.getRangeAt(W));Nn(N,N._ranges[N.rangeCount-1],Pi(N.nativeSelection)),N.isCollapsed=Ct(N),Xe(N)}else ue(N)};else if(Ae&&typeof nt.isCollapsed==_&&typeof en.collapsed==_&&P.implementsDomRange)oo=function(N){var W,ne=N.nativeSelection;ne.anchorNode?(W=io(ne,0),N._ranges=[W],N.rangeCount=1,Y(N),N.isCollapsed=Ct(N),Xe(N)):ue(N)};else return w.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Ge.refresh=function(N){var W=N?this._ranges.slice(0):null,ne=this.anchorNode,ye=this.anchorOffset;if(oo(this),N){var Fe=W.length;if(Fe!=this._ranges.length||this.anchorNode!=ne||this.anchorOffset!=ye)return!0;for(;Fe--;)if(!H(W[Fe],this._ranges[Fe]))return!0;return!1}};var Ju=function(N,W){var ne=N.getAllRanges();N.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)H(W,ne[ye])||N.addRange(ne[ye]);N.rangeCount||ue(N)};nn&&st?Ge.removeRange=function(N){if(this.docSelection.type==I){for(var W=this.docSelection.createRange(),ne=yt(N),ye=j(W.item(0)),Fe=q(ye).createControlRange(),ft,$t=!1,D=0,z=W.length;D<z;++D)ft=W.item(D),ft!==ne||$t?Fe.add(W.item(D)):$t=!0;Fe.select(),xn(this)}else Ju(this,N)}:Ge.removeRange=function(N){Ju(this,N)};var Pi;!et&&Ae&&P.implementsDomRange?(Pi=we,Ge.isBackward=function(){return Pi(this)}):Pi=Ge.isBackward=function(){return!1},Ge.isBackwards=Ge.isBackward,Ge.toString=function(){for(var N=[],W=0,ne=this.rangeCount;W<ne;++W)N[W]=""+this._ranges[W];return N.join("")};function ao(N,W){if(N.win.document!=j(W))throw new rt("WRONG_DOCUMENT_ERR")}function ys(N,W){if(W<0||W>(L.isCharacterDataNode(N)?N.length:N.childNodes.length))throw new rt("INDEX_SIZE_ERR")}Ge.collapse=function(N,W){ao(this,N);var ne=$.createRange(N);ne.collapseToPoint(N,W),this.setSingleRange(ne),this.isCollapsed=!0},Ge.collapseToStart=function(){if(this.rangeCount){var N=this._ranges[0];this.collapse(N.startContainer,N.startOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.collapseToEnd=function(){if(this.rangeCount){var N=this._ranges[this.rangeCount-1];this.collapse(N.endContainer,N.endOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.selectAllChildren=function(N){ao(this,N);var W=$.createRange(N);W.selectNodeContents(N),this.setSingleRange(W)},wt?Ge.setBaseAndExtent=function(N,W,ne,ye){this.nativeSelection.setBaseAndExtent(N,W,ne,ye),this.refresh()}:dt&&(Ge.setBaseAndExtent=function(N,W,ne,ye){ys(N,W),ys(ne,ye),ao(this,N),ao(this,ne);var Fe=$.createRange(node),ft=L.comparePoints(N,W,ne,ye)==-1;ft?Fe.setStartAndEnd(ne,ye,N,W):Fe.setStartAndEnd(N,W,ne,ye),this.setSingleRange(Fe,ft)}),Ge.deleteFromDocument=function(){if(nn&&st&&this.docSelection.type==I){for(var N=this.docSelection.createRange(),W;N.length;)W=N.item(0),N.remove(W),L.removeNode(W);this.refresh()}else if(this.rangeCount){var ne=this.getAllRanges();if(ne.length){this.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)ne[ye].deleteContents();this.addRange(ne[Fe-1])}}},Ge.eachRange=function(N,W){for(var ne=0,ye=this._ranges.length;ne<ye;++ne)if(N(this.getRangeAt(ne)))return W},Ge.getAllRanges=function(){var N=[];return this.eachRange(function(W){N.push(W)}),N},Ge.setSingleRange=function(N,W){this.removeAllRanges(),this.addRange(N,W)},Ge.callMethodOnEachRange=function(N,W){var ne=[];return this.eachRange(function(ye){ne.push(ye[N].apply(ye,W||[]))}),ne};function _s(N){return function(W,ne){var ye;this.rangeCount?(ye=this.getRangeAt(0),ye["set"+(N?"Start":"End")](W,ne)):(ye=$.createRange(this.win.document),ye.setStartAndEnd(W,ne)),this.setSingleRange(ye,this.isBackward())}}Ge.setStart=_s(!0),Ge.setEnd=_s(!1),$.rangePrototype.select=function(N){Qo(this.getDocument()).setSingleRange(this,N)},Ge.changeEachRange=function(N){var W=[],ne=this.isBackward();this.eachRange(function(ye){N(ye),W.push(ye)}),this.removeAllRanges(),ne&&W.length==1?this.addRange(W[0],"backward"):this.setRanges(W)},Ge.containsNode=function(N,W){return this.eachRange(function(ne){return ne.containsNode(N,W)},!0)||!1},Ge.getBookmark=function(N){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[N])}},Ge.moveToBookmark=function(N){for(var W=[],ne=0,ye,Fe;ye=N.rangeBookmarks[ne++];)Fe=$.createRange(this.win),Fe.moveToBookmark(ye),W.push(Fe);N.backward?this.setSingleRange(W[0],"backward"):this.setRanges(W)},Ge.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},Ge.restoreRanges=function(N){this.removeAllRanges();for(var W=0,ne;ne=N.ranges[W];++W)this.addRange(ne,N.backward&&W==0)},Ge.toHtml=function(){var N=[];return this.eachRange(function(W){N.push(Ne.toHtml(W))}),N.join("")},P.implementsTextRange&&(Ge.getNativeTextRange=function(){var N;if(N=this.docSelection){var W=N.createRange();if(Tr(W))return W;throw w.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return $.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw w.createError("getNativeTextRange: selection contains no range")}});function na(N){var W=[],ne=new Ze(N.anchorNode,N.anchorOffset),ye=new Ze(N.focusNode,N.focusOffset),Fe=typeof N.getName=="function"?N.getName():"Selection";if(typeof N.rangeCount<"u")for(var ft=0,$t=N.rangeCount;ft<$t;++ft)W[ft]=Ne.inspect(N.getRangeAt(ft));return"["+Fe+"(Ranges: "+W.join(", ")+")(anchor: "+ne.inspect()+", focus: "+ye.inspect()+"]"}Ge.getName=function(){return"WrappedSelection"},Ge.inspect=function(){return na(this)},Ge.detach=function(){ms(this.win,"delete"),vs(this)},xt.detachAll=function(){ms(null,"deleteAll")},xt.inspect=na,xt.isDirectionBackward=re,$.Selection=xt,$.selectionPrototype=Ge,$.addShimListener(function(N){typeof N.getSelection>"u"&&(N.getSelection=function(){return Qo(N)}),N=null})});var he=!1,Ve=function($){he||(he=!0,!A.initialized&&A.config.autoInitialize&&B())};return b&&(document.readyState=="complete"?Ve():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",Ve,!1),J(window,"load",Ve))),A})}(yp)),yp.exports}var QF=W0();const U0=ul(QF);var _p={exports:{}},V0;function e5(){return V0||(V0=1,function(t,e){(function(n,r){t.exports=n(W0())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(r,i){var o=r.dom,a=o.DomPosition,s=o.arrayContains,l=r.util,u=l.forEach,c="span",d=l.isHostMethod(document,"createElementNS");function f(P,I){for(var j in P)if(P.hasOwnProperty(j)&&I(j,P[j])===!1)return!1;return!0}function h(P){return P.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function v(P,I){return!!P&&new RegExp("(?:^|\\s)"+I+"(?:\\s|$)").test(P)}function g(P,I){if(typeof P.classList=="object")return P.classList.contains(I);var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");return v(q,I)}function m(P,I){if(typeof P.classList=="object")P.classList.add(I);else{var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");q?v(q,I)||(q+=" "+I):q=I,j?P.className=q:P.setAttribute("class",q)}}var y=function(){function P(I,j,q){return j&&q?" ":""}return function(I,j){if(typeof I.classList=="object")I.classList.remove(j);else{var q=typeof I.className=="string",H=q?I.className:I.getAttribute("class");H=H.replace(new RegExp("(^|\\s)"+j+"(\\s|$)"),P),q?I.className=H:I.setAttribute("class",H)}}}();function x(P){var I=typeof P.className=="string";return I?P.className:P.getAttribute("class")}function E(P){return P&&P.split(/\s+/).sort().join(" ")}function b(P){return E(x(P))}function T(P,I){return b(P)==b(I)}function A(P,I){for(var j=I.split(/\s+/),q=0,H=j.length;q<H;++q)if(!g(P,h(j[q])))return!1;return!0}function S(P){var I=P.parentNode;return I&&I.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(I.nodeName)}function M(P,I,j,q,H){var re=P.node,te=P.offset,oe=re,Le=te;re==q&&te>H&&++Le,re==I&&(te==j||te==j+1)&&(oe=q,Le+=H-j),re==I&&te>j+1&&--Le,P.node=oe,P.offset=Le}function C(P,I,j){P.node==I&&P.offset>j&&--P.offset}function G(P,I,j,q){j==-1&&(j=I.childNodes.length);var H=P.parentNode,re=o.getNodeIndex(P);u(q,function(te){M(te,H,re,I,j)}),I.childNodes.length==j?I.appendChild(P):I.insertBefore(P,I.childNodes[j])}function K(P,I){var j=P.parentNode,q=o.getNodeIndex(P);u(I,function(H){C(H,j,q)}),o.removeNode(P)}function J(P,I,j,q,H){for(var re,te=[];re=P.firstChild;)G(re,I,j++,H),te.push(re);return K(P,H),te}function R(P,I){return J(P,P.parentNode,o.getNodeIndex(P),!0,I)}function k(P,I){var j=P.cloneRange();j.selectNodeContents(I);var q=j.intersection(P),H=q?q.toString():"";return H!=""}function B(P){for(var I=P.getNodes([3]),j=0,q;(q=I[j])&&!k(P,q);)++j;for(var H=I.length-1;(q=I[H])&&!k(P,q);)--H;return I.slice(j,H+1)}function Z(P,I){if(P.attributes.length!=I.attributes.length)return!1;for(var j=0,q=P.attributes.length,H,re,te;j<q;++j)if(H=P.attributes[j],te=H.name,te!="class"&&(re=I.attributes.getNamedItem(te),H===null!=(re===null)||H.specified!=re.specified||H.specified&&H.nodeValue!==re.nodeValue))return!1;return!0}function ee(P,I){for(var j=0,q=P.attributes.length,H;j<q;++j)if(H=P.attributes[j].name,!(I&&s(I,H))&&P.attributes[j].specified&&H!="class")return!0;return!1}var ce=o.getComputedStyleProperty,Be=function(){var P=document.createElement("div");return typeof P.isContentEditable=="boolean"?function(I){return I&&I.nodeType==1&&I.isContentEditable}:function(I){return!I||I.nodeType!=1||I.contentEditable=="false"?!1:I.contentEditable=="true"||Be(I.parentNode)}}();function me(P){var I;return P&&P.nodeType==1&&((I=P.parentNode)&&I.nodeType==9&&I.designMode=="on"||Be(P)&&!Be(P.parentNode))}function de(P){return(Be(P)||P.nodeType!=1&&Be(P.parentNode))&&!me(P)}var Se=/^inline(-block|-table)?$/i;function je(P){return P&&P.nodeType==1&&!Se.test(ce(P,"display"))}var he=/[^\r\n\t\f \u200B]/;function Ve(P){if(P.data.length==0)return!0;if(he.test(P.data))return!1;var I=ce(P.parentNode,"whiteSpace");switch(I){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(P.data))return!1}return je(P.previousSibling)||je(P.nextSibling)}function $(P){var I=[],j,q;for(j=0;q=P[j++];)I.push(new a(q.startContainer,q.startOffset),new a(q.endContainer,q.endOffset));return I}function w(P,I){for(var j=0,q,H,re,te=P.length;j<te;++j)q=P[j],H=I[j*2],re=I[j*2+1],q.setStartAndEnd(H.node,H.offset,re.node,re.offset)}function _(P,I){return o.isCharacterDataNode(P)?I==0?!!P.previousSibling:I==P.length?!!P.nextSibling:!0:I>0&&I<P.childNodes.length}function F(P,I,j,q){var H,re,te=j==0;if(o.isAncestorOf(I,P))return P;if(o.isCharacterDataNode(I)){var oe=o.getNodeIndex(I);if(j==0)j=oe;else if(j==I.length)j=oe+1;else throw i.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+j+" in "+I.data);I=I.parentNode}if(_(I,j)){H=I.cloneNode(!1),re=I.parentNode,H.id&&H.removeAttribute("id");for(var Le,we=0;Le=I.childNodes[j];)G(Le,H,we++,q);return G(H,re,o.getNodeIndex(I)+1,q),I==P?H:F(P,re,o.getNodeIndex(H),q)}else if(P!=I){H=I.parentNode;var ge=o.getNodeIndex(I);return te||ge++,F(P,H,ge,q)}return P}function L(P,I){return P.namespaceURI==I.namespaceURI&&P.tagName.toLowerCase()==I.tagName.toLowerCase()&&T(P,I)&&Z(P,I)&&ce(P,"display")=="inline"&&ce(I,"display")=="inline"}function se(P){var I=P?"nextSibling":"previousSibling";return function(j,q){var H=j.parentNode,re=j[I];if(re){if(re&&re.nodeType==3)return re}else if(q&&(re=H[I],re&&re.nodeType==1&&L(H,re))){var te=re[P?"firstChild":"lastChild"];if(te&&te.nodeType==3)return te}return null}}var fe=se(!1),Ne=se(!0);function ze(P){this.isElementMerge=P.nodeType==1,this.textNodes=[];var I=this.isElementMerge?P.lastChild:P;I&&(this.textNodes[0]=I)}ze.prototype={doMerge:function(P){var I=this.textNodes,j=I[0];if(I.length>1){var q=o.getNodeIndex(j),H=[],re=0,te;u(I,function(oe,Le){te=oe.parentNode,Le>0&&(te.removeChild(oe),te.hasChildNodes()||o.removeNode(te),P&&u(P,function(we){we.node==oe&&(we.node=j,we.offset+=re),we.node==te&&we.offset>q&&(--we.offset,we.offset==q+1&&Le<I.length-1&&(we.node=j,we.offset=re))})),H[Le]=oe.data,re+=oe.data.length}),j.data=H.join("")}return j.data},getLength:function(){for(var P=this.textNodes.length,I=0;P--;)I+=this.textNodes[P].length;return I},toString:function(){var P=[];return u(this.textNodes,function(I,j){P[j]="'"+I.data+"'"}),"[Merge("+P.join(",")+")]"}};var rt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],Ze={};function at(P,I,j){var q,H,re,te,oe=this;oe.cssClass=oe.className=P;var Le=null,we={};if(typeof I=="object"&&I!==null){for(typeof I.elementTagName<"u"&&(I.elementTagName=I.elementTagName.toLowerCase()),j=I.tagNames,Le=I.elementProperties,we=I.elementAttributes,H=0;te=rt[H++];)I.hasOwnProperty(te)&&(oe[te]=I[te]);q=I.normalize}else q=I;oe.normalize=typeof q>"u"?!0:q,oe.attrExceptions=[];var ge=document.createElement(oe.elementTagName);oe.elementProperties=oe.copyPropertiesToElement(Le,ge,!0),f(we,function(et,nt){oe.attrExceptions.push(et),we[et]=""+nt}),oe.elementAttributes=we,oe.elementSortedClassName=oe.elementProperties.hasOwnProperty("className")?E(oe.elementProperties.className+" "+P):P,oe.applyToAnyTagName=!1;var st=typeof j;if(st=="string")j=="*"?oe.applyToAnyTagName=!0:oe.tagNames=h(j.toLowerCase()).split(/\s*,\s*/);else if(st=="object"&&typeof j.length=="number")for(oe.tagNames=[],H=0,re=j.length;H<re;++H)j[H]=="*"?oe.applyToAnyTagName=!0:oe.tagNames.push(j[H].toLowerCase());else oe.tagNames=[oe.elementTagName]}at.prototype={elementTagName:c,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(P,I,j){var q,H,re={},te,oe,Le,we;for(var ge in P)if(P.hasOwnProperty(ge))if(oe=P[ge],Le=I[ge],ge=="className")m(I,oe),m(I,this.className),I[ge]=E(I[ge]),j&&(re[ge]=oe);else if(ge=="style"){H=Le,j&&(re[ge]=te={});for(q in P[ge])P[ge].hasOwnProperty(q)&&(H[q]=oe[q],j&&(te[q]=H[q]));this.attrExceptions.push(ge)}else I[ge]=oe,j&&(re[ge]=I[ge],we=Ze.hasOwnProperty(ge)?Ze[ge]:ge,this.attrExceptions.push(we));return j?re:""},copyAttributesToElement:function(P,I){for(var j in P)P.hasOwnProperty(j)&&!/^class(?:Name)?$/i.test(j)&&I.setAttribute(j,P[j])},appliesToElement:function(P){return s(this.tagNames,P.tagName.toLowerCase())},getEmptyElements:function(P){var I=this;return P.getNodes([1],function(j){return I.appliesToElement(j)&&!j.hasChildNodes()})},hasClass:function(P){return P.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(P))&&g(P,this.className)},getSelfOrAncestorWithClass:function(P){for(;P;){if(this.hasClass(P))return P;P=P.parentNode}return null},isModifiable:function(P){return!this.applyToEditableOnly||de(P)},isIgnorableWhiteSpaceNode:function(P){return this.ignoreWhiteSpace&&P&&P.nodeType==3&&Ve(P)},postApply:function(P,I,j,q){var H=P[0],re=P[P.length-1],te=[],oe,Le=H,we=re,ge=0,st=re.length,et;u(P,function(Ae){et=fe(Ae,!q),et?(oe||(oe=new ze(et),te.push(oe)),oe.textNodes.push(Ae),Ae===H&&(Le=oe.textNodes[0],ge=Le.length),Ae===re&&(we=oe.textNodes[0],st=oe.getLength())):oe=null});var nt=Ne(re,!q);if(nt&&(oe||(oe=new ze(re),te.push(oe)),oe.textNodes.push(nt)),te.length){for(var en=0,ve=te.length;en<ve;++en)te[en].doMerge(j);I.setStartAndEnd(Le,ge,we,st)}},createContainer:function(P){var I=o.getDocument(P),j=d&&!o.isHtmlNamespace(P)&&P.namespaceURI?I.createElementNS(P.namespaceURI,this.elementTagName):I.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,j,!1),this.copyAttributesToElement(this.elementAttributes,j),m(j,this.className),this.onElementCreate&&this.onElementCreate(j,this),j},elementHasProperties:function(P,I){var j=this;return f(I,function(q,H){if(q=="className")return A(P,H);if(typeof H=="object"){if(!j.elementHasProperties(P[q],H))return!1}else if(P[q]!==H)return!1})},elementHasAttributes:function(P,I){return f(I,function(j,q){if(P.getAttribute(j)!==q)return!1})},applyToTextNode:function(P,I){if(S(P)){var j=P.parentNode;if(j.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(j)&&this.elementHasProperties(j,this.elementProperties)&&this.elementHasAttributes(j,this.elementAttributes))m(j,this.className);else{var q=P.parentNode,H=this.createContainer(q);q.insertBefore(H,P),H.appendChild(P)}}},isRemovable:function(P){return P.tagName.toLowerCase()==this.elementTagName&&b(P)==this.elementSortedClassName&&this.elementHasProperties(P,this.elementProperties)&&!ee(P,this.attrExceptions)&&this.elementHasAttributes(P,this.elementAttributes)&&this.isModifiable(P)},isEmptyContainer:function(P){var I=P.childNodes.length;return P.nodeType==1&&this.isRemovable(P)&&(I==0||I==1&&this.isEmptyContainer(P.firstChild))},removeEmptyContainers:function(P){var I=this,j=P.getNodes([1],function(re){return I.isEmptyContainer(re)}),q=[P],H=$(q);u(j,function(re){K(re,H)}),w(q,H)},undoToTextNode:function(P,I,j,q){if(!I.containsNode(j)){var H=I.cloneRange();H.selectNode(j),H.isPointInRange(I.endContainer,I.endOffset)&&(F(j,I.endContainer,I.endOffset,q),I.setEndAfter(j)),H.isPointInRange(I.startContainer,I.startOffset)&&(j=F(j,I.startContainer,I.startOffset,q))}this.isRemovable(j)?R(j,q):y(j,this.className)},splitAncestorWithClass:function(P,I,j){var q=this.getSelfOrAncestorWithClass(P);q&&F(q,P,I,j)},undoToAncestor:function(P,I){this.isRemovable(P)?R(P,I):y(P,this.className)},applyToRange:function(P,I){var j=this;I=I||[];var q=$(I||[]);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P);var H=B(P);if(H.length){u(H,function(oe){!j.isIgnorableWhiteSpaceNode(oe)&&!j.getSelfOrAncestorWithClass(oe)&&j.isModifiable(oe)&&j.applyToTextNode(oe,q)});var re=H[H.length-1];P.setStartAndEnd(H[0],0,re,re.length),j.normalize&&j.postApply(H,P,q,!1),w(I,q)}var te=j.getEmptyElements(P);u(te,function(oe){m(oe,j.className)})},applyToRanges:function(P){for(var I=P.length;I--;)this.applyToRange(P[I],P);return P},applyToSelection:function(P){var I=r.getSelection(P);I.setRanges(this.applyToRanges(I.getAllRanges()))},undoToRange:function(P,I){var j=this;I=I||[];var q=$(I);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P,q);var H=B(P),re,te,oe=H[H.length-1];if(H.length){j.splitAncestorWithClass(P.endContainer,P.endOffset,q),j.splitAncestorWithClass(P.startContainer,P.startOffset,q);for(var Le=0,we=H.length;Le<we;++Le)re=H[Le],te=j.getSelfOrAncestorWithClass(re),te&&j.isModifiable(re)&&j.undoToAncestor(te,q);P.setStartAndEnd(H[0],0,oe,oe.length),j.normalize&&j.postApply(H,P,q,!0),w(I,q)}var ge=j.getEmptyElements(P);u(ge,function(st){y(st,j.className)})},undoToRanges:function(P){for(var I=P.length;I--;)this.undoToRange(P[I],P);return P},undoToSelection:function(P){var I=r.getSelection(P),j=r.getSelection(P).getAllRanges();this.undoToRanges(j),I.setRanges(j)},isAppliedToRange:function(P){if(P.collapsed||P.toString()=="")return!!this.getSelfOrAncestorWithClass(P.commonAncestorContainer);var I=P.getNodes([3]);if(I.length){for(var j=0,q;q=I[j++];)if(!this.isIgnorableWhiteSpaceNode(q)&&k(P,q)&&this.isModifiable(q)&&!this.getSelfOrAncestorWithClass(q))return!1}return!0},isAppliedToRanges:function(P){var I=P.length;if(I==0)return!1;for(;I--;)if(!this.isAppliedToRange(P[I]))return!1;return!0},isAppliedToSelection:function(P){var I=r.getSelection(P);return this.isAppliedToRanges(I.getAllRanges())},toggleRange:function(P){this.isAppliedToRange(P)?this.undoToRange(P):this.applyToRange(P)},toggleSelection:function(P){this.isAppliedToSelection(P)?this.undoToSelection(P):this.applyToSelection(P)},getElementsWithClassIntersectingRange:function(P){var I=[],j=this;return P.getNodes([3],function(q){var H=j.getSelfOrAncestorWithClass(q);H&&!s(I,H)&&I.push(H)}),I},detach:function(){}};function Ct(P,I,j){return new at(P,I,j)}at.util={hasClass:g,addClass:m,removeClass:y,getClass:x,hasSameClasses:T,hasAllClasses:A,replaceWithOwnChildren:R,elementsHaveSameNonClassAttributes:Z,elementHasNonClassAttributes:ee,splitNodeAt:F,isEditableElement:Be,isEditingHost:me,isEditable:de},r.CssClassApplier=r.ClassApplier=at,r.createClassApplier=Ct,l.createAliasForDeprecatedMethod(r,"createCssClassApplier","createClassApplier",i)}),n})}(_p)),_p.exports}e5();var X0={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function G0(t){var e,n,r=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),i=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),o=r||i;return o?o.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{U0.init()}catch{console.error("rangy.init failed")}try{(l=(s=r==null?void 0:r.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new H0({parent:this.button||void 0,color:"#000",onDone:function(u){var c,d,f,h,v;try{a.coloredText&&(!((d=(c=a.coloredText).isAppliedToSelection)===null||d===void 0)&&d.call(c))&&a.coloredText.undoToSelection(),a.coloredText=U0.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),a.coloredText.toggleSelection(),(h=(f=a.base)===null||f===void 0?void 0:f.checkContentChanged)===null||h===void 0||h.call(f),(v=a.setInactive)===null||v===void 0||v.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),function(){function a(){}return a}())}var t5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),n5=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Y0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},K0=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){t5(e,t);function e(n){var r=t.call(this,n)||this;r.labelMap=new Map;var i=n.lf,o=n.graphModel;return r.lf=i,r.graphModel=o,r.state={tick:0},r}return e.prototype.componentDidMount=function(){var n=this,r=this.props.graphModel;this.editor=new Fu(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0(Fu))}})),r.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),r.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new Fu(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0(Fu))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,r=this.props,i=r.lf.extension,o=r.graphModel,a=K0(K0([],Y0(o.nodes),!1),Y0(o.edges),!1),s=i.label;if(s){var l=[];return gt(a,function(u){var c,d,f=u.getData(),h=(d=(c=f.properties)===null||c===void 0?void 0:c._label)!==null&&d!==void 0?d:[];gt(h,function(v){var g=n.labelMap,m=new WF(v,u,o);g.set(m.id,m),l.push(V(HF,{label:m,element:u,graphModel:o},m.id))})}),l}return null},e.prototype.render=function(){return V("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=n5([vn],e),e})(Qe);var q0=function(){return q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},q0.apply(this,arguments)},Z0=function(){return Z0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Z0.apply(this,arguments)},J0=function(){return J0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},J0.apply(this,arguments)},Q0=function(){return Q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q0.apply(this,arguments)},bp=function(){return bp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bp.apply(this,arguments)},xp=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ep=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zu="lf:defaultNodeMenu",Wu="lf:defaultEdgeMenu",wp="lf:defaultGraphMenu",Uu="lf:defaultSelectionMenu",Sp={nodeMenu:zu,edgeMenu:Wu,graphMenu:wp,selectionMenu:Uu},ii={nodeMenu:[],edgeMenu:[],graphMenu:[],selectionMenu:[]},r5=function(){function t(e){var n=e.lf,r=this;this.__currentData=null,this.__isSilentMode=!1,this.lf=n,this.__menuDOM=document.createElement("ul"),this.__isSilentMode=n.graphModel.editConfigModel.isSilentMode,this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(i){r.setMenuConfig(i)},this.lf.addMenuConfig=function(i){r.addMenuConfig(i)},this.lf.setMenuByType=function(i){r.setMenuByType(i)},this.lf.changeMenuItemDisableStatus=function(i,o,a){r.changeMenuItemDisableStatus(i,o,a)},this.lf.getMenuConfig=function(i){return r.getMenuConfig(i)},this.lf.resetMenuConfigByType=function(i){r.resetMenuConfigByType(i)}}return t.prototype.init=function(){var e=this,n,r,i;ii.nodeMenu=[{text:"删除",callback:function(o){e.lf.deleteNode(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}},{text:"复制",callback:function(o){e.lf.cloneNode(o.id)}}],(n=this.menuTypeMap)===null||n===void 0||n.set(zu,ii.nodeMenu),ii.edgeMenu=[{text:"删除",callback:function(o){e.lf.deleteEdge(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}}],(r=this.menuTypeMap)===null||r===void 0||r.set(Wu,ii.edgeMenu),ii.graphMenu=[],ii.selectionMenu=[{text:"删除",callback:function(o){e.lf.clearSelectElements(),o.edges.forEach(function(a){return e.lf.deleteEdge(a.id)}),o.nodes.forEach(function(a){return e.lf.deleteNode(a.id)})}}],(i=this.menuTypeMap)===null||i===void 0||i.set(Uu,ii.selectionMenu)},t.prototype.showMenu=function(e,n,r,i){if(!this.__isSilentMode&&!(!r||!r.length)){var o=this.__menuDOM;if(o){if(o.innerHTML="",o.append.apply(o,Ep([],xp(this.__getMenuDom(r)),!1)),!o.children.length)return;if(o.style.display="block",!i){o.style.top="".concat(n,"px"),o.style.left="".concat(e,"px");return}var a=i.width,s=i.height,l=i.clientX,u=i.clientY,c=this.lf.graphModel,d=o.offsetWidth,f=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=h-l,g=c.rootEl.getBoundingClientRect(),m=g.left+g.width;m<h&&(v=m-l),v<d&&(f=!1),f?o.style.left="".concat(e,"px"):o.style.left="".concat(e-a,"px");var y=o.offsetHeight,x=!0,E=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=E-u,T=g.top+g.height;T<E&&(b=T-u),b<y&&(x=!1),x?o.style.top="".concat(n,"px"):o.style.top="".concat(n-s,"px")}}},t.prototype.processMenuConfig=function(e,n){var r=this;if(e){var i=["nodeMenu","edgeMenu","graphMenu","selectionMenu"];i.forEach(function(o){var a,s,l,u,c=e[o],d=Sp[o];if(c!==void 0){if(n==="set")(a=r.menuTypeMap)===null||a===void 0||a.set(d,c||[]);else if(n==="add"&&Array.isArray(c)){var f=(l=(s=r.menuTypeMap)===null||s===void 0?void 0:s.get(d))!==null&&l!==void 0?l:[];(u=r.menuTypeMap)===null||u===void 0||u.set(d,f.concat(c))}}})}},t.prototype.createImageElement=function(e,n){var r=document.createElement("img");return r.src=e,r.alt=n,r.style.width="16px",r.style.height="16px",r.style.objectFit="contain",r},t.prototype.isImageFile=function(e){var n=[".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"];return n.some(function(r){return e.toLowerCase().includes(r)})},t.prototype.processIcon=function(e,n,r){var i;if(typeof n=="string"){var o=n;if(o.startsWith("data:image/")){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(this.isImageFile(o)){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(o.includes("<")&&o.includes(">")){e.innerHTML=o;return}if(o.includes(" ")||o.startsWith(".")){var s=o.replace(/^\./,"").split(" ");(i=e.classList).add.apply(i,Ep([],xp(s),!1));return}e.classList.add(o)}},t.prototype.__getMenuDom=function(e){var n=this,r=[];return e&&e.length>0&&e.forEach(function(i){var o=document.createElement("li");if(i.className?o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""," ").concat(i.className):o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""),i.icon){var a=document.createElement("span");a.className="lf-menu-item-icon",n.processIcon(a,i.icon,i.text),o.appendChild(a)}var s=document.createElement("span");s.className="lf-menu-item-text",i.text&&(s.innerText=i.text),o.appendChild(s),i.disabled&&o.setAttribute("disabled","true"),o.onclickCallback=i.callback,r.push(o)}),r},t.prototype.updateMenuItemDOMStatus=function(e,n){if(!(!this.__menuDOM||this.__menuDOM.style.display==="none")){var r=Array.from(this.__menuDOM.querySelectorAll(".lf-menu-item")),i=r.find(function(a){var s=a.querySelector(".lf-menu-item-text");return(s==null?void 0:s.textContent)===e});if(i){var o=i;n?(o.classList.add("lf-menu-item__disabled"),o.setAttribute("disabled","true")):(o.classList.remove("lf-menu-item__disabled"),o.removeAttribute("disabled"))}}},t.prototype.setupSilentModeListener=function(){var e=this;this.__editConfigChangeHandler=function(n){var r=n.data,i=r.isSilentMode;i!==e.__isSilentMode&&(e.__isSilentMode=i,e.updateMenuVisibility(!i))},this.lf.on("editConfig:changed",this.__editConfigChangeHandler)},t.prototype.updateMenuVisibility=function(e){this.__menuDOM&&(e?this.__currentData&&(this.__menuDOM.style.display="block"):(this.__menuDOM.style.display="none",this.__currentData=null))},t.prototype.refreshCurrentMenu=function(){var e,n,r,i,o,a,s,l,u,c,d;if(!(!this.__menuDOM||this.__menuDOM.style.display==="none"||!this.__currentData)){var f=this.__menuDOM.style,h=f.left,v=f.top,g=[];if(this.__currentData&&typeof this.__currentData=="object")if("sourceNodeId"in this.__currentData&&"targetNodeId"in this.__currentData){var m=this.lf.graphModel.getEdgeModelById(this.__currentData.id);if(m){var y=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(i=(r=this.menuTypeMap)===null||r===void 0?void 0:r.get(Wu))!==null&&i!==void 0?i:[]}}else if("id"in this.__currentData&&"type"in this.__currentData){var m=this.lf.graphModel.getNodeModelById(this.__currentData.id);if(m){var y=(o=this.menuTypeMap)===null||o===void 0?void 0:o.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(s=(a=this.menuTypeMap)===null||a===void 0?void 0:a.get(zu))!==null&&s!==void 0?s:[]}}else"nodes"in this.__currentData&&"edges"in this.__currentData?g=(u=(l=this.menuTypeMap)===null||l===void 0?void 0:l.get(Uu))!==null&&u!==void 0?u:[]:g=(d=(c=this.menuTypeMap)===null||c===void 0?void 0:c.get(wp))!==null&&d!==void 0?d:[];g&&g.length>0?(this.__menuDOM.innerHTML="",(e=this.__menuDOM).append.apply(e,Ep([],xp(this.__getMenuDom(g)),!1)),h&&(this.__menuDOM.style.left=h),v&&(this.__menuDOM.style.top=v)):(this.__menuDOM.style.display="none",this.__currentData=null)}},t.prototype.setMenuByType=function(e){var n,r=e.type,i=e.menu;!r||!i||((n=this.menuTypeMap)===null||n===void 0||n.set(r,i),this.refreshCurrentMenu())},t.prototype.getMenuConfig=function(e){var n,r;return(r=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(Sp[e]))!==null&&r!==void 0?r:[]},t.prototype.resetMenuConfigByType=function(e){var n;this.setMenuConfig((n={},n[e]=ii[e],n))},t.prototype.resetAllMenuConfig=function(){this.setMenuConfig(ii)},t.prototype.setMenuConfig=function(e){this.processMenuConfig(e,"set"),this.refreshCurrentMenu()},t.prototype.addMenuConfig=function(e){this.processMenuConfig(e,"add"),this.refreshCurrentMenu()},t.prototype.changeMenuItem=function(e,n){if(e==="add")this.addMenuConfig(n);else if(e==="reset")this.setMenuConfig(n);else throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'")},t.prototype.changeMenuItemDisableStatus=function(e,n,r){var i,o;if(!e||!n){console.warn("params is vaild");return}var a=(o=(i=this.menuTypeMap)===null||i===void 0?void 0:i.get(Sp[e]))!==null&&o!==void 0?o:[];if(!a.length){console.warn("menuMap: ".concat(e," is not exist"));return}var s=a.find(function(l){return l.text===n});if(!s){console.warn("menuItem: ".concat(n," is not exist"));return}s.disabled=r,this.updateMenuItemDOMStatus(n,r)},t.prototype.render=function(e,n){var r=this;e.graphModel.editConfigModel.isSilentMode||(this.__container=n,this.__currentData=null,this.setupSilentModeListener(),this.__menuDOM&&(this.__menuDOM.className="lf-menu",n.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",function(i){i.stopPropagation();for(var o=i.target;Array.from(o.classList).indexOf("lf-menu-item")===-1&&Array.from(o.classList).indexOf("lf-menu")===-1;)o=o==null?void 0:o.parentElement;Array.from(o.classList).indexOf("lf-menu-item__disabled")>-1||(Array.from(o.classList).indexOf("lf-menu-item")>-1?(o.onclickCallback(r.__currentData,o),r.__menuDOM&&(r.__menuDOM.style.display="none"),r.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!"))},!0)),this.lf.on("node:contextmenu",function(i){var o,a,s=i.data,l=i.position,u=i.e,c=l.domOverlayPosition,d=c.x,f=c.y,h=s.id,v=r.lf.graphModel.getNodeModelById(h);if(!(!v||r.__isSilentMode)){var g=[],m=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(v.type);v&&v.menu&&Array.isArray(v.menu)?g=v.menu:m?g=m:g=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(zu),r.__currentData=s,r.showMenu(d,f,g,{width:v.width,height:v.height,clientX:u.clientX,clientY:u.clientY})}}),this.lf.on("edge:contextmenu",function(i){var o,a,s,l=i.data,u=i.position,c=i.e,d=u.domOverlayPosition,f=d.x,h=d.y,v=l.id,g=r.lf.graphModel.getEdgeModelById(v);if(!(!g||r.__isSilentMode)){var m=[],y=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(g.type);g&&g.menu&&Array.isArray(g.menu)?m=g.menu:y?m=y:m=(s=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Wu))!==null&&s!==void 0?s:[],r.__currentData=l,r.showMenu(f,h,m,{width:g.width,height:g.height,clientX:c.clientX,clientY:c.clientY})}}),this.lf.on("blank:contextmenu",function(i){var o,a,s=i.position;if(!r.__isSilentMode){var l=(a=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(wp))!==null&&a!==void 0?a:[],u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=bp({},s.canvasOverlayPosition),r.showMenu(c,d,l)}}),this.lf.on("selection:contextmenu",function(i){var o,a=i.data,s=i.position;if(!r.__isSilentMode){var l=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(Uu),u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=a,r.showMenu(c,d,l)}}),this.lf.on("node:mousedown",function(){r.__menuDOM.style.display="none"}),this.lf.on("edge:click",function(){r.__menuDOM.style.display="none"}),this.lf.on("blank:click",function(){r.__menuDOM.style.display="none"}))},t.prototype.destroy=function(){var e;this.__editConfigChangeHandler&&this.lf.off("editConfig:changed",this.__editConfigChangeHandler),this.__menuDOM&&((e=this===null||this===void 0?void 0:this.__container)===null||e===void 0||e.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.pluginName="menu",t}(),i5=function(){function t(e){var n=e.lf,r=this;this.lf=n,this.lf.setPatternItems=function(i){r.setPatternItems(i)}}return t.prototype.render=function(e,n){var r=this;if(this.destroy(),!this.shapeList||this.shapeList.length===0){this.domContainer=n;return}this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach(function(i){var o;(o=r.panelEl)===null||o===void 0||o.appendChild(r.createDndItem(i))}),n.appendChild(this.panelEl),this.domContainer=n},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(e){this.shapeList=e,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(e){var n=this,r=document.createElement("div");r.className=e.className?"lf-dnd-item ".concat(e.className):"lf-dnd-item";var i=document.createElement("div");if(i.className="lf-dnd-shape",e.icon&&(i.style.backgroundImage="url(".concat(e.icon,")")),r.appendChild(i),e.label){var o=document.createElement("div");o.innerText=e.label,o.className="lf-dnd-text",r.appendChild(o)}return e.disabled?(r.classList.add("disabled"),r.onmousedown=function(){e.callback&&e.callback(n.lf,n.domContainer)},r):(r.onmousedown=function(){e.type&&n.lf.dnd.startDrag({type:e.type,properties:e.properties,text:e.text}),e.callback&&e.callback(n.lf,n.domContainer)},r.ondblclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:a,data:e})},r.onclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:a,data:e})},r.oncontextmenu=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:a,data:e})},r)},t.pluginName="dndPanel",t}(),ex=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},tx=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},o5=function(){function t(e){var n=e.lf,r=e.options,i=this,o;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;i.handleMouseDown(s)},this.draw=function(a){var s=i.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,u=s.y;if(i.endPoint={x:l,y:u},i.startPoint){var c=i.startPoint,d=c.x,f=c.y,h=d,v=f,g=l-d,m=u-f;l<d&&(h=l,g=d-l),u<f&&(v=u,m=f-u),i.wrapper&&(i.wrapper.style.left="".concat(h,"px"),i.wrapper.style.top="".concat(v,"px"),i.wrapper.style.width="".concat(g,"px"),i.wrapper.style.height="".concat(m,"px"))}},this.drawOff=function(a){if(i.lf.updateEditConfig({stopMoveGraph:i.originalStopMoveGraph}),i.originStatusSaved=!1,i.mouseDownInfo){var s=i.mouseDownInfo,l=s.x,u=s.y,c=s.time,d=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-u)<5&&Date.now()-c<200;if(d){i.lf.clearSelectElements(),i.cleanupSelectionState();return}}var f=Pe(i.startPoint),h=Pe(i.endPoint);if(document.removeEventListener("mousemove",i.draw),i.exclusiveMode||document.removeEventListener("mouseup",i.drawOff),f&&h){var l=f.x,u=f.y,v=h.x,g=h.y,m=[Math.min(l,v),Math.min(u,g)],y=[Math.max(l,v),Math.max(u,g)];if(i.lf.emit("selection:selected-area",{topLeft:m,bottomRight:y}),Math.abs(v-l)<10&&Math.abs(g-u)<10){i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0);return}var x=i.lf.graphModel.getAreaElement(m,y,i.isWholeEdge,i.isWholeNode,!0),E=i.lf.graphModel,b=E.dynamicGroup,T=E.group,A=[],S=i.lf.getSelectElements(),M=new Set(tx(tx([],ex(S.nodes.map(function(K){return K.id})),!1),ex(S.edges.map(function(K){return K.id})),!1));x.forEach(function(K){if(T){var J=T.getNodeGroup(K.id);if(x.includes(J))return}if(b){var J=b.getGroupByNodeId(K.id);if(x.includes(J))return}if(i.exclusiveMode&&M.has(K.id)){i.lf.deselectElementById(K.id);return}i.lf.selectElementById(K.id,!0),A.push(K)}),i.startPoint=void 0,i.endPoint=void 0,A.length>0&&i.lf.emit("selection:drop",{e:a}),i.lf.emit("selection:selected",{elements:A,leftTopPoint:m,rightBottomPoint:y})}i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0)},this.lf=n,this.exclusiveMode=(o=r==null?void 0:r.exclusiveMode)!==null&&o!==void 0?o:!1,n.openSelectionSelect=function(){i.openSelectionSelect()},n.closeSelectionSelect=function(){i.closeSelectionSelect()},n.setSelectionSelectMode=function(a){i.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var r=e.button===2;if(!r){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var i=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,o=i.x,a=i.y;this.startPoint={x:o,y:a},this.endPoint={x:o,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(u){u.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=Pe(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),nx=function(){return nx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nx.apply(this,arguments)},rx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zo=function(){return Zo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zo.apply(this,arguments)},ds=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},a5={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function s5(t){for(var e=t,n=1;n<e.length-1;){var r=ds(e[n-1],2),i=r[0],o=r[1],a=ds(e[n],2),s=a[0],l=a[1],u=ds(e[n+1],2),c=u[0],d=u[1];i===s&&s===c||o===l&&l===d?e.splice(n,1):n++}return e}function l5(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(i[1]+=r,o[0]+=r):e==="lb"&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return e==="tl"?(i[1]+=r,o[0]-=r):e==="rb"&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return e==="br"?(i[1]-=r,o[0]+=r):e==="lt"&&(i[0]+=r,o[1]-=r),[i,o];case"br":return e==="bl"?(i[1]-=r,o[0]-=r):e==="rt"&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}function u5(t,e,n,r){var i,o=1,a="",s="";Math.abs(t[0]-e[0])<=o?a=t[1]>e[1]?"t":"b":Math.abs(t[1]-e[1])<=o&&(a=t[0]>e[0]?"l":"r"),Math.abs(e[0]-n[0])<=o?s=e[1]>n[1]?"t":"b":Math.abs(e[1]-n[1])<=o&&(s=e[0]>n[0]?"l":"r");var l=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||1/5*r,u="".concat(a).concat(s),c=a5[u]||"-",d="L ".concat(t[0]," ").concat(t[1]);if(c==="-")d+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var f=ds(l5(e,u,c,l),2),h=f[0],v=f[1];h&&v&&(d+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=ds(v,2),e[0]=i[0],e[1]=i[1])}return d}function c5(t,e){var n=0,r="";if(t.length===2)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var i=t[n-1],o=t[n],a=t[n+++1];r+=u5(i,o,a,e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}(function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),u=n.getEdgeAnimationStyle(),c=s5(r.split(" ").map(function(h){return h.split(",").map(function(v){return+v})})),d=c5(c,s),f=Zo(Zo(Zo({style:i?u:{}},l),o),{fill:"none"});return Te("path",Zo({d},f))},e})(os),function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ya);var ix=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vu=function(){return Vu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Vu.apply(this,arguments)},ox=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ax=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},d5=function(t){ix(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.id,i=n.x,o=n.y,a=n.width,s=n.height,l=n.properties,u=this.props.model.getNodeStyle();return Te("svg",{x:i-a/2,y:o-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Te("text",{x:0,y:-5,fontSize:"16px",fill:u.stroke},l.labelText):"",l.disabledDelete?"":Te("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:u.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,r)},"x")])},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Vu(Vu({},l),{x:r-o/2,y:i-a/2,width:o,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var r=this.props.graphModel;r.deleteNode(n)},e}(pu),f5=function(t){ix(e,t);function e(){var n=t.apply(this,ax([],ox(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,r;this.points=[],((r=this.properties)===null||r===void 0?void 0:r.node_selection_ids).length>1&&setTimeout(function(){var i;n.updatePointsByNodes(((i=n.properties)===null||i===void 0?void 0:i.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var r=n.x,i=n.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(n){var r=this,i=[],o=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(u){var c=r.graphModel.getNodeModelById(u);if(c){var d=c.width,f=c.height,h=c.x,v=c.y;o=Math.min(o,h-d/2-r.d),a=Math.min(a,v-f/2-r.d),s=Math.max(s,h+d/2+r.d),l=Math.max(l,v+f/2+r.d)}}),i.push([o,a],[s,a],[s,l],[o,l]),![o,a,s,l].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(s+o)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var r;this.isResize=!0;for(var i=n.width,o=n.height,a={x:i/this.width,y:o/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],u=new Set;s.length;){var c=s.shift(),d=(r=this.graphModel.nodesMap[c])===null||r===void 0?void 0:r.model;if(d){if(!Xu(d)){l.push(d);continue}u.has(d.id)||(u.add(d.id),s.push.apply(s,ax([],ox(d.properties.node_selection_ids||[]),!1)))}}var f={x:this.x-this.width/2,y:this.y-this.height/2},h=t.prototype.resize.call(this,n),v={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(g){g.width=g.width*a.x,g.height=g.height*a.y;var m=(g.x-f.x)*a.x+v.x-g.x,y=(g.y-f.y)*a.y+v.y-g.y;g.move(m,y,!0)}),this.isResize=!1,h},e}(au),Cp="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:Cp,view:d5,model:f5})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,r=this.lf.getGraphRawData(),i=n.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var a=ui(o,"properties.node_selection_ids",[]);return i.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var r=e.graphModel.nodes.filter(function(i){if(!Xu(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(n.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===Cp)){n.currentClickNode=r.data;var o=!1;n.selectNodesIds.includes(r.data.id)&&((i=n.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?o?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(n.onNodeChange(e,r),Xu(r)&&!r.isResize){var a=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return Xu(r)||n.onNodeChange(e,r),!0})},t.pluginName="node-selection",t})();var Xu=function(t){return!!(t&&t.type===Cp)},p5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gu=function(){return Gu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Gu.apply(this,arguments)};(function(t){p5(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.properties;return Te("text",{x:r-o/2+5,y:i-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Gu(Gu({},s),{fill:"#FFFFFF",x:r-o/2,y:i-a/2})),this.getLabelShape()])},e})(Ji);var Yu=2,sx=.16,h5=.05,g5=.05,v5=.15,lx=5,ux=4,m5=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function cx(t){var e=t.r,n=t.g,r=t.b,i=EI(e,n,r);return{h:i.h*360,s:i.s,v:i.v}}function Ku(t){var e=t.r,n=t.g,r=t.b;return"#".concat(SI(e,n,r))}function y5(t,e,n){var r=n/100,i={r:(e.r-t.r)*r+t.r,g:(e.g-t.g)*r+t.g,b:(e.b-t.b)*r+t.b};return i}function dx(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-Yu*e:Math.round(t.h)+Yu*e:r=n?Math.round(t.h)+Yu*e:Math.round(t.h)-Yu*e,r<0?r+=360:r>=360&&(r-=360),r}function fx(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-sx*e:e===ux?r=t.s+sx:r=t.s+h5*e,r>1&&(r=1),n&&e===lx&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function px(t,e,n){var r;return n?r=t.v+g5*e:r=t.v-v5*e,r>1&&(r=1),Number(r.toFixed(2))}function Ap(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=_a(t),i=lx;i>0;i-=1){var o=cx(r),a=Ku(_a({h:dx(o,i,!0),s:fx(o,i,!0),v:px(o,i,!0)}));n.push(a)}n.push(Ku(r));for(var s=1;s<=ux;s+=1){var l=cx(r),u=Ku(_a({h:dx(l,s),s:fx(l,s),v:px(l,s)}));n.push(u)}return e.theme==="dark"?m5.map(function(c){var d=c.index,f=c.opacity,h=Ku(y5(_a(e.backgroundColor||"#141414"),_a(n[d]),f*100));return h}):n}var Op={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},qu={},Tp={};Object.keys(Op).forEach(function(t){qu[t]=Ap(Op[t]),qu[t].primary=qu[t][5],Tp[t]=Ap(Op[t],{theme:"dark",backgroundColor:"#141414"}),Tp[t].primary=Tp[t][5]});var _5=qu.blue,b5=Symbol("iconContext"),hx=function(){return p.inject(b5,{prefixCls:p.ref("anticon"),rootClassName:p.ref(""),csp:p.ref()})};function Np(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function x5(t,e){return t&&t.contains?t.contains(e):!1}var gx="data-vc-order",E5="vc-icon-key",Mp=new Map;function vx(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):E5}function Dp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function w5(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function mx(t){return Array.from((Mp.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function yx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Np())return null;var n=e.csp,r=e.prepend,i=document.createElement("style");i.setAttribute(gx,w5(r)),n&&n.nonce&&(i.nonce=n.nonce),i.innerHTML=t;var o=Dp(e),a=o.firstChild;if(r){if(r==="queue"){var s=mx(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(gx))});if(s.length)return o.insertBefore(i,s[s.length-1].nextSibling),i}o.insertBefore(i,a)}else o.appendChild(i);return i}function S5(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Dp(e);return mx(n).find(function(r){return r.getAttribute(vx(e))===t})}function C5(t,e){var n=Mp.get(t);if(!n||!x5(document,n)){var r=yx("",e),i=r.parentNode;Mp.set(t,i),t.removeChild(r)}}function A5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Dp(n);C5(r,n);var i=S5(e,n);if(i)return n.csp&&n.csp.nonce&&i.nonce!==n.csp.nonce&&(i.nonce=n.csp.nonce),i.innerHTML!==t&&(i.innerHTML=t),i;var o=yx(t,n);return o.setAttribute(vx(n),e),o}function _x(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){O5(t,i,n[i])})}return t}function O5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T5(t,e){process.env.NODE_ENV!=="production"&&!t&&console!==void 0&&console.error("Warning: ".concat(e))}function N5(t,e){T5(t,"[@ant-design/icons-vue] ".concat(e))}function bx(t){return typeof t=="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(typeof t.icon=="object"||typeof t.icon=="function")}function Pp(t,e,n){return n?p.h(t.tag,_x({key:e},n,t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):p.h(t.tag,_x({key:e},t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function xx(t){return Ap(t)[0]}function Ex(t){return t?Array.isArray(t)?t:[t]:[]}var M5=`
96
+ */var fp=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},pp=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Hu=function(){function t(e,n){var r=[],i=!0,o=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(n&&r.length===n));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var XF={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function F0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var GF=function(){function t(e,n,r,i){fp(this,t);var o=this;function a(l){if(l.startsWith("hsl")){var u=l.match(/([\-\d\.e]+)/g).map(Number),c=Hu(u,4),d=c[0],f=c[1],h=c[2],v=c[3];v===void 0&&(v=1),d/=360,f/=100,h/=100,o.hsla=[d,f,h,v]}else if(l.startsWith("rgb")){var g=l.match(/([\-\d\.e]+)/g).map(Number),m=Hu(g,4),y=m[0],x=m[1],E=m[2],b=m[3];b===void 0&&(b=1),o.rgba=[y,x,E,b]}else l.startsWith("#")?o.rgba=t.hexToRgb(l):o.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,r,i===void 0?1:i]}return pp(t,[{key:"printRGB",value:function(n){var r=n?this.rgba:this.rgba.slice(0,3),i=r.map(function(o,a){return F0(o,a===3?3:0)});return n?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(n){var r=[360,100,100,1],i=["","%","%",""],o=n?this.hsla:this.hsla.slice(0,3),a=o.map(function(s,l){return F0(s*r[l],l===3?3:1)+i[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var r=this.hex;return n?r:r.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,r=n.map(function(i,o){return o<3?i.toString(16):Math.round(i*255).toString(16)});return"#"+r.map(function(i){return i.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var r=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!r.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var i=r.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(o){return parseInt(o,16)});return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(n){var r=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=XF[r];return i===void 0?i:t.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var r=Hu(n,4),i=r[0],o=r[1],a=r[2],s=r[3];i/=255,o/=255,a/=255;var l=Math.max(i,o,a),u=Math.min(i,o,a),c=void 0,d=void 0,f=(l+u)/2;if(l===u)c=d=0;else{var h=l-u;switch(d=f>.5?h/(2-l-u):h/(l+u),l){case i:c=(o-a)/h+(o<a?6:0);break;case o:c=(a-i)/h+2;break;case a:c=(i-o)/h+4;break}c/=6}return[c,d,f,s]}},{key:"hslToRgb",value:function(n){var r=Hu(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=void 0,u=void 0,c=void 0;if(o===0)l=u=c=a;else{var d=function(m,y,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?m+(y-m)*6*x:x<.5?y:x<.6666666666666666?m+(y-m)*(.6666666666666666-x)*6:m},f=a<.5?a*(1+o):a+o-a*o,h=2*a-f;l=d(h,f,i+1/3),u=d(h,f,i),c=d(h,f,i-1/3)}var v=[l*255,u*255,c*255].map(Math.round);return v[3]=s,v}}]),t}(),YF=function(){function t(){fp(this,t),this._events=[]}return pp(t,[{key:"add",value:function(n,r,i){n.addEventListener(r,i,!1),this._events.push({target:n,type:r,handler:i})}},{key:"remove",value:function(n,r,i){this._events=this._events.filter(function(o){var a=!0;return n&&n!==o.target&&(a=!1),r&&r!==o.type&&(a=!1),i&&i!==o.handler&&(a=!1),a&&t._doRemove(o.target,o.type,o.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,r,i){n.removeEventListener(r,i,!1)}}]),t}();function KF(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function hp(t,e,n){var r=!1;function i(l,u,c){return Math.max(u,Math.min(l,c))}function o(l,u,c){if(c&&(r=!0),!!r){l.preventDefault();var d=e.getBoundingClientRect(),f=d.width,h=d.height,v=u.clientX,g=u.clientY,m=i(v-d.left,0,f),y=i(g-d.top,0,h);n(m/f,y/h)}}function a(l,u){var c=l.buttons===void 0?l.which:l.buttons;c===1?o(l,l,u):r=!1}function s(l,u){l.touches.length===1?o(l,l.touches[0],u):r=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){r=!1}),t.add(e,"touchend",function(l){r=!1}),t.add(e,"touchcancel",function(l){r=!1})}var qF=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
97
+ linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,ZF=360,$0="keydown",zu="mousedown",gp="focusin";function zr(t,e){return(e||document).querySelector(t)}function JF(t){t.preventDefault(),t.stopPropagation()}function vp(t,e,n,r,i){t.add(e,$0,function(o){n.indexOf(o.key)>=0&&r(o)})}var H0=function(){function t(e){fp(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new YF,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return pp(t,[{key:"setOptions",value:function(n){var r=this;if(!n)return;var i=this.settings;function o(u,c,d){for(var f in u)c[f]=u[f]}if(n instanceof HTMLElement)i.parent=n;else{i.parent&&n.parent&&i.parent!==n.parent&&(this._events.remove(i.parent),this._popupInited=!1),o(n,i),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=i.parent;if(s&&i.popup&&!this._popupInited){var l=function(c){return r.openHandler(c)};this._events.add(s,"click",l),vp(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!i.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var r=n&&n.type===$0?this._domEdit:this.domElement;setTimeout(function(){return r.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var r=n&&n.type,i=!1;if(!n)i=!0;else if(r===zu||r===gp){var o=(this.__containedEvent||0)+100;n.timeStamp>o&&(i=!0)}else JF(n),i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",r!==zu&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,r){this.closeHandler(),this.setOptions(n),r&&this.openHandler()}},{key:"setColor",value:function(n,r){this._setColor(n,{silent:r})}},{key:"_setColor",value:function(n,r){if(typeof n=="string"&&(n=n.trim()),!!n){r=r||{};var i=void 0;try{i=new GF(n)}catch(a){if(r.failSilently)return;throw a}if(!this.settings.alpha){var o=i.hsla;o[3]=1,i.hsla=o}this.colour=this.color=i,this._setHSLA(null,null,null,null,r)}}},{key:"setColour",value:function(n,r){this.setColor(n,r)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var r=this._toggleDOM(!0);return this._setPosition(),r}var i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=KF(i);return this.domElement=o,this._domH=zr(".picker_hue",o),this._domSL=zr(".picker_sl",o),this._domA=zr(".picker_alpha",o),this._domEdit=zr(".picker_editor input",o),this._domSample=zr(".picker_sample",o),this._domOkay=zr(".picker_done button",o),this._domCancel=zr(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup(function(){return o.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,r=this,i=this.domElement,o=this._events;function a(u,c,d){o.add(u,c,d)}a(i,"click",function(u){return u.preventDefault()}),hp(o,this._domH,function(u,c){return r._setHSLA(u)}),hp(o,this._domSL,function(u,c){return r._setHSLA(null,u,1-c)}),this.settings.alpha&&hp(o,this._domA,function(u,c){return r._setHSLA(null,null,null,1-c)});var s=this._domEdit;a(s,"input",function(u){r._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(u){var c=this;c.selectionStart===c.selectionEnd&&c.select()}),this._ifPopup(function(){var u=function(f){return n.closeHandler(f)};a(window,zu,u),a(window,gp,u),vp(o,i,["Esc","Escape"],u);var c=function(f){n.__containedEvent=f.timeStamp};a(i,zu,c),a(i,gp,c),a(n._domCancel,"click",u)});var l=function(c){n._ifPopup(function(){return n.closeHandler(c)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),vp(o,i,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,r=this.domElement;n!==r.parentNode&&n.appendChild(r),this._ifPopup(function(i){getComputedStyle(n).position==="static"&&(n.style.position="relative");var o=i===!0?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===o?r.classList.add(a):r.classList.remove(a)}),r.classList.add(o)})}},{key:"_setHSLA",value:function(n,r,i,o,a){a=a||{};var s=this.colour,l=s.hsla;[n,r,i,o].forEach(function(u,c){(u||u===0)&&(l[c]=u)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var r=this.colour,i=r.hsla,o="hsl("+i[0]*ZF+", 100%, 50%)",a=r.hslString,s=r.hslaString,l=this._domH,u=this._domSL,c=this._domA,d=zr(".picker_selector",l),f=zr(".picker_selector",u),h=zr(".picker_selector",c);function v(A,S,M){S.style.left=M*100+"%"}function g(A,S,M){S.style.top=M*100+"%"}v(l,d,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,v(u,f,i[1]),g(u,f,1-i[2]),u.style.color=a,g(c,h,1-i[3]);var m=a,y=m.replace("hsl","hsla").replace(")",", 0)"),x="linear-gradient("+[m,y]+")";if(this._domA.style.background=x+", "+qF,!n.fromEditor){var E=this.settings.editorFormat,b=this.settings.alpha,T=void 0;switch(E){case"rgb":T=r.printRGB(b);break;case"hsl":T=r.printHSL(b);break;default:T=r.printHex(b)}this._domEdit.value=T}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,r){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):r&&r()}},{key:"_toggleDOM",value:function(n){var r=this.domElement;if(!r)return!1;var i=n?"":"none",o=r.style.display!==i;return o&&(r.style.display=i),o}}]),t}();{var mp=document.createElement("style");mp.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(mp),H0.StyleElement=mp}var yp={exports:{}},z0;function W0(){return z0||(z0=1,function(t,e){(function(n,r){t.exports=n()})(function(){var n="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u($,w){var _=typeof $[w];return _==r||!!(_==n&&$[w])||_=="unknown"}function c($,w){return!!(typeof $[w]==n&&$[w])}function d($,w){return typeof $[w]!=i}function f($){return function(w,_){for(var F=_.length;F--;)if(!$(w,_[F]))return!1;return!0}}var h=f(u),v=f(c),g=f(d);function m($){return $&&h($,l)&&g($,s)}function y($){return c($,"body")?$.body:$.getElementsByTagName("body")[0]}var x=[].forEach?function($,w){$.forEach(w)}:function($,w){for(var _=0,F=$.length;_<F;++_)w($[_],_)},E={},b=typeof window!=i&&typeof document!=i,T={isHostMethod:u,isHostObject:c,isHostProperty:d,areHostMethods:h,areHostObjects:v,areHostProperties:g,isTextRange:m,getBody:y,forEach:x},A={version:"1.3.2",initialized:!1,isBrowser:b,supported:!0,util:T,features:{},modules:E,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i?!0:rangyAutoInitialize}};function S($){typeof console!=i&&u(console,"log")&&console.log($)}function M($,w){b&&w?alert($):S($)}function C($){A.initialized=!0,A.supported=!1,M("Rangy is not supported in this environment. Reason: "+$,A.config.alertOnFail)}A.fail=C;function G($){M("Rangy warning: "+$,A.config.alertOnWarn)}A.warn=G;var K;({}).hasOwnProperty?(T.extend=K=function($,w,_){var F,L;for(var se in w)se==="__proto__"||se==="constructor"||se==="prototype"||w.hasOwnProperty(se)&&(F=$[se],L=w[se],_&&F!==null&&typeof F=="object"&&L!==null&&typeof L=="object"&&K(F,L,!0),$[se]=L);return w.hasOwnProperty("toString")&&($.toString=w.toString),$},T.createOptions=function($,w){var _={};return K(_,w),$&&K(_,$),_}):C("hasOwnProperty not supported"),b||C("Rangy can only run in a browser"),function(){var $;if(b){var w=document.createElement("div");w.appendChild(document.createElement("span"));var _=[].slice;try{_.call(w.childNodes,0)[0].nodeType==1&&($=function(F){return _.call(F,0)})}catch{}}$||($=function(F){for(var L=[],se=0,fe=F.length;se<fe;++se)L[se]=F[se];return L}),T.toArray=$}();var J;b&&(u(document,"addEventListener")?J=function($,w,_){$.addEventListener(w,_,!1)}:u(document,"attachEvent")?J=function($,w,_){$.attachEvent("on"+w,_)}:C("Document does not have required addEventListener or attachEvent method"),T.addListener=J);var R=[];function k($){return $.message||$.description||String($)}function B(){if(!(!b||A.initialized)){var $,w=!1,_=!1;u(document,"createRange")&&($=document.createRange(),h($,a)&&g($,o)&&(w=!0));var F=y(document);if(!F||F.nodeName.toLowerCase()!="body"){C("No body element found");return}if(F&&u(F,"createTextRange")&&($=F.createTextRange(),m($)&&(_=!0)),!w&&!_){C("Neither Range nor TextRange are available");return}A.initialized=!0,A.features={implementsDomRange:w,implementsTextRange:_};var L,se;for(var fe in E)(L=E[fe])instanceof me&&L.init(L,A);for(var Ne=0,ze=R.length;Ne<ze;++Ne)try{R[Ne](A)}catch(rt){se="Rangy init listener threw an exception. Continuing. Detail: "+k(rt),S(se)}}}function Z($,w,_){_&&($+=" in module "+_.name),A.warn("DEPRECATED: "+$+" is deprecated. Please use "+w+" instead.")}function ee($,w,_,F){$[w]=function(){return Z(w,_,F),$[_].apply($,T.toArray(arguments))}}T.deprecationNotice=Z,T.createAliasForDeprecatedMethod=ee,A.init=B,A.addInitListener=function($){A.initialized?$(A):R.push($)};var ce=[];A.addShimListener=function($){ce.push($)};function Be($){$=$||window,B();for(var w=0,_=ce.length;w<_;++w)ce[w]($)}b&&(A.shim=A.createMissingNativeApi=Be,ee(A,"createMissingNativeApi","shim"));function me($,w,_){this.name=$,this.dependencies=w,this.initialized=!1,this.supported=!1,this.initializer=_}me.prototype={init:function(){for(var $=this.dependencies||[],w=0,_=$.length,F,L;w<_;++w){if(L=$[w],F=E[L],!F||!(F instanceof me))throw new Error("required module '"+L+"' not found");if(F.init(),!F.supported)throw new Error("required module '"+L+"' not supported")}this.initializer(this)},fail:function($){throw this.initialized=!0,this.supported=!1,new Error($)},warn:function($){A.warn("Module "+this.name+": "+$)},deprecationNotice:function($,w){A.warn("DEPRECATED: "+$+" in module "+this.name+" is deprecated. Please use "+w+" instead")},createError:function($){return new Error("Error in Rangy "+this.name+" module: "+$)}};function de($,w,_){var F=new me($,w,function(L){if(!L.initialized){L.initialized=!0;try{_(A,L),L.supported=!0}catch(fe){var se="Module '"+$+"' failed to load: "+k(fe);S(se),fe.stack&&S(fe.stack)}}});return E[$]=F,F}A.createModule=function($){var w,_;arguments.length==2?(w=arguments[1],_=[]):(w=arguments[2],_=arguments[1]);var F=de($,_,w);A.initialized&&A.supported&&F.init()},A.createCoreModule=function($,w,_){de($,w,_)};function Se(){}A.RangePrototype=Se,A.rangePrototype=new Se;function je(){}A.selectionPrototype=new je,A.createCoreModule("DomUtil",[],function($,w){var _="undefined",F=$.util,L=F.getBody;F.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||w.fail("document missing a Node creation method"),F.isHostMethod(document,"getElementsByTagName")||w.fail("document missing getElementsByTagName method");var se=document.createElement("div");F.areHostMethods(se,["insertBefore","appendChild","cloneNode"])||w.fail("Incomplete Element implementation"),F.isHostProperty(se,"innerHTML")||w.fail("Element is missing innerHTML property");var fe=document.createTextNode("test");F.areHostMethods(fe,["splitText","deleteData","insertData","appendData","cloneNode"])||w.fail("Incomplete Text Node implementation");var Ne=function(Y,ue){for(var Xe=Y.length;Xe--;)if(Y[Xe]===ue)return!0;return!1};function ze(Y){var ue;return typeof Y.namespaceURI==_||(ue=Y.namespaceURI)===null||ue=="http://www.w3.org/1999/xhtml"}function rt(Y){var ue=Y.parentNode;return ue.nodeType==1?ue:null}function Ze(Y){for(var ue=0;Y=Y.previousSibling;)++ue;return ue}function at(Y){switch(Y.nodeType){case 7:case 10:return 0;case 3:case 8:return Y.length;default:return Y.childNodes.length}}function Ct(Y,ue){var Xe=[],Me;for(Me=Y;Me;Me=Me.parentNode)Xe.push(Me);for(Me=ue;Me;Me=Me.parentNode)if(Ne(Xe,Me))return Me;return null}function P(Y,ue,Xe){for(var Me=Xe?ue:ue.parentNode;Me;){if(Me===Y)return!0;Me=Me.parentNode}return!1}function I(Y,ue){return P(Y,ue,!0)}function j(Y,ue,Xe){for(var Me,Dt=Xe?Y:Y.parentNode;Dt;){if(Me=Dt.parentNode,Me===ue)return Dt;Dt=Me}return null}function q(Y){var ue=Y.nodeType;return ue==3||ue==4||ue==8}function H(Y){if(!Y)return!1;var ue=Y.nodeType;return ue==3||ue==8}function re(Y,ue){var Xe=ue.nextSibling,Me=ue.parentNode;return Xe?Me.insertBefore(Y,Xe):Me.appendChild(Y),Y}function te(Y,ue,Xe){var Me=Y.cloneNode(!1);if(Me.deleteData(0,ue),Y.deleteData(ue,Y.length-ue),re(Me,Y),Xe)for(var Dt=0,yt;yt=Xe[Dt++];)yt.node==Y&&yt.offset>ue?(yt.node=Me,yt.offset-=ue):yt.node==Y.parentNode&&yt.offset>Ze(Y)&&++yt.offset;return Me}function oe(Y){if(Y.nodeType==9)return Y;if(typeof Y.ownerDocument!=_)return Y.ownerDocument;if(typeof Y.document!=_)return Y.document;if(Y.parentNode)return oe(Y.parentNode);throw w.createError("getDocument: no document found for node")}function Le(Y){var ue=oe(Y);if(typeof ue.defaultView!=_)return ue.defaultView;if(typeof ue.parentWindow!=_)return ue.parentWindow;throw w.createError("Cannot get a window object for node")}function we(Y){if(typeof Y.contentDocument!=_)return Y.contentDocument;if(typeof Y.contentWindow!=_)return Y.contentWindow.document;throw w.createError("getIframeDocument: No Document object found for iframe element")}function ge(Y){if(typeof Y.contentWindow!=_)return Y.contentWindow;if(typeof Y.contentDocument!=_)return Y.contentDocument.defaultView;throw w.createError("getIframeWindow: No Window object found for iframe element")}function st(Y){return Y&&F.isHostMethod(Y,"setTimeout")&&F.isHostObject(Y,"document")}function et(Y,ue,Xe){var Me;if(Y?F.isHostProperty(Y,"nodeType")?Me=Y.nodeType==1&&Y.tagName.toLowerCase()=="iframe"?we(Y):oe(Y):st(Y)&&(Me=Y.document):Me=document,!Me)throw ue.createError(Xe+"(): Parameter must be a Window object or DOM node");return Me}function nt(Y){for(var ue;ue=Y.parentNode;)Y=ue;return Y}function en(Y,ue,Xe,Me){var Dt,yt,Tr,Un,xn;if(Y==Xe)return ue===Me?0:ue<Me?-1:1;if(Dt=j(Xe,Y,!0))return ue<=Ze(Dt)?-1:1;if(Dt=j(Y,Xe,!0))return Ze(Dt)<Me?-1:1;if(yt=Ct(Y,Xe),!yt)throw new Error("comparePoints error: nodes have no common ancestor");if(Tr=Y===yt?yt:j(Y,yt,!0),Un=Xe===yt?yt:j(Xe,yt,!0),Tr===Un)throw w.createError("comparePoints got to case 4 and childA and childB are the same!");for(xn=yt.firstChild;xn;){if(xn===Tr)return-1;if(xn===Un)return 1;xn=xn.nextSibling}}var ve=!1;function Ae(Y){var ue;try{return ue=Y.parentNode,!1}catch{return!0}}(function(){var Y=document.createElement("b");Y.innerHTML="1";var ue=Y.firstChild;Y.innerHTML="<br />",ve=Ae(ue),$.features.crashyTextNodes=ve})();function dt(Y){if(!Y)return"[No node]";if(ve&&Ae(Y))return"[Broken node]";if(q(Y))return'"'+Y.data+'"';if(Y.nodeType==1){var ue=Y.id?' id="'+Y.id+'"':"";return"<"+Y.nodeName+ue+">[index:"+Ze(Y)+",length:"+Y.childNodes.length+"]["+(Y.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return Y.nodeName}function wt(Y){for(var ue=oe(Y).createDocumentFragment(),Xe;Xe=Y.firstChild;)ue.appendChild(Xe);return ue}var Ft;typeof window.getComputedStyle!=_?Ft=function(Y,ue){return Le(Y).getComputedStyle(Y,null)[ue]}:typeof document.documentElement.currentStyle!=_?Ft=function(Y,ue){return Y.currentStyle?Y.currentStyle[ue]:""}:w.fail("No means of obtaining computed style properties found");function Wn(Y,ue,Xe){var Me=L(Y),Dt=Y.createElement("div");Dt.contentEditable=""+!!Xe,ue&&(Dt.innerHTML=ue);var yt=Me.firstChild;return yt?Me.insertBefore(Dt,yt):Me.appendChild(Dt),Dt}function bn(Y){return Y.parentNode.removeChild(Y)}function tn(Y){this.root=Y,this._next=Y}tn.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var Y=this._current=this._next,ue,Xe;if(this._current)if(ue=Y.firstChild,ue)this._next=ue;else{for(Xe=null;Y!==this.root&&!(Xe=Y.nextSibling);)Y=Y.parentNode;this._next=Xe}return this._current},detach:function(){this._current=this._next=this.root=null}};function nn(Y){return new tn(Y)}function cn(Y,ue){this.node=Y,this.offset=ue}cn.prototype={equals:function(Y){return!!Y&&this.node===Y.node&&this.offset==Y.offset},inspect:function(){return"[DomPosition("+dt(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function Nn(Y){this.code=this[Y],this.codeName=Y,this.message="DOMException: "+this.codeName}Nn.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},Nn.prototype.toString=function(){return this.message},$.dom={arrayContains:Ne,isHtmlNamespace:ze,parentElement:rt,getNodeIndex:Ze,getNodeLength:at,getCommonAncestor:Ct,isAncestorOf:P,isOrIsAncestorOf:I,getClosestAncestorIn:j,isCharacterDataNode:q,isTextOrCommentNode:H,insertAfter:re,splitDataNode:te,getDocument:oe,getWindow:Le,getIframeWindow:ge,getIframeDocument:we,getBody:L,isWindow:st,getContentDocument:et,getRootContainer:nt,comparePoints:en,isBrokenNode:Ae,inspectNode:dt,getComputedStyleProperty:Ft,createTestElement:Wn,removeNode:bn,fragmentFromNodeChildren:wt,createIterator:nn,DomPosition:cn},$.DOMException=Nn}),A.createCoreModule("DomRange",["DomUtil"],function($,w){var _=$.dom,F=$.util,L=_.DomPosition,se=$.DOMException,fe=_.isCharacterDataNode,Ne=_.getNodeIndex,ze=_.isOrIsAncestorOf,rt=_.getDocument,Ze=_.comparePoints,at=_.splitDataNode,Ct=_.getClosestAncestorIn,P=_.getNodeLength,I=_.arrayContains,j=_.getRootContainer,q=$.features.crashyTextNodes,H=_.removeNode;function re(D,z){return D.nodeType!=3&&(ze(D,z.startContainer)||ze(D,z.endContainer))}function te(D){return D.document||rt(D.startContainer)}function oe(D){return j(D.startContainer)}function Le(D){return new L(D.parentNode,Ne(D))}function we(D){return new L(D.parentNode,Ne(D)+1)}function ge(D,z,Q){var le=D.nodeType==11?D.firstChild:D;return fe(z)?Q==z.length?_.insertAfter(D,z):z.parentNode.insertBefore(D,Q==0?z:at(z,Q)):Q>=z.childNodes.length?z.appendChild(D):z.insertBefore(D,z.childNodes[Q]),le}function st(D,z,Q){if(xt(D),xt(z),te(z)!=te(D))throw new se("WRONG_DOCUMENT_ERR");var le=Ze(D.startContainer,D.startOffset,z.endContainer,z.endOffset),Oe=Ze(D.endContainer,D.endOffset,z.startContainer,z.startOffset);return Q?le<=0&&Oe>=0:le<0&&Oe>0}function et(D){for(var z,Q,le=te(D.range).createDocumentFragment(),Oe;Q=D.next();){if(z=D.isPartiallySelectedSubtree(),Q=Q.cloneNode(!z),z&&(Oe=D.getSubtreeIterator(),Q.appendChild(et(Oe)),Oe.detach()),Q.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");le.appendChild(Q)}return le}function nt(D,z,Q){var le,Oe;Q=Q||{stop:!1};for(var it,ae;it=D.next();)if(D.isPartiallySelectedSubtree()){if(z(it)===!1){Q.stop=!0;return}else if(ae=D.getSubtreeIterator(),nt(ae,z,Q),ae.detach(),Q.stop)return}else for(le=_.createIterator(it);Oe=le.next();)if(z(Oe)===!1){Q.stop=!0;return}}function en(D){for(var z;D.next();)D.isPartiallySelectedSubtree()?(z=D.getSubtreeIterator(),en(z),z.detach()):D.remove()}function ve(D){for(var z,Q=te(D.range).createDocumentFragment(),le;z=D.next();){if(D.isPartiallySelectedSubtree()?(z=z.cloneNode(!1),le=D.getSubtreeIterator(),z.appendChild(ve(le)),le.detach()):D.remove(),z.nodeType==10)throw new se("HIERARCHY_REQUEST_ERR");Q.appendChild(z)}return Q}function Ae(D,z,Q){var le=!!(z&&z.length),Oe,it=!!Q;le&&(Oe=new RegExp("^("+z.join("|")+")$"));var ae=[];return nt(new wt(D,!1),function(Ee){if(!(le&&!Oe.test(Ee.nodeType))&&!(it&&!Q(Ee))){var Ie=D.startContainer;if(!(Ee==Ie&&fe(Ie)&&D.startOffset==Ie.length)){var tt=D.endContainer;Ee==tt&&fe(tt)&&D.endOffset==0||ae.push(Ee)}}}),ae}function dt(D){var z=typeof D.getName>"u"?"Range":D.getName();return"["+z+"("+_.inspectNode(D.startContainer)+":"+D.startOffset+", "+_.inspectNode(D.endContainer)+":"+D.endOffset+")]"}function wt(D,z){if(this.range=D,this.clonePartiallySelectedTextNodes=z,!D.collapsed){this.sc=D.startContainer,this.so=D.startOffset,this.ec=D.endContainer,this.eo=D.endOffset;var Q=D.commonAncestorContainer;this.sc===this.ec&&fe(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===Q&&!fe(this.sc)?this.sc.childNodes[this.so]:Ct(this.sc,Q,!0),this._last=this.ec===Q&&!fe(this.ec)?this.ec.childNodes[this.eo-1]:Ct(this.ec,Q,!0))}}wt.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var D=this._current=this._next;return D&&(this._next=D!==this._last?D.nextSibling:null,fe(D)&&this.clonePartiallySelectedTextNodes&&(D===this.ec&&(D=D.cloneNode(!0)).deleteData(this.eo,D.length-this.eo),this._current===this.sc&&(D=D.cloneNode(!0)).deleteData(0,this.so))),D},remove:function(){var D=this._current,z,Q;fe(D)&&(D===this.sc||D===this.ec)?(z=D===this.sc?this.so:0,Q=D===this.ec?this.eo:D.length,z!=Q&&D.deleteData(z,Q-z)):D.parentNode&&H(D)},isPartiallySelectedSubtree:function(){var D=this._current;return re(D,this.range)},getSubtreeIterator:function(){var D;if(this.isSingleCharacterDataNode)D=this.range.cloneRange(),D.collapse(!1);else{D=new $t(te(this.range));var z=this._current,Q=z,le=0,Oe=z,it=P(z);ze(z,this.sc)&&(Q=this.sc,le=this.so),ze(z,this.ec)&&(Oe=this.ec,it=this.eo),ft(D,Q,le,Oe,it)}return new wt(D,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var Ft=[1,3,4,5,7,8,10],Wn=[2,9,11],bn=[5,6,10,12],tn=[1,3,4,5,7,8,10,11],nn=[1,3,4,5,7,8];function cn(D){return function(z,Q){for(var le,Oe=Q?z:z.parentNode;Oe;){if(le=Oe.nodeType,I(D,le))return Oe;Oe=Oe.parentNode}return null}}var Nn=cn([9,11]),Y=cn(bn),ue=cn([6,10,12]),Xe=cn([1]);function Me(D,z){if(ue(D,z))throw new se("INVALID_NODE_TYPE_ERR")}function Dt(D,z){if(!I(z,D.nodeType))throw new se("INVALID_NODE_TYPE_ERR")}function yt(D,z){if(z<0||z>(fe(D)?D.length:D.childNodes.length))throw new se("INDEX_SIZE_ERR")}function Tr(D,z){if(Nn(D,!0)!==Nn(z,!0))throw new se("WRONG_DOCUMENT_ERR")}function Un(D){if(Y(D,!0))throw new se("NO_MODIFICATION_ALLOWED_ERR")}function xn(D,z){if(!D)throw new se(z)}function gs(D,z){return z<=(fe(D)?D.length:D.childNodes.length)}function io(D){return!!D.startContainer&&!!D.endContainer&&!(q&&(_.isBrokenNode(D.startContainer)||_.isBrokenNode(D.endContainer)))&&j(D.startContainer)==j(D.endContainer)&&gs(D.startContainer,D.startOffset)&&gs(D.endContainer,D.endOffset)}function xt(D){if(!io(D))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+D.inspect()+")")}var vs=document.createElement("style"),oi=!1;try{vs.innerHTML="<b>x</b>",oi=vs.firstChild.nodeType==3}catch{}$.features.htmlParsingConforms=oi;var ms=oi?function(D){var z=this.startContainer,Q=rt(z);if(!z)throw new se("INVALID_STATE_ERR");var le=null;return z.nodeType==1?le=z:fe(z)&&(le=_.parentElement(z)),le===null||le.nodeName=="HTML"&&_.isHtmlNamespace(rt(le).documentElement)&&_.isHtmlNamespace(le)?le=Q.createElement("body"):le=le.cloneNode(!1),le.innerHTML=D,_.fragmentFromNodeChildren(le)}:function(D){var z=te(this),Q=z.createElement("body");return Q.innerHTML=D,_.fragmentFromNodeChildren(Q)};function Qo(D,z){xt(D);var Q=D.startContainer,le=D.startOffset,Oe=D.endContainer,it=D.endOffset,ae=Q===Oe;fe(Oe)&&it>0&&it<Oe.length&&at(Oe,it,z),fe(Q)&&le>0&&le<Q.length&&(Q=at(Q,le,z),ae?(it-=le,Oe=Q):Oe==Q.parentNode&&it>=Ne(Q)&&it++,le=0),D.setStartAndEnd(Q,le,Oe,it)}function Ge(D){xt(D);var z=D.commonAncestorContainer.parentNode.cloneNode(!1);return z.appendChild(D.cloneContents()),z.innerHTML}var ea=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ta=0,oo=1,Qu=2,Pi=3,ao=0,ys=1,_s=2,na=3;F.extend($.rangePrototype,{compareBoundaryPoints:function(D,z){xt(this),Tr(this.startContainer,z.startContainer);var Q,le,Oe,it,ae=D==Pi||D==ta?"start":"end",Ee=D==oo||D==ta?"start":"end";return Q=this[ae+"Container"],le=this[ae+"Offset"],Oe=z[Ee+"Container"],it=z[Ee+"Offset"],Ze(Q,le,Oe,it)},insertNode:function(D){if(xt(this),Dt(D,tn),Un(this.startContainer),ze(D,this.startContainer))throw new se("HIERARCHY_REQUEST_ERR");var z=ge(D,this.startContainer,this.startOffset);this.setStartBefore(z)},cloneContents:function(){xt(this);var D,z;if(this.collapsed)return te(this).createDocumentFragment();if(this.startContainer===this.endContainer&&fe(this.startContainer))return D=this.startContainer.cloneNode(!0),D.data=D.data.slice(this.startOffset,this.endOffset),z=te(this).createDocumentFragment(),z.appendChild(D),z;var Q=new wt(this,!0);return D=et(Q),Q.detach(),D},canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var D=new wt(this,!0),z=D._first&&re(D._first,this)||D._last&&re(D._last,this);return D.detach(),!z},surroundContents:function(D){if(Dt(D,nn),!this.canSurroundContents())throw new se("INVALID_STATE_ERR");var z=this.extractContents();if(D.hasChildNodes())for(;D.lastChild;)D.removeChild(D.lastChild);ge(D,this.startContainer,this.startOffset),D.appendChild(z),this.selectNode(D)},cloneRange:function(){xt(this);for(var D=new $t(te(this)),z=ea.length,Q;z--;)Q=ea[z],D[Q]=this[Q];return D},toString:function(){xt(this);var D=this.startContainer;if(D===this.endContainer&&fe(D))return D.nodeType==3||D.nodeType==4?D.data.slice(this.startOffset,this.endOffset):"";var z=[],Q=new wt(this,!0);return nt(Q,function(le){(le.nodeType==3||le.nodeType==4)&&z.push(le.data)}),Q.detach(),z.join("")},compareNode:function(D){xt(this);var z=D.parentNode,Q=Ne(D);if(!z)throw new se("NOT_FOUND_ERR");var le=this.comparePoint(z,Q),Oe=this.comparePoint(z,Q+1);return le<0?Oe>0?_s:ao:Oe>0?ys:na},comparePoint:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)<0?-1:Ze(D,z,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:ms,toHtml:function(){return Ge(this)},intersectsNode:function(D,z){if(xt(this),j(D)!=oe(this))return!1;var Q=D.parentNode,le=Ne(D);if(!Q)return!0;var Oe=Ze(Q,le,this.endContainer,this.endOffset),it=Ze(Q,le+1,this.startContainer,this.startOffset);return z?Oe<=0&&it>=0:Oe<0&&it>0},isPointInRange:function(D,z){return xt(this),xn(D,"HIERARCHY_REQUEST_ERR"),Tr(D,this.startContainer),Ze(D,z,this.startContainer,this.startOffset)>=0&&Ze(D,z,this.endContainer,this.endOffset)<=0},intersectsRange:function(D){return st(this,D,!1)},intersectsOrTouchesRange:function(D){return st(this,D,!0)},intersection:function(D){if(this.intersectsRange(D)){var z=Ze(this.startContainer,this.startOffset,D.startContainer,D.startOffset),Q=Ze(this.endContainer,this.endOffset,D.endContainer,D.endOffset),le=this.cloneRange();return z==-1&&le.setStart(D.startContainer,D.startOffset),Q==1&&le.setEnd(D.endContainer,D.endOffset),le}return null},union:function(D){if(this.intersectsOrTouchesRange(D)){var z=this.cloneRange();return Ze(D.startContainer,D.startOffset,this.startContainer,this.startOffset)==-1&&z.setStart(D.startContainer,D.startOffset),Ze(D.endContainer,D.endOffset,this.endContainer,this.endOffset)==1&&z.setEnd(D.endContainer,D.endOffset),z}else throw new se("Ranges do not intersect")},containsNode:function(D,z){return z?this.intersectsNode(D,!1):this.compareNode(D)==na},containsNodeContents:function(D){return this.comparePoint(D,0)>=0&&this.comparePoint(D,P(D))<=0},containsRange:function(D){var z=this.intersection(D);return z!==null&&D.equals(z)},containsNodeText:function(D){var z=this.cloneRange();z.selectNode(D);var Q=z.getNodes([3]);if(Q.length>0){z.setStart(Q[0],0);var le=Q.pop();return z.setEnd(le,le.length),this.containsRange(z)}else return this.containsNodeContents(D)},getNodes:function(D,z){return xt(this),Ae(this,D,z)},getDocument:function(){return te(this)},collapseBefore:function(D){this.setEndBefore(D),this.collapse(!1)},collapseAfter:function(D){this.setStartAfter(D),this.collapse(!0)},getBookmark:function(D){var z=te(this),Q=$.createRange(z);D=D||_.getBody(z),Q.selectNodeContents(D);var le=this.intersection(Q),Oe=0,it=0;return le&&(Q.setEnd(le.startContainer,le.startOffset),Oe=Q.toString().length,it=Oe+le.toString().length),{start:Oe,end:it,containerNode:D}},moveToBookmark:function(D){var z=D.containerNode,Q=0;this.setStart(z,0),this.collapse(!0);for(var le=[z],Oe,it=!1,ae=!1,Ee,Ie,tt;!ae&&(Oe=le.pop());)if(Oe.nodeType==3)Ee=Q+Oe.length,!it&&D.start>=Q&&D.start<=Ee&&(this.setStart(Oe,D.start-Q),it=!0),it&&D.end>=Q&&D.end<=Ee&&(this.setEnd(Oe,D.end-Q),ae=!0),Q=Ee;else for(tt=Oe.childNodes,Ie=tt.length;Ie--;)le.push(tt[Ie])},getName:function(){return"DomRange"},equals:function(D){return $t.rangesEqual(this,D)},isValid:function(){return io(this)},inspect:function(){return dt(this)},detach:function(){}});function N(D){D.START_TO_START=ta,D.START_TO_END=oo,D.END_TO_END=Qu,D.END_TO_START=Pi,D.NODE_BEFORE=ao,D.NODE_AFTER=ys,D.NODE_BEFORE_AND_AFTER=_s,D.NODE_INSIDE=na}function W(D){N(D),N(D.prototype)}function ne(D,z){return function(){xt(this);var Q=this.startContainer,le=this.startOffset,Oe=this.commonAncestorContainer,it=new wt(this,!0),ae,Ee;Q!==Oe&&(ae=Ct(Q,Oe,!0),Ee=we(ae),Q=Ee.node,le=Ee.offset),nt(it,Un),it.reset();var Ie=D(it);return it.detach(),z(this,Q,le,Q,le),Ie}}function ye(D,z){function Q(ae,Ee){return function(Ie){Dt(Ie,Ft),Dt(j(Ie),Wn);var tt=(ae?Le:we)(Ie);(Ee?le:Oe)(this,tt.node,tt.offset)}}function le(ae,Ee,Ie){var tt=ae.endContainer,En=ae.endOffset;(Ee!==ae.startContainer||Ie!==ae.startOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==1)&&(tt=Ee,En=Ie),z(ae,Ee,Ie,tt,En))}function Oe(ae,Ee,Ie){var tt=ae.startContainer,En=ae.startOffset;(Ee!==ae.endContainer||Ie!==ae.endOffset)&&((j(Ee)!=j(tt)||Ze(Ee,Ie,tt,En)==-1)&&(tt=Ee,En=Ie),z(ae,tt,En,Ee,Ie))}var it=function(){};it.prototype=$.rangePrototype,D.prototype=new it,F.extend(D.prototype,{setStart:function(ae,Ee){Me(ae,!0),yt(ae,Ee),le(this,ae,Ee)},setEnd:function(ae,Ee){Me(ae,!0),yt(ae,Ee),Oe(this,ae,Ee)},setStartAndEnd:function(){var ae=arguments,Ee=ae[0],Ie=ae[1],tt=Ee,En=Ie;switch(ae.length){case 3:En=ae[2];break;case 4:tt=ae[2],En=ae[3];break}Me(Ee,!0),yt(Ee,Ie),Me(tt,!0),yt(tt,En),z(this,Ee,Ie,tt,En)},setBoundary:function(ae,Ee,Ie){this["set"+(Ie?"Start":"End")](ae,Ee)},setStartBefore:Q(!0,!0),setStartAfter:Q(!1,!0),setEndBefore:Q(!0,!1),setEndAfter:Q(!1,!1),collapse:function(ae){xt(this),ae?z(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):z(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(ae){Me(ae,!0),z(this,ae,0,ae,P(ae))},selectNode:function(ae){Me(ae,!1),Dt(ae,Ft);var Ee=Le(ae),Ie=we(ae);z(this,Ee.node,Ee.offset,Ie.node,Ie.offset)},extractContents:ne(ve,z),deleteContents:ne(en,z),canSurroundContents:function(){xt(this),Un(this.startContainer),Un(this.endContainer);var ae=new wt(this,!0),Ee=ae._first&&re(ae._first,this)||ae._last&&re(ae._last,this);return ae.detach(),!Ee},splitBoundaries:function(){Qo(this)},splitBoundariesPreservingPositions:function(ae){Qo(this,ae)},normalizeBoundaries:function(){xt(this);var ae=this.startContainer,Ee=this.startOffset,Ie=this.endContainer,tt=this.endOffset,En=function(Mn){var Wr=Mn.nextSibling;Wr&&Wr.nodeType==Mn.nodeType&&(Ie=Mn,tt=Mn.length,Mn.appendData(Wr.data),H(Wr))},Wx=function(Mn){var Wr=Mn.previousSibling;if(Wr&&Wr.nodeType==Mn.nodeType){ae=Mn;var e9=Mn.length;if(Ee=Wr.length,Mn.insertData(0,Wr.data),H(Wr),ae==Ie)tt+=Ee,Ie=ae;else if(Ie==Mn.parentNode){var Ux=Ne(Mn);tt==Ux?(Ie=Mn,tt=e9):tt>Ux&&tt--}}},Vp=!0,sr;if(fe(Ie))tt==Ie.length?En(Ie):tt==0&&(sr=Ie.previousSibling,sr&&sr.nodeType==Ie.nodeType&&(tt=sr.length,ae==Ie&&(Vp=!1),sr.appendData(Ie.data),H(Ie),Ie=sr));else{if(tt>0){var Xp=Ie.childNodes[tt-1];Xp&&fe(Xp)&&En(Xp)}Vp=!this.collapsed}if(Vp){if(fe(ae))Ee==0?Wx(ae):Ee==ae.length&&(sr=ae.nextSibling,sr&&sr.nodeType==ae.nodeType&&(Ie==sr&&(Ie=ae,tt+=ae.length),ae.appendData(sr.data),H(sr)));else if(Ee<ae.childNodes.length){var Gp=ae.childNodes[Ee];Gp&&fe(Gp)&&Wx(Gp)}}else ae=Ie,Ee=tt;z(this,ae,Ee,Ie,tt)},collapseToPoint:function(ae,Ee){Me(ae,!0),yt(ae,Ee),this.setStartAndEnd(ae,Ee)},parentElement:function(){xt(this);var ae=this.commonAncestorContainer;return ae?Xe(this.commonAncestorContainer,!0):null}}),W(D)}function Fe(D){D.collapsed=D.startContainer===D.endContainer&&D.startOffset===D.endOffset,D.commonAncestorContainer=D.collapsed?D.startContainer:_.getCommonAncestor(D.startContainer,D.endContainer)}function ft(D,z,Q,le,Oe){D.startContainer=z,D.startOffset=Q,D.endContainer=le,D.endOffset=Oe,D.document=_.getDocument(z),Fe(D)}function $t(D){ft(this,D,0,D,0)}ye($t,ft),F.extend($t,{rangeProperties:ea,RangeIterator:wt,copyComparisonConstants:W,createPrototypeRange:ye,inspect:dt,toHtml:Ge,getRangeDocument:te,rangesEqual:function(D,z){return D.startContainer===z.startContainer&&D.startOffset===z.startOffset&&D.endContainer===z.endContainer&&D.endOffset===z.endOffset}}),$.DomRange=$t}),A.createCoreModule("WrappedRange",["DomRange"],function($,w){var _,F,L=$.dom,se=$.util,fe=L.DomPosition,Ne=$.DomRange,ze=L.getBody,rt=L.getContentDocument,Ze=L.isCharacterDataNode;if($.features.implementsDomRange&&function(){var H,re=Ne.rangeProperties;function te(ve){for(var Ae=re.length,dt;Ae--;)dt=re[Ae],ve[dt]=ve.nativeRange[dt];ve.collapsed=ve.startContainer===ve.endContainer&&ve.startOffset===ve.endOffset}function oe(ve,Ae,dt,wt,Ft){var Wn=ve.startContainer!==Ae||ve.startOffset!=dt,bn=ve.endContainer!==wt||ve.endOffset!=Ft,tn=!ve.equals(ve.nativeRange);(Wn||bn||tn)&&(ve.setEnd(wt,Ft),ve.setStart(Ae,dt))}var Le;_=function(ve){if(!ve)throw w.createError("WrappedRange: Range must be specified");this.nativeRange=ve,te(this)},Ne.createPrototypeRange(_,oe),H=_.prototype,H.selectNode=function(ve){this.nativeRange.selectNode(ve),te(this)},H.cloneContents=function(){return this.nativeRange.cloneContents()},H.surroundContents=function(ve){this.nativeRange.surroundContents(ve),te(this)},H.collapse=function(ve){this.nativeRange.collapse(ve),te(this)},H.cloneRange=function(){return new _(this.nativeRange.cloneRange())},H.refresh=function(){te(this)},H.toString=function(){return this.nativeRange.toString()};var we=document.createTextNode("test");ze(document).appendChild(we);var ge=document.createRange();ge.setStart(we,0),ge.setEnd(we,0);try{ge.setStart(we,1),H.setStart=function(ve,Ae){this.nativeRange.setStart(ve,Ae),te(this)},H.setEnd=function(ve,Ae){this.nativeRange.setEnd(ve,Ae),te(this)},Le=function(ve){return function(Ae){this.nativeRange[ve](Ae),te(this)}}}catch{H.setStart=function(Ae,dt){try{this.nativeRange.setStart(Ae,dt)}catch{this.nativeRange.setEnd(Ae,dt),this.nativeRange.setStart(Ae,dt)}te(this)},H.setEnd=function(Ae,dt){try{this.nativeRange.setEnd(Ae,dt)}catch{this.nativeRange.setStart(Ae,dt),this.nativeRange.setEnd(Ae,dt)}te(this)},Le=function(Ae,dt){return function(wt){try{this.nativeRange[Ae](wt)}catch{this.nativeRange[dt](wt),this.nativeRange[Ae](wt)}te(this)}}}H.setStartBefore=Le("setStartBefore","setEndBefore"),H.setStartAfter=Le("setStartAfter","setEndAfter"),H.setEndBefore=Le("setEndBefore","setStartBefore"),H.setEndAfter=Le("setEndAfter","setStartAfter"),H.selectNodeContents=function(ve){this.setStartAndEnd(ve,0,L.getNodeLength(ve))},ge.selectNodeContents(we),ge.setEnd(we,3);var st=document.createRange();st.selectNodeContents(we),st.setEnd(we,4),st.setStart(we,2),ge.compareBoundaryPoints(ge.START_TO_END,st)==-1&&ge.compareBoundaryPoints(ge.END_TO_START,st)==1?H.compareBoundaryPoints=function(ve,Ae){return Ae=Ae.nativeRange||Ae,ve==Ae.START_TO_END?ve=Ae.END_TO_START:ve==Ae.END_TO_START&&(ve=Ae.START_TO_END),this.nativeRange.compareBoundaryPoints(ve,Ae)}:H.compareBoundaryPoints=function(ve,Ae){return this.nativeRange.compareBoundaryPoints(ve,Ae.nativeRange||Ae)};var et=document.createElement("div");et.innerHTML="123";var nt=et.firstChild,en=ze(document);en.appendChild(et),ge.setStart(nt,1),ge.setEnd(nt,2),ge.deleteContents(),nt.data=="13"&&(H.deleteContents=function(){this.nativeRange.deleteContents(),te(this)},H.extractContents=function(){var ve=this.nativeRange.extractContents();return te(this),ve}),en.removeChild(et),en=null,se.isHostMethod(ge,"createContextualFragment")&&(H.createContextualFragment=function(ve){return this.nativeRange.createContextualFragment(ve)}),ze(document).removeChild(we),H.getName=function(){return"WrappedRange"},$.WrappedRange=_,$.createNativeRange=function(ve){return ve=rt(ve,w,"createNativeRange"),ve.createRange()}}(),$.features.implementsTextRange){var at=function(H){var re=H.parentElement(),te=H.duplicate();te.collapse(!0);var oe=te.parentElement();te=H.duplicate(),te.collapse(!1);var Le=te.parentElement(),we=oe==Le?oe:L.getCommonAncestor(oe,Le);return we==re?we:L.getCommonAncestor(re,we)},Ct=function(H){return H.compareEndPoints("StartToEnd",H)==0},P=function(H,re,te,oe,Le){var we=H.duplicate();we.collapse(te);var ge=we.parentElement();if(L.isOrIsAncestorOf(re,ge)||(ge=re),!ge.canHaveHTML){var st=new fe(ge.parentNode,L.getNodeIndex(ge));return{boundaryPosition:st,nodeInfo:{nodeIndex:st.offset,containerElement:st.node}}}var et=L.getDocument(ge).createElement("span");et.parentNode&&L.removeNode(et);for(var nt,en=te?"StartToStart":"StartToEnd",ve,Ae,dt,wt,Ft=Le&&Le.containerElement==ge?Le.nodeIndex:0,Wn=ge.childNodes.length,bn=Wn,tn=bn;tn==Wn?ge.appendChild(et):ge.insertBefore(et,ge.childNodes[tn]),we.moveToElementText(et),nt=we.compareEndPoints(en,H),!(nt==0||Ft==bn);){if(nt==-1){if(bn==Ft+1)break;Ft=tn}else bn=bn==Ft+1?Ft:tn;tn=Math.floor((Ft+bn)/2),ge.removeChild(et)}if(wt=et.nextSibling,nt==-1&&wt&&Ze(wt)){we.setEndPoint(te?"EndToStart":"EndToEnd",H);var nn;if(/[\r\n]/.test(wt.data)){var cn=we.duplicate(),Nn=cn.text.replace(/\r\n/g,"\r").length;for(nn=cn.moveStart("character",Nn);(nt=cn.compareEndPoints("StartToEnd",cn))==-1;)nn++,cn.moveStart("character",1)}else nn=we.text.length;dt=new fe(wt,nn)}else ve=(oe||!te)&&et.previousSibling,Ae=(oe||te)&&et.nextSibling,Ae&&Ze(Ae)?dt=new fe(Ae,0):ve&&Ze(ve)?dt=new fe(ve,ve.data.length):dt=new fe(ge,L.getNodeIndex(et));return L.removeNode(et),{boundaryPosition:dt,nodeInfo:{nodeIndex:tn,containerElement:ge}}},I=function(H,re){var te,oe,Le=H.offset,we=L.getDocument(H.node),ge,st,et=ze(we).createTextRange(),nt=Ze(H.node);return nt?(te=H.node,oe=te.parentNode):(st=H.node.childNodes,te=Le<st.length?st[Le]:null,oe=H.node),ge=we.createElement("span"),ge.innerHTML="&#feff;",te?oe.insertBefore(ge,te):oe.appendChild(ge),et.moveToElementText(ge),et.collapse(!re),oe.removeChild(ge),nt&&et[re?"moveStart":"moveEnd"]("character",Le),et};F=function(H){this.textRange=H,this.refresh()},F.prototype=new Ne(document),F.prototype.refresh=function(){var H,re,te,oe=at(this.textRange);Ct(this.textRange)?re=H=P(this.textRange,oe,!0,!0).boundaryPosition:(te=P(this.textRange,oe,!0,!1),H=te.boundaryPosition,re=P(this.textRange,oe,!1,!1,te.nodeInfo).boundaryPosition),this.setStart(H.node,H.offset),this.setEnd(re.node,re.offset)},F.prototype.getName=function(){return"WrappedTextRange"},Ne.copyComparisonConstants(F);var j=function(H){if(H.collapsed)return I(new fe(H.startContainer,H.startOffset),!0);var re=I(new fe(H.startContainer,H.startOffset),!0),te=I(new fe(H.endContainer,H.endOffset),!1),oe=ze(Ne.getRangeDocument(H)).createTextRange();return oe.setEndPoint("StartToStart",re),oe.setEndPoint("EndToEnd",te),oe};if(F.rangeToTextRange=j,F.prototype.toTextRange=function(){return j(this)},$.WrappedTextRange=F,!$.features.implementsDomRange||$.config.preferTextRange){var q=function(H){return H("return this;")()}(Function);typeof q.Range>"u"&&(q.Range=F),$.createNativeRange=function(H){return H=rt(H,w,"createNativeRange"),ze(H).createTextRange()},$.WrappedRange=F}}$.createRange=function(H){return H=rt(H,w,"createRange"),new $.WrappedRange($.createNativeRange(H))},$.createRangyRange=function(H){return H=rt(H,w,"createRangyRange"),new Ne(H)},se.createAliasForDeprecatedMethod($,"createIframeRange","createRange"),se.createAliasForDeprecatedMethod($,"createIframeRangyRange","createRangyRange"),$.addShimListener(function(H){var re=H.document;typeof re.createRange>"u"&&(re.createRange=function(){return $.createRange(re)}),re=H=null})}),A.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function($,w){$.config.checkSelectionRanges=!0;var _="boolean",F="number",L=$.dom,se=$.util,fe=se.isHostMethod,Ne=$.DomRange,ze=$.WrappedRange,rt=$.DOMException,Ze=L.DomPosition,at,Ct,P=$.features,I="Control",j=L.getDocument,q=L.getBody,H=Ne.rangesEqual;function re(N){return typeof N=="string"?/^backward(s)?$/i.test(N):!!N}function te(N,W){if(N){if(L.isWindow(N))return N;if(N instanceof xt)return N.win;var ne=L.getContentDocument(N,w,W);return L.getWindow(ne)}else return window}function oe(N){return te(N,"getWinSelection").getSelection()}function Le(N){return te(N,"getDocSelection").document.selection}function we(N){var W=!1;return N.anchorNode&&(W=L.comparePoints(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset)==1),W}var ge=fe(window,"getSelection"),st=se.isHostObject(document,"selection");P.implementsWinGetSelection=ge,P.implementsDocSelection=st;var et=st&&(!ge||$.config.preferTextRange);if(et)at=Le,$.isSelectionValid=function(N){var W=te(N,"isSelectionValid").document,ne=W.selection;return ne.type!="None"||j(ne.createRange().parentElement())==W};else if(ge)at=oe,$.isSelectionValid=function(){return!0};else return w.fail("Neither document.selection or window.getSelection() detected."),!1;$.getNativeSelection=at;var nt=at();if(!nt)return w.fail("Native selection was null (possibly issue 138?)"),!1;var en=$.createNativeRange(document),ve=q(document),Ae=se.areHostProperties(nt,["anchorNode","focusNode","anchorOffset","focusOffset"]);P.selectionHasAnchorAndFocus=Ae;var dt=fe(nt,"extend");P.selectionHasExtend=dt;var wt=fe(nt,"setBaseAndExtent");P.selectionHasSetBaseAndExtent=wt;var Ft=typeof nt.rangeCount==F;P.selectionHasRangeCount=Ft;var Wn=!1,bn=!0,tn=dt?function(N,W){var ne=Ne.getRangeDocument(W),ye=$.createRange(ne);ye.collapseToPoint(W.endContainer,W.endOffset),N.addRange(Me(ye)),N.extend(W.startContainer,W.startOffset)}:null;se.areHostMethods(nt,["addRange","getRangeAt","removeAllRanges"])&&typeof nt.rangeCount==F&&P.implementsDomRange&&function(){var N=window.getSelection();if(N){for(var W=N.rangeCount,ne=W>1,ye=[],Fe=we(N),ft=0;ft<W;++ft)ye[ft]=N.getRangeAt(ft);var $t=L.createTestElement(document,"",!1),D=$t.appendChild(document.createTextNode("   ")),z=document.createRange();if(z.setStart(D,1),z.collapse(!0),N.removeAllRanges(),N.addRange(z),bn=N.rangeCount==1,N.removeAllRanges(),!ne){var Q=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(Q&&parseInt(Q[1])>=36)Wn=!1;else{var le=z.cloneRange();z.setStart(D,0),le.setEnd(D,3),le.setStart(D,2),N.addRange(z),N.addRange(le),Wn=N.rangeCount==2}}for(L.removeNode($t),N.removeAllRanges(),ft=0;ft<W;++ft)ft==0&&Fe?tn?tn(N,ye[ft]):($.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),N.addRange(ye[ft])):N.addRange(ye[ft])}}(),P.selectionSupportsMultipleRanges=Wn,P.collapsedNonEditableSelectionsSupported=bn;var nn=!1,cn;ve&&fe(ve,"createControlRange")&&(cn=ve.createControlRange(),se.areHostProperties(cn,["item","add"])&&(nn=!0)),P.implementsControlRange=nn,Ae?Ct=function(N){return N.anchorNode===N.focusNode&&N.anchorOffset===N.focusOffset}:Ct=function(N){return N.rangeCount?N.getRangeAt(N.rangeCount-1).collapsed:!1};function Nn(N,W,ne){var ye=ne?"end":"start",Fe=ne?"start":"end";N.anchorNode=W[ye+"Container"],N.anchorOffset=W[ye+"Offset"],N.focusNode=W[Fe+"Container"],N.focusOffset=W[Fe+"Offset"]}function Y(N){var W=N.nativeSelection;N.anchorNode=W.anchorNode,N.anchorOffset=W.anchorOffset,N.focusNode=W.focusNode,N.focusOffset=W.focusOffset}function ue(N){N.anchorNode=N.focusNode=null,N.anchorOffset=N.focusOffset=0,N.rangeCount=0,N.isCollapsed=!0,N._ranges.length=0,Xe(N)}function Xe(N){N.type=N.rangeCount==0?"None":Ct(N)?"Caret":"Range"}function Me(N){var W;return N instanceof Ne?(W=$.createNativeRange(N.getDocument()),W.setEnd(N.endContainer,N.endOffset),W.setStart(N.startContainer,N.startOffset)):N instanceof ze?W=N.nativeRange:P.implementsDomRange&&N instanceof L.getWindow(N.startContainer).Range&&(W=N),W}function Dt(N){if(!N.length||N[0].nodeType!=1)return!1;for(var W=1,ne=N.length;W<ne;++W)if(!L.isAncestorOf(N[0],N[W]))return!1;return!0}function yt(N){var W=N.getNodes();if(!Dt(W))throw w.createError("getSingleElementFromRange: range "+N.inspect()+" did not consist of a single element");return W[0]}function Tr(N){return!!N&&typeof N.text<"u"}function Un(N,W){var ne=new ze(W);N._ranges=[ne],Nn(N,ne,!1),N.rangeCount=1,N.isCollapsed=ne.collapsed,Xe(N)}function xn(N){if(N._ranges.length=0,N.docSelection.type=="None")ue(N);else{var W=N.docSelection.createRange();if(Tr(W))Un(N,W);else{N.rangeCount=W.length;for(var ne,ye=j(W.item(0)),Fe=0;Fe<N.rangeCount;++Fe)ne=$.createRange(ye),ne.selectNode(W.item(Fe)),N._ranges.push(ne);N.isCollapsed=N.rangeCount==1&&N._ranges[0].collapsed,Nn(N,N._ranges[N.rangeCount-1],!1),Xe(N)}}}function gs(N,W){for(var ne=N.docSelection.createRange(),ye=yt(W),Fe=j(ne.item(0)),ft=q(Fe).createControlRange(),$t=0,D=ne.length;$t<D;++$t)ft.add(ne.item($t));try{ft.add(ye)}catch{throw w.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}ft.select(),xn(N)}var io;fe(nt,"getRangeAt")?io=function(N,W){try{return N.getRangeAt(W)}catch{return null}}:Ae&&(io=function(N){var W=j(N.anchorNode),ne=$.createRange(W);return ne.setStartAndEnd(N.anchorNode,N.anchorOffset,N.focusNode,N.focusOffset),ne.collapsed!==this.isCollapsed&&ne.setStartAndEnd(N.focusNode,N.focusOffset,N.anchorNode,N.anchorOffset),ne});function xt(N,W,ne){this.nativeSelection=N,this.docSelection=W,this._ranges=[],this.win=ne,this.refresh()}xt.prototype=$.selectionPrototype;function vs(N){N.win=N.anchorNode=N.focusNode=N._ranges=null,N.rangeCount=N.anchorOffset=N.focusOffset=0,N.detached=!0,Xe(N)}var oi=[];function ms(N,W){for(var ne=oi.length,ye,Fe;ne--;)if(ye=oi[ne],Fe=ye.selection,W=="deleteAll")vs(Fe);else if(ye.win==N)return W=="delete"?(oi.splice(ne,1),!0):Fe;return W=="deleteAll"&&(oi.length=0),null}var Qo=function(N){if(N&&N instanceof xt)return N.refresh(),N;N=te(N,"getNativeSelection");var W=ms(N),ne=at(N),ye=st?Le(N):null;return W?(W.nativeSelection=ne,W.docSelection=ye,W.refresh()):(W=new xt(ne,ye,N),oi.push({win:N,selection:W})),W};$.getSelection=Qo,se.createAliasForDeprecatedMethod($,"getIframeSelection","getSelection");var Ge=xt.prototype;function ea(N,W){for(var ne=j(W[0].startContainer),ye=q(ne).createControlRange(),Fe=0,ft,$t=W.length;Fe<$t;++Fe){ft=yt(W[Fe]);try{ye.add(ft)}catch{throw w.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}ye.select(),xn(N)}if(!et&&Ae&&se.areHostMethods(nt,["removeAllRanges","addRange"])){Ge.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),ue(this)};var ta=function(N,W){tn(N.nativeSelection,W),N.refresh()};Ft?Ge.addRange=function(N,W){if(nn&&st&&this.docSelection.type==I)gs(this,N);else if(re(W)&&dt)ta(this,N);else{var ne;Wn?ne=this.rangeCount:(this.removeAllRanges(),ne=0);var ye=Me(N).cloneRange();try{this.nativeSelection.addRange(ye)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==ne+1){if($.config.checkSelectionRanges){var Fe=io(this.nativeSelection,this.rangeCount-1);Fe&&!H(Fe,N)&&(N=new ze(Fe))}this._ranges[this.rangeCount-1]=N,Nn(this,N,Pi(this.nativeSelection)),this.isCollapsed=Ct(this),Xe(this)}else this.refresh()}}:Ge.addRange=function(N,W){re(W)&&dt?ta(this,N):(this.nativeSelection.addRange(Me(N)),this.refresh())},Ge.setRanges=function(N){if(nn&&st&&N.length>1)ea(this,N);else{this.removeAllRanges();for(var W=0,ne=N.length;W<ne;++W)this.addRange(N[W])}}}else if(fe(nt,"empty")&&fe(en,"select")&&nn&&et)Ge.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var N;if(this.anchorNode)N=j(this.anchorNode);else if(this.docSelection.type==I){var W=this.docSelection.createRange();W.length&&(N=j(W.item(0)))}if(N){var ne=q(N).createTextRange();ne.select(),this.docSelection.empty()}}}catch{}ue(this)},Ge.addRange=function(N){this.docSelection.type==I?gs(this,N):($.WrappedTextRange.rangeToTextRange(N).select(),this._ranges[0]=N,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,Nn(this,N,!1),Xe(this))},Ge.setRanges=function(N){this.removeAllRanges();var W=N.length;W>1?ea(this,N):W&&this.addRange(N[0])};else return w.fail("No means of selecting a Range or TextRange was found"),!1;Ge.getRangeAt=function(N){if(N<0||N>=this.rangeCount)throw new rt("INDEX_SIZE_ERR");return this._ranges[N].cloneRange()};var oo;if(et)oo=function(N){var W;$.isSelectionValid(N.win)?W=N.docSelection.createRange():(W=q(N.win.document).createTextRange(),W.collapse(!0)),N.docSelection.type==I?xn(N):Tr(W)?Un(N,W):ue(N)};else if(fe(nt,"getRangeAt")&&typeof nt.rangeCount==F)oo=function(N){if(nn&&st&&N.docSelection.type==I)xn(N);else if(N._ranges.length=N.rangeCount=N.nativeSelection.rangeCount,N.rangeCount){for(var W=0,ne=N.rangeCount;W<ne;++W)N._ranges[W]=new $.WrappedRange(N.nativeSelection.getRangeAt(W));Nn(N,N._ranges[N.rangeCount-1],Pi(N.nativeSelection)),N.isCollapsed=Ct(N),Xe(N)}else ue(N)};else if(Ae&&typeof nt.isCollapsed==_&&typeof en.collapsed==_&&P.implementsDomRange)oo=function(N){var W,ne=N.nativeSelection;ne.anchorNode?(W=io(ne,0),N._ranges=[W],N.rangeCount=1,Y(N),N.isCollapsed=Ct(N),Xe(N)):ue(N)};else return w.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;Ge.refresh=function(N){var W=N?this._ranges.slice(0):null,ne=this.anchorNode,ye=this.anchorOffset;if(oo(this),N){var Fe=W.length;if(Fe!=this._ranges.length||this.anchorNode!=ne||this.anchorOffset!=ye)return!0;for(;Fe--;)if(!H(W[Fe],this._ranges[Fe]))return!0;return!1}};var Qu=function(N,W){var ne=N.getAllRanges();N.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)H(W,ne[ye])||N.addRange(ne[ye]);N.rangeCount||ue(N)};nn&&st?Ge.removeRange=function(N){if(this.docSelection.type==I){for(var W=this.docSelection.createRange(),ne=yt(N),ye=j(W.item(0)),Fe=q(ye).createControlRange(),ft,$t=!1,D=0,z=W.length;D<z;++D)ft=W.item(D),ft!==ne||$t?Fe.add(W.item(D)):$t=!0;Fe.select(),xn(this)}else Qu(this,N)}:Ge.removeRange=function(N){Qu(this,N)};var Pi;!et&&Ae&&P.implementsDomRange?(Pi=we,Ge.isBackward=function(){return Pi(this)}):Pi=Ge.isBackward=function(){return!1},Ge.isBackwards=Ge.isBackward,Ge.toString=function(){for(var N=[],W=0,ne=this.rangeCount;W<ne;++W)N[W]=""+this._ranges[W];return N.join("")};function ao(N,W){if(N.win.document!=j(W))throw new rt("WRONG_DOCUMENT_ERR")}function ys(N,W){if(W<0||W>(L.isCharacterDataNode(N)?N.length:N.childNodes.length))throw new rt("INDEX_SIZE_ERR")}Ge.collapse=function(N,W){ao(this,N);var ne=$.createRange(N);ne.collapseToPoint(N,W),this.setSingleRange(ne),this.isCollapsed=!0},Ge.collapseToStart=function(){if(this.rangeCount){var N=this._ranges[0];this.collapse(N.startContainer,N.startOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.collapseToEnd=function(){if(this.rangeCount){var N=this._ranges[this.rangeCount-1];this.collapse(N.endContainer,N.endOffset)}else throw new rt("INVALID_STATE_ERR")},Ge.selectAllChildren=function(N){ao(this,N);var W=$.createRange(N);W.selectNodeContents(N),this.setSingleRange(W)},wt?Ge.setBaseAndExtent=function(N,W,ne,ye){this.nativeSelection.setBaseAndExtent(N,W,ne,ye),this.refresh()}:dt&&(Ge.setBaseAndExtent=function(N,W,ne,ye){ys(N,W),ys(ne,ye),ao(this,N),ao(this,ne);var Fe=$.createRange(node),ft=L.comparePoints(N,W,ne,ye)==-1;ft?Fe.setStartAndEnd(ne,ye,N,W):Fe.setStartAndEnd(N,W,ne,ye),this.setSingleRange(Fe,ft)}),Ge.deleteFromDocument=function(){if(nn&&st&&this.docSelection.type==I){for(var N=this.docSelection.createRange(),W;N.length;)W=N.item(0),N.remove(W),L.removeNode(W);this.refresh()}else if(this.rangeCount){var ne=this.getAllRanges();if(ne.length){this.removeAllRanges();for(var ye=0,Fe=ne.length;ye<Fe;++ye)ne[ye].deleteContents();this.addRange(ne[Fe-1])}}},Ge.eachRange=function(N,W){for(var ne=0,ye=this._ranges.length;ne<ye;++ne)if(N(this.getRangeAt(ne)))return W},Ge.getAllRanges=function(){var N=[];return this.eachRange(function(W){N.push(W)}),N},Ge.setSingleRange=function(N,W){this.removeAllRanges(),this.addRange(N,W)},Ge.callMethodOnEachRange=function(N,W){var ne=[];return this.eachRange(function(ye){ne.push(ye[N].apply(ye,W||[]))}),ne};function _s(N){return function(W,ne){var ye;this.rangeCount?(ye=this.getRangeAt(0),ye["set"+(N?"Start":"End")](W,ne)):(ye=$.createRange(this.win.document),ye.setStartAndEnd(W,ne)),this.setSingleRange(ye,this.isBackward())}}Ge.setStart=_s(!0),Ge.setEnd=_s(!1),$.rangePrototype.select=function(N){Qo(this.getDocument()).setSingleRange(this,N)},Ge.changeEachRange=function(N){var W=[],ne=this.isBackward();this.eachRange(function(ye){N(ye),W.push(ye)}),this.removeAllRanges(),ne&&W.length==1?this.addRange(W[0],"backward"):this.setRanges(W)},Ge.containsNode=function(N,W){return this.eachRange(function(ne){return ne.containsNode(N,W)},!0)||!1},Ge.getBookmark=function(N){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[N])}},Ge.moveToBookmark=function(N){for(var W=[],ne=0,ye,Fe;ye=N.rangeBookmarks[ne++];)Fe=$.createRange(this.win),Fe.moveToBookmark(ye),W.push(Fe);N.backward?this.setSingleRange(W[0],"backward"):this.setRanges(W)},Ge.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},Ge.restoreRanges=function(N){this.removeAllRanges();for(var W=0,ne;ne=N.ranges[W];++W)this.addRange(ne,N.backward&&W==0)},Ge.toHtml=function(){var N=[];return this.eachRange(function(W){N.push(Ne.toHtml(W))}),N.join("")},P.implementsTextRange&&(Ge.getNativeTextRange=function(){var N;if(N=this.docSelection){var W=N.createRange();if(Tr(W))return W;throw w.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return $.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw w.createError("getNativeTextRange: selection contains no range")}});function na(N){var W=[],ne=new Ze(N.anchorNode,N.anchorOffset),ye=new Ze(N.focusNode,N.focusOffset),Fe=typeof N.getName=="function"?N.getName():"Selection";if(typeof N.rangeCount<"u")for(var ft=0,$t=N.rangeCount;ft<$t;++ft)W[ft]=Ne.inspect(N.getRangeAt(ft));return"["+Fe+"(Ranges: "+W.join(", ")+")(anchor: "+ne.inspect()+", focus: "+ye.inspect()+"]"}Ge.getName=function(){return"WrappedSelection"},Ge.inspect=function(){return na(this)},Ge.detach=function(){ms(this.win,"delete"),vs(this)},xt.detachAll=function(){ms(null,"deleteAll")},xt.inspect=na,xt.isDirectionBackward=re,$.Selection=xt,$.selectionPrototype=Ge,$.addShimListener(function(N){typeof N.getSelection>"u"&&(N.getSelection=function(){return Qo(N)}),N=null})});var he=!1,Ve=function($){he||(he=!0,!A.initialized&&A.config.autoInitialize&&B())};return b&&(document.readyState=="complete"?Ve():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",Ve,!1),J(window,"load",Ve))),A})}(yp)),yp.exports}var QF=W0();const U0=cl(QF);var _p={exports:{}},V0;function e5(){return V0||(V0=1,function(t,e){(function(n,r){t.exports=n(W0())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(r,i){var o=r.dom,a=o.DomPosition,s=o.arrayContains,l=r.util,u=l.forEach,c="span",d=l.isHostMethod(document,"createElementNS");function f(P,I){for(var j in P)if(P.hasOwnProperty(j)&&I(j,P[j])===!1)return!1;return!0}function h(P){return P.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function v(P,I){return!!P&&new RegExp("(?:^|\\s)"+I+"(?:\\s|$)").test(P)}function g(P,I){if(typeof P.classList=="object")return P.classList.contains(I);var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");return v(q,I)}function m(P,I){if(typeof P.classList=="object")P.classList.add(I);else{var j=typeof P.className=="string",q=j?P.className:P.getAttribute("class");q?v(q,I)||(q+=" "+I):q=I,j?P.className=q:P.setAttribute("class",q)}}var y=function(){function P(I,j,q){return j&&q?" ":""}return function(I,j){if(typeof I.classList=="object")I.classList.remove(j);else{var q=typeof I.className=="string",H=q?I.className:I.getAttribute("class");H=H.replace(new RegExp("(^|\\s)"+j+"(\\s|$)"),P),q?I.className=H:I.setAttribute("class",H)}}}();function x(P){var I=typeof P.className=="string";return I?P.className:P.getAttribute("class")}function E(P){return P&&P.split(/\s+/).sort().join(" ")}function b(P){return E(x(P))}function T(P,I){return b(P)==b(I)}function A(P,I){for(var j=I.split(/\s+/),q=0,H=j.length;q<H;++q)if(!g(P,h(j[q])))return!1;return!0}function S(P){var I=P.parentNode;return I&&I.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(I.nodeName)}function M(P,I,j,q,H){var re=P.node,te=P.offset,oe=re,Le=te;re==q&&te>H&&++Le,re==I&&(te==j||te==j+1)&&(oe=q,Le+=H-j),re==I&&te>j+1&&--Le,P.node=oe,P.offset=Le}function C(P,I,j){P.node==I&&P.offset>j&&--P.offset}function G(P,I,j,q){j==-1&&(j=I.childNodes.length);var H=P.parentNode,re=o.getNodeIndex(P);u(q,function(te){M(te,H,re,I,j)}),I.childNodes.length==j?I.appendChild(P):I.insertBefore(P,I.childNodes[j])}function K(P,I){var j=P.parentNode,q=o.getNodeIndex(P);u(I,function(H){C(H,j,q)}),o.removeNode(P)}function J(P,I,j,q,H){for(var re,te=[];re=P.firstChild;)G(re,I,j++,H),te.push(re);return K(P,H),te}function R(P,I){return J(P,P.parentNode,o.getNodeIndex(P),!0,I)}function k(P,I){var j=P.cloneRange();j.selectNodeContents(I);var q=j.intersection(P),H=q?q.toString():"";return H!=""}function B(P){for(var I=P.getNodes([3]),j=0,q;(q=I[j])&&!k(P,q);)++j;for(var H=I.length-1;(q=I[H])&&!k(P,q);)--H;return I.slice(j,H+1)}function Z(P,I){if(P.attributes.length!=I.attributes.length)return!1;for(var j=0,q=P.attributes.length,H,re,te;j<q;++j)if(H=P.attributes[j],te=H.name,te!="class"&&(re=I.attributes.getNamedItem(te),H===null!=(re===null)||H.specified!=re.specified||H.specified&&H.nodeValue!==re.nodeValue))return!1;return!0}function ee(P,I){for(var j=0,q=P.attributes.length,H;j<q;++j)if(H=P.attributes[j].name,!(I&&s(I,H))&&P.attributes[j].specified&&H!="class")return!0;return!1}var ce=o.getComputedStyleProperty,Be=function(){var P=document.createElement("div");return typeof P.isContentEditable=="boolean"?function(I){return I&&I.nodeType==1&&I.isContentEditable}:function(I){return!I||I.nodeType!=1||I.contentEditable=="false"?!1:I.contentEditable=="true"||Be(I.parentNode)}}();function me(P){var I;return P&&P.nodeType==1&&((I=P.parentNode)&&I.nodeType==9&&I.designMode=="on"||Be(P)&&!Be(P.parentNode))}function de(P){return(Be(P)||P.nodeType!=1&&Be(P.parentNode))&&!me(P)}var Se=/^inline(-block|-table)?$/i;function je(P){return P&&P.nodeType==1&&!Se.test(ce(P,"display"))}var he=/[^\r\n\t\f \u200B]/;function Ve(P){if(P.data.length==0)return!0;if(he.test(P.data))return!1;var I=ce(P.parentNode,"whiteSpace");switch(I){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(P.data))return!1}return je(P.previousSibling)||je(P.nextSibling)}function $(P){var I=[],j,q;for(j=0;q=P[j++];)I.push(new a(q.startContainer,q.startOffset),new a(q.endContainer,q.endOffset));return I}function w(P,I){for(var j=0,q,H,re,te=P.length;j<te;++j)q=P[j],H=I[j*2],re=I[j*2+1],q.setStartAndEnd(H.node,H.offset,re.node,re.offset)}function _(P,I){return o.isCharacterDataNode(P)?I==0?!!P.previousSibling:I==P.length?!!P.nextSibling:!0:I>0&&I<P.childNodes.length}function F(P,I,j,q){var H,re,te=j==0;if(o.isAncestorOf(I,P))return P;if(o.isCharacterDataNode(I)){var oe=o.getNodeIndex(I);if(j==0)j=oe;else if(j==I.length)j=oe+1;else throw i.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+j+" in "+I.data);I=I.parentNode}if(_(I,j)){H=I.cloneNode(!1),re=I.parentNode,H.id&&H.removeAttribute("id");for(var Le,we=0;Le=I.childNodes[j];)G(Le,H,we++,q);return G(H,re,o.getNodeIndex(I)+1,q),I==P?H:F(P,re,o.getNodeIndex(H),q)}else if(P!=I){H=I.parentNode;var ge=o.getNodeIndex(I);return te||ge++,F(P,H,ge,q)}return P}function L(P,I){return P.namespaceURI==I.namespaceURI&&P.tagName.toLowerCase()==I.tagName.toLowerCase()&&T(P,I)&&Z(P,I)&&ce(P,"display")=="inline"&&ce(I,"display")=="inline"}function se(P){var I=P?"nextSibling":"previousSibling";return function(j,q){var H=j.parentNode,re=j[I];if(re){if(re&&re.nodeType==3)return re}else if(q&&(re=H[I],re&&re.nodeType==1&&L(H,re))){var te=re[P?"firstChild":"lastChild"];if(te&&te.nodeType==3)return te}return null}}var fe=se(!1),Ne=se(!0);function ze(P){this.isElementMerge=P.nodeType==1,this.textNodes=[];var I=this.isElementMerge?P.lastChild:P;I&&(this.textNodes[0]=I)}ze.prototype={doMerge:function(P){var I=this.textNodes,j=I[0];if(I.length>1){var q=o.getNodeIndex(j),H=[],re=0,te;u(I,function(oe,Le){te=oe.parentNode,Le>0&&(te.removeChild(oe),te.hasChildNodes()||o.removeNode(te),P&&u(P,function(we){we.node==oe&&(we.node=j,we.offset+=re),we.node==te&&we.offset>q&&(--we.offset,we.offset==q+1&&Le<I.length-1&&(we.node=j,we.offset=re))})),H[Le]=oe.data,re+=oe.data.length}),j.data=H.join("")}return j.data},getLength:function(){for(var P=this.textNodes.length,I=0;P--;)I+=this.textNodes[P].length;return I},toString:function(){var P=[];return u(this.textNodes,function(I,j){P[j]="'"+I.data+"'"}),"[Merge("+P.join(",")+")]"}};var rt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],Ze={};function at(P,I,j){var q,H,re,te,oe=this;oe.cssClass=oe.className=P;var Le=null,we={};if(typeof I=="object"&&I!==null){for(typeof I.elementTagName<"u"&&(I.elementTagName=I.elementTagName.toLowerCase()),j=I.tagNames,Le=I.elementProperties,we=I.elementAttributes,H=0;te=rt[H++];)I.hasOwnProperty(te)&&(oe[te]=I[te]);q=I.normalize}else q=I;oe.normalize=typeof q>"u"?!0:q,oe.attrExceptions=[];var ge=document.createElement(oe.elementTagName);oe.elementProperties=oe.copyPropertiesToElement(Le,ge,!0),f(we,function(et,nt){oe.attrExceptions.push(et),we[et]=""+nt}),oe.elementAttributes=we,oe.elementSortedClassName=oe.elementProperties.hasOwnProperty("className")?E(oe.elementProperties.className+" "+P):P,oe.applyToAnyTagName=!1;var st=typeof j;if(st=="string")j=="*"?oe.applyToAnyTagName=!0:oe.tagNames=h(j.toLowerCase()).split(/\s*,\s*/);else if(st=="object"&&typeof j.length=="number")for(oe.tagNames=[],H=0,re=j.length;H<re;++H)j[H]=="*"?oe.applyToAnyTagName=!0:oe.tagNames.push(j[H].toLowerCase());else oe.tagNames=[oe.elementTagName]}at.prototype={elementTagName:c,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(P,I,j){var q,H,re={},te,oe,Le,we;for(var ge in P)if(P.hasOwnProperty(ge))if(oe=P[ge],Le=I[ge],ge=="className")m(I,oe),m(I,this.className),I[ge]=E(I[ge]),j&&(re[ge]=oe);else if(ge=="style"){H=Le,j&&(re[ge]=te={});for(q in P[ge])P[ge].hasOwnProperty(q)&&(H[q]=oe[q],j&&(te[q]=H[q]));this.attrExceptions.push(ge)}else I[ge]=oe,j&&(re[ge]=I[ge],we=Ze.hasOwnProperty(ge)?Ze[ge]:ge,this.attrExceptions.push(we));return j?re:""},copyAttributesToElement:function(P,I){for(var j in P)P.hasOwnProperty(j)&&!/^class(?:Name)?$/i.test(j)&&I.setAttribute(j,P[j])},appliesToElement:function(P){return s(this.tagNames,P.tagName.toLowerCase())},getEmptyElements:function(P){var I=this;return P.getNodes([1],function(j){return I.appliesToElement(j)&&!j.hasChildNodes()})},hasClass:function(P){return P.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(P))&&g(P,this.className)},getSelfOrAncestorWithClass:function(P){for(;P;){if(this.hasClass(P))return P;P=P.parentNode}return null},isModifiable:function(P){return!this.applyToEditableOnly||de(P)},isIgnorableWhiteSpaceNode:function(P){return this.ignoreWhiteSpace&&P&&P.nodeType==3&&Ve(P)},postApply:function(P,I,j,q){var H=P[0],re=P[P.length-1],te=[],oe,Le=H,we=re,ge=0,st=re.length,et;u(P,function(Ae){et=fe(Ae,!q),et?(oe||(oe=new ze(et),te.push(oe)),oe.textNodes.push(Ae),Ae===H&&(Le=oe.textNodes[0],ge=Le.length),Ae===re&&(we=oe.textNodes[0],st=oe.getLength())):oe=null});var nt=Ne(re,!q);if(nt&&(oe||(oe=new ze(re),te.push(oe)),oe.textNodes.push(nt)),te.length){for(var en=0,ve=te.length;en<ve;++en)te[en].doMerge(j);I.setStartAndEnd(Le,ge,we,st)}},createContainer:function(P){var I=o.getDocument(P),j=d&&!o.isHtmlNamespace(P)&&P.namespaceURI?I.createElementNS(P.namespaceURI,this.elementTagName):I.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,j,!1),this.copyAttributesToElement(this.elementAttributes,j),m(j,this.className),this.onElementCreate&&this.onElementCreate(j,this),j},elementHasProperties:function(P,I){var j=this;return f(I,function(q,H){if(q=="className")return A(P,H);if(typeof H=="object"){if(!j.elementHasProperties(P[q],H))return!1}else if(P[q]!==H)return!1})},elementHasAttributes:function(P,I){return f(I,function(j,q){if(P.getAttribute(j)!==q)return!1})},applyToTextNode:function(P,I){if(S(P)){var j=P.parentNode;if(j.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(j)&&this.elementHasProperties(j,this.elementProperties)&&this.elementHasAttributes(j,this.elementAttributes))m(j,this.className);else{var q=P.parentNode,H=this.createContainer(q);q.insertBefore(H,P),H.appendChild(P)}}},isRemovable:function(P){return P.tagName.toLowerCase()==this.elementTagName&&b(P)==this.elementSortedClassName&&this.elementHasProperties(P,this.elementProperties)&&!ee(P,this.attrExceptions)&&this.elementHasAttributes(P,this.elementAttributes)&&this.isModifiable(P)},isEmptyContainer:function(P){var I=P.childNodes.length;return P.nodeType==1&&this.isRemovable(P)&&(I==0||I==1&&this.isEmptyContainer(P.firstChild))},removeEmptyContainers:function(P){var I=this,j=P.getNodes([1],function(re){return I.isEmptyContainer(re)}),q=[P],H=$(q);u(j,function(re){K(re,H)}),w(q,H)},undoToTextNode:function(P,I,j,q){if(!I.containsNode(j)){var H=I.cloneRange();H.selectNode(j),H.isPointInRange(I.endContainer,I.endOffset)&&(F(j,I.endContainer,I.endOffset,q),I.setEndAfter(j)),H.isPointInRange(I.startContainer,I.startOffset)&&(j=F(j,I.startContainer,I.startOffset,q))}this.isRemovable(j)?R(j,q):y(j,this.className)},splitAncestorWithClass:function(P,I,j){var q=this.getSelfOrAncestorWithClass(P);q&&F(q,P,I,j)},undoToAncestor:function(P,I){this.isRemovable(P)?R(P,I):y(P,this.className)},applyToRange:function(P,I){var j=this;I=I||[];var q=$(I||[]);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P);var H=B(P);if(H.length){u(H,function(oe){!j.isIgnorableWhiteSpaceNode(oe)&&!j.getSelfOrAncestorWithClass(oe)&&j.isModifiable(oe)&&j.applyToTextNode(oe,q)});var re=H[H.length-1];P.setStartAndEnd(H[0],0,re,re.length),j.normalize&&j.postApply(H,P,q,!1),w(I,q)}var te=j.getEmptyElements(P);u(te,function(oe){m(oe,j.className)})},applyToRanges:function(P){for(var I=P.length;I--;)this.applyToRange(P[I],P);return P},applyToSelection:function(P){var I=r.getSelection(P);I.setRanges(this.applyToRanges(I.getAllRanges()))},undoToRange:function(P,I){var j=this;I=I||[];var q=$(I);P.splitBoundariesPreservingPositions(q),j.removeEmptyElements&&j.removeEmptyContainers(P,q);var H=B(P),re,te,oe=H[H.length-1];if(H.length){j.splitAncestorWithClass(P.endContainer,P.endOffset,q),j.splitAncestorWithClass(P.startContainer,P.startOffset,q);for(var Le=0,we=H.length;Le<we;++Le)re=H[Le],te=j.getSelfOrAncestorWithClass(re),te&&j.isModifiable(re)&&j.undoToAncestor(te,q);P.setStartAndEnd(H[0],0,oe,oe.length),j.normalize&&j.postApply(H,P,q,!0),w(I,q)}var ge=j.getEmptyElements(P);u(ge,function(st){y(st,j.className)})},undoToRanges:function(P){for(var I=P.length;I--;)this.undoToRange(P[I],P);return P},undoToSelection:function(P){var I=r.getSelection(P),j=r.getSelection(P).getAllRanges();this.undoToRanges(j),I.setRanges(j)},isAppliedToRange:function(P){if(P.collapsed||P.toString()=="")return!!this.getSelfOrAncestorWithClass(P.commonAncestorContainer);var I=P.getNodes([3]);if(I.length){for(var j=0,q;q=I[j++];)if(!this.isIgnorableWhiteSpaceNode(q)&&k(P,q)&&this.isModifiable(q)&&!this.getSelfOrAncestorWithClass(q))return!1}return!0},isAppliedToRanges:function(P){var I=P.length;if(I==0)return!1;for(;I--;)if(!this.isAppliedToRange(P[I]))return!1;return!0},isAppliedToSelection:function(P){var I=r.getSelection(P);return this.isAppliedToRanges(I.getAllRanges())},toggleRange:function(P){this.isAppliedToRange(P)?this.undoToRange(P):this.applyToRange(P)},toggleSelection:function(P){this.isAppliedToSelection(P)?this.undoToSelection(P):this.applyToSelection(P)},getElementsWithClassIntersectingRange:function(P){var I=[],j=this;return P.getNodes([3],function(q){var H=j.getSelfOrAncestorWithClass(q);H&&!s(I,H)&&I.push(H)}),I},detach:function(){}};function Ct(P,I,j){return new at(P,I,j)}at.util={hasClass:g,addClass:m,removeClass:y,getClass:x,hasSameClasses:T,hasAllClasses:A,replaceWithOwnChildren:R,elementsHaveSameNonClassAttributes:Z,elementHasNonClassAttributes:ee,splitNodeAt:F,isEditableElement:Be,isEditingHost:me,isEditable:de},r.CssClassApplier=r.ClassApplier=at,r.createClassApplier=Ct,l.createAliasForDeprecatedMethod(r,"createCssClassApplier","createClassApplier",i)}),n})}(_p)),_p.exports}e5();var X0={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function G0(t){var e,n,r=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),i=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),o=r||i;return o?o.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{U0.init()}catch{console.error("rangy.init failed")}try{(l=(s=r==null?void 0:r.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new H0({parent:this.button||void 0,color:"#000",onDone:function(u){var c,d,f,h,v;try{a.coloredText&&(!((d=(c=a.coloredText).isAppliedToSelection)===null||d===void 0)&&d.call(c))&&a.coloredText.undoToSelection(),a.coloredText=U0.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),a.coloredText.toggleSelection(),(h=(f=a.base)===null||f===void 0?void 0:f.checkContentChanged)===null||h===void 0||h.call(f),(v=a.setInactive)===null||v===void 0||v.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),function(){function a(){}return a}())}var t5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),n5=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Y0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},K0=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};(function(t){t5(e,t);function e(n){var r=t.call(this,n)||this;r.labelMap=new Map;var i=n.lf,o=n.graphModel;return r.lf=i,r.graphModel=o,r.state={tick:0},r}return e.prototype.componentDidMount=function(){var n=this,r=this.props.graphModel;this.editor=new $u(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0($u))}})),r.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),r.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new $u(".lf-label-editor",zi(X0,{autoLink:!0,extensions:{colorPicker:new(G0($u))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,r=this.props,i=r.lf.extension,o=r.graphModel,a=K0(K0([],Y0(o.nodes),!1),Y0(o.edges),!1),s=i.label;if(s){var l=[];return gt(a,function(u){var c,d,f=u.getData(),h=(d=(c=f.properties)===null||c===void 0?void 0:c._label)!==null&&d!==void 0?d:[];gt(h,function(v){var g=n.labelMap,m=new WF(v,u,o);g.set(m.id,m),l.push(V(HF,{label:m,element:u,graphModel:o},m.id))})}),l}return null},e.prototype.render=function(){return V("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=n5([vn],e),e})(Qe);var q0=function(){return q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},q0.apply(this,arguments)},Z0=function(){return Z0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Z0.apply(this,arguments)},J0=function(){return J0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},J0.apply(this,arguments)},Q0=function(){return Q0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q0.apply(this,arguments)},bp=function(){return bp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bp.apply(this,arguments)},xp=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ep=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Wu="lf:defaultNodeMenu",Uu="lf:defaultEdgeMenu",wp="lf:defaultGraphMenu",Vu="lf:defaultSelectionMenu",Sp={nodeMenu:Wu,edgeMenu:Uu,graphMenu:wp,selectionMenu:Vu},ii={nodeMenu:[],edgeMenu:[],graphMenu:[],selectionMenu:[]},r5=function(){function t(e){var n=e.lf,r=this;this.__currentData=null,this.__isSilentMode=!1,this.lf=n,this.__menuDOM=document.createElement("ul"),this.__isSilentMode=n.graphModel.editConfigModel.isSilentMode,this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(i){r.setMenuConfig(i)},this.lf.addMenuConfig=function(i){r.addMenuConfig(i)},this.lf.setMenuByType=function(i){r.setMenuByType(i)},this.lf.changeMenuItemDisableStatus=function(i,o,a){r.changeMenuItemDisableStatus(i,o,a)},this.lf.getMenuConfig=function(i){return r.getMenuConfig(i)},this.lf.resetMenuConfigByType=function(i){r.resetMenuConfigByType(i)}}return t.prototype.init=function(){var e=this,n,r,i;ii.nodeMenu=[{text:"删除",callback:function(o){e.lf.deleteNode(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}},{text:"复制",callback:function(o){e.lf.cloneNode(o.id)}}],(n=this.menuTypeMap)===null||n===void 0||n.set(Wu,ii.nodeMenu),ii.edgeMenu=[{text:"删除",callback:function(o){e.lf.deleteEdge(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}}],(r=this.menuTypeMap)===null||r===void 0||r.set(Uu,ii.edgeMenu),ii.graphMenu=[],ii.selectionMenu=[{text:"删除",callback:function(o){e.lf.clearSelectElements(),o.edges.forEach(function(a){return e.lf.deleteEdge(a.id)}),o.nodes.forEach(function(a){return e.lf.deleteNode(a.id)})}}],(i=this.menuTypeMap)===null||i===void 0||i.set(Vu,ii.selectionMenu)},t.prototype.showMenu=function(e,n,r,i){if(!this.__isSilentMode&&!(!r||!r.length)){var o=this.__menuDOM;if(o){if(o.innerHTML="",o.append.apply(o,Ep([],xp(this.__getMenuDom(r)),!1)),!o.children.length)return;if(o.style.display="block",!i){o.style.top="".concat(n,"px"),o.style.left="".concat(e,"px");return}var a=i.width,s=i.height,l=i.clientX,u=i.clientY,c=this.lf.graphModel,d=o.offsetWidth,f=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,v=h-l,g=c.rootEl.getBoundingClientRect(),m=g.left+g.width;m<h&&(v=m-l),v<d&&(f=!1),f?o.style.left="".concat(e,"px"):o.style.left="".concat(e-a,"px");var y=o.offsetHeight,x=!0,E=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=E-u,T=g.top+g.height;T<E&&(b=T-u),b<y&&(x=!1),x?o.style.top="".concat(n,"px"):o.style.top="".concat(n-s,"px")}}},t.prototype.processMenuConfig=function(e,n){var r=this;if(e){var i=["nodeMenu","edgeMenu","graphMenu","selectionMenu"];i.forEach(function(o){var a,s,l,u,c=e[o],d=Sp[o];if(c!==void 0){if(n==="set")(a=r.menuTypeMap)===null||a===void 0||a.set(d,c||[]);else if(n==="add"&&Array.isArray(c)){var f=(l=(s=r.menuTypeMap)===null||s===void 0?void 0:s.get(d))!==null&&l!==void 0?l:[];(u=r.menuTypeMap)===null||u===void 0||u.set(d,f.concat(c))}}})}},t.prototype.createImageElement=function(e,n){var r=document.createElement("img");return r.src=e,r.alt=n,r.style.width="16px",r.style.height="16px",r.style.objectFit="contain",r},t.prototype.isImageFile=function(e){var n=[".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"];return n.some(function(r){return e.toLowerCase().includes(r)})},t.prototype.processIcon=function(e,n,r){var i;if(typeof n=="string"){var o=n;if(o.startsWith("data:image/")){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(this.isImageFile(o)){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(o.includes("<")&&o.includes(">")){e.innerHTML=o;return}if(o.includes(" ")||o.startsWith(".")){var s=o.replace(/^\./,"").split(" ");(i=e.classList).add.apply(i,Ep([],xp(s),!1));return}e.classList.add(o)}},t.prototype.__getMenuDom=function(e){var n=this,r=[];return e&&e.length>0&&e.forEach(function(i){var o=document.createElement("li");if(i.className?o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""," ").concat(i.className):o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""),i.icon){var a=document.createElement("span");a.className="lf-menu-item-icon",n.processIcon(a,i.icon,i.text),o.appendChild(a)}var s=document.createElement("span");s.className="lf-menu-item-text",i.text&&(s.innerText=i.text),o.appendChild(s),i.disabled&&o.setAttribute("disabled","true"),o.onclickCallback=i.callback,r.push(o)}),r},t.prototype.updateMenuItemDOMStatus=function(e,n){if(!(!this.__menuDOM||this.__menuDOM.style.display==="none")){var r=Array.from(this.__menuDOM.querySelectorAll(".lf-menu-item")),i=r.find(function(a){var s=a.querySelector(".lf-menu-item-text");return(s==null?void 0:s.textContent)===e});if(i){var o=i;n?(o.classList.add("lf-menu-item__disabled"),o.setAttribute("disabled","true")):(o.classList.remove("lf-menu-item__disabled"),o.removeAttribute("disabled"))}}},t.prototype.setupSilentModeListener=function(){var e=this;this.__editConfigChangeHandler=function(n){var r=n.data,i=r.isSilentMode;i!==e.__isSilentMode&&(e.__isSilentMode=i,e.updateMenuVisibility(!i))},this.lf.on("editConfig:changed",this.__editConfigChangeHandler)},t.prototype.updateMenuVisibility=function(e){this.__menuDOM&&(e?this.__currentData&&(this.__menuDOM.style.display="block"):(this.__menuDOM.style.display="none",this.__currentData=null))},t.prototype.refreshCurrentMenu=function(){var e,n,r,i,o,a,s,l,u,c,d;if(!(!this.__menuDOM||this.__menuDOM.style.display==="none"||!this.__currentData)){var f=this.__menuDOM.style,h=f.left,v=f.top,g=[];if(this.__currentData&&typeof this.__currentData=="object")if("sourceNodeId"in this.__currentData&&"targetNodeId"in this.__currentData){var m=this.lf.graphModel.getEdgeModelById(this.__currentData.id);if(m){var y=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(i=(r=this.menuTypeMap)===null||r===void 0?void 0:r.get(Uu))!==null&&i!==void 0?i:[]}}else if("id"in this.__currentData&&"type"in this.__currentData){var m=this.lf.graphModel.getNodeModelById(this.__currentData.id);if(m){var y=(o=this.menuTypeMap)===null||o===void 0?void 0:o.get(m.type);m.menu&&Array.isArray(m.menu)?g=m.menu:y?g=y:g=(s=(a=this.menuTypeMap)===null||a===void 0?void 0:a.get(Wu))!==null&&s!==void 0?s:[]}}else"nodes"in this.__currentData&&"edges"in this.__currentData?g=(u=(l=this.menuTypeMap)===null||l===void 0?void 0:l.get(Vu))!==null&&u!==void 0?u:[]:g=(d=(c=this.menuTypeMap)===null||c===void 0?void 0:c.get(wp))!==null&&d!==void 0?d:[];g&&g.length>0?(this.__menuDOM.innerHTML="",(e=this.__menuDOM).append.apply(e,Ep([],xp(this.__getMenuDom(g)),!1)),h&&(this.__menuDOM.style.left=h),v&&(this.__menuDOM.style.top=v)):(this.__menuDOM.style.display="none",this.__currentData=null)}},t.prototype.setMenuByType=function(e){var n,r=e.type,i=e.menu;!r||!i||((n=this.menuTypeMap)===null||n===void 0||n.set(r,i),this.refreshCurrentMenu())},t.prototype.getMenuConfig=function(e){var n,r;return(r=(n=this.menuTypeMap)===null||n===void 0?void 0:n.get(Sp[e]))!==null&&r!==void 0?r:[]},t.prototype.resetMenuConfigByType=function(e){var n;this.setMenuConfig((n={},n[e]=ii[e],n))},t.prototype.resetAllMenuConfig=function(){this.setMenuConfig(ii)},t.prototype.setMenuConfig=function(e){this.processMenuConfig(e,"set"),this.refreshCurrentMenu()},t.prototype.addMenuConfig=function(e){this.processMenuConfig(e,"add"),this.refreshCurrentMenu()},t.prototype.changeMenuItem=function(e,n){if(e==="add")this.addMenuConfig(n);else if(e==="reset")this.setMenuConfig(n);else throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'")},t.prototype.changeMenuItemDisableStatus=function(e,n,r){var i,o;if(!e||!n){console.warn("params is vaild");return}var a=(o=(i=this.menuTypeMap)===null||i===void 0?void 0:i.get(Sp[e]))!==null&&o!==void 0?o:[];if(!a.length){console.warn("menuMap: ".concat(e," is not exist"));return}var s=a.find(function(l){return l.text===n});if(!s){console.warn("menuItem: ".concat(n," is not exist"));return}s.disabled=r,this.updateMenuItemDOMStatus(n,r)},t.prototype.render=function(e,n){var r=this;e.graphModel.editConfigModel.isSilentMode||(this.__container=n,this.__currentData=null,this.setupSilentModeListener(),this.__menuDOM&&(this.__menuDOM.className="lf-menu",n.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",function(i){i.stopPropagation();for(var o=i.target;Array.from(o.classList).indexOf("lf-menu-item")===-1&&Array.from(o.classList).indexOf("lf-menu")===-1;)o=o==null?void 0:o.parentElement;Array.from(o.classList).indexOf("lf-menu-item__disabled")>-1||(Array.from(o.classList).indexOf("lf-menu-item")>-1?(o.onclickCallback(r.__currentData,o),r.__menuDOM&&(r.__menuDOM.style.display="none"),r.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!"))},!0)),this.lf.on("node:contextmenu",function(i){var o,a,s=i.data,l=i.position,u=i.e,c=l.domOverlayPosition,d=c.x,f=c.y,h=s.id,v=r.lf.graphModel.getNodeModelById(h);if(!(!v||r.__isSilentMode)){var g=[],m=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(v.type);v&&v.menu&&Array.isArray(v.menu)?g=v.menu:m?g=m:g=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Wu),r.__currentData=s,r.showMenu(d,f,g,{width:v.width,height:v.height,clientX:u.clientX,clientY:u.clientY})}}),this.lf.on("edge:contextmenu",function(i){var o,a,s,l=i.data,u=i.position,c=i.e,d=u.domOverlayPosition,f=d.x,h=d.y,v=l.id,g=r.lf.graphModel.getEdgeModelById(v);if(!(!g||r.__isSilentMode)){var m=[],y=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(g.type);g&&g.menu&&Array.isArray(g.menu)?m=g.menu:y?m=y:m=(s=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Uu))!==null&&s!==void 0?s:[],r.__currentData=l,r.showMenu(f,h,m,{width:g.width,height:g.height,clientX:c.clientX,clientY:c.clientY})}}),this.lf.on("blank:contextmenu",function(i){var o,a,s=i.position;if(!r.__isSilentMode){var l=(a=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(wp))!==null&&a!==void 0?a:[],u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=bp({},s.canvasOverlayPosition),r.showMenu(c,d,l)}}),this.lf.on("selection:contextmenu",function(i){var o,a=i.data,s=i.position;if(!r.__isSilentMode){var l=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(Vu),u=s.domOverlayPosition,c=u.x,d=u.y;r.__currentData=a,r.showMenu(c,d,l)}}),this.lf.on("node:mousedown",function(){r.__menuDOM.style.display="none"}),this.lf.on("edge:click",function(){r.__menuDOM.style.display="none"}),this.lf.on("blank:click",function(){r.__menuDOM.style.display="none"}))},t.prototype.destroy=function(){var e;this.__editConfigChangeHandler&&this.lf.off("editConfig:changed",this.__editConfigChangeHandler),this.__menuDOM&&((e=this===null||this===void 0?void 0:this.__container)===null||e===void 0||e.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.pluginName="menu",t}(),i5=function(){function t(e){var n=e.lf,r=this;this.lf=n,this.lf.setPatternItems=function(i){r.setPatternItems(i)}}return t.prototype.render=function(e,n){var r=this;if(this.destroy(),!this.shapeList||this.shapeList.length===0){this.domContainer=n;return}this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach(function(i){var o;(o=r.panelEl)===null||o===void 0||o.appendChild(r.createDndItem(i))}),n.appendChild(this.panelEl),this.domContainer=n},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(e){this.shapeList=e,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(e){var n=this,r=document.createElement("div");r.className=e.className?"lf-dnd-item ".concat(e.className):"lf-dnd-item";var i=document.createElement("div");if(i.className="lf-dnd-shape",e.icon&&(i.style.backgroundImage="url(".concat(e.icon,")")),r.appendChild(i),e.label){var o=document.createElement("div");o.innerText=e.label,o.className="lf-dnd-text",r.appendChild(o)}return e.disabled?(r.classList.add("disabled"),r.onmousedown=function(){e.callback&&e.callback(n.lf,n.domContainer)},r):(r.onmousedown=function(){e.type&&n.lf.dnd.startDrag({type:e.type,properties:e.properties,text:e.text}),e.callback&&e.callback(n.lf,n.domContainer)},r.ondblclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:a,data:e})},r.onclick=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:a,data:e})},r.oncontextmenu=function(a){n.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:a,data:e})},r)},t.pluginName="dndPanel",t}(),ex=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},tx=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},o5=function(){function t(e){var n=e.lf,r=e.options,i=this,o;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;i.handleMouseDown(s)},this.draw=function(a){var s=i.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,u=s.y;if(i.endPoint={x:l,y:u},i.startPoint){var c=i.startPoint,d=c.x,f=c.y,h=d,v=f,g=l-d,m=u-f;l<d&&(h=l,g=d-l),u<f&&(v=u,m=f-u),i.wrapper&&(i.wrapper.style.left="".concat(h,"px"),i.wrapper.style.top="".concat(v,"px"),i.wrapper.style.width="".concat(g,"px"),i.wrapper.style.height="".concat(m,"px"))}},this.drawOff=function(a){if(i.lf.updateEditConfig({stopMoveGraph:i.originalStopMoveGraph}),i.originStatusSaved=!1,i.mouseDownInfo){var s=i.mouseDownInfo,l=s.x,u=s.y,c=s.time,d=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-u)<5&&Date.now()-c<200;if(d){i.lf.clearSelectElements(),i.cleanupSelectionState();return}}var f=Pe(i.startPoint),h=Pe(i.endPoint);if(document.removeEventListener("mousemove",i.draw),i.exclusiveMode||document.removeEventListener("mouseup",i.drawOff),f&&h){var l=f.x,u=f.y,v=h.x,g=h.y,m=[Math.min(l,v),Math.min(u,g)],y=[Math.max(l,v),Math.max(u,g)];if(i.lf.emit("selection:selected-area",{topLeft:m,bottomRight:y}),Math.abs(v-l)<10&&Math.abs(g-u)<10){i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0);return}var x=i.lf.graphModel.getAreaElement(m,y,i.isWholeEdge,i.isWholeNode,!0),E=i.lf.graphModel,b=E.dynamicGroup,T=E.group,A=[],S=i.lf.getSelectElements(),M=new Set(tx(tx([],ex(S.nodes.map(function(K){return K.id})),!1),ex(S.edges.map(function(K){return K.id})),!1));x.forEach(function(K){if(T){var J=T.getNodeGroup(K.id);if(x.includes(J))return}if(b){var J=b.getGroupByNodeId(K.id);if(x.includes(J))return}if(i.exclusiveMode&&M.has(K.id)){i.lf.deselectElementById(K.id);return}i.lf.selectElementById(K.id,!0),A.push(K)}),i.startPoint=void 0,i.endPoint=void 0,A.length>0&&i.lf.emit("selection:drop",{e:a}),i.lf.emit("selection:selected",{elements:A,leftTopPoint:m,rightBottomPoint:y})}i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0)},this.lf=n,this.exclusiveMode=(o=r==null?void 0:r.exclusiveMode)!==null&&o!==void 0?o:!1,n.openSelectionSelect=function(){i.openSelectionSelect()},n.closeSelectionSelect=function(){i.closeSelectionSelect()},n.setSelectionSelectMode=function(a){i.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var r=e.button===2;if(!r){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var i=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,o=i.x,a=i.y;this.startPoint={x:o,y:a},this.endPoint={x:o,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(u){u.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=Pe(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),nx=function(){return nx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},nx.apply(this,arguments)},rx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zo=function(){return Zo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Zo.apply(this,arguments)},ds=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},a5={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function s5(t){for(var e=t,n=1;n<e.length-1;){var r=ds(e[n-1],2),i=r[0],o=r[1],a=ds(e[n],2),s=a[0],l=a[1],u=ds(e[n+1],2),c=u[0],d=u[1];i===s&&s===c||o===l&&l===d?e.splice(n,1):n++}return e}function l5(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(i[1]+=r,o[0]+=r):e==="lb"&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return e==="tl"?(i[1]+=r,o[0]-=r):e==="rb"&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return e==="br"?(i[1]-=r,o[0]+=r):e==="lt"&&(i[0]+=r,o[1]-=r),[i,o];case"br":return e==="bl"?(i[1]-=r,o[0]-=r):e==="rt"&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}function u5(t,e,n,r){var i,o=1,a="",s="";Math.abs(t[0]-e[0])<=o?a=t[1]>e[1]?"t":"b":Math.abs(t[1]-e[1])<=o&&(a=t[0]>e[0]?"l":"r"),Math.abs(e[0]-n[0])<=o?s=e[1]>n[1]?"t":"b":Math.abs(e[1]-n[1])<=o&&(s=e[0]>n[0]?"l":"r");var l=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||1/5*r,u="".concat(a).concat(s),c=a5[u]||"-",d="L ".concat(t[0]," ").concat(t[1]);if(c==="-")d+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var f=ds(l5(e,u,c,l),2),h=f[0],v=f[1];h&&v&&(d+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=ds(v,2),e[0]=i[0],e[1]=i[1])}return d}function c5(t,e){var n=0,r="";if(t.length===2)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var i=t[n-1],o=t[n],a=t[n+++1];r+=u5(i,o,a,e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}(function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,r=n.points,i=n.isAnimation,o=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),u=n.getEdgeAnimationStyle(),c=s5(r.split(" ").map(function(h){return h.split(",").map(function(v){return+v})})),d=c5(c,s),f=Zo(Zo(Zo({style:i?u:{}},l),o),{fill:"none"});return Te("path",Zo({d},f))},e})(os),function(t){rx(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ya);var ix=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xu=function(){return Xu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Xu.apply(this,arguments)},ox=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ax=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},d5=function(t){ix(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.id,i=n.x,o=n.y,a=n.width,s=n.height,l=n.properties,u=this.props.model.getNodeStyle();return Te("svg",{x:i-a/2,y:o-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Te("text",{x:0,y:-5,fontSize:"16px",fill:u.stroke},l.labelText):"",l.disabledDelete?"":Te("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:u.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,r)},"x")])},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Xu(Xu({},l),{x:r-o/2,y:i-a/2,width:o,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var r=this.props.graphModel;r.deleteNode(n)},e}(hu),f5=function(t){ix(e,t);function e(){var n=t.apply(this,ax([],ox(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,r;this.points=[],((r=this.properties)===null||r===void 0?void 0:r.node_selection_ids).length>1&&setTimeout(function(){var i;n.updatePointsByNodes(((i=n.properties)===null||i===void 0?void 0:i.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var r=n.x,i=n.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(n){var r=this,i=[],o=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(u){var c=r.graphModel.getNodeModelById(u);if(c){var d=c.width,f=c.height,h=c.x,v=c.y;o=Math.min(o,h-d/2-r.d),a=Math.min(a,v-f/2-r.d),s=Math.max(s,h+d/2+r.d),l=Math.max(l,v+f/2+r.d)}}),i.push([o,a],[s,a],[s,l],[o,l]),![o,a,s,l].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(s+o)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var r;this.isResize=!0;for(var i=n.width,o=n.height,a={x:i/this.width,y:o/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],u=new Set;s.length;){var c=s.shift(),d=(r=this.graphModel.nodesMap[c])===null||r===void 0?void 0:r.model;if(d){if(!Gu(d)){l.push(d);continue}u.has(d.id)||(u.add(d.id),s.push.apply(s,ax([],ox(d.properties.node_selection_ids||[]),!1)))}}var f={x:this.x-this.width/2,y:this.y-this.height/2},h=t.prototype.resize.call(this,n),v={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(g){g.width=g.width*a.x,g.height=g.height*a.y;var m=(g.x-f.x)*a.x+v.x-g.x,y=(g.y-f.y)*a.y+v.y-g.y;g.move(m,y,!0)}),this.isResize=!1,h},e}(su),Cp="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:Cp,view:d5,model:f5})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,r=this.lf.getGraphRawData(),i=n.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var a=ui(o,"properties.node_selection_ids",[]);return i.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var r=e.graphModel.nodes.filter(function(i){if(!Gu(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(n.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===Cp)){n.currentClickNode=r.data;var o=!1;n.selectNodesIds.includes(r.data.id)&&((i=n.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?o?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(n.onNodeChange(e,r),Gu(r)&&!r.isResize){var a=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return Gu(r)||n.onNodeChange(e,r),!0})},t.pluginName="node-selection",t})();var Gu=function(t){return!!(t&&t.type===Cp)},p5=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yu=function(){return Yu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Yu.apply(this,arguments)};(function(t){p5(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=n.properties;return Te("text",{x:r-o/2+5,y:i-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var n=this.props.model,r=n.x,i=n.y,o=n.width,a=n.height,s=this.props.model.getNodeStyle();return Te("g",{},[Te("rect",Yu(Yu({},s),{fill:"#FFFFFF",x:r-o/2,y:i-a/2})),this.getLabelShape()])},e})(Ji);var Ku=2,sx=.16,h5=.05,g5=.05,v5=.15,lx=5,ux=4,m5=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function cx(t){var e=t.r,n=t.g,r=t.b,i=EI(e,n,r);return{h:i.h*360,s:i.s,v:i.v}}function qu(t){var e=t.r,n=t.g,r=t.b;return"#".concat(SI(e,n,r))}function y5(t,e,n){var r=n/100,i={r:(e.r-t.r)*r+t.r,g:(e.g-t.g)*r+t.g,b:(e.b-t.b)*r+t.b};return i}function dx(t,e,n){var r;return Math.round(t.h)>=60&&Math.round(t.h)<=240?r=n?Math.round(t.h)-Ku*e:Math.round(t.h)+Ku*e:r=n?Math.round(t.h)+Ku*e:Math.round(t.h)-Ku*e,r<0?r+=360:r>=360&&(r-=360),r}function fx(t,e,n){if(t.h===0&&t.s===0)return t.s;var r;return n?r=t.s-sx*e:e===ux?r=t.s+sx:r=t.s+h5*e,r>1&&(r=1),n&&e===lx&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function px(t,e,n){var r;return n?r=t.v+g5*e:r=t.v-v5*e,r>1&&(r=1),Number(r.toFixed(2))}function Ap(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=_a(t),i=lx;i>0;i-=1){var o=cx(r),a=qu(_a({h:dx(o,i,!0),s:fx(o,i,!0),v:px(o,i,!0)}));n.push(a)}n.push(qu(r));for(var s=1;s<=ux;s+=1){var l=cx(r),u=qu(_a({h:dx(l,s),s:fx(l,s),v:px(l,s)}));n.push(u)}return e.theme==="dark"?m5.map(function(c){var d=c.index,f=c.opacity,h=qu(y5(_a(e.backgroundColor||"#141414"),_a(n[d]),f*100));return h}):n}var Op={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Zu={},Tp={};Object.keys(Op).forEach(function(t){Zu[t]=Ap(Op[t]),Zu[t].primary=Zu[t][5],Tp[t]=Ap(Op[t],{theme:"dark",backgroundColor:"#141414"}),Tp[t].primary=Tp[t][5]});var _5=Zu.blue,b5=Symbol("iconContext"),hx=function(){return p.inject(b5,{prefixCls:p.ref("anticon"),rootClassName:p.ref(""),csp:p.ref()})};function Np(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function x5(t,e){return t&&t.contains?t.contains(e):!1}var gx="data-vc-order",E5="vc-icon-key",Mp=new Map;function vx(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):E5}function Dp(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function w5(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function mx(t){return Array.from((Mp.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function yx(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Np())return null;var n=e.csp,r=e.prepend,i=document.createElement("style");i.setAttribute(gx,w5(r)),n&&n.nonce&&(i.nonce=n.nonce),i.innerHTML=t;var o=Dp(e),a=o.firstChild;if(r){if(r==="queue"){var s=mx(o).filter(function(l){return["prepend","prependQueue"].includes(l.getAttribute(gx))});if(s.length)return o.insertBefore(i,s[s.length-1].nextSibling),i}o.insertBefore(i,a)}else o.appendChild(i);return i}function S5(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Dp(e);return mx(n).find(function(r){return r.getAttribute(vx(e))===t})}function C5(t,e){var n=Mp.get(t);if(!n||!x5(document,n)){var r=yx("",e),i=r.parentNode;Mp.set(t,i),t.removeChild(r)}}function A5(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Dp(n);C5(r,n);var i=S5(e,n);if(i)return n.csp&&n.csp.nonce&&i.nonce!==n.csp.nonce&&(i.nonce=n.csp.nonce),i.innerHTML!==t&&(i.innerHTML=t),i;var o=yx(t,n);return o.setAttribute(vx(n),e),o}function _x(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){O5(t,i,n[i])})}return t}function O5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T5(t,e){process.env.NODE_ENV!=="production"&&!t&&console!==void 0&&console.error("Warning: ".concat(e))}function N5(t,e){T5(t,"[@ant-design/icons-vue] ".concat(e))}function bx(t){return typeof t=="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(typeof t.icon=="object"||typeof t.icon=="function")}function Pp(t,e,n){return n?p.h(t.tag,_x({key:e},n,t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))})):p.h(t.tag,_x({key:e},t.attrs),(t.children||[]).map(function(r,i){return Pp(r,"".concat(e,"-").concat(t.tag,"-").concat(i))}))}function xx(t){return Ap(t)[0]}function Ex(t){return t?Array.isArray(t)?t:[t]:[]}var M5=`
98
98
  .anticon {
99
99
  display: inline-block;
100
100
  color: inherit;
@@ -148,9 +148,9 @@ The dependencies for this derivation are:
148
148
  transform: rotate(360deg);
149
149
  }
150
150
  }
151
- `;function wx(t){return t&&t.getRootNode&&t.getRootNode()}function D5(t){return Np()?wx(t)instanceof ShadowRoot:!1}function P5(t){return D5(t)?wx(t):null}var R5=function(){var e=hx(),n=e.prefixCls,r=e.csp,i=p.getCurrentInstance(),o=M5;n&&(o=o.replace(/anticon/g,n.value)),p.nextTick(function(){if(Np()){var a=i.vnode.el,s=P5(a);A5(o,"@ant-design-vue-icons",{prepend:!0,csp:r.value,attachTo:s})}})},L5=["icon","primaryColor","secondaryColor"];function I5(t,e){if(t==null)return{};var n=k5(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function k5(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Zu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){B5(t,i,n[i])})}return t}function B5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fs=p.reactive({primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1});function j5(t){var e=t.primaryColor,n=t.secondaryColor;fs.primaryColor=e,fs.secondaryColor=n||xx(e),fs.calculated=!!n}function F5(){return Zu({},fs)}var Di=function(e,n){var r=Zu({},e,n.attrs),i=r.icon,o=r.primaryColor,a=r.secondaryColor,s=I5(r,L5),l=fs;if(o&&(l={primaryColor:o,secondaryColor:a||xx(o)}),N5(bx(i),"icon should be icon definiton, but got ".concat(i)),!bx(i))return null;var u=i;return u&&typeof u.icon=="function"&&(u=Zu({},u,{icon:u.icon(l.primaryColor,l.secondaryColor)})),Pp(u.icon,"svg-".concat(u.name),Zu({},s,{"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};Di.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String},Di.inheritAttrs=!1,Di.displayName="IconBase",Di.getTwoToneColors=F5,Di.setTwoToneColors=j5;function $5(t,e){return U5(t)||W5(t,e)||z5(t,e)||H5()}function H5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
151
+ `;function wx(t){return t&&t.getRootNode&&t.getRootNode()}function D5(t){return Np()?wx(t)instanceof ShadowRoot:!1}function P5(t){return D5(t)?wx(t):null}var R5=function(){var e=hx(),n=e.prefixCls,r=e.csp,i=p.getCurrentInstance(),o=M5;n&&(o=o.replace(/anticon/g,n.value)),p.nextTick(function(){if(Np()){var a=i.vnode.el,s=P5(a);A5(o,"@ant-design-vue-icons",{prepend:!0,csp:r.value,attachTo:s})}})},L5=["icon","primaryColor","secondaryColor"];function I5(t,e){if(t==null)return{};var n=k5(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function k5(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Ju(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){B5(t,i,n[i])})}return t}function B5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var fs=p.reactive({primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1});function j5(t){var e=t.primaryColor,n=t.secondaryColor;fs.primaryColor=e,fs.secondaryColor=n||xx(e),fs.calculated=!!n}function F5(){return Ju({},fs)}var Di=function(e,n){var r=Ju({},e,n.attrs),i=r.icon,o=r.primaryColor,a=r.secondaryColor,s=I5(r,L5),l=fs;if(o&&(l={primaryColor:o,secondaryColor:a||xx(o)}),N5(bx(i),"icon should be icon definiton, but got ".concat(i)),!bx(i))return null;var u=i;return u&&typeof u.icon=="function"&&(u=Ju({},u,{icon:u.icon(l.primaryColor,l.secondaryColor)})),Pp(u.icon,"svg-".concat(u.name),Ju({},s,{"data-icon":u.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};Di.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String},Di.inheritAttrs=!1,Di.displayName="IconBase",Di.getTwoToneColors=F5,Di.setTwoToneColors=j5;function $5(t,e){return U5(t)||W5(t,e)||z5(t,e)||H5()}function H5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
152
152
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z5(t,e){if(t){if(typeof t=="string")return Sx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sx(t,e)}}function Sx(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function W5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function U5(t){if(Array.isArray(t))return t}function Cx(t){var e=Ex(t),n=$5(e,2),r=n[0],i=n[1];return Di.setTwoToneColors({primaryColor:r,secondaryColor:i})}function V5(){var t=Di.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var X5=p.defineComponent({name:"InsertStyles",setup:function(){return R5(),function(){return null}}}),G5=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function Y5(t,e){return J5(t)||Z5(t,e)||q5(t,e)||K5()}function K5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
153
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5(t,e){if(t){if(typeof t=="string")return Ax(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ax(t,e)}}function Ax(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Z5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function J5(t){if(Array.isArray(t))return t}function Ox(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){ps(t,i,n[i])})}return t}function ps(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q5(t,e){if(t==null)return{};var n=e$(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function e$(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}Cx(_5.primary);var Jo=function(e,n){var r,i=Ox({},e,n.attrs),o=i.class,a=i.icon,s=i.spin,l=i.rotate,u=i.tabindex,c=i.twoToneColor,d=i.onClick,f=Q5(i,G5),h=hx(),v=h.prefixCls,g=h.rootClassName,m=(r={},ps(r,g.value,!!g.value),ps(r,v.value,!0),ps(r,"".concat(v.value,"-").concat(a.name),!!a.name),ps(r,"".concat(v.value,"-spin"),!!s||a.name==="loading"),r),y=u;y===void 0&&d&&(y=-1);var x=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,E=Ex(c),b=Y5(E,2),T=b[0],A=b[1];return p.createVNode("span",Ox({role:"img","aria-label":a.name},f,{onClick:d,class:[m,o],tabindex:y}),[p.createVNode(Di,{icon:a,primaryColor:T,secondaryColor:A,style:x},null),p.createVNode(X5,null,null)])};Jo.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:[String,Array]},Jo.displayName="AntdIcon",Jo.inheritAttrs=!1,Jo.getTwoToneColor=V5,Jo.setTwoToneColor=Cx;var t$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function Tx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){n$(t,i,n[i])})}return t}function n$(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rp=function(e,n){var r=Tx({},e,n.attrs);return p.createVNode(Jo,Tx({},r,{icon:t$}),null)};Rp.displayName="EditOutlined",Rp.inheritAttrs=!1;const r$=Qr(p.defineComponent({inheritAttrs:!1,__name:"index",props:p.mergeModels({dictType:{type:String,default:""},include:{type:[Array,String]},exclude:{type:Array},sort:{type:Boolean}},{dictMap:{type:Object},dictMapModifiers:{}}),emits:["update:dictMap"],setup(t){const e=t,n=p.useModel(t,"dictMap"),[r,{fetchDict:i,toList:o}]=eh(e.dictType,{immediate:!1}),a=p.computed(()=>{var l;const s=o(e.dictType);if(e.sort&&s.sort((u,c)=>parseFloat(u.value)-parseFloat(c.value)),e.include){const u=typeof e.include=="string"?e.include.split(","):e.include;return s.filter(c=>u.includes(c.value))}return(l=e.exclude)!=null&&l.length?s.filter(u=>{var c;return!((c=e.exclude)!=null&&c.includes(u.value))}):s});return e.dictType&&i(),p.watch(()=>r.value,()=>{if(n.value&&typeof n.value=="object")for(const s in r.value)n.value[s]=r.value}),(s,l)=>{const u=ie.Select;return p.openBlock(),p.createBlock(u,p.mergeProps({class:"dict-select",placeholder:s.$t("common.plsSelect"),showSearch:!1,options:p.unref(a),dropdownMatchSelectWidth:!1},s.$attrs),null,16,["placeholder","options"])}}}),[["__scopeId","data-v-02a7899b"]]),i$={class:"wrapper"},o$={class:"mt-xs"},a$={class:"flex-sc"},s$={class:"mt-xs"},l$=Qr(p.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({});function a(d){const f=d.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${f}}`)}function s(d){if(typeof d=="string"&&(d.trim().startsWith("{")||d.trim().startsWith("[")))try{return JSON.parse(d),!0}catch{return!1}return!1}function l(){r.jsonStr?(s(r.jsonStr)?o.value=JSON.parse(r.jsonStr):o.value=a(r.jsonStr),o.value.fallbackFirstLinkStatus!==null&&o.value.fallbackFirstLinkStatus!==void 0&&(o.value.fallbackFirstLinkStatus=String(o.value.fallbackFirstLinkStatus))):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1,fallbackFirstLinkStatus:null}}function u(){Wt.Modal.destroyAll()}function c(){const d=o.value;if(d.timeoutConfigSwitch&&!d.timeoutPeriod){Wt.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}d.fallbackFirstLinkStatus&&(d.fallbackFirstLinkStatus=Number(d.fallbackFirstLinkStatus)),i("submit",o.value),Wt.Modal.destroyAll()}return p.onMounted(()=>{l()}),(d,f)=>{const h=ie.Checkbox,v=ie.FormItem,g=ie.Radio,m=ie.RadioGroup,y=ie.InputNumber,x=r$,E=ie.Form,b=ie.Button,T=ie.Space;return p.openBlock(),p.createElementBlock("div",i$,[p.createVNode(E,{class:"my-nm","label-col":{span:6},"wrapper-col":{span:18},colon:!1,model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(v,{label:d.$t("bpmn.revertRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).revokeRule,"onUpdate:checked":f[0]||(f[0]=A=>p.unref(o).revokeRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.rollbackRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).fallbackRule,"onUpdate:checked":f[1]||(f[1]=A=>p.unref(o).fallbackRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.deduplicationApprovers")},{default:p.withCtx(()=>[p.createElementVNode("div",o$,p.toDisplayString(d.$t("bpmn.deduplicationApproversTxt")),1),p.createVNode(m,{value:p.unref(o).approverRemoveDuplicates,"onUpdate:value":f[2]||(f[2]=A=>p.unref(o).approverRemoveDuplicates=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio1")),1)]),_:1}),p.createVNode(g,{value:2},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).timeoutConfigSwitch,"onUpdate:checked":f[3]||(f[3]=A=>p.unref(o).timeoutConfigSwitch=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.unref(o).timeoutConfigSwitch?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createVNode(v,{label:d.$t("wo_my.timeout")},{default:p.withCtx(()=>[p.createElementVNode("div",a$,[p.createTextVNode(p.toDisplayString(d.$t("bpmn.linkTimeoutTxt1"))+" ",1),p.createVNode(y,{class:"mx-xs",value:p.unref(o).timeoutPeriod,"onUpdate:value":f[4]||(f[4]=A=>p.unref(o).timeoutPeriod=A),min:1,max:1e4,precision:0},null,8,["value"]),p.createTextVNode(" "+p.toDisplayString(d.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutHandle")},{default:p.withCtx(()=>[p.createElementVNode("div",s$,p.toDisplayString(d.$t("bpmn.timeoutHandleTxt")),1),p.createVNode(m,{value:p.unref(o).timeoutHandler,"onUpdate:value":f[5]||(f[5]=A=>p.unref(o).timeoutHandler=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):p.createCommentVNode("",!0),p.createVNode(v,{label:d.$t("bpmn.fallbackFirstLinkStatus")},{default:p.withCtx(()=>[p.createVNode(x,{"dict-type":"fallback_first_link_status",value:p.unref(o).fallbackFirstLinkStatus,"onUpdate:value":f[6]||(f[6]=A=>p.unref(o).fallbackFirstLinkStatus=A),placeholder:d.$t("common.plsSelect"),style:{width:"80%"}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>[p.createVNode(b,{onClick:u},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",onClick:c},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-8e7f13af"]]),u$={key:0},c$={key:1,style:{color:"#696868"}},d$=p.defineComponent({__name:"Process",props:p.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(t){const{modal:e}=Wt.App.useApp(),{t:n}=Dn.useI18n(),r=p.useModel(t,"formState"),i=p.ref(["1","2","3","4","5","6"]);function o(){e.info({title:n("ruleModel.title"),content:p.h(l$,{jsonStr:r.value.jobPriority,onSubmit:a=>{r.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const l=ie.Input,u=ie.FormItem,c=ie.Form,d=ie.CollapsePanel,f=ie.Button,h=ie.Collapse;return p.openBlock(),p.createBlock(h,{activeKey:p.unref(i),"onUpdate:activeKey":s[3]||(s[3]=v=>p.isRef(i)?i.value=v:null)},{default:p.withCtx(()=>[p.createVNode(d,{key:"1",header:a.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.id,"onUpdate:value":s[0]||(s[0]=v=>r.value.id=v),placeholder:a.$t("common.plsEnter"),readonly:t.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.name,"onUpdate:value":s[1]||(s[1]=v=>r.value.name=v),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Version Tag")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.versionTag,"onUpdate:value":s[2]||(s[2]=v=>r.value.versionTag=v),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.createVNode(d,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Job Priority")},{default:p.withCtx(()=>[p.createVNode(f,{onClick:o,style:{width:"100%"}},{default:p.withCtx(()=>[r.value.jobPriority?(p.openBlock(),p.createElementBlock("span",c$,[p.createTextVNode(p.toDisplayString(p.unref(n)("bpmn.has_config_rule"))+" ",1),p.createVNode(p.unref(Rp))])):(p.openBlock(),p.createElementBlock("span",u$,p.toDisplayString(p.unref(n)("bpmn.no_config_rule")),1))]),_:1})]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),f$=Qr(p.defineComponent({__name:"TemplateConfig",props:{data:{type:Object,default:()=>{}},templateList:{type:Array,default:()=>[]}},emits:["update:data"],setup(t,{emit:e}){const n=e,r=t,i=p.computed({get:()=>r.data,set:u=>{n("update:data",u)}}),o=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("1")}).map(u=>({label:u.name,value:u.id}))),a=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("2")}).map(u=>({label:u.name,value:u.id}))),s=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("3")}).map(u=>({label:u.name,value:u.id}))),l=(u,c)=>c.label.toLowerCase().indexOf(u.toLowerCase())>=0;return(u,c)=>{const d=ie.Select,f=ie.FormItem,h=ie.Form;return p.openBlock(),p.createElementBlock("div",null,[p.createVNode(h,{class:"form-query-select mx-nm mt-nm",layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(f,{label:u.$t("bpmn.todoHandle")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[1],"onUpdate:value":c[0]||(c[0]=v=>i.value[1]=v),options:o.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.todoDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[2],"onUpdate:value":c[1]||(c[1]=v=>i.value[2]=v),options:a.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.AllDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[3],"onUpdate:value":c[2]||(c[2]=v=>i.value[3]=v),options:s.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-8a27c7e4"]]),p$={class:"modal-container"},h$=p.defineComponent({__name:"SelectLinkTask",props:{id:{type:String},componentInfo:{type:String,default:""},variable:{type:String,default:""},description:{type:String,default:""}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"},{title:n("bpmn.action"),dataIndex:"action"}]),s=p.ref([]),l=p.ref();function u(k,B){s.value=k,l.value=B}const c=p.ref({1:void 0,2:void 0,3:void 0}),d=p.ref({}),f=p.ref(!1),h=p.ref(""),v=p.ref("");function g(){f.value=!1,h.value=m(c.value)}function m(k){return Object.entries(k).filter(([ee,ce])=>ce!==void 0).map(([ee,ce])=>`${ee}-${ce}`).join(",")}function y(k){if(typeof k!="string"||k.trim()==="")return{};const B=k.split(","),Z={};return B.forEach(ee=>{const[ce,...Be]=ee.split("-");if(ce&&Be.length>0){const me=Be.join("-");Z[ce]=me}}),Z}function x(){f.value=!1}function E(k){d.value=k,f.value=!0}const b=p.ref([]);async function T(){const{result:k}=await Gt.getTemplateList({pageNo:1,pageSize:1e3});b.value=(k==null?void 0:k.data)||[]}const A=p.ref([]);async function S(){const{result:k}=await Gt.getLinkList({pageNo:1,pageSize:1e3});A.value=(k==null?void 0:k.data)||[]}p.watchEffect(()=>{r.id&&(r.id.startsWith("common-approve-")||r.id.startsWith("common-handle-")?(v.value=r.id.slice(-4),s.value=[r.id.slice(0,-4)+"*"]):s.value=[r.id]),r.componentInfo&&(c.value=y(r.componentInfo))});function M(k){l.value=null;const B={...o.value};return Object.assign(B,k),Gt.getLinkList(B)}const C=p.ref(),G=()=>{C.value.refresh()},K=()=>{o.value={},G()};p.onMounted(()=>{K(),T(),S()});function J(){Wt.Modal.destroyAll()}function R(){var k,B;if((k=l.value)!=null&&k.length)i("submit",{...l.value[0],bindComponent:h.value,hasSuffix:""});else if((B=s.value)!=null&&B.length){const Z=A.value.find(ee=>ee.id===s.value[0]);i("submit",{...Z,id:r.id,bindComponent:h.value,hasSuffix:v.value})}Wt.Modal.destroyAll()}return(k,B)=>{const Z=ie.Input,ee=ie.FormItem,ce=ie.Button,Be=ie.Space,me=ie.Form,de=ie.Tooltip,Se=p.resolveComponent("a-table-ex"),je=ie.Modal;return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",p$,[p.createVNode(me,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(ee,{label:k.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).id,"onUpdate:value":B[0]||(B[0]=he=>p.unref(o).id=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{label:k.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).description,"onUpdate:value":B[1]||(B[1]=he=>p.unref(o).description=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(Be,null,{default:p.withCtx(()=>[p.createVNode(ce,{type:"primary",onClick:G},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_search")),1)]),_:1}),p.createVNode(ce,{onClick:K},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(Se,{ref_key:"tableEx",ref:C,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:M},{bodyCell:p.withCtx(({record:he,column:Ve})=>[Ve.dataIndex==="action"?(p.openBlock(),p.createBlock(de,{key:0,placement:"top"},{title:p.withCtx(()=>[p.createElementVNode("span",null,p.toDisplayString(k.$t("bpmn.tempConfigTip")),1)]),default:p.withCtx(()=>[p.createVNode(ce,{type:"link",onClick:$=>E(he),style:{"padding-left":"0"},disabled:!p.unref(s).includes(he.id)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("bpmn.tempConfig")),1)]),_:2},1032,["onClick","disabled"])]),_:2},1024)):p.createCommentVNode("",!0)]),_:1},8,["columns","row-selection"]),p.createVNode(Be,{class:"modal-btns"},{default:p.withCtx(()=>{var he;return[p.createVNode(ce,{onClick:J},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(ce,{type:"primary",disabled:!((he=p.unref(s))!=null&&he.length),onClick:R},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})]),p.createVNode(je,{open:p.unref(f),"onUpdate:open":B[3]||(B[3]=he=>p.isRef(f)?f.value=he:null),title:k.$t("bpmn.tempConfig"),onOk:g,onCancel:x},{default:p.withCtx(()=>[p.createVNode(f$,{data:p.unref(c),"onUpdate:data":B[2]||(B[2]=he=>p.isRef(c)?c.value=he:null),"template-list":p.unref(b)},null,8,["data","template-list"])]),_:1},8,["open","title"])],64)}}}),g$={class:"modal-container"},v$=p.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.userIds&&(s.value=Array.isArray(r.userIds)?r.userIds:[r.userIds])});function c(m){l.value=null;const y={...o.value,branchId:r.branchId};return Object.assign(y,m),Gt.getUserList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Wt.Modal.destroyAll()}function g(){var m;if((m=l.value)!=null&&m.length){const y=l.value;i("submit",r.mode==="multiple"?y:y[0])}Wt.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",g$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("user.key")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).userName,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).userName=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"userId","row-selection":{type:t.mode==="multiple"?"checkbox":"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),m$=p.defineComponent({__name:"UserTask",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Wt.App.useApp(),{t:r}=Dn.useI18n(),i=p.inject("type"),o=p.inject("isApproval"),a=p.useModel(t,"formState"),s=p.ref(["1","2","3","4","5","6"]),l=p.ref([]),u=p.ref([]),c=p.ref([]),d=p.computed(()=>{var S;const A=a.value.assignee;return(S=String(A))==null?void 0:S.startsWith("${")});function f(){const A="abcdefghijklmnopqrstuvwxyz";let S="";for(let M=0;M<2;M++)S+=A.charAt(Math.floor(Math.random()*A.length));for(let M=0;M<2;M++)S+=Math.floor(Math.random()*10);return S}function h(){console.log(a.value,"formState.value"),n.info({title:r("link.select_link"),content:p.h(h$,{id:a.value.id,variable:a.value.assignee,description:a.value.name,componentInfo:a.value.bindComponent,onSubmit:A=>{let S=A.id;const M=S!==a.value.id;S.endsWith("*")&&(A.hasSuffix?S=S.substring(0,S.length-1)+A.hasSuffix:S=S.substring(0,S.length-1)+f()),Object.assign(a.value,{id:S,name:o?g(S):`bpmn.${i}_${S}`,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:M?[]:a.value.userArr,roleArr:M?[]:a.value.roleArr,approveRank:"0"}),A.variable&&(a.value.assignee=`\${${A.variable}}`),a.value.bindComponent=A.bindComponent||void 0}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function v(){n.info({title:r("user.select_user"),content:p.h(v$,{userIds:a.value.assignee,onSubmit:A=>{Object.assign(a.value,{assignee:A.userId,"camunda:assigneeName":A.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function g(A){return A.includes("common-approve-")?`bpmn.${A.slice(0,-4)}0`:`bpmn.${A}`}function m(A){A==0?a.value.name=r("bpmn.common-approve-0"):a.value.name=r(`bpmn.${a.value.id.slice(0,-4)}${A}`)}function y(){Gt.getBranchTree().then(A=>{A.code===0&&(l.value=A.result||[])})}function x(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getUserList(A).then(S=>{var M,C;S.code===0&&(c.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.userName,value:G.userId})))||[])})}function E(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getRoleList(A).then(S=>{var M,C;S.code===0&&(u.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.roleName,value:G.roleId})))||[])})}function b(){Object.assign(a.value,{userArr:[],roleArr:[]}),x(),E()}function T(A){if(A!=null&&A.length){const S=c.value.find(M=>M.userId===A[0]);a.value.priority!==S.branchId&&(Object.assign(a.value,{priority:S.branchId,roleArr:[]}),x(),E())}}return p.onMounted(()=>{y(),x(),E()}),(A,S)=>{const M=ie.Input,C=ie.FormItem,G=ie.InputNumber,K=ie.TreeSelect,J=ie.Select,R=ie.Form,k=ie.CollapsePanel,B=ie.Radio,Z=ie.RadioGroup,ee=ie.Checkbox,ce=ie.CheckboxGroup,Be=ie.Collapse;return p.openBlock(),p.createBlock(Be,{activeKey:p.unref(s),"onUpdate:activeKey":S[10]||(S[10]=me=>p.isRef(s)?s.value=me:null)},{default:p.withCtx(()=>[p.createVNode(k,{key:"1",header:A.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(R,{layout:"vertical",model:a.value},{default:p.withCtx(()=>[p.createVNode(C,{label:A.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(M,{value:a.value.id,"onUpdate:value":S[0]||(S[0]=me=>a.value.id=me),placeholder:A.$t("common.plsEnter"),readonly:"",onClick:h},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(M,{value:A.$t(a.value.name),disabled:"",placeholder:A.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),a.value.id&&a.value.id.includes("common-approve-")?(p.openBlock(),p.createBlock(C,{key:0,label:A.$t("FLOW_CHART.approve-rank")},{default:p.withCtx(()=>[p.createVNode(G,{style:{width:"100%"},value:a.value.approveRank,"onUpdate:value":S[1]||(S[1]=me=>a.value.approveRank=me),min:0,max:10,placeholder:A.$t("common.plsEnter"),onChange:m},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0),p.createVNode(C,{label:A.$t("FLOW_CHART.Assignee")},{default:p.withCtx(()=>[p.unref(d)?(p.openBlock(),p.createBlock(M,{key:0,value:a.value.assignee,"onUpdate:value":S[2]||(S[2]=me=>a.value.assignee=me),placeholder:A.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(p.openBlock(),p.createBlock(M,{key:1,value:a.value["camunda:assigneeName"],"onUpdate:value":S[3]||(S[3]=me=>a.value["camunda:assigneeName"]=me),placeholder:A.$t("common.plsSelect"),readonly:"",onClick:v},null,8,["value","placeholder"]))]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Priority")},{default:p.withCtx(()=>[p.createVNode(K,{value:a.value.priority,"onUpdate:value":S[4]||(S[4]=me=>a.value.priority=me),placeholder:A.$t("common.plsSelect"),"tree-data":p.unref(l),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:b},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Users")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.userArr,"onUpdate:value":S[5]||(S[5]=me=>a.value.userArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(c),optionFilterProp:"label",disabled:p.unref(d),onChange:T},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Groups")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.roleArr,"onUpdate:value":S[6]||(S[6]=me=>a.value.roleArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(u),optionFilterProp:"label",disabled:p.unref(d)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.unref(o)?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(k,{key:"2",header:A.$t("FLOW_CHART.isAllowRollback")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.rollback,"onUpdate:value":S[7]||(S[7]=me=>a.value.rollback=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"1"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.yes")),1)]),_:1}),p.createVNode(B,{value:"0"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"3",header:A.$t("FLOW_CHART.Approval Mode")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.approvalSign,"onUpdate:value":S[8]||(S[8]=me=>a.value.approvalSign=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"orSign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Or Sign")),1)]),_:1}),p.createVNode(B,{value:"countersign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"4",header:A.$t("FLOW_CHART.Approval Required")},{default:p.withCtx(()=>[p.createVNode(ce,{value:a.value.approvalCheckbox,"onUpdate:value":S[9]||(S[9]=me=>a.value.approvalCheckbox=me)},{default:p.withCtx(()=>[p.createVNode(ee,{value:"advice"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Comments Required")),1)]),_:1}),p.createVNode(ee,{value:"attachment"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0)]),_:1},8,["activeKey"])}}}),y$=p.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),_$=p.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.SelectOption,l=ie.Select,u=ie.Form,c=ie.CollapsePanel,d=ie.Collapse;return p.openBlock(),p.createBlock(d,{activeKey:p.unref(n),"onUpdate:activeKey":i[4]||(i[4]=f=>p.isRef(n)?n.value=f:null)},{default:p.withCtx(()=>[p.createVNode(c,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(u,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=f=>e.value.id=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=f=>e.value.name=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Condition Type")},{default:p.withCtx(()=>[p.createVNode(l,{value:e.value.condType,"onUpdate:value":i[2]||(i[2]=f=>e.value.condType=f),placeholder:r.$t("common.plsSelect"),allowClear:""},{default:p.withCtx(()=>[p.createVNode(s,{value:"bpmn:FormalExpression"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(r.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),e.value.condType==="bpmn:FormalExpression"?(p.openBlock(),p.createBlock(a,{key:0,label:r.$t("FLOW_CHART.Expression")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.condBody,"onUpdate:value":i[3]||(i[3]=f=>e.value.condBody=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),b$={class:"modal-container"},x$=p.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.id&&(s.value=[r.id])});function c(m){l.value=null;const y={...o.value};return Object.assign(y,m),Gt.getLinkList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Wt.Modal.destroyAll()}function g(){var m;(m=l.value)!=null&&m.length&&i("submit",l.value[0]),Wt.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",b$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).id,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).id=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{label:m.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).description,"onUpdate:value":y[1]||(y[1]=M=>p.unref(o).description=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),E$=p.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Wt.App.useApp(),{t:r}=Dn.useI18n(),i=p.useModel(t,"formState"),o=p.ref(["1","2","3","4","5","6"]);function a(){const c="abcdefghijklmnopqrstuvwxyz";let d="";for(let f=0;f<2;f++)d+=c.charAt(Math.floor(Math.random()*c.length));for(let f=0;f<2;f++)d+=Math.floor(Math.random()*10);return d}const s=e;function l(){s("updateNodeName",i.value.id,i.value.name)}function u(){n.info({title:r("link.select_link"),content:p.h(x$,{id:i.value.id,onSubmit:c=>{let d=c.id;d.endsWith("*")&&(d=d.substring(0,d.length-1)+a()),Object.assign(i.value,{id:d,name:"bpmn.endName"})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(c,d)=>{const f=ie.Input,h=ie.FormItem,v=ie.Form,g=ie.CollapsePanel,m=ie.Collapse;return p.openBlock(),p.createBlock(m,{activeKey:p.unref(o),"onUpdate:activeKey":d[1]||(d[1]=y=>p.isRef(o)?o.value=y:null)},{default:p.withCtx(()=>[p.createVNode(g,{key:"1",header:c.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(v,{layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(h,{label:c.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(f,{value:i.value.id,"onUpdate:value":d[0]||(d[0]=y=>i.value.id=y),placeholder:c.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(h,{label:c.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(f,{value:c.$t(i.value.name),disabled:"",placeholder:c.$t("common.plsEnter"),onChange:l},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),w$=p.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),disabled:"",placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),S$={class:"properties-panel"},C$=Qr(p.defineComponent({__name:"BpmnPropertiesPanel",props:{lfRef:{type:Object},isEdit:{type:Boolean},processAttrs:{type:Object}},emits:["changeProcess"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=e,i=t,o=p.ref(""),a=p.ref({}),s=p.ref({});let l;p.watch(()=>i.lfRef,()=>{i.lfRef&&(s.value=i.lfRef,u())}),p.watch(a,(h,v)=>{h===v&&d()},{deep:!0});function u(){s.value.on("node:click",({data:h,e:v,position:g})=>{c(h)}),s.value.on("edge:click,",({data:h,e:v,position:g})=>{c(h)}),s.value.on("blank:click",({e:h})=>{o.value="bpmn:process",a.value={id:i.processAttrs.id||"Process_1",name:i.processAttrs.name,jobPriority:i.processAttrs["camunda:jobPriority"]}})}function c(h){var m;if(!h||l===h)return;l=h;const v=h.type;o.value="",p.nextTick(()=>{o.value=v});const g={...h.properties,id:h.id,name:((m=h.text)==null?void 0:m.value)||""};v==="bpmn:userTask"?(Object.assign(g,{rollback:g["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(g,{approvalSign:g["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),g["camunda:assignee"]&&(g.assignee=g["camunda:assignee"]),g["camunda:priority"]&&(g.priority=g["camunda:priority"]),g["camunda:advice"]==="true"&&g.approvalCheckbox.push("advice"),g["camunda:attachment"]==="true"&&g.approvalCheckbox.push("attachment"),g["camunda:bindComponent"]&&(g.bindComponent=g["camunda:bindComponent"]),g.hasOwnProperty("camunda:approveRank")?g.approveRank=g["camunda:approveRank"]:g.id.includes("common-approve-")&&(g.approveRank=0),typeof g["camunda:candidateUsers"]=="number"?g.userArr=[g["camunda:candidateUsers"].toString()]:typeof g["camunda:candidateUsers"]=="string"?g.userArr=(g["camunda:candidateUsers"]||"").split(",").filter(y=>y):g.userArr=[],typeof g["camunda:candidateGroups"]=="number"?g.roleArr=[g["camunda:candidateGroups"].toString()]:typeof g["camunda:candidateGroups"]=="string"?g.roleArr=(g["camunda:candidateGroups"]||"").split(",").filter(y=>y):g.roleArr=[]):v==="bpmn:sequenceFlow"&&(console.log("data.properties",h.properties,h.properties["bpmn:conditionExpression"]),h.properties["bpmn:conditionExpression"]&&Object.assign(g,{condType:h.properties["bpmn:conditionExpression"]["xsi:type"],condBody:h.properties["bpmn:conditionExpression"]["#text"].replace(/\s+/g,"")})),a.value=g}function d(){var m,y;const h=a.value;function v(x){return x?"true":"false"}const g={id:h.id,name:h.name};if(console.log("bpmnType.value",o.value),o.value==="bpmn:process")h.jobPriority&&Object.assign(g,{"camunda:jobPriority":h.jobPriority}),r("changeProcess",g);else if(o.value==="bpmn:userTask"){Object.assign(g,{"camunda:orSign":v(h.approvalSign==="orSign"),"camunda:rollback":h.rollback==="1"?"1":"0","camunda:countersign":v(h.approvalSign==="countersign"),"camunda:advice":v(h.approvalCheckbox.includes("advice")),"camunda:attachment":v(h.approvalCheckbox.includes("attachment")),"camunda:assignee":h.assignee||"","camunda:assigneeName":h["camunda:assigneeName"]||"","camunda:priority":h.priority||"","camunda:candidateUsers":((m=h.userArr)==null?void 0:m.join())||"","camunda:candidateGroups":((y=h.roleArr)==null?void 0:y.join())||"","camunda:bindComponent":h.bindComponent||"","camunda:approveRank":h.approveRank,"camunda:transName":h.name,name:n(h.name)}),console.log("activeNode.id, attrs",l.id,g);const{id:x}=l,{id:E}=h;E&&x!==E&&s.value.changeNodeId(x,E),s.value.getNodeModelById(E).setProperties(g),s.value.updateText(E,n(h.name))}}function f(h,v){l.id&&(s.value.setProperties(l.id,{name:v}),s.value.updateText(l.id,v))}return(h,v)=>{const g=zm;return p.openBlock(),p.createElementBlock("div",S$,[p.createVNode(g,null,{default:p.withCtx(()=>[p.unref(o)==="bpmn:process"?(p.openBlock(),p.createBlock(d$,{key:0,formState:p.unref(a),"onUpdate:formState":v[0]||(v[0]=m=>p.isRef(a)?a.value=m:null),isEdit:t.isEdit},null,8,["formState","isEdit"])):p.unref(o)==="bpmn:userTask"?(p.openBlock(),p.createBlock(m$,{key:1,formState:p.unref(a),"onUpdate:formState":v[1]||(v[1]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)==="bpmn:exclusiveGateway"?(p.openBlock(),p.createBlock(y$,{key:2,formState:p.unref(a),"onUpdate:formState":v[2]||(v[2]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:sequenceFlow"?(p.openBlock(),p.createBlock(_$,{key:3,formState:p.unref(a),"onUpdate:formState":v[3]||(v[3]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:endEvent"?(p.openBlock(),p.createBlock(E$,{key:4,formState:p.unref(a),"onUpdate:formState":v[4]||(v[4]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)?(p.openBlock(),p.createBlock(w$,{key:5,formState:p.unref(a),"onUpdate:formState":v[5]||(v[5]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-fe59c58a"]]),Lp="menu-common",Nx=200,A$=100;class Mx{constructor({lf:e}){Yp(this,"setContextMenuByType",(e,n)=>{this.menuTypeMap.set(e,n)});Yp(this,"listenDelete",()=>{this.hideContextMenu()});this.menuTypeMap=new Map,this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Lp,[])}render(e,n){this.container=n,e.on("node:click",({data:r})=>{this._activeData=r,this.createContextMenu(),console.log(r)}),e.on("edge:click",({data:r})=>{this._activeData=r,this.createContextMenu()}),e.on("blank:click",()=>{this.hideContextMenu()})}hideContextMenu(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1}showContextMenu(e){if(!e||!e.id){console.warn("请检查传入的参数");return}this._activeData=e,this.createContextMenu()}setContextMenuItems(e){this.menuTypeMap.set(Lp,e)}getContextMenuPosition(){const e=this._activeData,n=this.lf.graphModel.getElement(e.id);if(!n){console.warn(`找不到元素${e.id}`);return}let r,i;if(n.BaseType==="edge"){r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER;const o=n.getData();r=Math.max(o.startPoint.x,r),i=Math.min(o.startPoint.y,i),r=Math.max(o.endPoint.x,r),i=Math.min(o.endPoint.y,i),o.pointsList&&o.pointsList.forEach(a=>{r=Math.max(a.x,r),i=Math.min(a.y,i)})}return n.BaseType==="node"&&(r=e.x+n.width/2,i=e.y-n.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([r,i])}createContextMenu(){const{isSilentMode:e}=this.lf.options;if(e)return;let n=this.menuTypeMap.get(this._activeData.type)||[];n=n.concat(this.menuTypeMap.get(Lp));const r=document.createDocumentFragment();n.forEach(i=>{const o=document.createElement("div");o.className="lf-context-item";const a=document.createElement("img");a.src=i.icon,a.className="lf-context-img",i.className&&(o.className=`${o.className} ${i.className}`),a.addEventListener("click",()=>{this.hideContextMenu(),i.callback?i.callback(this._activeData):this.addNode({sourceId:this._activeData.id,x:this._activeData.x,y:this._activeData.y,properties:i.properties,type:i.type,text:i.text||""})}),o.appendChild(a),r.appendChild(o)}),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(r),this.showMenu()}addNode(e,n){const r=n!==void 0;n===void 0&&(n=e.y);const i=this.lf.getNodeModelById(e.sourceId),o=e.x-100+Nx,a=n-e.y/2-20,s=e.x+100+Nx,l=n+e.y/2+20,u=this.lf.getAreaElement([o,a],[s,l]);if(console.log(u),u.length){n=n+A$,this.addNode(e,n);return}const c=this.lf.addNode({type:e.type,x:e.x+200,y:n,properties:e.properties,text:e.text});let d,f;r&&(d={x:e.x,y:e.y+i.height/2},f={x:c.x-c.width/2,y:c.y}),this.lf.addEdge({sourceNodeId:e.sourceId,targetNodeId:c.id,startPoint:d,endPoint:f})}showMenu(){const[e,n]=this.getContextMenuPosition();this.__menuDOM.style.display="flex",this.__menuDOM.style.top=`${n}px`,this.__menuDOM.style.left=`${e+10}px`,this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}}Mx.pluginName="contextPad";const O$=(t,e)=>{const n={type:"bpmn:userTask",label:e("bpmn.userTaskName"),text:e("bpmn.userTaskName"),properties:{"camunda:transName":"bpmn.userTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAp1JREFUWEftlj9oE2EYxp/3IkSckotOpqDgl5ZWcLBgxcVBdBL8gw66iCg2lxrBzcl0qpPS1lyQKm5uiuBUHBztoAjVVtOLRDA46Z06VAvmXkkwQWLS3PudQwn54KY8z/v8eO7uvRA2+KENzoc+YNg71PsNxm6VYxStnibwIQCnAF4kptcMv+RWjSlk1VqYFkM1mLCLx5jpJoh2doD4zoQpL61u6EJqA5oF5zwY9wIFE3JuWk0G0raItAATd8r7uPprQRRoYMQdV8siD6C3ZkzbeQ5gTBLGwGPPUsclnppW3GCs8HaHwZvK0iAAq5sj37Z9ujS6KvGKARP5lXNMdF8S0tT6fNidSD2VeMWAcfv9OMEvSEKaWo2XRQwYm3UOGhE80wEk5pNfMqlHEq8YMFEobmc2KpKQhpZR3eNZQ4sSrxiwNty0Sw8BPiEJAujDlp/R4crVgR8Snxagzm1m8FnPSj2QwGmtmUaAaTtzAC4ECWTCNd3PnVaDDahEoZRl5ul1ITVWy9/zQgHWBsULpQPw+QwIw2CM1IcTlsBYZgN3v6bVqyAtd9KEBgwTHsTb+4DmnJPEGgZgIAlCst4KowIfFUTx0b2otHZmo11xg+ZtZz8iGAPjCFC/gpx5EOZRxYI7oWr/hAKfQIBb7XeDDOMKMx1tthQ4okXIqBDxE4I//dkaKnYb0xXQzBdzoEgW4Hi3YbLfyQNXZ9zMYG4937qApu28Af6sDlm6RL3kWmq3eM3EbecFAXslSbpaBl56lhpt52/bYNxemSHQZd1AHR+DZz0rlW31tgfMOw4RdukE6XqYUfIySgUCNG2HdYPC+FxL/VNY2wb7gB1q7qEG68vZuB7meRJ72Z9st7S7fknEQf/Z0AcMW2i/wbAN/gbA1dYpL5kz5gAAAABJRU5ErkJggg==",properties:{actived:!0}},r={type:"bpmn:serviceTask",label:e("bpmn.serviceTaskName"),text:e("bpmn.serviceTaskName"),properties:{"camunda:transName":"bpmn.serviceTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAz9JREFUWEfVmEtoE1EUhv8zqaBgwUwi+K5CJqkoumhBxY11IVTBhaBUUNCFtplQRRSrK+vKVrTgYyZUF7qRigV3dqFg3YhdtAsLapIJKK2vRToRqgtpM0cmtTVJE3IzyWKcXTL/+c83c+/cc+4luPwil/OhKsCVWjJgEVqZM75iD8rk+co08/xHePMnpy/CMaANlyE2RBJbNLvJKaRjQF/UuMaMSyKAROiZCiuXRbSFGseAsp4cALhNLCk9NtXAUTFtvqoKQOMNgJ2CSUdMVdklqM2TlQRc1ze57NfS38eJM2uY+GlabRzPjZR14xuAVYJJv5uqsjpX69Vj24jpECRpAoQRs0N5X8yrKKCsJdeDeBDAjvkgBl5JzHdm6+itlEEfAQcF4eZkRENShs4xZbZaRJ0E7MmJfwemVjMSmBSag7KWvAXiMxUBVCtmum1GAmfLAvq1ZItF/LLafE7iJaa9qUhgODd20RDL0eQzMO93kqDqGKIhMxw4UBJQ1uKnQNK9yhPxFwYZEjhmEc0SEAIoBOYNFXuxddqMhO7Pxy28wfr+uH9JRnoNIFiJKTGfnIoEHxaL8WqJi0TUW4kfgMSMx9o93R5KZb+t+WBZNw4DeFKJmUgJ8+vJJgs8WokvE46lw8qjfEAt3g2SrogaSaDmlBoYE9GviH7YKHHdRxFtVsPWVTMS6s4DtH94dWOUgKZyRszclY4Er5fT5d73aYkTTPSgfAyPm2pw+6I5aP/h743VW8ulfhCVrptEE2Y40FA+0WKFrCc+A7S2ZCzzgPTTak91NU4XBVyYj1r8PEi6UdSI8MIMK/ucAHp1Y7iggvyzYeuCGQndLPQtWYtLmTHhbjqsdDoB9OmJKIM6CmPtMppWlZZinv8noOzWIXb9R+LqZUZ2+0Lt+lLn+mbBXoNc3W4tVBE3N6zZeuz2ln9uqF28afoLWHLbyR6Kwco2tlsqqcfMSHqI2pithqq3nXZigY27abeQgpBpU1XkXG1VG3eRpKJVJ9sgA2NpVWkW8RVut8qZybphD7O9jxG5Bk1VOSIirBmgTzd6GOgSSUpA75SqCB3V1QzQ9QeY9pO6+ghYZGhroXF8gFmL5CIefwB0scE4DheJlAAAAABJRU5ErkJggg==",cls:"import_icon"},i={type:"bpmn:exclusiveGateway",label:e("bpmn.exclusiveGatewayName"),properties:{"camunda:transName":"bpmn.exclusiveGatewayName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAAHeEJUAAAAABGdBTUEAALGPC/xhBQAAAvVJREFUOBGNVEFrE0EU/mY3bQoiFlOkaUJrQUQoWMGePLX24EH0IIoHKQiCV0G8iE1covgLiqA/QTzVm1JPogc9tIJYFaQtlhQxqYjSpunu+L7JvmUTU3AgmTfvffPNN++9WSA1DO182f6xwILzD5btfAoQmwL5KJEwiQyVbSVZ0IgRyV6PTpIJ81E5ZvqfHQR0HUOBHW4L5Et2kQ6Zf7iAOhTFAA8s0pEP7AXO1uAA52SbqGk6h/6J45LaLhO64ByfcUzM39V7ZiAdS2yCePPEIQYvTUHqM/n7dgQNfBKWPjpF4ISk8q3J4nB11qw6X8l+FsF3EhlkEMfrjIer3wJTLwS2aCNcj4DbGxXTw00JmAuO+Ni6bBxVUCvS5d9aa04+so4pHW5jLTywuXAL7jJ+D06sl82Sgl2JuVBQn498zkc2bGKxULHjCnSMadBKYDYYHAtsby1EQ5lNGrQd4Y3v4Zo0XdGEmDno46yCM9Tk+RiJmUYHS/aXHPNTcjxcbTFna000PFJHIVZ5lFRqRpJWk9/+QtlOUYJj9HG5pVFEU7zqIYDVsw2s+AJaD8wTd2umgSCCyUxgGsS1Y6TBwXQQTFuZaHcd8gAGioE90hlsY+wMcs30RduYtxanjMGal8H5dMW67dmT1JFtYUEe8LiQLRsPZ6IIc7A4J5tqco3T0pnv/4u0kyzrYUq7gASuEyI8VXKvB9Odytv6jS/PNaZBln0nioJG/AVQRZvApOdhjj3Jt8QC8Im09SafwdBdvIpztpxWxpeKCC+EsFdS8DCyuCn2munFpL7ctHKp+Xc5cMybeIyMAN33SPL3ZR9QV1XVwLyzHm6Iv0/yeUuUb7PPlZC4D4HZkeu6dpF4v9j9MreGtMbxMMRLIcjJic9yHi7WQ3yVKzZVWUr5UrViJvn1FfUlwe/KYVfYyWRLSGNu16hR01U9IacajXPei0wx/5BqgInvJN+MMNtNme7ReU9SBbgntovn0kKHpFg7UogZvaZiOue/q1SBo9ktHzQAAAAASUVORK5CYII="},o={type:"bpmn:endEvent",label:e("bpmn.endName"),text:e("bpmn.endName"),properties:{"camunda:transName":"bpmn.endName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAA1BJREFUOBFtVE1IVUEYPXOf+tq40Y3vPcmFIdSjIorWoRG0ERWUgnb5FwVhYQSl72oUoZAboxKNFtWiwKRN0M+jpfSzqJAQclHo001tKkjl3emc8V69igP3znzfnO/M9zcDcKT67azmjYWTwl9Vn7Vumeqzj1DVb6cleQY4oAVnIOPb+mKAGxQmKI5CWNJ2aLPatxWa3aB9K7/fB+/Z0jUF6TmMlFLQqrkECWQzOZxYGjTlOl8eeKaIY5yHnFn486xBustDjWT6dG7pmjHOJd+33t0iitTPkK6tEvjxq4h2MozQ6WFSX/LkDUGfFwfhEZj1Auz/U4pyAi5Sznd7uKzznXeVHlI/Aywmk6j7fsUsEuCGADrWARXXwjxWQsUbIupDHJI7kF5dRktg0eN81IbiZXiTESic50iwS+t1oJgL83jAiBupLDCQqwziaWSoAFSeIR3P5Xv5az00wyIn35QRYTwdSYbz8pH8fxUUAtxnFvYmEmgI0wYXUXcCCSpeEVpXlsRhBnCEATxWylL9+EKCAYhe1NGstUa6356kS9NVvt3DU2fd+Wtbm/+lSbylJqsqkSm9CRhvoJVlvKPvF1RKY/FcPn5j4UfIMLn8D4UYb54BNsilTDXKnF4CfTobA0FpoW/LSp306wkXM+XaOJhZaFkcNM82ASNAWMrhrUbRfmyeI1FvRBTpN06WKxa9BK0o2E4Pd3zfBBEwPsv9sQBnmLVbLEIZ/Xe9LYwJu/Er17W6HYVBc7vmuk0xUQ+pqxdom5Fnp55SiytXLPYoMXNM4u4SNSCFWnrVIzKG3EGyMXo6n/BQOe+bX3FClY4PwydVhthOZ9NnS+ntiLh0fxtlUJHAuGaFoVmttpVMeum0p3WEXbcll94l1wM/gZ0Ccczop77VvN2I7TlsZCsuXf1WHvWEhjO8DPtyOVg2/mvK9QqboEth+7pD6NUQC1HN/TwvydGBARi9MZSzLE4b8Ru3XhX2PBxf8E1er2A6516o0w4sIA+lwURhAON82Kwe2iDAC1Watq4XHaGQ7skLcFOtI5lDxuM2gZe6WFIotPAhbaeYlU4to5cuarF1QrcZ/lwrLaCJl66JBocYZnrNlvm2+MBCTmUymPrYZVbjdlr/BxlMjmNmNI3SAAAAAElFTkSuQmCC"},a={icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAUpJREFUWEftVzuywjAMlKgDPV2g4RYPuAnfDs7w4AzQ8b0Jn1vQQDp6SI0YFwFPSMC2EiYZnDLZldYrybERGI/XLs4Aofc2BMHcXV37pmnQlOh1SwMgmijxEYfu4jJVwoZARgKPXeevQLjTSXhDqlcX/l6HI7APgaeOM0LCulIAhDIA1JSwT9ABCM4qHELaVZb+6FUg4L9KgLQxBDTOqUDVEqdsYWSJU85pHN5oio2zGRDzK/DUchpYwI3BorUpdKNmZe1vo4ixDlqBkl2JOCiCaNfuDUFun0QEustrogPldYoU6P9dgWKQ5CoGkxj3XsZ+xcG4JOEdIKo9rEBRLuugfKIOb1mcPuJwwzqUf3U6jW4FCps5LnC4tsRc962D1sGgBziTyOHaHsxUD2b+wMq5RH3lwJopgZm/dnLc+sRN5Nr5KQnne64F3gEyDFZHJCakvQAAAABJRU5ErkJggg==",callback:s=>{t.deleteElement(s.id),t.extension.contextPad.hideContextMenu()}};t.extension.contextPad.setContextMenuItems([a]),t.extension.contextPad.setContextMenuByType("bpmn:startEvent",[n,r,i]),t.extension.contextPad.setContextMenuByType("bpmn:userTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:serviceTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:exclusiveGateway",[n,r])};var Ip={};const Dx=TI(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Px;function T$(){return Px||(Px=1,function(t){(function(e){e.parser=function(w,_){return new r(w,_)},e.SAXParser=r,e.SAXStream=c,e.createStream=u,e.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(w,_){if(!(this instanceof r))return new r(w,_);var F=this;o(F),F.q=F.c="",F.bufferCheckPosition=e.MAX_BUFFER_LENGTH,F.opt=_||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!w,F.noscript=!!(w||F.opt.noscript),F.state=C.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),F.attribList=[],F.opt.xmlns&&(F.ns=Object.create(g)),F.opt.unquotedAttributeValues===void 0&&(F.opt.unquotedAttributeValues=!w),F.trackPosition=F.opt.position!==!1,F.trackPosition&&(F.position=F.line=F.column=0),K(F,"onready")}Object.create||(Object.create=function(w){function _(){}_.prototype=w;var F=new _;return F}),Object.keys||(Object.keys=function(w){var _=[];for(var F in w)w.hasOwnProperty(F)&&_.push(F);return _});function i(w){for(var _=Math.max(e.MAX_BUFFER_LENGTH,10),F=0,L=0,se=n.length;L<se;L++){var fe=w[n[L]].length;if(fe>_)switch(n[L]){case"textNode":R(w);break;case"cdata":J(w,"oncdata",w.cdata),w.cdata="";break;case"script":J(w,"onscript",w.script),w.script="";break;default:B(w,"Max buffer length exceeded: "+n[L])}F=Math.max(F,fe)}var Ne=e.MAX_BUFFER_LENGTH-F;w.bufferCheckPosition=Ne+w.position}function o(w){for(var _=0,F=n.length;_<F;_++)w[n[_]]=""}function a(w){R(w),w.cdata!==""&&(J(w,"oncdata",w.cdata),w.cdata=""),w.script!==""&&(J(w,"onscript",w.script),w.script="")}r.prototype={end:function(){Z(this)},write:$,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var s;try{s=Dx.Stream}catch{s=function(){}}s||(s=function(){});var l=e.EVENTS.filter(function(w){return w!=="error"&&w!=="end"});function u(w,_){return new c(w,_)}function c(w,_){if(!(this instanceof c))return new c(w,_);s.apply(this),this._parser=new r(w,_),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(L){F.emit("error",L),F._parser.error=null},this._decoder=null,l.forEach(function(L){Object.defineProperty(F,"on"+L,{get:function(){return F._parser["on"+L]},set:function(se){if(!se)return F.removeAllListeners(L),F._parser["on"+L]=se,se;F.on(L,se)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(s.prototype,{constructor:{value:c}}),c.prototype.write=function(w){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(w)){if(!this._decoder){var _=Dx.StringDecoder;this._decoder=new _("utf8")}w=this._decoder.write(w)}return this._parser.write(w.toString()),this.emit("data",w),!0},c.prototype.end=function(w){return w&&w.length&&this.write(w),this._parser.end(),!0},c.prototype.on=function(w,_){var F=this;return!F._parser["on"+w]&&l.indexOf(w)!==-1&&(F._parser["on"+w]=function(){var L=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);L.splice(0,0,w),F.emit.apply(F,L)}),s.prototype.on.call(F,w,_)};var d="[CDATA[",f="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",g={xml:h,xmlns:v},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,x=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function b(w){return w===" "||w===`
153
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5(t,e){if(t){if(typeof t=="string")return Ax(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ax(t,e)}}function Ax(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Z5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function J5(t){if(Array.isArray(t))return t}function Ox(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){ps(t,i,n[i])})}return t}function ps(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q5(t,e){if(t==null)return{};var n=e$(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function e$(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}Cx(_5.primary);var Jo=function(e,n){var r,i=Ox({},e,n.attrs),o=i.class,a=i.icon,s=i.spin,l=i.rotate,u=i.tabindex,c=i.twoToneColor,d=i.onClick,f=Q5(i,G5),h=hx(),v=h.prefixCls,g=h.rootClassName,m=(r={},ps(r,g.value,!!g.value),ps(r,v.value,!0),ps(r,"".concat(v.value,"-").concat(a.name),!!a.name),ps(r,"".concat(v.value,"-spin"),!!s||a.name==="loading"),r),y=u;y===void 0&&d&&(y=-1);var x=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,E=Ex(c),b=Y5(E,2),T=b[0],A=b[1];return p.createVNode("span",Ox({role:"img","aria-label":a.name},f,{onClick:d,class:[m,o],tabindex:y}),[p.createVNode(Di,{icon:a,primaryColor:T,secondaryColor:A,style:x},null),p.createVNode(X5,null,null)])};Jo.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:[String,Array]},Jo.displayName="AntdIcon",Jo.inheritAttrs=!1,Jo.getTwoToneColor=V5,Jo.setTwoToneColor=Cx;var t$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function Tx(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?Object(arguments[e]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){n$(t,i,n[i])})}return t}function n$(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rp=function(e,n){var r=Tx({},e,n.attrs);return p.createVNode(Jo,Tx({},r,{icon:t$}),null)};Rp.displayName="EditOutlined",Rp.inheritAttrs=!1;const r$=Qr(p.defineComponent({inheritAttrs:!1,__name:"index",props:p.mergeModels({dictType:{type:String,default:""},include:{type:[Array,String]},exclude:{type:Array},sort:{type:Boolean}},{dictMap:{type:Object},dictMapModifiers:{}}),emits:["update:dictMap"],setup(t){const e=t,n=p.useModel(t,"dictMap"),[r,{fetchDict:i,toList:o}]=eh(e.dictType,{immediate:!1}),a=p.computed(()=>{var l;const s=o(e.dictType);if(e.sort&&s.sort((u,c)=>parseFloat(u.value)-parseFloat(c.value)),e.include){const u=typeof e.include=="string"?e.include.split(","):e.include;return s.filter(c=>u.includes(c.value))}return(l=e.exclude)!=null&&l.length?s.filter(u=>{var c;return!((c=e.exclude)!=null&&c.includes(u.value))}):s});return e.dictType&&i(),p.watch(()=>r.value,()=>{if(n.value&&typeof n.value=="object")for(const s in r.value)n.value[s]=r.value}),(s,l)=>{const u=ie.Select;return p.openBlock(),p.createBlock(u,p.mergeProps({class:"dict-select",placeholder:s.$t("common.plsSelect"),showSearch:!1,options:p.unref(a),dropdownMatchSelectWidth:!1},s.$attrs),null,16,["placeholder","options"])}}}),[["__scopeId","data-v-02a7899b"]]),i$={class:"wrapper"},o$={class:"mt-xs"},a$={class:"flex-sc"},s$={class:"mt-xs"},l$=Qr(p.defineComponent({__name:"RuleConfig",props:{jsonStr:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({});function a(d){const f=d.replace(/(false|true|\d+)(?=")/g,"$1,");return JSON.parse(`{${f}}`)}function s(d){if(typeof d=="string"&&(d.trim().startsWith("{")||d.trim().startsWith("[")))try{return JSON.parse(d),!0}catch{return!1}return!1}function l(){r.jsonStr?(s(r.jsonStr)?o.value=JSON.parse(r.jsonStr):o.value=a(r.jsonStr),o.value.fallbackFirstLinkStatus!==null&&o.value.fallbackFirstLinkStatus!==void 0&&(o.value.fallbackFirstLinkStatus=String(o.value.fallbackFirstLinkStatus))):o.value={revokeRule:!1,fallbackRule:!1,approverRemoveDuplicates:2,timeoutConfigSwitch:!1,timeoutPeriod:1,timeoutHandler:1,fallbackFirstLinkStatus:null}}function u(){Ht.Modal.destroyAll()}function c(){const d=o.value;if(d.timeoutConfigSwitch&&!d.timeoutPeriod){Ht.message.warning(n("bpmn.timeoutPeriodEmptyTip"));return}d.fallbackFirstLinkStatus&&(d.fallbackFirstLinkStatus=Number(d.fallbackFirstLinkStatus)),i("submit",o.value),Ht.Modal.destroyAll()}return p.onMounted(()=>{l()}),(d,f)=>{const h=ie.Checkbox,v=ie.FormItem,g=ie.Radio,m=ie.RadioGroup,y=ie.InputNumber,x=r$,E=ie.Form,b=ie.Button,T=ie.Space;return p.openBlock(),p.createElementBlock("div",i$,[p.createVNode(E,{class:"my-nm","label-col":{span:6},"wrapper-col":{span:18},colon:!1,model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(v,{label:d.$t("bpmn.revertRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).revokeRule,"onUpdate:checked":f[0]||(f[0]=A=>p.unref(o).revokeRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.revertRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.rollbackRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).fallbackRule,"onUpdate:checked":f[1]||(f[1]=A=>p.unref(o).fallbackRule=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.rollbackRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.deduplicationApprovers")},{default:p.withCtx(()=>[p.createElementVNode("div",o$,p.toDisplayString(d.$t("bpmn.deduplicationApproversTxt")),1),p.createVNode(m,{value:p.unref(o).approverRemoveDuplicates,"onUpdate:value":f[2]||(f[2]=A=>p.unref(o).approverRemoveDuplicates=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio1")),1)]),_:1}),p.createVNode(g,{value:2},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.deduplicationRadio2")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutRule")},{default:p.withCtx(()=>[p.createVNode(h,{checked:p.unref(o).timeoutConfigSwitch,"onUpdate:checked":f[3]||(f[3]=A=>p.unref(o).timeoutConfigSwitch=A)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutRuleTxt")),1)]),_:1},8,["checked"])]),_:1},8,["label"]),p.unref(o).timeoutConfigSwitch?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createVNode(v,{label:d.$t("wo_my.timeout")},{default:p.withCtx(()=>[p.createElementVNode("div",a$,[p.createTextVNode(p.toDisplayString(d.$t("bpmn.linkTimeoutTxt1"))+" ",1),p.createVNode(y,{class:"mx-xs",value:p.unref(o).timeoutPeriod,"onUpdate:value":f[4]||(f[4]=A=>p.unref(o).timeoutPeriod=A),min:1,max:1e4,precision:0},null,8,["value"]),p.createTextVNode(" "+p.toDisplayString(d.$t("bpmn.linkTimeoutTxt2")),1)])]),_:1},8,["label"]),p.createVNode(v,{label:d.$t("bpmn.timeoutHandle")},{default:p.withCtx(()=>[p.createElementVNode("div",s$,p.toDisplayString(d.$t("bpmn.timeoutHandleTxt")),1),p.createVNode(m,{value:p.unref(o).timeoutHandler,"onUpdate:value":f[5]||(f[5]=A=>p.unref(o).timeoutHandler=A)},{default:p.withCtx(()=>[p.createVNode(g,{value:0},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio0")),1)]),_:1}),p.createVNode(g,{value:1},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("bpmn.timeoutHandleRadio1")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])],64)):p.createCommentVNode("",!0),p.createVNode(v,{label:d.$t("bpmn.fallbackFirstLinkStatus")},{default:p.withCtx(()=>[p.createVNode(x,{"dict-type":"fallback_first_link_status",value:p.unref(o).fallbackFirstLinkStatus,"onUpdate:value":f[6]||(f[6]=A=>p.unref(o).fallbackFirstLinkStatus=A),placeholder:d.$t("common.plsSelect"),style:{width:"80%"}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>[p.createVNode(b,{onClick:u},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",onClick:c},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(d.$t("common.btn_sure")),1)]),_:1})]),_:1})])}}}),[["__scopeId","data-v-8e7f13af"]]),u$={key:0},c$={key:1,style:{color:"#696868"}},d$=p.defineComponent({__name:"Process",props:p.mergeModels({isEdit:{type:Boolean}},{formState:{},formStateModifiers:{}}),emits:["update:formState"],setup(t){const{modal:e}=Ht.App.useApp(),{t:n}=Dn.useI18n(),r=p.useModel(t,"formState"),i=p.ref(["1","2","3","4","5","6"]);function o(){e.info({title:n("ruleModel.title"),content:p.h(l$,{jsonStr:r.value.jobPriority,onSubmit:a=>{r.value.jobPriority=JSON.stringify(a)}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:850,class:"modal-comp"})}return(a,s)=>{const l=ie.Input,u=ie.FormItem,c=ie.Form,d=ie.CollapsePanel,f=ie.Button,h=ie.Collapse;return p.openBlock(),p.createBlock(h,{activeKey:p.unref(i),"onUpdate:activeKey":s[3]||(s[3]=v=>p.isRef(i)?i.value=v:null)},{default:p.withCtx(()=>[p.createVNode(d,{key:"1",header:a.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Id"),extra:a.$t("FLOW_CHART.idTip")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.id,"onUpdate:value":s[0]||(s[0]=v=>r.value.id=v),placeholder:a.$t("common.plsEnter"),readonly:t.isEdit},null,8,["value","placeholder","readonly"])]),_:1},8,["label","extra"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.name,"onUpdate:value":s[1]||(s[1]=v=>r.value.name=v),placeholder:a.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(u,{label:a.$t("FLOW_CHART.Version Tag")},{default:p.withCtx(()=>[p.createVNode(l,{value:r.value.versionTag,"onUpdate:value":s[2]||(s[2]=v=>r.value.versionTag=v),disabled:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.createVNode(d,{key:"4",header:a.$t("FLOW_CHART.Job Configuration")},{default:p.withCtx(()=>[p.createVNode(c,{layout:"vertical",model:r.value},{default:p.withCtx(()=>[p.createVNode(u,{label:a.$t("FLOW_CHART.Job Priority")},{default:p.withCtx(()=>[p.createVNode(f,{onClick:o,style:{width:"100%"}},{default:p.withCtx(()=>[r.value.jobPriority?(p.openBlock(),p.createElementBlock("span",c$,[p.createTextVNode(p.toDisplayString(p.unref(n)("bpmn.has_config_rule"))+" ",1),p.createVNode(p.unref(Rp))])):(p.openBlock(),p.createElementBlock("span",u$,p.toDisplayString(p.unref(n)("bpmn.no_config_rule")),1))]),_:1})]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),f$=Qr(p.defineComponent({__name:"TemplateConfig",props:{data:{type:Object,default:()=>{}},templateList:{type:Array,default:()=>[]}},emits:["update:data"],setup(t,{emit:e}){const n=e,r=t,i=p.computed({get:()=>r.data,set:u=>{n("update:data",u)}}),o=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("1")}).map(u=>({label:u.name,value:u.id}))),a=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("2")}).map(u=>({label:u.name,value:u.id}))),s=p.computed(()=>r.templateList.filter(u=>{var c;return(c=u==null?void 0:u.type)==null?void 0:c.split(",").includes("3")}).map(u=>({label:u.name,value:u.id}))),l=(u,c)=>c.label.toLowerCase().indexOf(u.toLowerCase())>=0;return(u,c)=>{const d=ie.Select,f=ie.FormItem,h=ie.Form;return p.openBlock(),p.createElementBlock("div",null,[p.createVNode(h,{class:"form-query-select mx-nm mt-nm",layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(f,{label:u.$t("bpmn.todoHandle")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[1],"onUpdate:value":c[0]||(c[0]=v=>i.value[1]=v),options:o.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.todoDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[2],"onUpdate:value":c[1]||(c[1]=v=>i.value[2]=v),options:a.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"]),p.createVNode(f,{label:u.$t("bpmn.AllDetail")},{default:p.withCtx(()=>[p.createVNode(d,{value:i.value[3],"onUpdate:value":c[2]||(c[2]=v=>i.value[3]=v),options:s.value,allowClear:"",placeholder:u.$t("common.plsSelect"),"show-search":"","filter-option":l},null,8,["value","options","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-8a27c7e4"]]),p$={class:"modal-container"},h$=p.defineComponent({__name:"SelectLinkTask",props:{id:{type:String},componentInfo:{type:String,default:""},variable:{type:String,default:""},description:{type:String,default:""}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"},{title:n("bpmn.action"),dataIndex:"action"}]),s=p.ref([]),l=p.ref();function u(k,B){s.value=k,l.value=B}const c=p.ref({1:void 0,2:void 0,3:void 0}),d=p.ref({}),f=p.ref(!1),h=p.ref(""),v=p.ref("");function g(){f.value=!1,h.value=m(c.value)}function m(k){return Object.entries(k).filter(([ee,ce])=>ce!==void 0).map(([ee,ce])=>`${ee}-${ce}`).join(",")}function y(k){if(typeof k!="string"||k.trim()==="")return{};const B=k.split(","),Z={};return B.forEach(ee=>{const[ce,...Be]=ee.split("-");if(ce&&Be.length>0){const me=Be.join("-");Z[ce]=me}}),Z}function x(){f.value=!1}function E(k){d.value=k,f.value=!0}const b=p.ref([]);async function T(){const{result:k}=await Gt.getTemplateList({pageNo:1,pageSize:1e3});b.value=(k==null?void 0:k.data)||[]}const A=p.ref([]);async function S(){const{result:k}=await Gt.getLinkList({pageNo:1,pageSize:1e3});A.value=(k==null?void 0:k.data)||[]}p.watchEffect(()=>{r.id&&(r.id.startsWith("common-approve-")||r.id.startsWith("common-handle-")?(v.value=r.id.slice(-4),s.value=[r.id.slice(0,-4)+"*"]):s.value=[r.id]),r.componentInfo&&(c.value=y(r.componentInfo))});function M(k){l.value=null;const B={...o.value};return Object.assign(B,k),Gt.getLinkList(B)}const C=p.ref(),G=()=>{C.value.refresh()},K=()=>{o.value={},G()};p.onMounted(()=>{K(),T(),S()});function J(){Ht.Modal.destroyAll()}function R(){var k,B;if((k=l.value)!=null&&k.length)i("submit",{...l.value[0],bindComponent:h.value,hasSuffix:""});else if((B=s.value)!=null&&B.length){const Z=A.value.find(ee=>ee.id===s.value[0]);i("submit",{...Z,id:r.id,bindComponent:h.value,hasSuffix:v.value})}Ht.Modal.destroyAll()}return(k,B)=>{const Z=ie.Input,ee=ie.FormItem,ce=ie.Button,Be=ie.Space,me=ie.Form,de=ie.Tooltip,Se=p.resolveComponent("a-table-ex"),je=ie.Modal;return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("div",p$,[p.createVNode(me,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(ee,{label:k.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).id,"onUpdate:value":B[0]||(B[0]=he=>p.unref(o).id=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{label:k.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(Z,{value:p.unref(o).description,"onUpdate:value":B[1]||(B[1]=he=>p.unref(o).description=he),placeholder:k.$t("common.plsEnter"),onKeydown:p.withKeys(G,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(ee,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(Be,null,{default:p.withCtx(()=>[p.createVNode(ce,{type:"primary",onClick:G},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_search")),1)]),_:1}),p.createVNode(ce,{onClick:K},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(Se,{ref_key:"tableEx",ref:C,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:M},{bodyCell:p.withCtx(({record:he,column:Ve})=>[Ve.dataIndex==="action"?(p.openBlock(),p.createBlock(de,{key:0,placement:"top"},{title:p.withCtx(()=>[p.createElementVNode("span",null,p.toDisplayString(k.$t("bpmn.tempConfigTip")),1)]),default:p.withCtx(()=>[p.createVNode(ce,{type:"link",onClick:$=>E(he),style:{"padding-left":"0"},disabled:!p.unref(s).includes(he.id)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("bpmn.tempConfig")),1)]),_:2},1032,["onClick","disabled"])]),_:2},1024)):p.createCommentVNode("",!0)]),_:1},8,["columns","row-selection"]),p.createVNode(Be,{class:"modal-btns"},{default:p.withCtx(()=>{var he;return[p.createVNode(ce,{onClick:J},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(ce,{type:"primary",disabled:!((he=p.unref(s))!=null&&he.length),onClick:R},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(k.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})]),p.createVNode(je,{open:p.unref(f),"onUpdate:open":B[3]||(B[3]=he=>p.isRef(f)?f.value=he:null),title:k.$t("bpmn.tempConfig"),onOk:g,onCancel:x},{default:p.withCtx(()=>[p.createVNode(f$,{data:p.unref(c),"onUpdate:data":B[2]||(B[2]=he=>p.isRef(c)?c.value=he:null),"template-list":p.unref(b)},null,8,["data","template-list"])]),_:1},8,["open","title"])],64)}}}),g$={class:"modal-container"},v$=p.defineComponent({__name:"SelectUser",props:{userIds:{type:String||Array},branchId:{type:String},mode:{type:String,default:"default"}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("user.user_name"),dataIndex:"userName"},{title:n("user.user_id"),dataIndex:"userCode"},{title:n("arrears.org"),dataIndex:"branchName"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.userIds&&(s.value=Array.isArray(r.userIds)?r.userIds:[r.userIds])});function c(m){l.value=null;const y={...o.value,branchId:r.branchId};return Object.assign(y,m),Gt.getUserList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Ht.Modal.destroyAll()}function g(){var m;if((m=l.value)!=null&&m.length){const y=l.value;i("submit",r.mode==="multiple"?y:y[0])}Ht.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",g$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("user.key")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).userName,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).userName=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"userId","row-selection":{type:t.mode==="multiple"?"checkbox":"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),m$=p.defineComponent({__name:"UserTask",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Ht.App.useApp(),{t:r}=Dn.useI18n(),i=p.inject("type"),o=p.inject("isApproval"),a=p.useModel(t,"formState"),s=p.ref(["1","2","3","4","5","6"]),l=p.ref([]),u=p.ref([]),c=p.ref([]),d=p.computed(()=>{var S;const A=a.value.assignee;return(S=String(A))==null?void 0:S.startsWith("${")});function f(){const A="abcdefghijklmnopqrstuvwxyz";let S="";for(let M=0;M<2;M++)S+=A.charAt(Math.floor(Math.random()*A.length));for(let M=0;M<2;M++)S+=Math.floor(Math.random()*10);return S}function h(){console.log(a.value,"formState.value"),n.info({title:r("link.select_link"),content:p.h(h$,{id:a.value.id,variable:a.value.assignee,description:a.value.name,componentInfo:a.value.bindComponent,onSubmit:A=>{let S=A.id;const M=S!==a.value.id;S.endsWith("*")&&(A.hasSuffix?S=S.substring(0,S.length-1)+A.hasSuffix:S=S.substring(0,S.length-1)+f()),Object.assign(a.value,{id:S,name:o?g(S):`bpmn.${i}_${S}`,assignee:"","camunda:assigneeName":"",priority:void 0,userArr:M?[]:a.value.userArr,roleArr:M?[]:a.value.roleArr,approveRank:"0"}),A.variable&&(a.value.assignee=`\${${A.variable}}`),a.value.bindComponent=A.bindComponent||void 0}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function v(){n.info({title:r("user.select_user"),content:p.h(v$,{userIds:a.value.assignee,onSubmit:A=>{Object.assign(a.value,{assignee:A.userId,"camunda:assigneeName":A.userName})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}function g(A){return A.includes("common-approve-")?`bpmn.${A.slice(0,-4)}0`:`bpmn.${A}`}function m(A){A==0?a.value.name=r("bpmn.common-approve-0"):a.value.name=r(`bpmn.${a.value.id.slice(0,-4)}${A}`)}function y(){Gt.getBranchTree().then(A=>{A.code===0&&(l.value=A.result||[])})}function x(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getUserList(A).then(S=>{var M,C;S.code===0&&(c.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.userName,value:G.userId})))||[])})}function E(){const A={pageNo:1,pageSize:1e3,branchId:a.value.priority||void 0};Gt.getRoleList(A).then(S=>{var M,C;S.code===0&&(u.value=((C=(M=S.result)==null?void 0:M.data)==null?void 0:C.map(G=>({...G,label:G.roleName,value:G.roleId})))||[])})}function b(){Object.assign(a.value,{userArr:[],roleArr:[]}),x(),E()}function T(A){if(A!=null&&A.length){const S=c.value.find(M=>M.userId===A[0]);a.value.priority!==S.branchId&&(Object.assign(a.value,{priority:S.branchId,roleArr:[]}),x(),E())}}return p.onMounted(()=>{y(),x(),E()}),(A,S)=>{const M=ie.Input,C=ie.FormItem,G=ie.InputNumber,K=ie.TreeSelect,J=ie.Select,R=ie.Form,k=ie.CollapsePanel,B=ie.Radio,Z=ie.RadioGroup,ee=ie.Checkbox,ce=ie.CheckboxGroup,Be=ie.Collapse;return p.openBlock(),p.createBlock(Be,{activeKey:p.unref(s),"onUpdate:activeKey":S[10]||(S[10]=me=>p.isRef(s)?s.value=me:null)},{default:p.withCtx(()=>[p.createVNode(k,{key:"1",header:A.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(R,{layout:"vertical",model:a.value},{default:p.withCtx(()=>[p.createVNode(C,{label:A.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(M,{value:a.value.id,"onUpdate:value":S[0]||(S[0]=me=>a.value.id=me),placeholder:A.$t("common.plsEnter"),readonly:"",onClick:h},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(M,{value:A.$t(a.value.name),disabled:"",placeholder:A.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),a.value.id&&a.value.id.includes("common-approve-")?(p.openBlock(),p.createBlock(C,{key:0,label:A.$t("FLOW_CHART.approve-rank")},{default:p.withCtx(()=>[p.createVNode(G,{style:{width:"100%"},value:a.value.approveRank,"onUpdate:value":S[1]||(S[1]=me=>a.value.approveRank=me),min:0,max:10,placeholder:A.$t("common.plsEnter"),onChange:m},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0),p.createVNode(C,{label:A.$t("FLOW_CHART.Assignee")},{default:p.withCtx(()=>[p.unref(d)?(p.openBlock(),p.createBlock(M,{key:0,value:a.value.assignee,"onUpdate:value":S[2]||(S[2]=me=>a.value.assignee=me),placeholder:A.$t("common.plsSelect"),disabled:""},null,8,["value","placeholder"])):(p.openBlock(),p.createBlock(M,{key:1,value:a.value["camunda:assigneeName"],"onUpdate:value":S[3]||(S[3]=me=>a.value["camunda:assigneeName"]=me),placeholder:A.$t("common.plsSelect"),readonly:"",onClick:v},null,8,["value","placeholder"]))]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Priority")},{default:p.withCtx(()=>[p.createVNode(K,{value:a.value.priority,"onUpdate:value":S[4]||(S[4]=me=>a.value.priority=me),placeholder:A.$t("common.plsSelect"),"tree-data":p.unref(l),treeDefaultExpandAll:"",treeNodeFilterProp:"label","show-search":"","allow-clear":"",onChange:b},null,8,["value","placeholder","tree-data"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Users")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.userArr,"onUpdate:value":S[5]||(S[5]=me=>a.value.userArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(c),optionFilterProp:"label",disabled:p.unref(d),onChange:T},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"]),p.createVNode(C,{label:A.$t("FLOW_CHART.Candidate Groups")},{default:p.withCtx(()=>[p.createVNode(J,{value:a.value.roleArr,"onUpdate:value":S[6]||(S[6]=me=>a.value.roleArr=me),placeholder:A.$t("common.plsSelect"),mode:"multiple",maxTagCount:10,options:p.unref(u),optionFilterProp:"label",disabled:p.unref(d)},null,8,["value","placeholder","options","disabled"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"]),p.unref(o)?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(k,{key:"2",header:A.$t("FLOW_CHART.isAllowRollback")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.rollback,"onUpdate:value":S[7]||(S[7]=me=>a.value.rollback=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"1"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.yes")),1)]),_:1}),p.createVNode(B,{value:"0"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.no")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"3",header:A.$t("FLOW_CHART.Approval Mode")},{default:p.withCtx(()=>[p.createVNode(Z,{value:a.value.approvalSign,"onUpdate:value":S[8]||(S[8]=me=>a.value.approvalSign=me)},{default:p.withCtx(()=>[p.createVNode(B,{value:"orSign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Or Sign")),1)]),_:1}),p.createVNode(B,{value:"countersign"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.countersign")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0),p.unref(o)?(p.openBlock(),p.createBlock(k,{key:"4",header:A.$t("FLOW_CHART.Approval Required")},{default:p.withCtx(()=>[p.createVNode(ce,{value:a.value.approvalCheckbox,"onUpdate:value":S[9]||(S[9]=me=>a.value.approvalCheckbox=me)},{default:p.withCtx(()=>[p.createVNode(ee,{value:"advice"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Comments Required")),1)]),_:1}),p.createVNode(ee,{value:"attachment"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(A.$t("FLOW_CHART.Attachment Required")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["header"])):p.createCommentVNode("",!0)]),_:1},8,["activeKey"])}}}),y$=p.defineComponent({__name:"ExclusiveGateway",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),_$=p.defineComponent({__name:"SequenceFlow",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.SelectOption,l=ie.Select,u=ie.Form,c=ie.CollapsePanel,d=ie.Collapse;return p.openBlock(),p.createBlock(d,{activeKey:p.unref(n),"onUpdate:activeKey":i[4]||(i[4]=f=>p.isRef(n)?n.value=f:null)},{default:p.withCtx(()=>[p.createVNode(c,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(u,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=f=>e.value.id=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=f=>e.value.name=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Condition Type")},{default:p.withCtx(()=>[p.createVNode(l,{value:e.value.condType,"onUpdate:value":i[2]||(i[2]=f=>e.value.condType=f),placeholder:r.$t("common.plsSelect"),allowClear:""},{default:p.withCtx(()=>[p.createVNode(s,{value:"bpmn:FormalExpression"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(r.$t("FLOW_CHART.Expression")),1)]),_:1})]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),e.value.condType==="bpmn:FormalExpression"?(p.openBlock(),p.createBlock(a,{key:0,label:r.$t("FLOW_CHART.Expression")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.condBody,"onUpdate:value":i[3]||(i[3]=f=>e.value.condBody=f),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])):p.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),b$={class:"modal-container"},x$=p.defineComponent({__name:"SelectLink",props:{id:{type:String}},emits:["submit"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=t,i=e,o=p.ref({}),a=p.ref([{title:n("link.id"),dataIndex:"id"},{title:n("link.description"),dataIndex:"description"},{title:n("link.due"),dataIndex:"due"},{title:n("link.variable"),dataIndex:"variable"}]),s=p.ref([]),l=p.ref();function u(m,y){s.value=m,l.value=y}p.watchEffect(()=>{r.id&&(s.value=[r.id])});function c(m){l.value=null;const y={...o.value};return Object.assign(y,m),Gt.getLinkList(y)}const d=p.ref(),f=()=>{d.value.refresh()},h=()=>{o.value={},f()};p.onMounted(()=>{h()});function v(){Ht.Modal.destroyAll()}function g(){var m;(m=l.value)!=null&&m.length&&i("submit",l.value[0]),Ht.Modal.destroyAll()}return(m,y)=>{const x=ie.Input,E=ie.FormItem,b=ie.Button,T=ie.Space,A=ie.Form,S=p.resolveComponent("a-table-ex");return p.openBlock(),p.createElementBlock("div",b$,[p.createVNode(A,{class:"form-query mx-nm mt-nm",layout:"vertical",model:p.unref(o)},{default:p.withCtx(()=>[p.createVNode(E,{label:m.$t("link.id")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).id,"onUpdate:value":y[0]||(y[0]=M=>p.unref(o).id=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{label:m.$t("link.description")},{default:p.withCtx(()=>[p.createVNode(x,{value:p.unref(o).description,"onUpdate:value":y[1]||(y[1]=M=>p.unref(o).description=M),placeholder:m.$t("common.plsEnter"),onKeydown:p.withKeys(f,["enter"])},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(E,{class:"form-btns"},{default:p.withCtx(()=>[p.createVNode(T,null,{default:p.withCtx(()=>[p.createVNode(b,{type:"primary",onClick:f},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_search")),1)]),_:1}),p.createVNode(b,{onClick:h},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_reset")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),p.createVNode(S,{ref_key:"tableEx",ref:d,class:"table-query bordered mx-nm",columns:p.unref(a),rowKey:"id","row-selection":{type:"radio",selectedRowKeys:p.unref(s),onChange:u},loadData:c},null,8,["columns","row-selection"]),p.createVNode(T,{class:"modal-btns"},{default:p.withCtx(()=>{var M;return[p.createVNode(b,{onClick:v},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_cancel1")),1)]),_:1}),p.createVNode(b,{type:"primary",disabled:!((M=p.unref(s))!=null&&M.length),onClick:g},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(m.$t("common.btn_sure")),1)]),_:1},8,["disabled"])]}),_:1})])}}}),E$=p.defineComponent({__name:"EndEvent",props:{formState:{},formStateModifiers:{}},emits:p.mergeModels(["updateNodeName"],["update:formState"]),setup(t,{emit:e}){const{modal:n}=Ht.App.useApp(),{t:r}=Dn.useI18n(),i=p.useModel(t,"formState"),o=p.ref(["1","2","3","4","5","6"]);function a(){const c="abcdefghijklmnopqrstuvwxyz";let d="";for(let f=0;f<2;f++)d+=c.charAt(Math.floor(Math.random()*c.length));for(let f=0;f<2;f++)d+=Math.floor(Math.random()*10);return d}const s=e;function l(){s("updateNodeName",i.value.id,i.value.name)}function u(){n.info({title:r("link.select_link"),content:p.h(x$,{id:i.value.id,onSubmit:c=>{let d=c.id;d.endsWith("*")&&(d=d.substring(0,d.length-1)+a()),Object.assign(i.value,{id:d,name:"bpmn.endName"})}}),centered:!0,icon:null,footer:null,closable:!0,maskClosable:!0,width:800,class:"modal-comp"})}return(c,d)=>{const f=ie.Input,h=ie.FormItem,v=ie.Form,g=ie.CollapsePanel,m=ie.Collapse;return p.openBlock(),p.createBlock(m,{activeKey:p.unref(o),"onUpdate:activeKey":d[1]||(d[1]=y=>p.isRef(o)?o.value=y:null)},{default:p.withCtx(()=>[p.createVNode(g,{key:"1",header:c.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(v,{layout:"vertical",model:i.value},{default:p.withCtx(()=>[p.createVNode(h,{label:c.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(f,{value:i.value.id,"onUpdate:value":d[0]||(d[0]=y=>i.value.id=y),placeholder:c.$t("common.plsEnter"),readonly:"",onClick:u},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(h,{label:c.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(f,{value:c.$t(i.value.name),disabled:"",placeholder:c.$t("common.plsEnter"),onChange:l},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),w$=p.defineComponent({__name:"Other",props:{formState:{},formStateModifiers:{}},emits:["update:formState"],setup(t){const e=p.useModel(t,"formState"),n=p.ref(["1","2","3","4","5","6"]);return(r,i)=>{const o=ie.Input,a=ie.FormItem,s=ie.Form,l=ie.CollapsePanel,u=ie.Collapse;return p.openBlock(),p.createBlock(u,{activeKey:p.unref(n),"onUpdate:activeKey":i[2]||(i[2]=c=>p.isRef(n)?n.value=c:null)},{default:p.withCtx(()=>[p.createVNode(l,{key:"1",header:r.$t("FLOW_CHART.General")},{default:p.withCtx(()=>[p.createVNode(s,{layout:"vertical",model:e.value},{default:p.withCtx(()=>[p.createVNode(a,{label:r.$t("FLOW_CHART.Id")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.id,"onUpdate:value":i[0]||(i[0]=c=>e.value.id=c),placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"]),p.createVNode(a,{label:r.$t("FLOW_CHART.Name")},{default:p.withCtx(()=>[p.createVNode(o,{value:e.value.name,"onUpdate:value":i[1]||(i[1]=c=>e.value.name=c),disabled:"",placeholder:r.$t("common.plsEnter")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["header"])]),_:1},8,["activeKey"])}}}),S$={class:"properties-panel"},C$=Qr(p.defineComponent({__name:"BpmnPropertiesPanel",props:{lfRef:{type:Object},isEdit:{type:Boolean},processAttrs:{type:Object}},emits:["changeProcess"],setup(t,{emit:e}){const{t:n}=Dn.useI18n(),r=e,i=t,o=p.ref(""),a=p.ref({}),s=p.ref({});let l;p.watch(()=>i.lfRef,()=>{i.lfRef&&(s.value=i.lfRef,u())}),p.watch(a,(h,v)=>{h===v&&d()},{deep:!0});function u(){s.value.on("node:click",({data:h,e:v,position:g})=>{c(h)}),s.value.on("edge:click,",({data:h,e:v,position:g})=>{c(h)}),s.value.on("blank:click",({e:h})=>{o.value="bpmn:process",a.value={id:i.processAttrs.id||"Process_1",name:i.processAttrs.name,jobPriority:i.processAttrs["camunda:jobPriority"]}})}function c(h){var m;if(!h||l===h)return;l=h;const v=h.type;o.value="",p.nextTick(()=>{o.value=v});const g={...h.properties,id:h.id,name:((m=h.text)==null?void 0:m.value)||""};v==="bpmn:userTask"?(Object.assign(g,{rollback:g["camunda:rollback"]==="1"?"1":"0",approvalCheckbox:[]}),Object.assign(g,{approvalSign:g["camunda:countersign"]==="true"?"countersign":"orSign",approvalCheckbox:[]}),g["camunda:assignee"]&&(g.assignee=g["camunda:assignee"]),g["camunda:priority"]&&(g.priority=g["camunda:priority"]),g["camunda:advice"]==="true"&&g.approvalCheckbox.push("advice"),g["camunda:attachment"]==="true"&&g.approvalCheckbox.push("attachment"),g["camunda:bindComponent"]&&(g.bindComponent=g["camunda:bindComponent"]),g.hasOwnProperty("camunda:approveRank")?g.approveRank=g["camunda:approveRank"]:g.id.includes("common-approve-")&&(g.approveRank=0),typeof g["camunda:candidateUsers"]=="number"?g.userArr=[g["camunda:candidateUsers"].toString()]:typeof g["camunda:candidateUsers"]=="string"?g.userArr=(g["camunda:candidateUsers"]||"").split(",").filter(y=>y):g.userArr=[],typeof g["camunda:candidateGroups"]=="number"?g.roleArr=[g["camunda:candidateGroups"].toString()]:typeof g["camunda:candidateGroups"]=="string"?g.roleArr=(g["camunda:candidateGroups"]||"").split(",").filter(y=>y):g.roleArr=[]):v==="bpmn:sequenceFlow"&&(console.log("data.properties",h.properties,h.properties["bpmn:conditionExpression"]),h.properties["bpmn:conditionExpression"]&&Object.assign(g,{condType:h.properties["bpmn:conditionExpression"]["xsi:type"],condBody:h.properties["bpmn:conditionExpression"]["#text"].replace(/\s+/g,"")})),a.value=g}function d(){var m,y;const h=a.value;function v(x){return x?"true":"false"}const g={id:h.id,name:h.name};if(console.log("bpmnType.value",o.value),o.value==="bpmn:process")h.jobPriority&&Object.assign(g,{"camunda:jobPriority":h.jobPriority}),r("changeProcess",g);else if(o.value==="bpmn:userTask"){Object.assign(g,{"camunda:orSign":v(h.approvalSign==="orSign"),"camunda:rollback":h.rollback==="1"?"1":"0","camunda:countersign":v(h.approvalSign==="countersign"),"camunda:advice":v(h.approvalCheckbox.includes("advice")),"camunda:attachment":v(h.approvalCheckbox.includes("attachment")),"camunda:assignee":h.assignee||"","camunda:assigneeName":h["camunda:assigneeName"]||"","camunda:priority":h.priority||"","camunda:candidateUsers":((m=h.userArr)==null?void 0:m.join())||"","camunda:candidateGroups":((y=h.roleArr)==null?void 0:y.join())||"","camunda:bindComponent":h.bindComponent||"","camunda:approveRank":h.approveRank,"camunda:transName":h.name,name:n(h.name)}),console.log("activeNode.id, attrs",l.id,g);const{id:x}=l,{id:E}=h;if(E&&x!==E)if(!s.value.getNodeModelById(E))s.value.changeNodeId(x,E);else{Ht.message.warning(n("bpmn.repeat_id_tip"));const{eventCenter:T}=s.value.graphModel;T.emit("blank:click",{});return}p.nextTick(()=>{s.value.getNodeModelById(E).setProperties(g),s.value.updateText(E,n(h.name))})}}function f(h,v){l.id&&(s.value.setProperties(l.id,{name:v}),s.value.updateText(l.id,v))}return(h,v)=>{const g=zm;return p.openBlock(),p.createElementBlock("div",S$,[p.createVNode(g,null,{default:p.withCtx(()=>[p.unref(o)==="bpmn:process"?(p.openBlock(),p.createBlock(d$,{key:0,formState:p.unref(a),"onUpdate:formState":v[0]||(v[0]=m=>p.isRef(a)?a.value=m:null),isEdit:t.isEdit},null,8,["formState","isEdit"])):p.unref(o)==="bpmn:userTask"?(p.openBlock(),p.createBlock(m$,{key:1,formState:p.unref(a),"onUpdate:formState":v[1]||(v[1]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)==="bpmn:exclusiveGateway"?(p.openBlock(),p.createBlock(y$,{key:2,formState:p.unref(a),"onUpdate:formState":v[2]||(v[2]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:sequenceFlow"?(p.openBlock(),p.createBlock(_$,{key:3,formState:p.unref(a),"onUpdate:formState":v[3]||(v[3]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.unref(o)==="bpmn:endEvent"?(p.openBlock(),p.createBlock(E$,{key:4,formState:p.unref(a),"onUpdate:formState":v[4]||(v[4]=m=>p.isRef(a)?a.value=m:null),onUpdateNodeName:f},null,8,["formState"])):p.unref(o)?(p.openBlock(),p.createBlock(w$,{key:5,formState:p.unref(a),"onUpdate:formState":v[5]||(v[5]=m=>p.isRef(a)?a.value=m:null)},null,8,["formState"])):p.createCommentVNode("",!0)]),_:1})])}}}),[["__scopeId","data-v-f008f12f"]]),Lp="menu-common",Nx=200,A$=100;class Mx{constructor({lf:e}){Yp(this,"setContextMenuByType",(e,n)=>{this.menuTypeMap.set(e,n)});Yp(this,"listenDelete",()=>{this.hideContextMenu()});this.menuTypeMap=new Map,this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Lp,[])}render(e,n){this.container=n,e.on("node:click",({data:r})=>{this._activeData=r,this.createContextMenu(),console.log(r)}),e.on("edge:click",({data:r})=>{this._activeData=r,this.createContextMenu()}),e.on("blank:click",()=>{this.hideContextMenu()})}hideContextMenu(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1}showContextMenu(e){if(!e||!e.id){console.warn("请检查传入的参数");return}this._activeData=e,this.createContextMenu()}setContextMenuItems(e){this.menuTypeMap.set(Lp,e)}getContextMenuPosition(){const e=this._activeData,n=this.lf.graphModel.getElement(e.id);if(!n){console.warn(`找不到元素${e.id}`);return}let r,i;if(n.BaseType==="edge"){r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER;const o=n.getData();r=Math.max(o.startPoint.x,r),i=Math.min(o.startPoint.y,i),r=Math.max(o.endPoint.x,r),i=Math.min(o.endPoint.y,i),o.pointsList&&o.pointsList.forEach(a=>{r=Math.max(a.x,r),i=Math.min(a.y,i)})}return n.BaseType==="node"&&(r=e.x+n.width/2,i=e.y-n.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([r,i])}createContextMenu(){const{isSilentMode:e}=this.lf.options;if(e)return;let n=this.menuTypeMap.get(this._activeData.type)||[];n=n.concat(this.menuTypeMap.get(Lp));const r=document.createDocumentFragment();n.forEach(i=>{const o=document.createElement("div");o.className="lf-context-item";const a=document.createElement("img");a.src=i.icon,a.className="lf-context-img",i.className&&(o.className=`${o.className} ${i.className}`),a.addEventListener("click",()=>{this.hideContextMenu(),i.callback?i.callback(this._activeData):this.addNode({sourceId:this._activeData.id,x:this._activeData.x,y:this._activeData.y,properties:i.properties,type:i.type,text:i.text||""})}),o.appendChild(a),r.appendChild(o)}),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(r),this.showMenu()}addNode(e,n){const r=n!==void 0;n===void 0&&(n=e.y);const i=this.lf.getNodeModelById(e.sourceId),o=e.x-100+Nx,a=n-e.y/2-20,s=e.x+100+Nx,l=n+e.y/2+20,u=this.lf.getAreaElement([o,a],[s,l]);if(console.log(u),u.length){n=n+A$,this.addNode(e,n);return}const c=this.lf.addNode({type:e.type,x:e.x+200,y:n,properties:e.properties,text:e.text});let d,f;r&&(d={x:e.x,y:e.y+i.height/2},f={x:c.x-c.width/2,y:c.y}),this.lf.addEdge({sourceNodeId:e.sourceId,targetNodeId:c.id,startPoint:d,endPoint:f})}showMenu(){const[e,n]=this.getContextMenuPosition();this.__menuDOM.style.display="flex",this.__menuDOM.style.top=`${n}px`,this.__menuDOM.style.left=`${e+10}px`,this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}}Mx.pluginName="contextPad";const O$=(t,e)=>{const n={type:"bpmn:userTask",label:e("bpmn.userTaskName"),text:e("bpmn.userTaskName"),properties:{"camunda:transName":"bpmn.userTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAp1JREFUWEftlj9oE2EYxp/3IkSckotOpqDgl5ZWcLBgxcVBdBL8gw66iCg2lxrBzcl0qpPS1lyQKm5uiuBUHBztoAjVVtOLRDA46Z06VAvmXkkwQWLS3PudQwn54KY8z/v8eO7uvRA2+KENzoc+YNg71PsNxm6VYxStnibwIQCnAF4kptcMv+RWjSlk1VqYFkM1mLCLx5jpJoh2doD4zoQpL61u6EJqA5oF5zwY9wIFE3JuWk0G0raItAATd8r7uPprQRRoYMQdV8siD6C3ZkzbeQ5gTBLGwGPPUsclnppW3GCs8HaHwZvK0iAAq5sj37Z9ujS6KvGKARP5lXNMdF8S0tT6fNidSD2VeMWAcfv9OMEvSEKaWo2XRQwYm3UOGhE80wEk5pNfMqlHEq8YMFEobmc2KpKQhpZR3eNZQ4sSrxiwNty0Sw8BPiEJAujDlp/R4crVgR8Snxagzm1m8FnPSj2QwGmtmUaAaTtzAC4ECWTCNd3PnVaDDahEoZRl5ul1ITVWy9/zQgHWBsULpQPw+QwIw2CM1IcTlsBYZgN3v6bVqyAtd9KEBgwTHsTb+4DmnJPEGgZgIAlCst4KowIfFUTx0b2otHZmo11xg+ZtZz8iGAPjCFC/gpx5EOZRxYI7oWr/hAKfQIBb7XeDDOMKMx1tthQ4okXIqBDxE4I//dkaKnYb0xXQzBdzoEgW4Hi3YbLfyQNXZ9zMYG4937qApu28Af6sDlm6RL3kWmq3eM3EbecFAXslSbpaBl56lhpt52/bYNxemSHQZd1AHR+DZz0rlW31tgfMOw4RdukE6XqYUfIySgUCNG2HdYPC+FxL/VNY2wb7gB1q7qEG68vZuB7meRJ72Z9st7S7fknEQf/Z0AcMW2i/wbAN/gbA1dYpL5kz5gAAAABJRU5ErkJggg==",properties:{actived:!0}},r={type:"bpmn:serviceTask",label:e("bpmn.serviceTaskName"),text:e("bpmn.serviceTaskName"),properties:{"camunda:transName":"bpmn.serviceTaskName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAz9JREFUWEfVmEtoE1EUhv8zqaBgwUwi+K5CJqkoumhBxY11IVTBhaBUUNCFtplQRRSrK+vKVrTgYyZUF7qRigV3dqFg3YhdtAsLapIJKK2vRToRqgtpM0cmtTVJE3IzyWKcXTL/+c83c+/cc+4luPwil/OhKsCVWjJgEVqZM75iD8rk+co08/xHePMnpy/CMaANlyE2RBJbNLvJKaRjQF/UuMaMSyKAROiZCiuXRbSFGseAsp4cALhNLCk9NtXAUTFtvqoKQOMNgJ2CSUdMVdklqM2TlQRc1ze57NfS38eJM2uY+GlabRzPjZR14xuAVYJJv5uqsjpX69Vj24jpECRpAoQRs0N5X8yrKKCsJdeDeBDAjvkgBl5JzHdm6+itlEEfAQcF4eZkRENShs4xZbZaRJ0E7MmJfwemVjMSmBSag7KWvAXiMxUBVCtmum1GAmfLAvq1ZItF/LLafE7iJaa9qUhgODd20RDL0eQzMO93kqDqGKIhMxw4UBJQ1uKnQNK9yhPxFwYZEjhmEc0SEAIoBOYNFXuxddqMhO7Pxy28wfr+uH9JRnoNIFiJKTGfnIoEHxaL8WqJi0TUW4kfgMSMx9o93R5KZb+t+WBZNw4DeFKJmUgJ8+vJJgs8WokvE46lw8qjfEAt3g2SrogaSaDmlBoYE9GviH7YKHHdRxFtVsPWVTMS6s4DtH94dWOUgKZyRszclY4Er5fT5d73aYkTTPSgfAyPm2pw+6I5aP/h743VW8ulfhCVrptEE2Y40FA+0WKFrCc+A7S2ZCzzgPTTak91NU4XBVyYj1r8PEi6UdSI8MIMK/ucAHp1Y7iggvyzYeuCGQndLPQtWYtLmTHhbjqsdDoB9OmJKIM6CmPtMppWlZZinv8noOzWIXb9R+LqZUZ2+0Lt+lLn+mbBXoNc3W4tVBE3N6zZeuz2ln9uqF28afoLWHLbyR6Kwco2tlsqqcfMSHqI2pithqq3nXZigY27abeQgpBpU1XkXG1VG3eRpKJVJ9sgA2NpVWkW8RVut8qZybphD7O9jxG5Bk1VOSIirBmgTzd6GOgSSUpA75SqCB3V1QzQ9QeY9pO6+ghYZGhroXF8gFmL5CIefwB0scE4DheJlAAAAABJRU5ErkJggg==",cls:"import_icon"},i={type:"bpmn:exclusiveGateway",label:e("bpmn.exclusiveGatewayName"),properties:{"camunda:transName":"bpmn.exclusiveGatewayName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAAHeEJUAAAAABGdBTUEAALGPC/xhBQAAAvVJREFUOBGNVEFrE0EU/mY3bQoiFlOkaUJrQUQoWMGePLX24EH0IIoHKQiCV0G8iE1covgLiqA/QTzVm1JPogc9tIJYFaQtlhQxqYjSpunu+L7JvmUTU3AgmTfvffPNN++9WSA1DO182f6xwILzD5btfAoQmwL5KJEwiQyVbSVZ0IgRyV6PTpIJ81E5ZvqfHQR0HUOBHW4L5Et2kQ6Zf7iAOhTFAA8s0pEP7AXO1uAA52SbqGk6h/6J45LaLhO64ByfcUzM39V7ZiAdS2yCePPEIQYvTUHqM/n7dgQNfBKWPjpF4ISk8q3J4nB11qw6X8l+FsF3EhlkEMfrjIer3wJTLwS2aCNcj4DbGxXTw00JmAuO+Ni6bBxVUCvS5d9aa04+so4pHW5jLTywuXAL7jJ+D06sl82Sgl2JuVBQn498zkc2bGKxULHjCnSMadBKYDYYHAtsby1EQ5lNGrQd4Y3v4Zo0XdGEmDno46yCM9Tk+RiJmUYHS/aXHPNTcjxcbTFna000PFJHIVZ5lFRqRpJWk9/+QtlOUYJj9HG5pVFEU7zqIYDVsw2s+AJaD8wTd2umgSCCyUxgGsS1Y6TBwXQQTFuZaHcd8gAGioE90hlsY+wMcs30RduYtxanjMGal8H5dMW67dmT1JFtYUEe8LiQLRsPZ6IIc7A4J5tqco3T0pnv/4u0kyzrYUq7gASuEyI8VXKvB9Odytv6jS/PNaZBln0nioJG/AVQRZvApOdhjj3Jt8QC8Im09SafwdBdvIpztpxWxpeKCC+EsFdS8DCyuCn2munFpL7ctHKp+Xc5cMybeIyMAN33SPL3ZR9QV1XVwLyzHm6Iv0/yeUuUb7PPlZC4D4HZkeu6dpF4v9j9MreGtMbxMMRLIcjJic9yHi7WQ3yVKzZVWUr5UrViJvn1FfUlwe/KYVfYyWRLSGNu16hR01U9IacajXPei0wx/5BqgInvJN+MMNtNme7ReU9SBbgntovn0kKHpFg7UogZvaZiOue/q1SBo9ktHzQAAAAASUVORK5CYII="},o={type:"bpmn:endEvent",label:e("bpmn.endName"),text:e("bpmn.endName"),properties:{"camunda:transName":"bpmn.endName"},icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAH6ji2bAAAABGdBTUEAALGPC/xhBQAAA1BJREFUOBFtVE1IVUEYPXOf+tq40Y3vPcmFIdSjIorWoRG0ERWUgnb5FwVhYQSl72oUoZAboxKNFtWiwKRN0M+jpfSzqJAQclHo001tKkjl3emc8V69igP3znzfnO/M9zcDcKT67azmjYWTwl9Vn7Vumeqzj1DVb6cleQY4oAVnIOPb+mKAGxQmKI5CWNJ2aLPatxWa3aB9K7/fB+/Z0jUF6TmMlFLQqrkECWQzOZxYGjTlOl8eeKaIY5yHnFn486xBustDjWT6dG7pmjHOJd+33t0iitTPkK6tEvjxq4h2MozQ6WFSX/LkDUGfFwfhEZj1Auz/U4pyAi5Sznd7uKzznXeVHlI/Aywmk6j7fsUsEuCGADrWARXXwjxWQsUbIupDHJI7kF5dRktg0eN81IbiZXiTESic50iwS+t1oJgL83jAiBupLDCQqwziaWSoAFSeIR3P5Xv5az00wyIn35QRYTwdSYbz8pH8fxUUAtxnFvYmEmgI0wYXUXcCCSpeEVpXlsRhBnCEATxWylL9+EKCAYhe1NGstUa6356kS9NVvt3DU2fd+Wtbm/+lSbylJqsqkSm9CRhvoJVlvKPvF1RKY/FcPn5j4UfIMLn8D4UYb54BNsilTDXKnF4CfTobA0FpoW/LSp306wkXM+XaOJhZaFkcNM82ASNAWMrhrUbRfmyeI1FvRBTpN06WKxa9BK0o2E4Pd3zfBBEwPsv9sQBnmLVbLEIZ/Xe9LYwJu/Er17W6HYVBc7vmuk0xUQ+pqxdom5Fnp55SiytXLPYoMXNM4u4SNSCFWnrVIzKG3EGyMXo6n/BQOe+bX3FClY4PwydVhthOZ9NnS+ntiLh0fxtlUJHAuGaFoVmttpVMeum0p3WEXbcll94l1wM/gZ0Ccczop77VvN2I7TlsZCsuXf1WHvWEhjO8DPtyOVg2/mvK9QqboEth+7pD6NUQC1HN/TwvydGBARi9MZSzLE4b8Ru3XhX2PBxf8E1er2A6516o0w4sIA+lwURhAON82Kwe2iDAC1Watq4XHaGQ7skLcFOtI5lDxuM2gZe6WFIotPAhbaeYlU4to5cuarF1QrcZ/lwrLaCJl66JBocYZnrNlvm2+MBCTmUymPrYZVbjdlr/BxlMjmNmNI3SAAAAAElFTkSuQmCC"},a={icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAUpJREFUWEftVzuywjAMlKgDPV2g4RYPuAnfDs7w4AzQ8b0Jn1vQQDp6SI0YFwFPSMC2EiYZnDLZldYrybERGI/XLs4Aofc2BMHcXV37pmnQlOh1SwMgmijxEYfu4jJVwoZARgKPXeevQLjTSXhDqlcX/l6HI7APgaeOM0LCulIAhDIA1JSwT9ABCM4qHELaVZb+6FUg4L9KgLQxBDTOqUDVEqdsYWSJU85pHN5oio2zGRDzK/DUchpYwI3BorUpdKNmZe1vo4ixDlqBkl2JOCiCaNfuDUFun0QEustrogPldYoU6P9dgWKQ5CoGkxj3XsZ+xcG4JOEdIKo9rEBRLuugfKIOb1mcPuJwwzqUf3U6jW4FCps5LnC4tsRc962D1sGgBziTyOHaHsxUD2b+wMq5RH3lwJopgZm/dnLc+sRN5Nr5KQnne64F3gEyDFZHJCakvQAAAABJRU5ErkJggg==",callback:s=>{t.deleteElement(s.id),t.extension.contextPad.hideContextMenu()}};t.extension.contextPad.setContextMenuItems([a]),t.extension.contextPad.setContextMenuByType("bpmn:startEvent",[n,r,i]),t.extension.contextPad.setContextMenuByType("bpmn:userTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:serviceTask",[n,r,i,o]),t.extension.contextPad.setContextMenuByType("bpmn:exclusiveGateway",[n,r])};var Ip={};const Dx=TI(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Px;function T$(){return Px||(Px=1,function(t){(function(e){e.parser=function(w,_){return new r(w,_)},e.SAXParser=r,e.SAXStream=c,e.createStream=u,e.MAX_BUFFER_LENGTH=64*1024;var n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(w,_){if(!(this instanceof r))return new r(w,_);var F=this;o(F),F.q=F.c="",F.bufferCheckPosition=e.MAX_BUFFER_LENGTH,F.opt=_||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!w,F.noscript=!!(w||F.opt.noscript),F.state=C.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),F.attribList=[],F.opt.xmlns&&(F.ns=Object.create(g)),F.opt.unquotedAttributeValues===void 0&&(F.opt.unquotedAttributeValues=!w),F.trackPosition=F.opt.position!==!1,F.trackPosition&&(F.position=F.line=F.column=0),K(F,"onready")}Object.create||(Object.create=function(w){function _(){}_.prototype=w;var F=new _;return F}),Object.keys||(Object.keys=function(w){var _=[];for(var F in w)w.hasOwnProperty(F)&&_.push(F);return _});function i(w){for(var _=Math.max(e.MAX_BUFFER_LENGTH,10),F=0,L=0,se=n.length;L<se;L++){var fe=w[n[L]].length;if(fe>_)switch(n[L]){case"textNode":R(w);break;case"cdata":J(w,"oncdata",w.cdata),w.cdata="";break;case"script":J(w,"onscript",w.script),w.script="";break;default:B(w,"Max buffer length exceeded: "+n[L])}F=Math.max(F,fe)}var Ne=e.MAX_BUFFER_LENGTH-F;w.bufferCheckPosition=Ne+w.position}function o(w){for(var _=0,F=n.length;_<F;_++)w[n[_]]=""}function a(w){R(w),w.cdata!==""&&(J(w,"oncdata",w.cdata),w.cdata=""),w.script!==""&&(J(w,"onscript",w.script),w.script="")}r.prototype={end:function(){Z(this)},write:$,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var s;try{s=Dx.Stream}catch{s=function(){}}s||(s=function(){});var l=e.EVENTS.filter(function(w){return w!=="error"&&w!=="end"});function u(w,_){return new c(w,_)}function c(w,_){if(!(this instanceof c))return new c(w,_);s.apply(this),this._parser=new r(w,_),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(L){F.emit("error",L),F._parser.error=null},this._decoder=null,l.forEach(function(L){Object.defineProperty(F,"on"+L,{get:function(){return F._parser["on"+L]},set:function(se){if(!se)return F.removeAllListeners(L),F._parser["on"+L]=se,se;F.on(L,se)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(s.prototype,{constructor:{value:c}}),c.prototype.write=function(w){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(w)){if(!this._decoder){var _=Dx.StringDecoder;this._decoder=new _("utf8")}w=this._decoder.write(w)}return this._parser.write(w.toString()),this.emit("data",w),!0},c.prototype.end=function(w){return w&&w.length&&this.write(w),this._parser.end(),!0},c.prototype.on=function(w,_){var F=this;return!F._parser["on"+w]&&l.indexOf(w)!==-1&&(F._parser["on"+w]=function(){var L=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);L.splice(0,0,w),F.emit.apply(F,L)}),s.prototype.on.call(F,w,_)};var d="[CDATA[",f="DOCTYPE",h="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",g={xml:h,xmlns:v},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,x=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function b(w){return w===" "||w===`
154
154
  `||w==="\r"||w===" "}function T(w){return w==='"'||w==="'"}function A(w){return w===">"||b(w)}function S(w,_){return w.test(_)}function M(w,_){return!S(w,_)}var C=0;e.STATE={BEGIN:C++,BEGIN_WHITESPACE:C++,TEXT:C++,TEXT_ENTITY:C++,OPEN_WAKA:C++,SGML_DECL:C++,SGML_DECL_QUOTED:C++,DOCTYPE:C++,DOCTYPE_QUOTED:C++,DOCTYPE_DTD:C++,DOCTYPE_DTD_QUOTED:C++,COMMENT_STARTING:C++,COMMENT:C++,COMMENT_ENDING:C++,COMMENT_ENDED:C++,CDATA:C++,CDATA_ENDING:C++,CDATA_ENDING_2:C++,PROC_INST:C++,PROC_INST_BODY:C++,PROC_INST_ENDING:C++,OPEN_TAG:C++,OPEN_TAG_SLASH:C++,ATTRIB:C++,ATTRIB_NAME:C++,ATTRIB_NAME_SAW_WHITE:C++,ATTRIB_VALUE:C++,ATTRIB_VALUE_QUOTED:C++,ATTRIB_VALUE_CLOSED:C++,ATTRIB_VALUE_UNQUOTED:C++,ATTRIB_VALUE_ENTITY_Q:C++,ATTRIB_VALUE_ENTITY_U:C++,CLOSE_TAG:C++,CLOSE_TAG_SAW_WHITE:C++,SCRIPT:C++,SCRIPT_ENDING:C++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(w){var _=e.ENTITIES[w],F=typeof _=="number"?String.fromCharCode(_):_;e.ENTITIES[w]=F});for(var G in e.STATE)e.STATE[e.STATE[G]]=G;C=e.STATE;function K(w,_,F){w[_]&&w[_](F)}function J(w,_,F){w.textNode&&R(w),K(w,_,F)}function R(w){w.textNode=k(w.opt,w.textNode),w.textNode&&K(w,"ontext",w.textNode),w.textNode=""}function k(w,_){return w.trim&&(_=_.trim()),w.normalize&&(_=_.replace(/\s+/g," ")),_}function B(w,_){return R(w),w.trackPosition&&(_+=`
155
155
  Line: `+w.line+`
156
156
  Column: `+w.column+`
@@ -182,4 +182,4 @@ ${u}`}if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return this
182
182
  </bpmndi:BPMNPlane>
183
183
  </bpmndi:BPMNDiagram>
184
184
  </bpmn:definitions>
185
- `}let u=p.ref({});function c(){Gt.getBpmnXml({code:r.data.code}).then(h=>{var v;if(h.code===0){const g=h.result.text,x=new DOMParser().parseFromString(g,"text/xml").getElementsByTagName("bpmn:process")[0];if(x){const E={};for(let b=0;b<x.attributes.length;b++){const T=x.attributes[b];E[T.name]=T.value}console.log("原始 process 属性:",u),u.value=E,console.log("提取的 process 属性:",u)}(v=o.value)==null||v.render(zx(g,n)),p.nextTick(()=>{const{eventCenter:E}=o.value.graphModel;E.emit("blank:click",{})})}})}function d(h){u.value=Object.assign({},u.value,h),console.log("processAttrs",u.value)}p.onMounted(()=>{s(),r.data.code?c():(o.value.render(zx(l(),n)),p.nextTick(()=>{const{eventCenter:h}=o.value.graphModel;h.emit("blank:click",{})}))}),p.onUnmounted(()=>{o.value.destroy()});function f(){return I$(o.value.getGraphData(),u.value)}return e({saveXML:f}),(h,v)=>(p.openBlock(),p.createElementBlock("div",H$,[p.createElementVNode("div",{id:"graph",ref_key:"container",ref:i},null,512),p.createVNode(C$,{lfRef:p.unref(o),isEdit:t.data.opType==="2",processAttrs:p.unref(u),onChangeProcess:d},null,8,["lfRef","isEdit","processAttrs"])]))}}),[["__scopeId","data-v-248ac0b1"]]),W$={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function U$(t,e){return p.openBlock(),p.createElementBlock("svg",W$,e[0]||(e[0]=[p.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const V$=p.markRaw({name:"ant-design-left",render:U$}),X$={class:"container"},G$={class:"viewer-container"},Y$=Qr(p.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(t){const{t:e}=Dn.useI18n(),n=t,r=p.computed(()=>{const l=n.data.opType||"1";if(l==="1")return e("bpmn.add_workflow");if(l==="2")return e("bpmn.edit_workflow");if(l==="3")return e("bpmn.clone_workflow")}),i=p.inject(cl);function o(){i==null||i.emit("changeComp",{comp:"BusTypeList"})}const a=p.ref();function s(){var f;const l=(f=a.value)==null?void 0:f.saveXML();if(!l)return;const u={type:n.data.type,text:l};((n.data.opType||"1")==="2"?Gt.bpmnUpdate(u):Gt.bpmnInsert(u)).then(h=>{h.code===0&&(i==null||i.emit("changeComp",{comp:"BusTypeList"}))})}return(l,u)=>{const c=V$,d=ie.Button,f=ie.Space,h=ie.PageHeader,v=z$;return p.openBlock(),p.createElementBlock("div",X$,[p.createVNode(h,{class:"page-header-sticky",title:p.unref(r),onBack:o},{backIcon:p.withCtx(()=>[p.createVNode(c)]),extra:p.withCtx(()=>[p.createVNode(f,null,{default:p.withCtx(()=>[p.createVNode(d,{type:"default",onClick:o},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_cancel")),1)]),_:1}),p.createVNode(d,{type:"primary",onClick:s},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),p.createElementVNode("div",G$,[p.createVNode(v,{ref_key:"bpmnViewer",ref:a,data:t.data},null,8,["data"])])])}}}),[["__scopeId","data-v-832ed055"]]),K$={class:"wrapper"},q$=Qr(p.defineComponent({components:{BusTypeList:jI,BpmnEditPage:Y$},__name:"index",setup(t){const e=p.ref("BusTypeList"),n=p.ref(),r=pE(cl);return p.provide(cl,r),r.on((i,o)=>{i==="changeComp"&&(e.value=o.comp,n.value=o)}),(i,o)=>{const a=mE;return p.openBlock(),p.createBlock(a,null,{default:p.withCtx(()=>[p.createElementVNode("div",K$,[(p.openBlock(),p.createBlock(p.KeepAlive,{include:"BusTypeList"},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(p.unref(e)),{data:p.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);Kp.createPinia();function Z$(t){nc().setLang(t)}function J$(t,e){const{i18n:n,pinia:r,theme:i}=e;Xx(n);const o=nc();o.setTheme(i),o.setupLangWatcher()}const Q$={install:J$};pt.WfManagePage=q$,pt.default=Q$,pt.setWorkflowLang=Z$,Object.defineProperties(pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
185
+ `}let u=p.ref({});function c(){Gt.getBpmnXml({code:r.data.code}).then(h=>{var v;if(h.code===0){const g=h.result.text,x=new DOMParser().parseFromString(g,"text/xml").getElementsByTagName("bpmn:process")[0];if(x){const E={};for(let b=0;b<x.attributes.length;b++){const T=x.attributes[b];E[T.name]=T.value}console.log("原始 process 属性:",u),u.value=E,console.log("提取的 process 属性:",u)}(v=o.value)==null||v.render(zx(g,n)),p.nextTick(()=>{const{eventCenter:E}=o.value.graphModel;E.emit("blank:click",{})})}})}function d(h){u.value=Object.assign({},u.value,h),console.log("processAttrs",u.value)}p.onMounted(()=>{s(),r.data.code?c():(o.value.render(zx(l(),n)),p.nextTick(()=>{const{eventCenter:h}=o.value.graphModel;h.emit("blank:click",{})}))}),p.onUnmounted(()=>{o.value.destroy()});function f(){return I$(o.value.getGraphData(),u.value)}return e({saveXML:f}),(h,v)=>(p.openBlock(),p.createElementBlock("div",H$,[p.createElementVNode("div",{id:"graph",ref_key:"container",ref:i},null,512),p.createVNode(C$,{lfRef:p.unref(o),isEdit:t.data.opType==="2",processAttrs:p.unref(u),onChangeProcess:d},null,8,["lfRef","isEdit","processAttrs"])]))}}),[["__scopeId","data-v-248ac0b1"]]),W$={class:"icon",viewBox:"0 0 1024 1024",width:"1.2em",height:"1.2em"};function U$(t,e){return p.openBlock(),p.createElementBlock("svg",W$,e[0]||(e[0]=[p.createElementVNode("path",{fill:"currentColor",d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281l360-281.1c3.8-3 6.1-7.7 6.1-12.6"},null,-1)]))}const V$=p.markRaw({name:"ant-design-left",render:U$}),X$={class:"container"},G$={class:"viewer-container"},Y$=Qr(p.defineComponent({__name:"BpmnEditPage",props:{data:{type:Object,required:!0}},setup(t){const{t:e}=Dn.useI18n(),n=t,r=p.computed(()=>{const l=n.data.opType||"1";if(l==="1")return e("bpmn.add_workflow");if(l==="2")return e("bpmn.edit_workflow");if(l==="3")return e("bpmn.clone_workflow")}),i=p.inject(dl);function o(){i==null||i.emit("changeComp",{comp:"BusTypeList"})}const a=p.ref();function s(){var f;const l=(f=a.value)==null?void 0:f.saveXML();if(!l)return;const u={type:n.data.type,text:l};((n.data.opType||"1")==="2"?Gt.bpmnUpdate(u):Gt.bpmnInsert(u)).then(h=>{h.code===0&&(i==null||i.emit("changeComp",{comp:"BusTypeList"}))})}return(l,u)=>{const c=V$,d=ie.Button,f=ie.Space,h=ie.PageHeader,v=z$;return p.openBlock(),p.createElementBlock("div",X$,[p.createVNode(h,{class:"page-header-sticky",title:p.unref(r),onBack:o},{backIcon:p.withCtx(()=>[p.createVNode(c)]),extra:p.withCtx(()=>[p.createVNode(f,null,{default:p.withCtx(()=>[p.createVNode(d,{type:"default",onClick:o},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_cancel")),1)]),_:1}),p.createVNode(d,{type:"primary",onClick:s},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(l.$t("common.btn_ok")),1)]),_:1})]),_:1})]),_:1},8,["title"]),p.createElementVNode("div",G$,[p.createVNode(v,{ref_key:"bpmnViewer",ref:a,data:t.data},null,8,["data"])])])}}}),[["__scopeId","data-v-832ed055"]]),K$={class:"wrapper"},q$=Qr(p.defineComponent({components:{BusTypeList:jI,BpmnEditPage:Y$},__name:"index",setup(t){const e=p.ref("BusTypeList"),n=p.ref(),r=pE(dl);return p.provide(dl,r),r.on((i,o)=>{i==="changeComp"&&(e.value=o.comp,n.value=o)}),(i,o)=>{const a=mE;return p.openBlock(),p.createBlock(a,null,{default:p.withCtx(()=>[p.createElementVNode("div",K$,[(p.openBlock(),p.createBlock(p.KeepAlive,{include:"BusTypeList"},[(p.openBlock(),p.createBlock(p.resolveDynamicComponent(p.unref(e)),{data:p.unref(n)},null,8,["data"]))],1024))])]),_:1})}}}),[["__scopeId","data-v-82fb5b00"]]);Kp.createPinia();function Z$(t){Ss().setLang(t)}function J$(t,e){const{i18n:n,pinia:r,theme:i}=e;Xx(n);const o=Ss();o.setTheme(i),e.needI18nRequest&&o.setupLangWatcher()}const Q$={install:J$};pt.WfManagePage=q$,pt.default=Q$,pt.setWorkflowLang=Z$,Object.defineProperties(pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});