@oneclick.dev/cms-kit 0.0.132 → 0.0.133

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.
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),t=require("@vue-flow/core"),r=require("nuxt/app");function n(e,t){if(!e)return"";return function(e,t,r="text"){const n=a(e);if(!n.length)return e;if(1===n.length&&0===n[0].start&&n[0].end===e.length)return o(n[0].expression,t);let u="",s=0;for(const a of n)u+=e.slice(s,a.start),u+=i(o(a.expression,t),r),s=a.end;return u+e.slice(s)}(e,function(e){const t=["__proto__","constructor","prototype"],r=e=>{if(Array.isArray(e))return e.map(r);if(e&&"object"==typeof e){const n={};for(const o in e)t.includes(o)||(n[o]=r(e[o]));return n}return e},n={};for(const o in e)!t.includes(o)&&f(o)&&(n[o]=r(e[o]));return n}(t?.reduce((e,t)=>(e[t.name]=t.value,e),{})??{}))}function o(e,t){if(!e)return"";const r=function(e){const t=e.match(/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g)||[],r=new Set(["true","false","null","undefined","return","if","else","try","catch","typeof","new","delete","void","throw","in","instanceof","var","let","const","function","class","this","super","switch","case","break","continue","default","for","while","do","of","with","yield","await","async","import","export","from","debugger"]);return[...new Set(t.filter(e=>!r.has(e)&&!d.has(e)))]}(e),n={...t};for(const a of r)a in n||(n[a]=void 0);const o=Object.keys(n),i=Object.values(n);try{return new Function(...o,`'use strict'; return (${e})`)(...i)}catch(u){return void console.warn(`Interpolation failed for expression: "${e}"`,u)}}function i(e,t){if("js"===t){if(null==e)return"null";if("string"==typeof e)return JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return"null"}}if(null==e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const u=new Map;function a(e){const t=[];let r=0;for(;r<e.length;){const n=e.indexOf("{{",r);if(-1===n)break;const o=s(e,n+2);-1!==o?(t.push({start:n,end:o+2,expression:e.slice(n+2,o).trim()}),r=o+2):r=n+2}return t}function s(e,t){let r=e.indexOf("}}",t);for(;-1!==r;){if(c(e.slice(t,r).trim()))return r;r=e.indexOf("}}",r+1)}return-1}function c(e){if(!e)return!0;const t=u.get(e);if(void 0!==t)return t;let r=!1;try{new Function(`'use strict'; return (${e})`),r=!0}catch{r=!1}return u.set(e,r),r}function f(e){return/^[$A-Z_][0-9A-Z_$]*$/i.test(e)}const d=new Set(["Number","String","Boolean","Array","Object","JSON","Math","Date","RegExp","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","NaN","Infinity","Intl"]);function l(e,t,r,n,o=8e3){const i=crypto.randomUUID();return new Promise((u,a)=>{const s=e=>{const t=e.data;t&&"response"===t.type&&t.id===i&&(f(),u(t.payload))},c=setTimeout(()=>{f(),a(new Error("Timed out waiting for response"))},o),f=()=>{clearTimeout(c),window.removeEventListener("message",s)};window.addEventListener("message",s);const d=JSON.parse(JSON.stringify(r));e.postMessage({type:t,id:i,payload:d},n)})}const h={"api-request":async(e,{node:t})=>{try{let r=Object.keys(e).map(t=>({name:t,value:e[t]})),o=n(t.data.url,r),i=n(t.data.method,r).toUpperCase(),u=t.data.body?.map(e=>({key:n(e.key,r),value:n(e.value,r)}))||[],a=t.data.headers?.map(e=>({key:n(e.key,r),value:n(e.value,r)}))||[],s=t.data.cookies?.map(e=>({key:n(e.key,r),value:n(e.value,r)}))||[];const c=(t.data.urlParameters?.map(e=>({key:n(e.key,r),value:n(e.value,r)}))||[]).filter(e=>e.key).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"),f=c?`${o}?${c}`:o,d={};if(a.forEach(({key:e,value:t})=>{e&&(d[e]=t)}),s.length>0){const e=s.map(({key:e,value:t})=>`${e}=${t}`).join("; ");d.Cookie=e}let l=null;if(["POST","PUT","PATCH"].includes(i)){const e={};u.forEach(({key:t,value:r})=>{t&&(e[t]=r)}),l=JSON.stringify(e),d["Content-Type"]||="application/json"}const h=await fetch(f,{method:i,headers:d,body:l,credentials:"include"});if(h.status>=400)return{result:{success:!1,status:h.status}};let p;const v=h.headers.get("content-type");return p=v?.includes("application/json")?await h.json():await h.text(),{result:{success:!0,data:p,status:h.status}}}catch(r){return{result:{success:!1,status:r.status||500}}}},conditional:async(e,{node:t})=>({conditionMet:!!p(t.data.condition,e)}),switch:async(e,{node:t})=>({value:t.data.expression?p(t.data.expression,e):void 0}),"for-each":async(e,{node:t})=>{let r=t.data.itemsExpression?p(t.data.itemsExpression,e):[],n=v(r);return{items:n,itemCount:n.length}},"merge-wait":async e=>({merged:!0,...e}),"integration-action":async(e,{node:t})=>{const{$useIntegrationActions:n}=r.useNuxtApp(),{fireAction:o}=n(t.data.action.integration);return{result:await o(t.data.action,e)}},"show-toast":async(e,{node:t})=>{let r=Object.keys(e).map(t=>({name:t,value:e[t]}));console.log("Showing toast with variables",r,e,t);let o=n(t.data.title,r),i=n(t.data.message,r);return"true"===document.documentElement.dataset.moduleOverlayMode?(window.parent.postMessage({type:"toast:show",payload:{title:o,description:i}},"*"),{shown:!0}):(window.postMessage({type:"toast:show",payload:{title:o,description:i}},"*"),{shown:!0})},"finish-flow":async(e,{node:t,onFinish:r})=>{if(t.data.returnData){let n=p(t.data.transform,e);r({finishAllFlows:!0===t.data.finishAllFlows},n)}else r({finishAllFlows:!0===t.data.finishAllFlows});return{finished:!0}},confetti:async(e,{node:t})=>{const{$confetti:n}=r.useNuxtApp();return n(),{confetti:!0}},confirm:async(e,{node:t})=>{const{$useConfirmation:o}=r.useNuxtApp(),{confirm:i}=o();if(i){let r=Object.keys(e).map(t=>({name:t,value:e[t]})),o=n(t.data.title,r),u=n(t.data.message,r),a=n(t.data.confirmText,r);if("true"===document.documentElement.dataset.moduleOverlayMode){return{confirmed:(await l(window.parent,"confirmation-modal:show",{message:u,title:o,confirmText:a},"*")).confirmed}}return{confirmed:await i(u,o,a)}}return{confirmed:!1}},"set-variable":async(e,{node:t,localVariables:r})=>{let o=Object.keys(e).map(t=>({name:t,value:e[t]})),i={};for(const u of t.data.updateActions??[]){const e=r.value.find(e=>e.id===u.variableId),t=n(u.value,o);e&&("element"===e?.type?(e.value.value=t,i[e.name]={value:t}):(e.value=t,i[e.name]=t)),window.dispatchEvent(new CustomEvent("flow-update-form-variable",{detail:{id:u.variableId,value:t}}))}return{set:!0,...i}},"transform-data":async(e,{node:t})=>({transformed:!0,value:p(t.data.transform,e)}),"visit-url":async(e,{node:t})=>{let r=Object.keys(e).map(t=>({name:t,value:e[t]})),o=n(t.data.url,r);return t.data.newTab?window.open(o,"_blank"):window.location.href=o,{visited:!0}},"show-dialog":async(e,{node:t,flowBuilderExtensions:n})=>{const{$useCustomDialog:o}=r.useNuxtApp(),{openCustomDialog:i}=o();let u=Object.keys(e).map(t=>({name:t,value:e[t]}));if("true"===document.documentElement.dataset.moduleOverlayMode){window.parent.__pendingDialogExtensions={formBuilderExtensions:[],flowBuilderExtensions:n};return await l(window.parent,"dialog:show",{layout:t.data.layout,variables:u},"*")}return await i(t.data.layout,u,[],n)},"show-module":async(e,{node:t})=>{const{$useModuleOverlay:o}=r.useNuxtApp(),{openInOverlay:i}=o();let u=Object.keys(e).map(t=>({name:t,value:e[t]}));const a={};if(t.data.moduleData?.forEach(e=>{a[n(e.key,u)]=n(e.value,u)}),"true"===document.documentElement.dataset.moduleOverlayMode){return await l(window.parent,"module-overlay:show",{moduleId:t.data.moduleId,params:a},"*")}return await i(t.data.moduleId,a)},"wait-delay":async(e,{node:t})=>{let r=parseInt(t.data.delayMs)||0;return await new Promise(e=>setTimeout(e,r)),{waited:!0}},"ai-agent":async(e,{node:t})=>{const{$useAgentService:o}=r.useNuxtApp(),i=o(),u=Object.keys(e).map(t=>({name:t,value:e[t]})),a=t.data.projectSlug,s=t.data.agentId,c=t.data.method;if(!a)throw new Error("AI Agent node: missing project slug");if(!s)throw new Error("AI Agent node: no agent selected");if(!c)throw new Error("AI Agent node: no method selected");if("get-collaborators"===c){return{collaborators:await i.getAgentCollaborators(a,s)}}if("create-conversation"===c){const e=n(t.data.userId,u),r=n(t.data.message,u),o=await i.flowCreateConversation(a,s,{userId:e,message:r});return{conversationId:o.conversationId,messageId:o.messageId}}if("add-to-conversation"===c){const e=n(t.data.conversationId,u),r=n(t.data.message,u),o=await i.flowAddAgentMessage(a,s,{conversationId:e,message:r});return{messageId:o.messageId,conversationId:o.conversationId}}throw new Error(`AI Agent node: unknown method "${c}"`)}},p=(e,t={})=>{var r=document.createElement("iframe");document.body.appendChild(r);var n=r.contentWindow.Function;return document.body.removeChild(r),n(...Object.keys(t),"'use strict';"+e)(...Object.values(t))},v=e=>null==e?[]:Array.isArray(e)?e:"object"==typeof e?Object.entries(e).map(([e,t])=>({key:e,value:t})):[e],g={ERROR:"error",SKIPPED:"skipped",CANCELLED:"cancelled",FINISHED:"finished",RUNNING:"running"};function y(e){if(null==e)return"";if("object"==typeof e)try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)}var m,b,w,_,E,j,O,k,x,N,I,C,S,A,M,P,L,F,T,R,D,z,V,G,B,U,$,W,q,Y,J,H,K,Q,Z,X,ee,te,re,ne,oe,ie,ue,ae,se,ce,fe,de,le,he,pe,ve,ge,ye,me,be,we,_e,Ee,je,Oe,ke,xe,Ne,Ie,Ce,Se,Ae,Me,Pe,Le,Fe,Te,Re,De,ze,Ve,Ge,Be,Ue,$e,We,qe,Ye,Je,He,Ke,Qe,Ze,Xe,et,tt,rt,nt,ot="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function it(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ut(){if(b)return m;b=1;var e="\0";function t(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function n(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}return o+""+i+""+(void 0===n?"\0":n)}function o(e,t){return n(e,t.v,t.w,t.name)}return m=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(t){t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(t,r){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=e,this._children[t]={},this._children[e][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===r)r=e;else{for(var n=r+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==e)return r}}children(t=e){if(this._isCompound){var r=this._children[t];if(r)return Object.keys(r)}else{if(t===e)return this.nodes();if(this.hasNode(t))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};function o(e){var i=r.parent(e);return void 0===i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:o(i)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,o(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,r,o,i,u=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,r=a.w,o=a.name,2===arguments.length&&(i=arguments[1],u=!0)):(e=a,r=arguments[1],o=arguments[3],arguments.length>2&&(i=arguments[2],u=!0)),e=""+e,r=""+r,void 0!==o&&(o=""+o);var s=n(this._isDirected,e,r,o);if(Object.hasOwn(this._edgeLabels,s))return u&&(this._edgeLabels[s]=i),this;if(void 0!==o&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=u?i:this._defaultEdgeLabelFn(e,r,o);var c=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};n&&(a.name=n);return a}(this._isDirected,e,r,o);return e=c.v,r=c.w,Object.freeze(c),this._edgeObjs[s]=c,t(this._preds[r],e),t(this._sucs[e],r),this._in[r][s]=c,this._out[e][s]=c,this._edgeCount++,this}edge(e,t,r){var i=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,r);return this._edgeLabels[i]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var i=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,i)}removeEdge(e,t,i){var u=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,i),a=this._edgeObjs[u];return a&&(e=a.v,t=a.w,delete this._edgeLabels[u],delete this._edgeObjs[u],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][u],delete this._out[e][u],this._edgeCount--),this}inEdges(e,t){var r=this._in[e];if(r){var n=Object.values(r);return t?n.filter(e=>e.v===t):n}}outEdges(e,t){var r=this._out[e];if(r){var n=Object.values(r);return t?n.filter(e=>e.w===t):n}}nodeEdges(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))}},m}function at(){if(k)return O;k=1;var e=ut();function t(e){return e.nodes().map(function(t){var r=e.node(t),n=e.parent(t),o={v:t};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o})}function r(e){return e.edges().map(function(t){var r=e.edge(t),n={v:t.v,w:t.w};return void 0!==t.name&&(n.name=t.name),void 0!==r&&(n.value=r),n})}return O={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};void 0!==e.graph()&&(n.value=structuredClone(e.graph()));return n},read:function(t){var r=new e(t.options).setGraph(t.value);return t.nodes.forEach(function(e){r.setNode(e.v,e.value),e.parent&&r.setParent(e.v,e.parent)}),t.edges.forEach(function(e){r.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),r}}}function st(){if(N)return x;return N=1,x=function(e){var t,r={},n=[];function o(n){Object.hasOwn(r,n)||(r[n]=!0,t.push(n),e.successors(n).forEach(o),e.predecessors(n).forEach(o))}return e.nodes().forEach(function(e){t=[],o(e),t.length&&n.push(t)}),n}}function ct(){if(C)return I;C=1;return I=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(e=String(e),!Object.hasOwn(r,e)){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}function ft(){if(A)return S;A=1;var e=ct();S=function(r,n,o,i){return function(t,r,n,o){var i,u,a={},s=new e,c=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),c=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,s.decrease(t,c))};t.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;a[e]={distance:t},s.add(e,t)});for(;s.size()>0&&(i=s.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(c);return a}(r,String(n),o||t,i||function(e){return r.outEdges(e)})};var t=()=>1;return S}function dt(){if(P)return M;P=1;var e=ft();return M=function(t,r,n){return t.nodes().reduce(function(o,i){return o[i]=e(t,i,r,n),o},{})}}function lt(){if(F)return L;return F=1,L=function(e){var t=0,r=[],n={},o=[];function i(u){var a=n[u]={onStack:!0,lowlink:t,index:t++};if(r.push(u),e.successors(u).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var s,c=[];do{s=r.pop(),n[s].onStack=!1,c.push(s)}while(u!==s);o.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(n,e)||i(e)}),o}}function ht(){if(R)return T;R=1;var e=lt();return T=function(t){return e(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}}function pt(){if(z)return D;z=1,D=function(t,r,n){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],u=i[r],a=n.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)})})}),n}(t,r||e,n||function(e){return t.outEdges(e)})};var e=()=>1;return D}function vt(){if(G)return V;function e(e){var r={},n={},o=[];if(e.sinks().forEach(function i(u){if(Object.hasOwn(n,u))throw new t;Object.hasOwn(r,u)||(n[u]=!0,r[u]=!0,e.predecessors(u).forEach(i),delete n[u],o.push(u))}),Object.keys(r).length!==e.nodeCount())throw new t;return o}G=1;class t extends Error{constructor(){super(...arguments)}}return V=e,e.CycleException=t,V}function gt(){if(U)return B;U=1;var e=vt();return B=function(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}}function yt(){if(W)return $;function e(e,t,n,o){for(var i=[[e,!1]];i.length>0;){var u=i.pop();u[1]?o.push(u[0]):Object.hasOwn(n,u[0])||(n[u[0]]=!0,i.push([u[0],!0]),r(t(u[0]),e=>i.push([e,!1])))}}function t(e,t,n,o){for(var i=[e];i.length>0;){var u=i.pop();Object.hasOwn(n,u)||(n[u]=!0,o.push(u),r(t(u),e=>i.push(e)))}}function r(e,t){for(var r=e.length;r--;)t(e[r],r,e);return e}return W=1,$=function(r,n,o){Array.isArray(n)||(n=[n]);var i=r.isDirected()?e=>r.successors(e):e=>r.neighbors(e),u="post"===o?e:t,a=[],s={};return n.forEach(e=>{if(!r.hasNode(e))throw new Error("Graph does not have node: "+e);u(e,i,s,a)}),a}}function mt(){if(Y)return q;Y=1;var e=yt();return q=function(t,r){return e(t,r,"post")}}function bt(){if(H)return J;H=1;var e=yt();return J=function(t,r){return e(t,r,"pre")}}function wt(){if(Q)return K;Q=1;var e=ut(),t=ct();return K=function(r,n){var o,i=new e,u={},a=new t;function s(e){var t=e.v===o?e.w:e.v,r=a.priority(t);if(void 0!==r){var i=n(e);i<r&&(u[t]=o,a.decrease(t,i))}}if(0===r.nodeCount())return i;r.nodes().forEach(function(e){a.add(e,Number.POSITIVE_INFINITY),i.setNode(e)}),a.decrease(r.nodes()[0],0);var c=!1;for(;a.size()>0;){if(o=a.removeMin(),Object.hasOwn(u,o))i.setEdge(o,u[o]);else{if(c)throw new Error("Input graph is not connected: "+r);c=!0}r.nodeEdges(o).forEach(s)}return i}}function _t(){if(te)return ee;te=1;var e=j?E:(j=1,E={Graph:ut(),version:_?w:(_=1,w="2.2.4")});return ee={Graph:e.Graph,json:at(),alg:X?Z:(X=1,Z={components:st(),dijkstra:ft(),dijkstraAll:dt(),findCycles:ht(),floydWarshall:pt(),isAcyclic:gt(),postorder:mt(),preorder:bt(),prim:wt(),tarjan:lt(),topsort:vt()}),version:e.version}}function Et(){if(ie)return oe;ie=1;let e=_t().Graph,t=function(){if(ne)return re;function e(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function t(e,t){if("_next"!==e&&"_prev"!==e)return t}return ne=1,re=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let t=this._sentinel,r=t._prev;if(r!==t)return e(r),r}enqueue(t){let r=this._sentinel;t._prev&&t._next&&e(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){let e=[],r=this._sentinel,n=r._prev;for(;n!==r;)e.push(JSON.stringify(n,t)),n=n._prev;return"["+e.join(", ")+"]"}}}();oe=function(i,u){if(i.nodeCount()<=1)return[];let a=function(r,n){let i=new e,u=0,a=0;r.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),r.edges().forEach(e=>{let t=i.edge(e.v,e.w)||0,r=n(e),o=t+r;i.setEdge(e.v,e.w,o),a=Math.max(a,i.node(e.v).out+=r),u=Math.max(u,i.node(e.w).in+=r)});let s=function(e){const t=[];for(let r=0;r<e;r++)t.push(r);return t}(a+u+3).map(()=>new t),c=u+1;return i.nodes().forEach(e=>{o(s,c,i.node(e))}),{graph:i,buckets:s,zeroIdx:c}}(i,u||r);return function(e,t,r){let o,i=[],u=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;o=a.dequeue();)n(e,t,r,o);for(;o=u.dequeue();)n(e,t,r,o);if(e.nodeCount())for(let u=t.length-2;u>0;--u)if(o=t[u].dequeue(),o){i=i.concat(n(e,t,r,o,!0));break}}return i}(a.graph,a.buckets,a.zeroIdx).flatMap(e=>i.outEdges(e.v,e.w))};let r=()=>1;function n(e,t,r,n,i){let u=i?[]:void 0;return e.inEdges(n.v).forEach(n=>{let a=e.edge(n),s=e.node(n.v);i&&u.push({v:n.v,w:n.w}),s.out-=a,o(t,r,s)}),e.outEdges(n.v).forEach(n=>{let i=e.edge(n),u=n.w,a=e.node(u);a.in-=i,o(t,r,a)}),e.removeNode(n.v),u}function o(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}return oe}function jt(){if(ae)return ue;ae=1;let e=_t().Graph;function t(e,t,r,n){for(var o=n;e.hasNode(o);)o=u(n);return r.dummy=t,e.setNode(o,r),o}ue={addBorderNode:function(e,r,n,o){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=o);return t(e,"border",i,r)},addDummyNode:t,applyWithChunking:n,asNonCompoundGraph:function(t){let r=new e({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(e=>{t.children(e).length||r.setNode(e,t.node(e))}),t.edges().forEach(e=>{r.setEdge(e,t.edge(e))}),r},buildLayerMatrix:function(e){let t=a(o(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,u=t.x-o,a=t.y-i,s=e.width/2,c=e.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(a)*s>Math.abs(u)*c?(a<0&&(c=-c),r=c*u/a,n=c):(u<0&&(s=-s),r=s,n=s*a/u);return{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;"string"==typeof t&&(r=e=>e[t]);return Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:o,normalizeRanks:function(e){let t=e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}),r=n(Math.min,t);e.nodes().forEach(t=>{let n=e.node(t);Object.hasOwn(n,"rank")&&(n.rank-=r)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){const r={};for(const n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return s(e.nodes(),t)},range:a,removeEmptyRanks:function(e){let t=e.nodes().map(t=>e.node(t).rank),r=n(Math.min,t),o=[];e.nodes().forEach(t=>{let n=e.node(t).rank-r;o[n]||(o[n]=[]),o[n].push(t)});let i=0,u=e.graph().nodeRankFactor;Array.from(o).forEach((t,r)=>{void 0===t&&r%u!==0?--i:void 0!==t&&i&&t.forEach(t=>e.node(t).rank+=i)})},simplify:function(t){let r=(new e).setGraph(t.graph());return t.nodes().forEach(e=>r.setNode(e,t.node(e))),t.edges().forEach(e=>{let n=r.edge(e.v,e.w)||{weight:0,minlen:1},o=t.edge(e);r.setEdge(e.v,e.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),r},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return s(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:u,zipObject:s};const r=65535;function n(e,t){if(t.length>r){const n=function(e,t=r){const n=[];for(let r=0;r<e.length;r+=t){const o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function o(e){const t=e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MIN_VALUE:r});return n(Math.max,t)}let i=0;function u(e){return e+""+ ++i}function a(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);const o=[];for(let i=e;n(i);i+=r)o.push(i);return o}function s(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}return ue}function Ot(){if(ce)return se;ce=1;let e=Et(),t=jt().uniqueId;return se={run:function(r){("greedy"===r.graph().acyclicer?e(r,(n=r,e=>n.edge(e).weight)):function(e){let t=[],r={},n={};function o(i){Object.hasOwn(n,i)||(n[i]=!0,r[i]=!0,e.outEdges(i).forEach(e=>{Object.hasOwn(r,e.w)?t.push(e):o(e.w)}),delete r[i])}return e.nodes().forEach(o),t}(r)).forEach(e=>{let n=r.edge(e);r.removeEdge(e),n.forwardName=e.name,n.reversed=!0,r.setEdge(e.w,e.v,n,t("rev"))});var n},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}function kt(){if(de)return fe;de=1;let e=jt();return fe={run:function(t){t.graph().dummyChains=[],t.edges().forEach(r=>function(t,r){let n,o,i,u=r.v,a=t.node(u).rank,s=r.w,c=t.node(s).rank,f=r.name,d=t.edge(r),l=d.labelRank;if(c===a+1)return;for(t.removeEdge(r),i=0,++a;a<c;++i,++a)d.points=[],o={width:0,height:0,edgeLabel:d,edgeObj:r,rank:a},n=e.addDummyNode(t,"edge",o,"_d"),a===l&&(o.width=d.width,o.height=d.height,o.dummy="edge-label",o.labelpos=d.labelpos),t.setEdge(u,n,{weight:d.weight},f),0===i&&t.graph().dummyChains.push(n),u=n;t.setEdge(u,s,{weight:d.weight},f)}(t,r))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}}}function xt(){if(he)return le;he=1;const{applyWithChunking:e}=jt();return le={longestPath:function(t){var r={};t.sources().forEach(function n(o){var i=t.node(o);if(Object.hasOwn(r,o))return i.rank;r[o]=!0;let u=t.outEdges(o).map(e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen);var a=e(Math.min,u);return a===Number.POSITIVE_INFINITY&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}function Nt(){if(ve)return pe;ve=1;var e=_t().Graph,t=xt().slack;function r(e,r){return e.nodes().forEach(function n(o){r.nodeEdges(o).forEach(i=>{var u=i.v,a=o===u?i.w:u;e.hasNode(a)||t(r,i)||(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})}),e.nodeCount()}function n(e,r){return r.edges().reduce((n,o)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=t(r,o)),i<n[0]?[i,o]:n},[Number.POSITIVE_INFINITY,null])[1]}function o(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}return pe=function(i){var u,a,s=new e({directed:!1}),c=i.nodes()[0],f=i.nodeCount();s.setNode(c,{});for(;r(s,i)<f;)u=n(s,i),a=s.hasNode(u.v)?t(i,u):-t(i,u),o(s,i,a);return s}}function It(){if(ye)return ge;ye=1;var e=Nt(),t=xt().slack,r=xt().longestPath,n=_t().alg.preorder,o=_t().alg.postorder,i=jt().simplify;function u(t){t=i(t),r(t);var n,o=e(t);for(c(o),a(o,t);n=d(o);)h(o,t,n,l(o,t,n))}function a(e,t){var r=o(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>function(e,t,r){var n=e.node(r),o=n.parent;e.edge(r,o).cutvalue=s(e,t,r)}(e,t,r))}function s(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),u=0;return i||(o=!1,i=t.edge(n,r)),u=i.weight,t.nodeEdges(r).forEach(i=>{var a,s,c=i.v===r,f=c?i.w:i.v;if(f!==n){var d=c===o,l=t.edge(i).weight;if(u+=d?l:-l,a=r,s=f,e.hasEdge(a,s)){var h=e.edge(r,f).cutvalue;u+=d?-h:h}}}),u}function c(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,r,n,o){var i=r,u=e.node(n);return t[n]=!0,e.neighbors(n).forEach(o=>{Object.hasOwn(t,o)||(r=f(e,t,r,o,n))}),u.low=i,u.lim=r++,o?u.parent=o:delete u.parent,r}function d(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function l(e,r,n){var o=n.v,i=n.w;r.hasEdge(o,i)||(o=n.w,i=n.v);var u=e.node(o),a=e.node(i),s=u,c=!1;return u.lim>a.lim&&(s=a,c=!0),r.edges().filter(t=>c===p(e,e.node(t.v),s)&&c!==p(e,e.node(t.w),s)).reduce((e,n)=>t(r,n)<t(r,e)?n:e)}function h(e,t,r,o){var i=r.v,u=r.w;e.removeEdge(i,u),e.setEdge(o.v,o.w,{}),c(e),a(e,t),function(e,t){var r=e.nodes().find(e=>!t.node(e).parent),o=n(e,r);(o=o.slice(1)).forEach(r=>{var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function p(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}return ge=u,u.initLowLimValues=c,u.initCutValues=a,u.calcCutValue=s,u.leaveEdge=d,u.enterEdge=l,u.exchangeEdges=h,ge}function Ct(){if(be)return me;be=1;var e=xt().longestPath,t=Nt(),r=It();me=function(r){var i=r.graph().ranker;if(i instanceof Function)return i(r);switch(r.graph().ranker){case"network-simplex":default:o(r);break;case"tight-tree":!function(r){e(r),t(r)}(r);break;case"longest-path":n(r);case"none":}};var n=e;function o(e){r(e)}return me}function St(){if(_e)return we;return _e=1,we=function(e){let t=function(e){let t={},r=0;function n(o){let i=r;e.children(o).forEach(n),t[o]={low:i,lim:r++}}return e.children().forEach(n),t}(e);e.graph().dummyChains.forEach(r=>{let n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){let o,i,u=[],a=[],s=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),u.push(o)}while(o&&(t[o].low>s||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(e,t,o.v,o.w),u=i.path,a=i.lca,s=0,c=u[s],f=!0;for(;r!==o.w;){if(n=e.node(r),f){for(;(c=u[s])!==a&&e.node(c).maxRank<n.rank;)s++;c===a&&(f=!1)}if(!f){for(;s<u.length-1&&e.node(c=u[s+1]).minRank<=n.rank;)s++;c=u[s]}e.setParent(r,c),r=e.successors(r)[0]}})}}function At(){if(je)return Ee;je=1;let e=jt();function t(r,n,o,i,u,a,s){let c=r.children(s);if(!c.length)return void(s!==n&&r.setEdge(n,s,{weight:0,minlen:o}));let f=e.addBorderNode(r,"_bt"),d=e.addBorderNode(r,"_bb"),l=r.node(s);r.setParent(f,s),l.borderTop=f,r.setParent(d,s),l.borderBottom=d,c.forEach(e=>{t(r,n,o,i,u,a,e);let c=r.node(e),l=c.borderTop?c.borderTop:e,h=c.borderBottom?c.borderBottom:e,p=c.borderTop?i:2*i,v=l!==h?1:u-a[s]+1;r.setEdge(f,l,{weight:p,minlen:v,nestingEdge:!0}),r.setEdge(h,d,{weight:p,minlen:v,nestingEdge:!0})}),r.parent(s)||r.setEdge(n,f,{weight:0,minlen:u+a[s]})}return Ee={run:function(r){let n=e.addDummyNode(r,"root",{},"_root"),o=function(e){var t={};function r(n,o){var i=e.children(n);i&&i.length&&i.forEach(e=>r(e,o+1)),t[n]=o}return e.children().forEach(e=>r(e,1)),t}(r),i=Object.values(o),u=e.applyWithChunking(Math.max,i)-1,a=2*u+1;r.graph().nestingRoot=n,r.edges().forEach(e=>r.edge(e).minlen*=a);let s=function(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}(r)+1;r.children().forEach(e=>t(r,n,a,s,u,o,e)),r.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}function Mt(){if(Ne)return xe;function e(e){e.nodes().forEach(r=>t(e.node(r))),e.edges().forEach(r=>t(e.edge(r)))}function t(e){let t=e.width;e.width=e.height,e.height=t}function r(e){e.y=-e.y}function n(e){let t=e.x;e.x=e.y,e.y=t}return Ne=1,xe={adjust:function(t){let r=t.graph().rankdir.toLowerCase();"lr"!==r&&"rl"!==r||e(t)},undo:function(t){let o=t.graph().rankdir.toLowerCase();"bt"!==o&&"rl"!==o||function(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(r),Object.hasOwn(n,"y")&&r(n)})}(t);"lr"!==o&&"rl"!==o||(!function(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(n),Object.hasOwn(r,"x")&&n(r)})}(t),e(t))}}}function Pt(){if(Fe)return Le;Fe=1;let e=jt();return Le=function(t,r){let n={};return t.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),r.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(t){let r=[];function n(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight);t.weight&&(r+=t.barycenter*t.weight,n+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function o(e){return r=>{r.in.push(e),0===--r.indegree&&t.push(r)}}for(;t.length;){let e=t.pop();r.push(e),e.in.reverse().forEach(n(e)),e.out.forEach(o(e))}return r.filter(e=>!e.merged).map(t=>e.pick(t,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}function Lt(){if(ze)return De;ze=1;let e=Pe?Me:(Pe=1,Me=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(r.length){let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})}),t=Pt(),r=function(){if(Re)return Te;Re=1;let e=jt();function t(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}return Te=function(r,n){let o=e.partition(r,e=>Object.hasOwn(e,"barycenter")),i=o.lhs,u=o.rhs.sort((e,t)=>t.i-e.i),a=[],s=0,c=0,f=0;var d;i.sort((d=!!n,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:d?t.i-e.i:e.i-t.i)),f=t(a,u,f),i.forEach(e=>{f+=e.vs.length,a.push(e.vs),s+=e.barycenter*e.weight,c+=e.weight,f=t(a,u,f)});let l={vs:a.flat(!0)};return c&&(l.barycenter=s/c,l.weight=c),l}}();return De=function n(o,i,u,a){let s=o.children(i),c=o.node(i),f=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,l={};f&&(s=s.filter(e=>e!==f&&e!==d));let h=e(o,s);h.forEach(e=>{if(o.children(e.v).length){let i=n(o,e.v,u,a);l[e.v]=i,Object.hasOwn(i,"barycenter")&&(r=i,void 0!==(t=e).barycenter?(t.barycenter=(t.barycenter*t.weight+r.barycenter*r.weight)/(t.weight+r.weight),t.weight+=r.weight):(t.barycenter=r.barycenter,t.weight=r.weight))}var t,r});let p=t(h,u);!function(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}(p,l);let v=r(p,a);if(f&&(v.vs=[f,v.vs,d].flat(!0),o.predecessors(f).length)){let e=o.node(o.predecessors(f)[0]),t=o.node(o.predecessors(d)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+t.order)/(v.weight+2),v.weight+=2}return v},De}function Ft(){if(Ge)return Ve;Ge=1;let e=_t().Graph,t=jt();return Ve=function(r,n,o,i){i||(i=r.nodes());let u=function(e){var r;for(;e.hasNode(r=t.uniqueId("_root")););return r}(r),a=new e({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(e=>r.node(e));return i.forEach(e=>{let t=r.node(e),i=r.parent(e);(t.rank===n||t.minRank<=n&&n<=t.maxRank)&&(a.setNode(e),a.setParent(e,i||u),r[o](e).forEach(t=>{let n=t.v===e?t.w:t.v,o=a.edge(n,e),i=void 0!==o?o.weight:0;a.setEdge(n,e,{weight:r.edge(t).weight+i})}),Object.hasOwn(t,"minRank")&&a.setNode(e,{borderLeft:t.borderLeft[n],borderRight:t.borderRight[n]}))}),a}}function Tt(){if(We)return $e;We=1;let e=function(){if(Ce)return Ie;Ce=1;let e=jt();return Ie=function(t){let r={},n=t.nodes().filter(e=>!t.children(e).length),o=n.map(e=>t.node(e).rank),i=e.applyWithChunking(Math.max,o),u=e.range(i+1).map(()=>[]);return n.sort((e,r)=>t.node(e).rank-t.node(r).rank).forEach(function e(n){if(r[n])return;r[n]=!0;let o=t.node(n);u[o.rank].push(n),t.successors(n).forEach(e)}),u}}(),t=function(){if(Ae)return Se;Ae=1;let e=jt().zipObject;function t(t,r,n){let o=e(n,n.map((e,t)=>t)),i=r.flatMap(e=>t.outEdges(e).map(e=>({pos:o[e.w],weight:t.edge(e).weight})).sort((e,t)=>e.pos-t.pos)),u=1;for(;u<n.length;)u<<=1;let a=2*u-1;u-=1;let s=new Array(a).fill(0),c=0;return i.forEach(e=>{let t=e.pos+u;s[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*r}),c}return Se=function(e,r){let n=0;for(let o=1;o<r.length;++o)n+=t(e,r[o-1],r[o]);return n}}(),r=Lt(),n=Ft(),o=Ue?Be:(Ue=1,Be=function(e,t,r){let n,o={};r.forEach(r=>{let i,u,a=e.parent(r);for(;a;){if(i=e.parent(a),i?(u=o[i],o[i]=a):(u=n,n=a),u&&u!==a)return void t.setEdge(u,a);a=i}})}),i=_t().Graph,u=jt();function a(e,t,r){const o=new Map,i=(e,t)=>{o.has(e)||o.set(e,[]),o.get(e).push(t)};for(const n of e.nodes()){const t=e.node(n);if("number"==typeof t.rank&&i(t.rank,n),"number"==typeof t.minRank&&"number"==typeof t.maxRank)for(let e=t.minRank;e<=t.maxRank;e++)e!==t.rank&&i(e,n)}return t.map(function(t){return n(e,t,r,o.get(t)||[])})}function s(e,t){let n=new i;e.forEach(function(e){let i=e.graph().root,u=r(e,i,n,t);u.vs.forEach((t,r)=>e.node(t).order=r),o(e,n,u.vs)})}function c(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}return $e=function r(n,o){if(o&&"function"==typeof o.customOrder)return void o.customOrder(n,r);let i=u.maxRank(n),f=a(n,u.range(1,i+1),"inEdges"),d=a(n,u.range(i-1,-1,-1),"outEdges"),l=e(n);if(c(n,l),o&&o.disableOptimalOrderHeuristic)return;let h,p=Number.POSITIVE_INFINITY;for(let e=0,a=0;a<4;++e,++a){s(e%2?f:d,e%4>=2),l=u.buildLayerMatrix(n);let r=t(n,l);r<p&&(a=0,h=Object.assign({},l),p=r)}c(n,h)},$e}function Rt(){if(Ye)return qe;Ye=1;let e=_t().Graph,t=jt();function r(e,t){let r={};return t.length&&t.reduce(function(t,n){let i=0,u=0,a=t.length,s=n[n.length-1];return n.forEach((t,c)=>{let f=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=f?e.node(f).order:a;(f||t===s)&&(n.slice(u,c+1).forEach(t=>{e.predecessors(t).forEach(n=>{let u=e.node(n),a=u.order;!(a<i||d<a)||u.dummy&&e.node(t).dummy||o(r,n,t)})}),u=c+1,i=d)}),n}),r}function n(e,r){let n={};function i(r,i,u,a,s){let c;t.range(i,u).forEach(t=>{c=r[t],e.node(c).dummy&&e.predecessors(c).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&o(n,t,c)})})}return r.length&&r.reduce(function(t,r){let n,o=-1,u=0;return r.forEach((a,s)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(n=e.node(t[0]).order,i(r,u,s,o,n),u=s,o=n)}i(r,u,r.length,n,t.length)}),r}),n}function o(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function i(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function u(e,t,r,n){let o={},u={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,u[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=n(e);if(s.length){s=s.sort((e,t)=>a[e]-a[t]);let n=(s.length-1)/2;for(let c=Math.floor(n),f=Math.ceil(n);c<=f;++c){let n=s[c];u[e]===e&&t<a[n]&&!i(r,e,n)&&(u[n]=e,u[e]=o[e]=o[n],t=a[n])}}})}),{root:o,align:u}}function a(t,r,n,o,i){let u={},a=function(t,r,n,o){let i=new e,u=t.graph(),a=function(e,t,r){return(n,o,i)=>{let u,a=n.node(o),s=n.node(i),c=0;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=r?u:-u),u=0,c+=(a.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2}return u&&(c+=r?u:-u),u=0,c}}(u.nodesep,u.edgesep,o);return r.forEach(e=>{let r;e.forEach(e=>{let o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e})}),i}(t,r,n,i),s=i?"borderLeft":"borderRight";function c(e,t){let r=a.nodes(),n=r.pop(),o={};for(;n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return c(function(e){u[e]=a.inEdges(e).reduce((e,t)=>Math.max(e,u[t.v]+a.edge(t)),0)},a.predecessors.bind(a)),c(function(e){let r=a.outEdges(e).reduce((e,t)=>Math.min(e,u[t.w]-a.edge(t)),Number.POSITIVE_INFINITY),n=t.node(e);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(u[e]=Math.max(u[e],r))},a.successors.bind(a)),Object.keys(o).forEach(e=>u[e]=u[n[e]]),u}function s(e,t){return Object.values(t).reduce((t,r)=>{let n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([t,r])=>{let i=function(e,t){return e.node(t).width}(e,t)/2;n=Math.max(r+i,n),o=Math.min(r-i,o)});const i=n-o;return i<t[0]&&(t=[i,r]),t},[Number.POSITIVE_INFINITY,null])[1]}function c(e,r){let n=Object.values(r),o=t.applyWithChunking(Math.min,n),i=t.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(u=>{let a=n+u,s=e[a];if(s===r)return;let c=Object.values(s),f=o-t.applyWithChunking(Math.min,c);"l"!==u&&(f=i-t.applyWithChunking(Math.max,c)),f&&(e[a]=t.mapValues(s,e=>e+f))})})}function f(e,r){return t.mapValues(e.ul,(t,n)=>{if(r)return e[r.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}return qe={positionX:function(e){let o,i=t.buildLayerMatrix(e),d=Object.assign(r(e,i),n(e,i)),l={};["u","d"].forEach(r=>{o="u"===r?i:Object.values(i).reverse(),["l","r"].forEach(n=>{"r"===n&&(o=o.map(e=>Object.values(e).reverse()));let i=("u"===r?e.predecessors:e.successors).bind(e),s=u(e,o,d,i),c=a(e,o,s.root,s.align,"r"===n);"r"===n&&(c=t.mapValues(c,e=>-e)),l[r+n]=c})});let h=s(e,l);return c(l,h),f(l,e.graph().align)},findType1Conflicts:r,findType2Conflicts:n,addConflict:o,hasConflict:i,verticalAlignment:u,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:s,balance:f}}function Dt(){if(He)return Je;He=1;let e=jt(),t=Rt().positionX;return Je=function(r){(function(t){let r=e.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e=>{const r=e.reduce((e,r)=>{const n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>t.node(e).y=o+r/2),o+=r+n})})(r=e.asNonCompoundGraph(r)),Object.entries(t(r)).forEach(([e,t])=>r.node(e).x=t)}}function zt(){if(Qe)return Ke;Qe=1;let e=Ot(),t=kt(),r=Ct(),n=jt().normalizeRanks,o=St(),i=jt().removeEmptyRanks,u=At(),a=function(){if(ke)return Oe;ke=1;let e=jt();function t(t,r,n,o,i,u){let a={width:0,height:0,rank:u,borderType:r},s=i[r][u-1],c=e.addDummyNode(t,"border",a,n);i[r][u]=c,t.setParent(c,o),s&&t.setEdge(s,c,{weight:1})}return Oe=function(e){e.children().forEach(function r(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(r),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let r=i.minRank,o=i.maxRank+1;r<o;++r)t(e,"borderLeft","_bl",n,i,r),t(e,"borderRight","_br",n,i,r)}})}}(),s=Mt(),c=Tt(),f=Dt(),d=jt(),l=_t().Graph;Ke=function(j,O){let k=O&&O.debugTiming?d.time:d.notime;k("layout",()=>{let x=k(" buildLayoutGraph",()=>function(e){let t=new l({multigraph:!0,compound:!0}),r=E(e.graph());return t.setGraph(Object.assign({},p,_(r,h),d.pick(r,v))),e.nodes().forEach(r=>{const n=_(E(e.node(r)),g);Object.keys(y).forEach(e=>{void 0===n[e]&&(n[e]=y[e])}),t.setNode(r,n),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{let n=E(e.edge(r));t.setEdge(r,Object.assign({},b,_(n,m),d.pick(n,w)))}),t}(j));k(" runLayout",()=>function(l,h,p){h(" makeSpaceForEdgeLabels",()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{let n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(l)),h(" removeSelfEdges",()=>function(e){e.edges().forEach(t=>{if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(l)),h(" acyclic",()=>e.run(l)),h(" nestingGraph.run",()=>u.run(l)),h(" rank",()=>r(d.asNonCompoundGraph(l))),h(" injectEdgeLabelProxies",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let r=e.node(t.v),n={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};d.addDummyNode(e,"edge-proxy",n,"_ep")}})}(l)),h(" removeEmptyRanks",()=>i(l)),h(" nestingGraph.cleanup",()=>u.cleanup(l)),h(" normalizeRanks",()=>n(l)),h(" assignRankMinMax",()=>function(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}(l)),h(" removeEdgeLabelProxies",()=>function(e){e.nodes().forEach(t=>{let r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}(l)),h(" normalize.run",()=>t.run(l)),h(" parentDummyChains",()=>o(l)),h(" addBorderSegments",()=>a(l)),h(" order",()=>c(l,p)),h(" insertSelfEdges",()=>function(e){var t=d.buildLayerMatrix(e);t.forEach(t=>{var r=0;t.forEach((t,n)=>{var o=e.node(t);o.order=n+r,(o.selfEdges||[]).forEach(t=>{d.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(l)),h(" adjustCoordinateSystem",()=>s.adjust(l)),h(" position",()=>f(l)),h(" positionSelfEdges",()=>function(e){e.nodes().forEach(t=>{var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,u=r.x-o,a=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}(l)),h(" removeBorderNodes",()=>function(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(r.borderLeft[r.borderLeft.length-1]),u=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(u.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),e.nodes().forEach(t=>{"border"===e.node(t).dummy&&e.removeNode(t)})}(l)),h(" normalize.undo",()=>t.undo(l)),h(" fixupEdgeLabelCoords",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(l)),h(" undoCoordinateSystem",()=>s.undo(l)),h(" translateGraph",()=>function(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),u=i.marginx||0,a=i.marginy||0;function s(e){let i=e.x,u=e.y,a=e.width,s=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,u-s/2),o=Math.max(o,u+s/2)}e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&s(r)}),t-=u,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+u,i.height=o-n+a}(l)),h(" assignNodeIntersects",()=>function(e){e.edges().forEach(t=>{let r,n,o=e.edge(t),i=e.node(t.v),u=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=u,n=i),o.points.unshift(d.intersectRect(i,r)),o.points.push(d.intersectRect(u,n))})}(l)),h(" reversePoints",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse()})}(l)),h(" acyclic.undo",()=>e.undo(l))}(x,k,O)),k(" updateInputGraph",()=>function(e,t){e.nodes().forEach(r=>{let n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,t.children(r).length&&(n.width=o.width,n.height=o.height))}),e.edges().forEach(r=>{let n=e.edge(r),o=t.edge(r);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(j,x))})};let h=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],g=["width","height","rank"],y={width:0,height:0},m=["minlen","weight","width","height","labeloffset"],b={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},w=["labelpos"];function _(e,t){return d.mapValues(d.pick(e,t),Number)}function E(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}return Ke}function Vt(){if(Xe)return Ze;Xe=1;let e=jt(),t=_t().Graph;return Ze={debugOrdering:function(r){let n=e.buildLayerMatrix(r),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(e=>{o.setNode(e,{label:e}),o.setParent(e,"layer"+r.node(e).rank)}),r.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),n.forEach((e,t)=>{let r="layer"+t;o.setNode(r,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}const Gt=it(nt?rt:(nt=1,rt={graphlib:_t(),layout:zt(),debug:Vt(),util:{time:jt().time,notime:jt().notime},version:tt?et:(tt=1,et="1.1.8")}));var Bt,Ut,$t,Wt,qt,Yt,Jt,Ht,Kt,Qt,Zt,Xt,er,tr,rr,nr,or,ir,ur,ar,sr,cr,fr,dr,lr,hr,pr,vr,gr,yr,mr,br,wr,_r,Er,jr,Or,kr,xr,Nr,Ir,Cr,Sr,Ar,Mr,Pr,Lr,Fr,Tr,Rr,Dr,zr,Vr,Gr,Br,Ur,$r,Wr,qr,Yr,Jr,Hr,Kr,Qr,Zr,Xr,en,tn,rn,nn,on,un,an,sn,cn,fn,dn,ln,hn,pn,vn,gn,yn,mn,bn,wn,_n,En,jn,On,kn,xn,Nn,In,Cn,Sn,An,Mn,Pn,Ln,Fn,Tn,Rn,Dn,zn,Vn,Gn,Bn;function Un(){if(Wt)return $t;return Wt=1,$t=function(e,t){return e===t||e!=e&&t!=t}}function $n(){if(Yt)return qt;Yt=1;var e=Un();return qt=function(t,r){for(var n=t.length;n--;)if(e(t[n][0],r))return n;return-1}}function Wn(){if(nr)return rr;nr=1;var e=Ut?Bt:(Ut=1,Bt=function(){this.__data__=[],this.size=0}),t=function(){if(Ht)return Jt;Ht=1;var e=$n(),t=Array.prototype.splice;return Jt=function(r){var n=this.__data__,o=e(n,r);return!(o<0||(o==n.length-1?n.pop():t.call(n,o,1),--this.size,0))}}(),r=function(){if(Qt)return Kt;Qt=1;var e=$n();return Kt=function(t){var r=this.__data__,n=e(r,t);return n<0?void 0:r[n][1]}}(),n=function(){if(Xt)return Zt;Xt=1;var e=$n();return Zt=function(t){return e(this.__data__,t)>-1}}(),o=function(){if(tr)return er;tr=1;var e=$n();return er=function(t,r){var n=this.__data__,o=e(n,t);return o<0?(++this.size,n.push([t,r])):n[o][1]=r,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,rr=i}function qn(){if(hr)return lr;hr=1;var e="object"==typeof ot&&ot&&ot.Object===Object&&ot;return lr=e}function Yn(){if(vr)return pr;vr=1;var e=qn(),t="object"==typeof self&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return pr=r}function Jn(){if(yr)return gr;yr=1;var e=Yn().Symbol;return gr=e}function Hn(){if(jr)return Er;jr=1;var e=Jn(),t=function(){if(br)return mr;br=1;var e=Jn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;return mr=function(e){var t=r.call(e,o),i=e[o];try{e[o]=void 0;var u=!0}catch(s){}var a=n.call(e);return u&&(t?e[o]=i:delete e[o]),a}}(),r=function(){if(_r)return wr;_r=1;var e=Object.prototype.toString;return wr=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return Er=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):r(e)}}function Kn(){if(kr)return Or;return kr=1,Or=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Qn(){if(Nr)return xr;Nr=1;var e=Hn(),t=Kn();return xr=function(r){if(!t(r))return!1;var n=e(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function Zn(){if(Ar)return Sr;Ar=1;var e,t=function(){if(Cr)return Ir;Cr=1;var e=Yn()["__core-js_shared__"];return Ir=e}(),r=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return Sr=function(e){return!!r&&r in e}}function Xn(){if(Pr)return Mr;Pr=1;var e=Function.prototype.toString;return Mr=function(t){if(null!=t){try{return e.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function eo(){if(zr)return Dr;zr=1;var e=function(){if(Fr)return Lr;Fr=1;var e=Qn(),t=Zn(),r=Kn(),n=Xn(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,s=u.hasOwnProperty,c=RegExp("^"+a.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Lr=function(i){return!(!r(i)||t(i))&&(e(i)?c:o).test(n(i))}}(),t=Rr?Tr:(Rr=1,Tr=function(e,t){return null==e?void 0:e[t]});return Dr=function(r,n){var o=t(r,n);return e(o)?o:void 0}}function to(){if(Gr)return Vr;Gr=1;var e=eo()(Yn(),"Map");return Vr=e}function ro(){if(Ur)return Br;Ur=1;var e=eo()(Object,"create");return Br=e}function no(){if(tn)return en;tn=1;var e=function(){if(Wr)return $r;Wr=1;var e=ro();return $r=function(){this.__data__=e?e(null):{},this.size=0}}(),t=Yr?qr:(Yr=1,qr=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}),r=function(){if(Hr)return Jr;Hr=1;var e=ro(),t=Object.prototype.hasOwnProperty;return Jr=function(r){var n=this.__data__;if(e){var o=n[r];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(n,r)?n[r]:void 0}}(),n=function(){if(Qr)return Kr;Qr=1;var e=ro(),t=Object.prototype.hasOwnProperty;return Kr=function(r){var n=this.__data__;return e?void 0!==n[r]:t.call(n,r)}}(),o=function(){if(Xr)return Zr;Xr=1;var e=ro();return Zr=function(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=e&&void 0===r?"__lodash_hash_undefined__":r,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,en=i}function oo(){if(sn)return an;sn=1;var e=un?on:(un=1,on=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e});return an=function(t,r){var n=t.__data__;return e(r)?n["string"==typeof r?"string":"hash"]:n.map}}function io(){if(mn)return yn;mn=1;var e=function(){if(nn)return rn;nn=1;var e=no(),t=Wn(),r=to();return rn=function(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}}(),t=function(){if(fn)return cn;fn=1;var e=oo();return cn=function(t){var r=e(this,t).delete(t);return this.size-=r?1:0,r}}(),r=function(){if(ln)return dn;ln=1;var e=oo();return dn=function(t){return e(this,t).get(t)}}(),n=function(){if(pn)return hn;pn=1;var e=oo();return hn=function(t){return e(this,t).has(t)}}(),o=function(){if(gn)return vn;gn=1;var e=oo();return vn=function(t,r){var n=e(this,t),o=n.size;return n.set(t,r),this.size+=n.size==o?0:1,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,yn=i}function uo(){if(En)return _n;En=1;var e=Wn(),t=function(){if(ir)return or;ir=1;var e=Wn();return or=function(){this.__data__=new e,this.size=0}}(),r=ar?ur:(ar=1,ur=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}),n=cr?sr:(cr=1,sr=function(e){return this.__data__.get(e)}),o=dr?fr:(dr=1,fr=function(e){return this.__data__.has(e)}),i=function(){if(wn)return bn;wn=1;var e=Wn(),t=to(),r=io();return bn=function(n,o){var i=this.__data__;if(i instanceof e){var u=i.__data__;if(!t||u.length<199)return u.push([n,o]),this.size=++i.size,this;i=this.__data__=new r(u)}return i.set(n,o),this.size=i.size,this}}();function u(t){var r=this.__data__=new e(t);this.size=r.size}return u.prototype.clear=t,u.prototype.delete=r,u.prototype.get=n,u.prototype.has=o,u.prototype.set=i,_n=u}function ao(){if(On)return jn;return On=1,jn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}}function so(){if(xn)return kn;xn=1;var e=eo(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return kn=t}function co(){if(In)return Nn;In=1;var e=so();return Nn=function(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}}function fo(){if(Sn)return Cn;Sn=1;var e=co(),t=Un(),r=Object.prototype.hasOwnProperty;return Cn=function(n,o,i){var u=n[o];r.call(n,o)&&t(u,i)&&(void 0!==i||o in n)||e(n,o,i)}}function lo(){if(Mn)return An;Mn=1;var e=fo(),t=co();return An=function(r,n,o,i){var u=!o;o||(o={});for(var a=-1,s=n.length;++a<s;){var c=n[a],f=i?i(o[c],r[c],c,o,r):void 0;void 0===f&&(f=r[c]),u?t(o,c,f):e(o,c,f)}return o}}function ho(){if(Tn)return Fn;return Tn=1,Fn=function(e){return null!=e&&"object"==typeof e}}function po(){if(Vn)return zn;Vn=1;var e=function(){if(Dn)return Rn;Dn=1;var e=Hn(),t=ho();return Rn=function(r){return t(r)&&"[object Arguments]"==e(r)}}(),t=ho(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!o.call(e,"callee")};return zn=i}function vo(){if(Bn)return Gn;Bn=1;var e=Array.isArray;return Gn=e}var go,yo,mo,bo,wo,_o,Eo,jo,Oo,ko,xo,No={exports:{}};function Io(){return mo||(mo=1,e=No,t=No.exports,r=Yn(),n=yo?go:(yo=1,go=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,u=i&&i.exports===o?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n,e.exports=a),No.exports;var e,t,r,n,o,i,u,a}function Co(){if(wo)return bo;wo=1;var e=/^(?:0|[1-9]\d*)$/;return bo=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}}function So(){if(Eo)return _o;Eo=1;return _o=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}function Ao(){if(xo)return ko;return xo=1,ko=function(e){return function(t){return e(t)}}}var Mo,Po,Lo,Fo,To,Ro,Do,zo,Vo,Go,Bo,Uo,$o,Wo,qo,Yo,Jo,Ho,Ko,Qo,Zo,Xo,ei,ti,ri,ni,oi,ii={exports:{}};function ui(){return Mo||(Mo=1,e=ii,t=ii.exports,r=qn(),n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n&&r.process,u=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(t){}}(),e.exports=u),ii.exports;var e,t,r,n,o,i,u}function ai(){if(Lo)return Po;Lo=1;var e=function(){if(Oo)return jo;Oo=1;var e=Hn(),t=So(),r=ho(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,jo=function(o){return r(o)&&t(o.length)&&!!n[e(o)]}}(),t=Ao(),r=ui(),n=r&&r.isTypedArray,o=n?t(n):e;return Po=o}function si(){if(To)return Fo;To=1;var e=Ln?Pn:(Ln=1,Pn=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}),t=po(),r=vo(),n=Io(),o=Co(),i=ai(),u=Object.prototype.hasOwnProperty;return Fo=function(a,s){var c=r(a),f=!c&&t(a),d=!c&&!f&&n(a),l=!c&&!f&&!d&&i(a),h=c||f||d||l,p=h?e(a.length,String):[],v=p.length;for(var g in a)!s&&!u.call(a,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||l&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,v))||p.push(g);return p}}function ci(){if(Do)return Ro;Do=1;var e=Object.prototype;return Ro=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}}function fi(){if(Vo)return zo;return Vo=1,zo=function(e,t){return function(r){return e(t(r))}}}function di(){if($o)return Uo;$o=1;var e=ci(),t=function(){if(Bo)return Go;Bo=1;var e=fi()(Object.keys,Object);return Go=e}(),r=Object.prototype.hasOwnProperty;return Uo=function(n){if(!e(n))return t(n);var o=[];for(var i in Object(n))r.call(n,i)&&"constructor"!=i&&o.push(i);return o}}function li(){if(qo)return Wo;qo=1;var e=Qn(),t=So();return Wo=function(r){return null!=r&&t(r.length)&&!e(r)}}function hi(){if(Jo)return Yo;Jo=1;var e=si(),t=di(),r=li();return Yo=function(n){return r(n)?e(n):t(n)}}function pi(){if(ei)return Xo;ei=1;var e=Kn(),t=ci(),r=Zo?Qo:(Zo=1,Qo=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}),n=Object.prototype.hasOwnProperty;return Xo=function(o){if(!e(o))return r(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&n.call(o,a))&&u.push(a);return u}}function vi(){if(ri)return ti;ri=1;var e=si(),t=pi(),r=li();return ti=function(n){return r(n)?e(n,!0):t(n)}}var gi,yi,mi,bi,wi,_i,Ei,ji,Oi,ki,xi,Ni,Ii,Ci,Si,Ai,Mi,Pi,Li,Fi,Ti,Ri,Di,zi,Vi,Gi,Bi,Ui,$i,Wi,qi,Yi,Ji,Hi,Ki,Qi,Zi,Xi,eu,tu,ru,nu,ou,iu,uu,au,su,cu,fu,du,lu,hu,pu,vu,gu,yu,mu,bu,wu,_u,Eu,ju,Ou,ku,xu,Nu,Iu,Cu,Su,Au,Mu,Pu,Lu,Fu,Tu,Ru,Du,zu,Vu,Gu,Bu,Uu,$u,Wu,qu,Yu,Ju,Hu,Ku,Qu,Zu,Xu,ea,ta,ra,na,oa,ia,ua,aa,sa,ca,fa,da,la,ha,pa,va,ga,ya,ma,ba,wa,_a,Ea,ja,Oa,ka,xa,Na,Ia,Ca,Sa,Aa,Ma,Pa,La,Fa,Ta,Ra,Da,za,Va,Ga,Ba,Ua,$a,Wa,qa,Ya,Ja,Ha,Ka,Qa,Za,Xa,es,ts,rs,ns,os,is,us,as,ss,cs,fs,ds,ls,hs,ps,vs,gs,ys,ms,bs,ws,_s,Es,js,Os,ks,xs,Ns,Is,Cs,Ss,As,Ms,Ps,Ls,Fs,Ts,Rs,Ds,zs,Vs,Gs,Bs,Us,$s,Ws,qs,Ys,Js,Hs,Ks,Qs,Zs,Xs,ec,tc,rc,nc,oc,ic,uc,ac,sc,cc,fc,dc,lc,hc,pc,vc,gc,yc,mc,bc,wc,_c,Ec,jc,Oc,kc,xc,Nc,Ic,Cc,Sc,Ac,Mc,Pc,Lc,Fc,Tc,Rc,Dc,zc,Vc,Gc,Bc,Uc,$c,Wc,qc,Yc,Jc,Hc,Kc,Qc,Zc,Xc,ef,tf,rf,nf,of,uf,af,sf,cf,ff,df,lf,hf,pf,vf,gf,yf,mf,bf,wf,_f,Ef,jf,Of,kf,xf={exports:{}};function Nf(){if(wi)return bi;return wi=1,bi=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var u=e[r];t(u,r,e)&&(i[o++]=u)}return i}}function If(){if(Ei)return _i;return Ei=1,_i=function(){return[]}}function Cf(){if(Oi)return ji;Oi=1;var e=Nf(),t=If(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return ji=n?function(t){return null==t?[]:(t=Object(t),e(n(t),function(e){return r.call(t,e)}))}:t}function Sf(){if(Ii)return Ni;return Ii=1,Ni=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}}function Af(){if(Si)return Ci;Si=1;var e=fi()(Object.getPrototypeOf,Object);return Ci=e}function Mf(){if(Mi)return Ai;Mi=1;var e=Sf(),t=Af(),r=Cf(),n=If(),o=Object.getOwnPropertySymbols;return Ai=o?function(n){for(var o=[];n;)e(o,r(n)),n=t(n);return o}:n}function Pf(){if(Ti)return Fi;Ti=1;var e=Sf(),t=vo();return Fi=function(r,n,o){var i=n(r);return t(r)?i:e(i,o(r))}}function Lf(){if(Di)return Ri;Di=1;var e=Pf(),t=Cf(),r=hi();return Ri=function(n){return e(n,r,t)}}function Ff(){if(qi)return Wi;qi=1;var e=eo()(Yn(),"Set");return Wi=e}function Tf(){if(Ki)return Hi;Ki=1;var e=function(){if(Bi)return Gi;Bi=1;var e=eo()(Yn(),"DataView");return Gi=e}(),t=to(),r=function(){if($i)return Ui;$i=1;var e=eo()(Yn(),"Promise");return Ui=e}(),n=Ff(),o=function(){if(Ji)return Yi;Ji=1;var e=eo()(Yn(),"WeakMap");return Yi=e}(),i=Hn(),u=Xn(),a="[object Map]",s="[object Promise]",c="[object Set]",f="[object WeakMap]",d="[object DataView]",l=u(e),h=u(t),p=u(r),v=u(n),g=u(o),y=i;return(e&&y(new e(new ArrayBuffer(1)))!=d||t&&y(new t)!=a||r&&y(r.resolve())!=s||n&&y(new n)!=c||o&&y(new o)!=f)&&(y=function(e){var t=i(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case l:return d;case h:return a;case p:return s;case v:return c;case g:return f}return t}),Hi=y}function Rf(){if(eu)return Xi;eu=1;var e=Yn().Uint8Array;return Xi=e}function Df(){if(ru)return tu;ru=1;var e=Rf();return tu=function(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}}function zf(){if(lu)return du;lu=1;var e=Df(),t=function(){if(ou)return nu;ou=1;var e=Df();return nu=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}}(),r=function(){if(uu)return iu;uu=1;var e=/\w*$/;return iu=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}}(),n=function(){if(su)return au;su=1;var e=Jn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;return au=function(e){return r?Object(r.call(e)):{}}}(),o=function(){if(fu)return cu;fu=1;var e=Df();return cu=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}}();return du=function(i,u,a){var s=i.constructor;switch(u){case"[object ArrayBuffer]":return e(i);case"[object Boolean]":case"[object Date]":return new s(+i);case"[object DataView]":return t(i,a);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,a);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(i);case"[object RegExp]":return r(i);case"[object Symbol]":return n(i)}}}function Vf(){if(pu)return hu;pu=1;var e=Kn(),t=Object.create;return hu=function(){function r(){}return function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var o=new r;return r.prototype=void 0,o}}()}function Gf(){if(wu)return bu;wu=1;var e=function(){if(mu)return yu;mu=1;var e=Tf(),t=ho();return yu=function(r){return t(r)&&"[object Map]"==e(r)}}(),t=Ao(),r=ui(),n=r&&r.isMap,o=n?t(n):e;return bu=o}function Bf(){if(Ou)return ju;Ou=1;var e=function(){if(Eu)return _u;Eu=1;var e=Tf(),t=ho();return _u=function(r){return t(r)&&"[object Set]"==e(r)}}(),t=Ao(),r=ui(),n=r&&r.isSet,o=n?t(n):e;return ju=o}function Uf(){if(xu)return ku;xu=1;var e,t,r,n,o,i,u,a=uo(),s=ao(),c=fo(),f=function(){if(Ko)return Ho;Ko=1;var e=lo(),t=hi();return Ho=function(r,n){return r&&e(n,t(n),r)}}(),d=function(){if(oi)return ni;oi=1;var e=lo(),t=vi();return ni=function(r,n){return r&&e(n,t(n),r)}}(),l=(gi||(gi=1,e=xf,t=xf.exports,r=Yn(),n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n?r.Buffer:void 0,u=i?i.allocUnsafe:void 0,e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=u?u(r):new e.constructor(r);return e.copy(n),n}),xf.exports),h=mi?yi:(mi=1,yi=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}),p=function(){if(xi)return ki;xi=1;var e=lo(),t=Cf();return ki=function(r,n){return e(r,t(r),n)}}(),v=function(){if(Li)return Pi;Li=1;var e=lo(),t=Mf();return Pi=function(r,n){return e(r,t(r),n)}}(),g=Lf(),y=function(){if(Vi)return zi;Vi=1;var e=Pf(),t=Mf(),r=vi();return zi=function(n){return e(n,r,t)}}(),m=Tf(),b=function(){if(Zi)return Qi;Zi=1;var e=Object.prototype.hasOwnProperty;return Qi=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}}(),w=zf(),_=function(){if(gu)return vu;gu=1;var e=Vf(),t=Af(),r=ci();return vu=function(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}}(),E=vo(),j=Io(),O=Gf(),k=Kn(),x=Bf(),N=hi(),I=vi(),C="[object Arguments]",S="[object Function]",A="[object Object]",M={};return M[C]=M["[object Array]"]=M["[object ArrayBuffer]"]=M["[object DataView]"]=M["[object Boolean]"]=M["[object Date]"]=M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Map]"]=M["[object Number]"]=M[A]=M["[object RegExp]"]=M["[object Set]"]=M["[object String]"]=M["[object Symbol]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M["[object Error]"]=M[S]=M["[object WeakMap]"]=!1,ku=function e(t,r,n,o,i,u){var P,L=1&r,F=2&r,T=4&r;if(n&&(P=i?n(t,o,i,u):n(t)),void 0!==P)return P;if(!k(t))return t;var R=E(t);if(R){if(P=b(t),!L)return h(t,P)}else{var D=m(t),z=D==S||"[object GeneratorFunction]"==D;if(j(t))return l(t,L);if(D==A||D==C||z&&!i){if(P=F||z?{}:_(t),!L)return F?v(t,d(P,t)):p(t,f(P,t))}else{if(!M[D])return i?t:{};P=w(t,D,L)}}u||(u=new a);var V=u.get(t);if(V)return V;u.set(t,P),x(t)?t.forEach(function(o){P.add(e(o,r,n,o,t,u))}):O(t)&&t.forEach(function(o,i){P.set(i,e(o,r,n,i,t,u))});var G=R?void 0:(T?F?y:g:F?I:N)(t);return s(G||t,function(o,i){G&&(o=t[i=o]),c(P,i,e(o,r,n,i,t,u))}),P},ku}function $f(){if(Iu)return Nu;Iu=1;var e=Uf();return Nu=function(t){return e(t,4)}}function Wf(){if(Su)return Cu;return Su=1,Cu=function(e){return function(){return e}}}function qf(){if(Lu)return Pu;Lu=1;var e=(Mu?Au:(Mu=1,Au=function(e){return function(t,r,n){for(var o=-1,i=Object(t),u=n(t),a=u.length;a--;){var s=u[e?a:++o];if(!1===r(i[s],s,i))break}return t}}))();return Pu=e}function Yf(){if(Tu)return Fu;Tu=1;var e=qf(),t=hi();return Fu=function(r,n){return r&&e(r,n,t)}}function Jf(){if(Vu)return zu;Vu=1;var e=Yf(),t=function(){if(Du)return Ru;Du=1;var e=li();return Ru=function(t,r){return function(n,o){if(null==n)return n;if(!e(n))return t(n,o);for(var i=n.length,u=r?i:-1,a=Object(n);(r?u--:++u<i)&&!1!==o(a[u],u,a););return n}}}()(e);return zu=t}function Hf(){if(Bu)return Gu;return Bu=1,Gu=function(e){return e}}function Kf(){if(qu)return Wu;qu=1;var e=ao(),t=Jf(),r=function(){if($u)return Uu;$u=1;var e=Hf();return Uu=function(t){return"function"==typeof t?t:e}}(),n=vo();return Wu=function(o,i){return(n(o)?e:t)(o,r(i))}}function Qf(){if(ra)return ta;ra=1;var e=io(),t=Zu?Qu:(Zu=1,Qu=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),r=ea?Xu:(ea=1,Xu=function(e){return this.__data__.has(e)});function n(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,ta=n}function Zf(){if(ua)return ia;return ua=1,ia=function(e,t){return e.has(t)}}function Xf(){if(sa)return aa;sa=1;var e=Qf(),t=oa?na:(oa=1,na=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}),r=Zf();return aa=function(n,o,i,u,a,s){var c=1&i,f=n.length,d=o.length;if(f!=d&&!(c&&d>f))return!1;var l=s.get(n),h=s.get(o);if(l&&h)return l==o&&h==n;var p=-1,v=!0,g=2&i?new e:void 0;for(s.set(n,o),s.set(o,n);++p<f;){var y=n[p],m=o[p];if(u)var b=c?u(m,y,p,o,n,s):u(y,m,p,n,o,s);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!t(o,function(e,t){if(!r(g,t)&&(y===e||a(y,e,i,u,s)))return g.push(t)})){v=!1;break}}else if(y!==m&&!a(y,m,i,u,s)){v=!1;break}}return s.delete(n),s.delete(o),v}}function ed(){if(la)return da;return la=1,da=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}}function td(){if(pa)return ha;pa=1;var e=Jn(),t=Rf(),r=Un(),n=Xf(),o=fa?ca:(fa=1,ca=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}),i=ed(),u=e?e.prototype:void 0,a=u?u.valueOf:void 0;return ha=function(e,u,s,c,f,d,l){switch(s){case"[object DataView]":if(e.byteLength!=u.byteLength||e.byteOffset!=u.byteOffset)return!1;e=e.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=u.byteLength||!d(new t(e),new t(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+u);case"[object Error]":return e.name==u.name&&e.message==u.message;case"[object RegExp]":case"[object String]":return e==u+"";case"[object Map]":var h=o;case"[object Set]":var p=1&c;if(h||(h=i),e.size!=u.size&&!p)return!1;var v=l.get(e);if(v)return v==u;c|=2,l.set(e,u);var g=n(h(e),h(u),c,f,d,l);return l.delete(e),g;case"[object Symbol]":if(a)return a.call(e)==a.call(u)}return!1}}function rd(){if(ma)return ya;ma=1;var e=uo(),t=Xf(),r=td(),n=function(){if(ga)return va;ga=1;var e=Lf(),t=Object.prototype.hasOwnProperty;return va=function(r,n,o,i,u,a){var s=1&o,c=e(r),f=c.length;if(f!=e(n).length&&!s)return!1;for(var d=f;d--;){var l=c[d];if(!(s?l in n:t.call(n,l)))return!1}var h=a.get(r),p=a.get(n);if(h&&p)return h==n&&p==r;var v=!0;a.set(r,n),a.set(n,r);for(var g=s;++d<f;){var y=r[l=c[d]],m=n[l];if(i)var b=s?i(m,y,l,n,r,a):i(y,m,l,r,n,a);if(!(void 0===b?y===m||u(y,m,o,i,a):b)){v=!1;break}g||(g="constructor"==l)}if(v&&!g){var w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(v=!1)}return a.delete(r),a.delete(n),v}}(),o=Tf(),i=vo(),u=Io(),a=ai(),s="[object Arguments]",c="[object Array]",f="[object Object]",d=Object.prototype.hasOwnProperty;return ya=function(l,h,p,v,g,y){var m=i(l),b=i(h),w=m?c:o(l),_=b?c:o(h),E=(w=w==s?f:w)==f,j=(_=_==s?f:_)==f,O=w==_;if(O&&u(l)){if(!u(h))return!1;m=!0,E=!1}if(O&&!E)return y||(y=new e),m||a(l)?t(l,h,p,v,g,y):r(l,h,w,p,v,g,y);if(!(1&p)){var k=E&&d.call(l,"__wrapped__"),x=j&&d.call(h,"__wrapped__");if(k||x){var N=k?l.value():l,I=x?h.value():h;return y||(y=new e),g(N,I,p,v,y)}}return!!O&&(y||(y=new e),n(l,h,p,v,g,y))}}function nd(){if(wa)return ba;wa=1;var e=rd(),t=ho();return ba=function r(n,o,i,u,a){return n===o||(null==n||null==o||!t(n)&&!t(o)?n!=n&&o!=o:e(n,o,i,u,r,a))},ba}function od(){if(Oa)return ja;Oa=1;var e=Kn();return ja=function(t){return t==t&&!e(t)}}function id(){if(Ia)return Na;return Ia=1,Na=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}}function ud(){if(Sa)return Ca;Sa=1;var e=function(){if(Ea)return _a;Ea=1;var e=uo(),t=nd();return _a=function(r,n,o,i){var u=o.length,a=u,s=!i;if(null==r)return!a;for(r=Object(r);u--;){var c=o[u];if(s&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++u<a;){var f=(c=o[u])[0],d=r[f],l=c[1];if(s&&c[2]){if(void 0===d&&!(f in r))return!1}else{var h=new e;if(i)var p=i(d,l,f,r,n,h);if(!(void 0===p?t(l,d,3,i,h):p))return!1}}return!0}}(),t=function(){if(xa)return ka;xa=1;var e=od(),t=hi();return ka=function(r){for(var n=t(r),o=n.length;o--;){var i=n[o],u=r[i];n[o]=[i,u,e(u)]}return n}}(),r=id();return Ca=function(n){var o=t(n);return 1==o.length&&o[0][2]?r(o[0][0],o[0][1]):function(t){return t===n||e(t,n,o)}}}function ad(){if(Ma)return Aa;Ma=1;var e=Hn(),t=ho();return Aa=function(r){return"symbol"==typeof r||t(r)&&"[object Symbol]"==e(r)}}function sd(){if(La)return Pa;La=1;var e=vo(),t=ad(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Pa=function(o,i){if(e(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||(n.test(o)||!r.test(o)||null!=i&&o in Object(i))}}function cd(){if(Da)return Ra;Da=1;var e=function(){if(Ta)return Fa;Ta=1;var e=io();function t(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var o=function(){var e=arguments,t=n?n.apply(this,e):e[0],i=o.cache;if(i.has(t))return i.get(t);var u=r.apply(this,e);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||e),o}return t.Cache=e,Fa=t}();return Ra=function(t){var r=e(t,function(e){return 500===n.size&&n.clear(),e}),n=r.cache;return r}}function fd(){if(Ba)return Ga;return Ba=1,Ga=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}}function dd(){if(qa)return Wa;qa=1;var e=function(){if($a)return Ua;$a=1;var e=Jn(),t=fd(),r=vo(),n=ad(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Ua=function e(o){if("string"==typeof o)return o;if(r(o))return t(o,e)+"";if(n(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Ua}();return Wa=function(t){return null==t?"":e(t)}}function ld(){if(Ja)return Ya;Ja=1;var e=vo(),t=sd(),r=function(){if(Va)return za;Va=1;var e=cd(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,o,i){n.push(o?i.replace(r,"$1"):t||e)}),n});return za=n}(),n=dd();return Ya=function(o,i){return e(o)?o:t(o,i)?[o]:r(n(o))}}function hd(){if(Ka)return Ha;Ka=1;var e=ad();return Ha=function(t){if("string"==typeof t||e(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}}function pd(){if(Za)return Qa;Za=1;var e=ld(),t=hd();return Qa=function(r,n){for(var o=0,i=(n=e(n,r)).length;null!=r&&o<i;)r=r[t(n[o++])];return o&&o==i?r:void 0}}function vd(){if(os)return ns;os=1;var e=ld(),t=po(),r=vo(),n=Co(),o=So(),i=hd();return ns=function(u,a,s){for(var c=-1,f=(a=e(a,u)).length,d=!1;++c<f;){var l=i(a[c]);if(!(d=null!=u&&s(u,l)))break;u=u[l]}return d||++c!=f?d:!!(f=null==u?0:u.length)&&o(f)&&n(l,f)&&(r(u)||t(u))}}function gd(){if(us)return is;us=1;var e=rs?ts:(rs=1,ts=function(e,t){return null!=e&&t in Object(e)}),t=vd();return is=function(r,n){return null!=r&&t(r,n,e)}}function yd(){if(ss)return as;ss=1;var e=nd(),t=function(){if(es)return Xa;es=1;var e=pd();return Xa=function(t,r,n){var o=null==t?void 0:e(t,r);return void 0===o?n:o}}(),r=gd(),n=sd(),o=od(),i=id(),u=hd();return as=function(a,s){return n(a)&&o(s)?i(u(a),s):function(n){var o=t(n,a);return void 0===o&&o===s?r(n,a):e(s,o,3)}}}function md(){if(fs)return cs;return fs=1,cs=function(e){return function(t){return null==t?void 0:t[e]}}}function bd(){if(ps)return hs;ps=1;var e=md(),t=function(){if(ls)return ds;ls=1;var e=pd();return ds=function(t){return function(r){return e(r,t)}}}(),r=sd(),n=hd();return hs=function(o){return r(o)?e(n(o)):t(o)}}function wd(){if(gs)return vs;gs=1;var e=ud(),t=yd(),r=Hf(),n=vo(),o=bd();return vs=function(i){return"function"==typeof i?i:null==i?r:"object"==typeof i?n(i)?t(i[0],i[1]):e(i):o(i)}}function _d(){if(ms)return ys;ms=1;var e=Nf(),t=function(){if(Ku)return Hu;Ku=1;var e=Jf();return Hu=function(t,r){var n=[];return e(t,function(e,t,o){r(e,t,o)&&n.push(e)}),n}}(),r=wd(),n=vo();return ys=function(o,i){return(n(o)?e:t)(o,r(i,3))}}function Ed(){if(Es)return _s;Es=1;var e=function(){if(ws)return bs;ws=1;var e=Object.prototype.hasOwnProperty;return bs=function(t,r){return null!=t&&e.call(t,r)}}(),t=vd();return _s=function(r,n){return null!=r&&t(r,n,e)}}function jd(){if(Os)return js;Os=1;var e=di(),t=Tf(),r=po(),n=vo(),o=li(),i=Io(),u=ci(),a=ai(),s=Object.prototype.hasOwnProperty;return js=function(c){if(null==c)return!0;if(o(c)&&(n(c)||"string"==typeof c||"function"==typeof c.splice||i(c)||a(c)||r(c)))return!c.length;var f=t(c);if("[object Map]"==f||"[object Set]"==f)return!c.size;if(u(c))return!e(c).length;for(var d in c)if(s.call(c,d))return!1;return!0}}function Od(){if(xs)return ks;return xs=1,ks=function(e){return void 0===e}}function kd(){if(Ss)return Cs;Ss=1;var e=fd(),t=wd(),r=function(){if(Is)return Ns;Is=1;var e=Jf(),t=li();return Ns=function(r,n){var o=-1,i=t(r)?Array(r.length):[];return e(r,function(e,t,r){i[++o]=n(e,t,r)}),i}}(),n=vo();return Cs=function(o,i){return(n(o)?e:r)(o,t(i,3))}}function xd(){if(Ts)return Fs;Ts=1;var e=Ms?As:(Ms=1,As=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}),t=Jf(),r=wd(),n=Ls?Ps:(Ls=1,Ps=function(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r}),o=vo();return Fs=function(i,u,a){var s=o(i)?e:n,c=arguments.length<3;return s(i,r(u,4),a,c,t)},Fs}function Nd(){if(qs)return Ws;qs=1;var e=function(){if(Vs)return zs;Vs=1;var e=md()("length");return zs=e}(),t=function(){if(Bs)return Gs;Bs=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Gs=function(t){return e.test(t)}}(),r=function(){if($s)return Us;$s=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+r+"|"+n+")?",s="[\\ufe0e\\ufe0f]?",c=s+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+s+a+")*",f="(?:"+[o+r+"?",r,i,u,t].join("|")+")",d=RegExp(n+"(?="+n+")|"+f+c,"g");return Us=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}}();return Ws=function(n){return t(n)?r(n):e(n)}}function Id(){if(Js)return Ys;Js=1;var e=di(),t=Tf(),r=li(),n=function(){if(Ds)return Rs;Ds=1;var e=Hn(),t=vo(),r=ho();return Rs=function(n){return"string"==typeof n||!t(n)&&r(n)&&"[object String]"==e(n)}}(),o=Nd();return Ys=function(i){if(null==i)return 0;if(r(i))return n(i)?o(i):i.length;var u=t(i);return"[object Map]"==u||"[object Set]"==u?i.size:e(i).length}}function Cd(){if(Ks)return Hs;Ks=1;var e=ao(),t=Vf(),r=Yf(),n=wd(),o=Af(),i=vo(),u=Io(),a=Qn(),s=Kn(),c=ai();return Hs=function(f,d,l){var h=i(f),p=h||u(f)||c(f);if(d=n(d,4),null==l){var v=f&&f.constructor;l=p?h?new v:[]:s(f)&&a(v)?t(o(f)):{}}return(p?e:r)(f,function(e,t,r){return d(l,e,t,r)}),l}}function Sd(){if(ec)return Xs;ec=1;var e=Sf(),t=function(){if(Zs)return Qs;Zs=1;var e=Jn(),t=po(),r=vo(),n=e?e.isConcatSpreadable:void 0;return Qs=function(e){return r(e)||t(e)||!!(n&&e&&e[n])}}();return Xs=function r(n,o,i,u,a){var s=-1,c=n.length;for(i||(i=t),a||(a=[]);++s<c;){var f=n[s];o>0&&i(f)?o>1?r(f,o-1,i,u,a):e(a,f):u||(a[a.length]=f)}return a},Xs}function Ad(){if(oc)return nc;oc=1;var e=rc?tc:(rc=1,tc=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}),t=Math.max;return nc=function(r,n,o){return n=t(void 0===n?r.length-1:n,0),function(){for(var i=arguments,u=-1,a=t(i.length-n,0),s=Array(a);++u<a;)s[u]=i[n+u];u=-1;for(var c=Array(n+1);++u<n;)c[u]=i[u];return c[n]=o(s),e(r,this,c)}},nc}function Md(){if(fc)return cc;fc=1;var e=function(){if(uc)return ic;uc=1;var e=Wf(),t=so(),r=Hf();return ic=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}(),t=function(){if(sc)return ac;sc=1;var e=Date.now;return ac=function(t){var r=0,n=0;return function(){var o=e(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},ac}(),r=t(e);return cc=r}function Pd(){if(wc)return bc;wc=1;var e=pc?hc:(pc=1,hc=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}),t=gc?vc:(gc=1,vc=function(e){return e!=e}),r=mc?yc:(mc=1,yc=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1});return bc=function(n,o,i){return o==o?r(n,o,i):e(n,t,i)}}function Ld(){if(Ic)return Nc;Ic=1;var e=Ff(),t=xc?kc:(xc=1,kc=function(){}),r=ed(),n=e&&1/r(new e([,-0]))[1]==1/0?function(t){return new e(t)}:t;return Nc=n}function Fd(){if(Sc)return Cc;Sc=1;var e=Qf(),t=function(){if(Ec)return _c;Ec=1;var e=Pd();return _c=function(t,r){return!(null==t||!t.length)&&e(t,r,0)>-1}}(),r=Oc?jc:(Oc=1,jc=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}),n=Zf(),o=Ld(),i=ed();return Cc=function(u,a,s){var c=-1,f=t,d=u.length,l=!0,h=[],p=h;if(s)l=!1,f=r;else if(d>=200){var v=a?null:o(u);if(v)return i(v);l=!1,f=n,p=new e}else p=a?[]:h;e:for(;++c<d;){var g=u[c],y=a?a(g):g;if(g=s||0!==g?g:0,l&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue e;a&&p.push(y),h.push(g)}else f(p,y,s)||(p!==h&&p.push(y),h.push(g))}return h}}function Td(){if(Lc)return Pc;Lc=1;var e=Sd(),t=function(){if(lc)return dc;lc=1;var e=Hf(),t=Ad(),r=Md();return dc=function(n,o){return r(t(n,o,e),n+"")}}(),r=Fd(),n=function(){if(Mc)return Ac;Mc=1;var e=li(),t=ho();return Ac=function(r){return t(r)&&e(r)}}(),o=t(function(t){return r(e(t,1,n,!0))});return Pc=o}function Rd(){if(Dc)return Rc;Dc=1;var e=function(){if(Tc)return Fc;Tc=1;var e=fd();return Fc=function(t,r){return e(r,function(e){return t[e]})}}(),t=hi();return Rc=function(r){return null==r?[]:e(r,t(r))}}function Dd(){if(Vc)return zc;var e;Vc=1;try{e={clone:$f(),constant:Wf(),each:Ju?Yu:(Ju=1,Yu=Kf()),filter:_d(),has:Ed(),isArray:vo(),isEmpty:jd(),isFunction:Qn(),isUndefined:Od(),keys:hi(),map:kd(),reduce:xd(),size:Id(),transform:Cd(),union:Td(),values:Rd()}}catch(t){}return e||(e=window._),zc=e}function zd(){if(Bc)return Gc;Bc=1;var e=Dd();Gc=r;var t="\0";function r(r){this._isDirected=!e.has(r,"directed")||r.directed,this._isMultigraph=!!e.has(r,"multigraph")&&r.multigraph,this._isCompound=!!e.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function n(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function i(t,r,n,o){var i=""+r,u=""+n;if(!t&&i>u){var a=i;i=u,u=a}return i+""+u+""+(e.isUndefined(o)?"\0":o)}function u(e,t){return i(e,t.v,t.w,t.name)}return r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return e.keys(this._nodes)},r.prototype.sources=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._in[r])})},r.prototype.sinks=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._out[r])})},r.prototype.setNodes=function(t,r){var n=arguments,o=this;return e.each(t,function(e){n.length>1?o.setNode(e,r):o.setNode(e)}),this},r.prototype.setNode=function(r,n){return e.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=n),this):(this._nodes[r]=arguments.length>1?n:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=t,this._children[r]={},this._children[t][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(t){return e.has(this._nodes,t)},r.prototype.removeNode=function(t){var r=this;if(e.has(this._nodes,t)){var n=function(e){r.removeEdge(r._edgeObjs[e])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],e.each(this.children(t),function(e){r.setParent(e)}),delete this._children[t]),e.each(e.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],e.each(e.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(r,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(n))n=t;else{for(var o=n+="";!e.isUndefined(o);o=this.parent(o))if(o===r)throw new Error("Setting "+n+" as parent of "+r+" would create a cycle");this.setNode(n)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=n,this._children[n][r]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var r=this._parent[e];if(r!==t)return r}},r.prototype.children=function(r){if(e.isUndefined(r)&&(r=t),this._isCompound){var n=this._children[r];if(n)return e.keys(n)}else{if(r===t)return this.nodes();if(this.hasNode(r))return[]}},r.prototype.predecessors=function(t){var r=this._preds[t];if(r)return e.keys(r)},r.prototype.successors=function(t){var r=this._sucs[t];if(r)return e.keys(r)},r.prototype.neighbors=function(t){var r=this.predecessors(t);if(r)return e.union(r,this.successors(t))},r.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},r.prototype.filterNodes=function(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;e.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)}),e.each(this._edgeObjs,function(e){r.hasNode(e.v)&&r.hasNode(e.w)&&r.setEdge(e,n.edge(e))});var o={};function i(e){var t=n.parent(e);return void 0===t||r.hasNode(t)?(o[e]=t,t):t in o?o[t]:i(t)}return this._isCompound&&e.each(r.nodes(),function(e){r.setParent(e,i(e))}),r},r.prototype.setDefaultEdgeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return e.values(this._edgeObjs)},r.prototype.setPath=function(t,r){var n=this,o=arguments;return e.reduce(t,function(e,t){return o.length>1?n.setEdge(e,t,r):n.setEdge(e,t),t}),this},r.prototype.setEdge=function(){var t,r,o,u,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,r=s.w,o=s.name,2===arguments.length&&(u=arguments[1],a=!0)):(t=s,r=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),t=""+t,r=""+r,e.isUndefined(o)||(o=""+o);var c=i(this._isDirected,t,r,o);if(e.has(this._edgeLabels,c))return a&&(this._edgeLabels[c]=u),this;if(!e.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[c]=a?u:this._defaultEdgeLabelFn(t,r,o);var f=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};n&&(a.name=n);return a}(this._isDirected,t,r,o);return t=f.v,r=f.w,Object.freeze(f),this._edgeObjs[c]=f,n(this._preds[r],t),n(this._sucs[t],r),this._in[r][c]=f,this._out[t][c]=f,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,r,n){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,t,r,n);return e.has(this._edgeLabels,o)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[n];return a&&(e=a.v,t=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],o(this._preds[t],e),o(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(t,r){var n=this._in[t];if(n){var o=e.values(n);return r?e.filter(o,function(e){return e.v===r}):o}},r.prototype.outEdges=function(t,r){var n=this._out[t];if(n){var o=e.values(n);return r?e.filter(o,function(e){return e.w===r}):o}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))},Gc}function Vd(){if(Jc)return Yc;Jc=1;var e=Dd(),t=zd();function r(t){return e.map(t.nodes(),function(r){var n=t.node(r),o=t.parent(r),i={v:r};return e.isUndefined(n)||(i.value=n),e.isUndefined(o)||(i.parent=o),i})}function n(t){return e.map(t.edges(),function(r){var n=t.edge(r),o={v:r.v,w:r.w};return e.isUndefined(r.name)||(o.name=r.name),e.isUndefined(n)||(o.value=n),o})}return Yc={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:n(t)};e.isUndefined(t.graph())||(o.value=e.clone(t.graph()));return o},read:function(r){var n=new t(r.options).setGraph(r.value);return e.each(r.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),e.each(r.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}}}function Gd(){if(Kc)return Hc;Kc=1;var e=Dd();return Hc=function(t){var r,n={},o=[];function i(o){e.has(n,o)||(n[o]=!0,r.push(o),e.each(t.successors(o),i),e.each(t.predecessors(o),i))}return e.each(t.nodes(),function(e){r=[],i(e),r.length&&o.push(r)}),o}}function Bd(){if(Zc)return Qc;Zc=1;var e=Dd();function t(){this._arr=[],this._keyIndices={}}return Qc=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(t){return e.has(this._keyIndices,t)},t.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,r){var n=this._keyIndices;if(t=String(t),!e.has(n,t)){var o=this._arr,i=o.length;return n[t]=i,o.push({key:t,priority:r}),this._decrease(i),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},t.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))},t.prototype._decrease=function(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t},t.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t},Qc}function Ud(){if(ef)return Xc;ef=1;var e=Dd(),t=Bd();Xc=function(e,n,o,i){return function(e,r,n,o){var i,u,a={},s=new t,c=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),c=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,s.decrease(t,c))};e.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;a[e]={distance:t},s.add(e,t)});for(;s.size()>0&&(i=s.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(c);return a}(e,String(n),o||r,i||function(t){return e.outEdges(t)})};var r=e.constant(1);return Xc}function $d(){if(rf)return tf;rf=1;var e=Ud(),t=Dd();return tf=function(r,n,o){return t.transform(r.nodes(),function(t,i){t[i]=e(r,i,n,o)},{})}}function Wd(){if(of)return nf;of=1;var e=Dd();return nf=function(t){var r=0,n=[],o={},i=[];function u(a){var s=o[a]={onStack:!0,lowlink:r,index:r++};if(n.push(a),t.successors(a).forEach(function(t){e.has(o,t)?o[t].onStack&&(s.lowlink=Math.min(s.lowlink,o[t].index)):(u(t),s.lowlink=Math.min(s.lowlink,o[t].lowlink))}),s.lowlink===s.index){var c,f=[];do{c=n.pop(),o[c].onStack=!1,f.push(c)}while(a!==c);i.push(f)}}return t.nodes().forEach(function(t){e.has(o,t)||u(t)}),i}}function qd(){if(af)return uf;af=1;var e=Dd(),t=Wd();return uf=function(r){return e.filter(t(r),function(e){return e.length>1||1===e.length&&r.hasEdge(e[0],e[0])})}}function Yd(){if(cf)return sf;cf=1;var e=Dd();sf=function(e,r,n){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],u=i[r],a=n.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)})})}),n}(e,r||t,n||function(t){return e.outEdges(t)})};var t=e.constant(1);return sf}function Jd(){if(df)return ff;df=1;var e=Dd();function t(t){var n={},o={},i=[];if(e.each(t.sinks(),function u(a){if(e.has(o,a))throw new r;e.has(n,a)||(o[a]=!0,n[a]=!0,e.each(t.predecessors(a),u),delete o[a],i.push(a))}),e.size(n)!==t.nodeCount())throw new r;return i}function r(){}return ff=t,t.CycleException=r,r.prototype=new Error,ff}function Hd(){if(hf)return lf;hf=1;var e=Jd();return lf=function(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}}function Kd(){if(vf)return pf;vf=1;var e=Dd();function t(r,n,o,i,u,a){e.has(i,n)||(i[n]=!0,o||a.push(n),e.each(u(n),function(e){t(r,e,o,i,u,a)}),o&&a.push(n))}return pf=function(r,n,o){e.isArray(n)||(n=[n]);var i=(r.isDirected()?r.successors:r.neighbors).bind(r),u=[],a={};return e.each(n,function(e){if(!r.hasNode(e))throw new Error("Graph does not have node: "+e);t(r,e,"post"===o,a,i,u)}),u}}function Qd(){if(yf)return gf;yf=1;var e=Kd();return gf=function(t,r){return e(t,r,"post")}}function Zd(){if(bf)return mf;bf=1;var e=Kd();return mf=function(t,r){return e(t,r,"pre")}}function Xd(){if(_f)return wf;_f=1;var e=Dd(),t=zd(),r=Bd();return wf=function(n,o){var i,u=new t,a={},s=new r;function c(e){var t=e.v===i?e.w:e.v,r=s.priority(t);if(void 0!==r){var n=o(e);n<r&&(a[t]=i,s.decrease(t,n))}}if(0===n.nodeCount())return u;e.each(n.nodes(),function(e){s.add(e,Number.POSITIVE_INFINITY),u.setNode(e)}),s.decrease(n.nodes()[0],0);var f=!1;for(;s.size()>0;){if(i=s.removeMin(),e.has(a,i))u.setEdge(i,a[i]);else{if(f)throw new Error("Input graph is not connected: "+n);f=!0}n.nodeEdges(i).forEach(c)}return u}}var el=function(){if(kf)return Of;kf=1;var e=qc?Wc:(qc=1,Wc={Graph:zd(),version:$c?Uc:($c=1,Uc="2.1.8")});return Of={Graph:e.Graph,json:Vd(),alg:jf?Ef:(jf=1,Ef={components:Gd(),dijkstra:Ud(),dijkstraAll:$d(),findCycles:qd(),floydWarshall:Yd(),isAcyclic:Hd(),postorder:Qd(),preorder:Zd(),prim:Xd(),tarjan:Wd(),topsort:Jd()}),version:e.version}}();const tl={};function rl(t){if(tl[t])return tl[t];const r=e.inject(t,null);if(!r){console.warn(`[whitelabel-modules] Missing injected composable: ${t}. Will retry on next call.`);const r=(...r)=>{const n=e.inject(t,null);if(!n)throw new Error(`[whitelabel-modules] ${t} still not provided.`);return tl[t]=n,n(...r)};return tl[t]=r,r}return tl[t]=r,r}exports.ProcessStatus=g,exports.findInterpolationSegments=a,exports.getDefaultExportFromCjs=it,exports.interpolateTemplateFromVariableContext=n,exports.useAI=e=>rl("cms-useAI")(e),exports.useAgencyIntegrations=()=>rl("cms-useAgencyIntegrations")(),exports.useAgentService=()=>rl("cms-useAgentService")(),exports.useConfirmation=()=>rl("cms-useConfirmation")(),exports.useCustomDialog=()=>rl("cms-useCustomDialog")(),exports.useFirebaseIntegration=e=>rl("cms-useFirebaseIntegration")(e),exports.useFlowBuilder=()=>rl("cms-useFlowBuilder")(),exports.useFormBuilder=()=>rl("cms-useFormBuilder")(),exports.useGoogleServiceAccountIntegration=e=>rl("cms-useGoogleServiceAccountIntegration")(e),exports.useIntegrationActionBuilder=()=>rl("cms-useIntegrationActionBuilder")(),exports.useIntegrationActions=e=>rl("cms-useIntegrationActions")(e),exports.useIntegrations=()=>rl("cms-useIntegrations")(),exports.useLayout=function(){const{findNode:r}=t.useVueFlow(),n=e.ref(new el.Graph({directed:!0}));return{graph:n,layout:function(e,o,i="TB"){const u=new Gt.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:i});const a="LR"===i;for(const t of e){const e=r(t.id);u.setNode(t.id,{width:e?.dimensions.width||150,height:e?.dimensions.height||50})}for(const t of o)u.setEdge(t.source,t.target);Gt.layout(u);const s=new el.Graph({directed:!0});for(const t of e)s.setNode(t.id);for(const t of o)s.setEdge(t.source,t.target);return n.value=s,e.map(e=>{const r=u.node(e.id);return{...e,targetPosition:a?t.Position.Left:t.Position.Top,sourcePosition:a?t.Position.Right:t.Position.Bottom,position:{x:r.x,y:r.y}}})}}},exports.useLogs=()=>rl("cms-useLogs")(),exports.useMailer=e=>rl("cms-useMailer")(e),exports.useMediaLibrary=()=>rl("cms-useMediaLibrary")(),exports.useModule=()=>rl("cms-useModule")(),exports.useModuleApi=()=>rl("cms-useModuleApi")(),exports.useModuleBreadcrumbs=e=>rl("cms-useModuleBreadcrumbs")(e),exports.useModuleOverlay=()=>rl("cms-useModuleOverlay")(),exports.useModulePermissions=()=>rl("cms-useModulePermissions")(),exports.useModuleRoute=()=>rl("cms-useModuleRoute")(),exports.useModuleStorage=()=>rl("cms-useModuleStorage")(),exports.useOverlayParams=()=>rl("cms-useOverlayParams")(),exports.useOverlayStack=()=>rl("cms-useOverlayStack")(),exports.useProjectService=()=>rl("cms-useProjectService")(),exports.useProjectSettings=()=>rl("cms-useProjectSettings")(),exports.useQueryBuilder=()=>rl("cms-useQueryBuilder")(),exports.useRoute=()=>rl("cms-useRoute")(),exports.useRouter=()=>rl("cms-useRouter")(),exports.useRunProcess=function({graph:r,cancelOnError:n=!0,nodes:o=[],edges:i=[],variables:u=[],computedVariables:a=[],onFinish:s,flowBuilderExtensions:c=[],maxIterations:f=100}){const{updateNodeData:d,getConnectedEdges:l,findNode:p}=t.useVueFlow(),v=new Map;let m=!1;const b=(e,...t)=>(m=!0,s?.(e,...t)),w=new Map(o.map(e=>[e.id,e])),_=e.toRef(()=>e.toValue(r)),E=e.ref(!1),j=new Map,O=new Map,k=new Set,x=new Map,N=e.ref(u?JSON.parse(JSON.stringify(u.map(e=>({...e,value:Object.keys(e).includes("defaultValue")?e.defaultValue:e.value??null})))):[]);async function I(t,r=!1,o={}){const u=O.get(t)??0;if(r&&"START"!==t||u>=f)return;k.add(t);const a=l(t).filter(e=>e.target===t);if(await Promise.all(a.map(e=>async function(e){return new Promise(t=>{const r=setInterval(()=>{e()&&(clearInterval(r),t(!0))},100)})}(()=>!e.data?.isAnimating))),k.clear(),E.value)try{const e=_.value.predecessors(t)||[],r=Object.assign({},...e.map(e=>v.get(e)??{})),n={...Object.fromEntries(N.value.map(e=>[e.name,e.value])),...r},a=w?.size>0?w.get(t):p(t);if("merge-wait"===a.type&&!function(e,t){const r=new Set(i.filter(t=>t.target===e).map(e=>e.source));if(0===r.size)return!0;const n=x.get(e)??new Set;t&&n.add(t);return x.set(e,n),!(n.size<r.size)&&(x.set(e,new Set),!0)}(t,o.from))return void M(t,g.RUNNING);O.set(t,u+1),M(t,g.RUNNING);const s=function(e){const t={};return e.forEach(e=>{e.type?.value&&"function"==typeof e.processFunction&&(t[e.type.value]=e.processFunction)}),t}(c),f={...h,...s}[a.data.taskType??a.type],d=f?await f(n,{node:a,graph:_.value,onFinish:b,localVariables:N,flowBuilderExtensions:c}):{};v.set(t,d?JSON.parse(JSON.stringify(d)):{});const l=i.filter(e=>e.source===t);if("for-each"===a.type)return await async function(e,t,r){const n=Array.isArray(t?.items)?t.items:[],o=e.data.itemVariableName||"item",i=e.data.indexVariableName||"index",u=(a=[o,i,"items","itemCount","isFirst","isLast"],a.map(e=>{const t=N.value.findIndex(t=>t.name===e);return{name:e,index:t,variable:t>=0?JSON.parse(JSON.stringify(N.value[t])):null}}));var a;for(let s=0;s<n.length;s++){const u=n[s],a={...t,item:u,index:s,[o]:u,[i]:s,items:n,itemCount:n.length,isFirst:0===s,isLast:s===n.length-1};P(o,u,"any"),P(i,s,"number"),P("items",n,"array"),P("itemCount",n.length,"number"),P("isFirst",0===s,"boolean"),P("isLast",s===n.length-1,"boolean"),v.set(e.id,JSON.parse(JSON.stringify(a)));for(const t of r.filter(e=>"each"===e.sourceHandle))await I(t.target,!1,{from:e.id})}(function(e){for(const t of[...e].reverse()){const e=N.value.findIndex(e=>e.name===t.name);!t.variable&&e>=0?N.value.splice(e,1):t.variable&&e>=0?N.value[e]=t.variable:t.variable&&N.value.splice(t.index,0,t.variable)}})(u),v.set(e.id,JSON.parse(JSON.stringify({items:n,itemCount:n.length,completed:!0})));for(const s of r.filter(e=>"done"===e.sourceHandle))await I(s.target,!1,{from:e.id})}(a,d,l),void M(t,g.FINISHED);M(t,g.FINISHED);l.some(e=>e.sourceHandle);const m="switch"===a.type?l.filter(e=>!e.data?.switchDefault&&function(e,t){return y(t?.value)===y(e.data?.switchCase)}(e,d)):[];for(const o of l){const{source:e,sourceHandle:r}=o,n=w.get(e).type;("start"===n||"confirm"===n&&"success"===r&&!0===d.confirmed||"confirm"===n&&"error"===r&&!1===d.confirmed||"integration-action"===n&&"success"===r&&!0===d.result?.success||"integration-action"===n&&"error"===r&&!1===d.result?.success||"api-request"===n&&"success"===r&&!0===d.result?.success||"api-request"===n&&"error"===r&&!1===d.result?.success||"conditional"===n&&"success"===r&&!0===d.conditionMet||"conditional"===n&&"error"===r&&!1===d.conditionMet||"switch"===n&&"success"===r&&m.includes(o)||"switch"===n&&"success"===r&&o.data?.switchDefault&&0===m.length||!["confirm","integration-action","api-request","conditional","switch"].includes(n)&&"success"===r)&&await I(o.target,!1,{from:t})}}catch(s){console.error(`Error in node ${t}:`,s),M(t,g.ERROR),e.toValue(n)&&await S(t)}}function C(e){A();for(const t of e)M(t.id,null)}async function S(e){const t=_.value.successors(e)||[];for(const r of t)M(r,g.SKIPPED),await S(r)}function A(){E.value=!1,O.clear(),j.clear(),x.clear()}function M(e,t){d(e,{status:t})}function P(e,t,r){const n=N.value.find(t=>t.name===e);n?n.value=t:N.value.push({id:`__loop_${e}`,name:e,type:r,value:t,defaultValue:t})}return{run:async function(e){if(E.value)return;C(e),E.value=!0;const t=e.filter(e=>0===_.value.predecessors(e.id)?.length);await Promise.all(t.map(e=>I(e.id,!0))),0!==k.size||m||b(),A()},stop:async function(){E.value=!1;for(const e of k)clearTimeout(j.get(e)),j.delete(e),M(e,g.CANCELLED),await S(e);for(const[e,t]of j)clearTimeout(t),j.delete(e),M(e,g.CANCELLED),await S(e);O.clear(),k.clear()},reset:C,isRunning:E}},exports.useUtilsService=()=>rl("cms-useUtilsService")();
@@ -0,0 +1 @@
1
+ import{toRef as e,toValue as t,ref as r,inject as n}from"vue";import{useVueFlow as o,Position as i}from"@vue-flow/core";import{useNuxtApp as u}from"nuxt/app";function a(e,t){if(!e)return"";return function(e,t,r="text"){const n=d(e);if(!n.length)return e;if(1===n.length&&0===n[0].start&&n[0].end===e.length)return s(n[0].expression,t);let o="",i=0;for(const u of n)o+=e.slice(i,u.start),o+=c(s(u.expression,t),r),i=u.end;return o+e.slice(i)}(e,function(e){const t=["__proto__","constructor","prototype"],r=e=>{if(Array.isArray(e))return e.map(r);if(e&&"object"==typeof e){const n={};for(const o in e)t.includes(o)||(n[o]=r(e[o]));return n}return e},n={};for(const o in e)!t.includes(o)&&p(o)&&(n[o]=r(e[o]));return n}(t?.reduce((e,t)=>(e[t.name]=t.value,e),{})??{}))}function s(e,t){if(!e)return"";const r=function(e){const t=e.match(/\b[a-zA-Z_][a-zA-Z0-9_]*\b/g)||[],r=/* @__PURE__ */new Set(["true","false","null","undefined","return","if","else","try","catch","typeof","new","delete","void","throw","in","instanceof","var","let","const","function","class","this","super","switch","case","break","continue","default","for","while","do","of","with","yield","await","async","import","export","from","debugger"]);return[...new Set(t.filter(e=>!r.has(e)&&!v.has(e)))]}(e),n={...t};for(const a of r)a in n||(n[a]=void 0);const o=Object.keys(n),i=Object.values(n);try{return new Function(...o,`'use strict'; return (${e})`)(...i)}catch(u){return void console.warn(`Interpolation failed for expression: "${e}"`,u)}}function c(e,t){if("js"===t){if(null==e)return"null";if("string"==typeof e)return JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return"null"}}if(null==e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const f=/* @__PURE__ */new Map;function d(e){const t=[];let r=0;for(;r<e.length;){const n=e.indexOf("{{",r);if(-1===n)break;const o=l(e,n+2);-1!==o?(t.push({start:n,end:o+2,expression:e.slice(n+2,o).trim()}),r=o+2):r=n+2}return t}function l(e,t){let r=e.indexOf("}}",t);for(;-1!==r;){if(h(e.slice(t,r).trim()))return r;r=e.indexOf("}}",r+1)}return-1}function h(e){if(!e)return!0;const t=f.get(e);if(void 0!==t)return t;let r=!1;try{new Function(`'use strict'; return (${e})`),r=!0}catch{r=!1}return f.set(e,r),r}function p(e){return/^[$A-Z_][0-9A-Z_$]*$/i.test(e)}const v=/* @__PURE__ */new Set(["Number","String","Boolean","Array","Object","JSON","Math","Date","RegExp","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","NaN","Infinity","Intl"]);function g(e,t,r,n,o=8e3){const i=crypto.randomUUID();return new Promise((u,a)=>{const s=e=>{const t=e.data;t&&"response"===t.type&&t.id===i&&(f(),u(t.payload))},c=setTimeout(()=>{f(),a(new Error("Timed out waiting for response"))},o),f=()=>{clearTimeout(c),window.removeEventListener("message",s)};window.addEventListener("message",s);const d=JSON.parse(JSON.stringify(r));e.postMessage({type:t,id:i,payload:d},n)})}const y={"api-request":async(e,{node:t})=>{try{let r=Object.keys(e).map(t=>({name:t,value:e[t]})),n=a(t.data.url,r),o=a(t.data.method,r).toUpperCase(),i=t.data.body?.map(e=>({key:a(e.key,r),value:a(e.value,r)}))||[],u=t.data.headers?.map(e=>({key:a(e.key,r),value:a(e.value,r)}))||[],s=t.data.cookies?.map(e=>({key:a(e.key,r),value:a(e.value,r)}))||[];const c=(t.data.urlParameters?.map(e=>({key:a(e.key,r),value:a(e.value,r)}))||[]).filter(e=>e.key).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"),f=c?`${n}?${c}`:n,d={};if(u.forEach(({key:e,value:t})=>{e&&(d[e]=t)}),s.length>0){const e=s.map(({key:e,value:t})=>`${e}=${t}`).join("; ");d.Cookie=e}let l=null;if(["POST","PUT","PATCH"].includes(o)){const e={};i.forEach(({key:t,value:r})=>{t&&(e[t]=r)}),l=JSON.stringify(e),d["Content-Type"]||="application/json"}const h=await fetch(f,{method:o,headers:d,body:l,credentials:"include"});if(h.status>=400)return{result:{success:!1,status:h.status}};let p;const v=h.headers.get("content-type");return p=v?.includes("application/json")?await h.json():await h.text(),{result:{success:!0,data:p,status:h.status}}}catch(r){return{result:{success:!1,status:r.status||500}}}},conditional:async(e,{node:t})=>({conditionMet:!!m(t.data.condition,e)}),switch:async(e,{node:t})=>({value:t.data.expression?m(t.data.expression,e):void 0}),"for-each":async(e,{node:t})=>{let r=t.data.itemsExpression?m(t.data.itemsExpression,e):[],n=b(r);return{items:n,itemCount:n.length}},"merge-wait":async e=>({merged:!0,...e}),"integration-action":async(e,{node:t})=>{const{$useIntegrationActions:r}=u(),{fireAction:n}=r(t.data.action.integration);return{result:await n(t.data.action,e)}},"show-toast":async(e,{node:t})=>{let r=Object.keys(e).map(t=>({name:t,value:e[t]}));console.log("Showing toast with variables",r,e,t);let n=a(t.data.title,r),o=a(t.data.message,r);return"true"===document.documentElement.dataset.moduleOverlayMode?(window.parent.postMessage({type:"toast:show",payload:{title:n,description:o}},"*"),{shown:!0}):(window.postMessage({type:"toast:show",payload:{title:n,description:o}},"*"),{shown:!0})},"finish-flow":async(e,{node:t,onFinish:r})=>{if(t.data.returnData){let n=m(t.data.transform,e);r({finishAllFlows:!0===t.data.finishAllFlows},n)}else r({finishAllFlows:!0===t.data.finishAllFlows});return{finished:!0}},confetti:async(e,{node:t})=>{const{$confetti:r}=u();return r(),{confetti:!0}},confirm:async(e,{node:t})=>{const{$useConfirmation:r}=u(),{confirm:n}=r();if(n){let r=Object.keys(e).map(t=>({name:t,value:e[t]})),o=a(t.data.title,r),i=a(t.data.message,r),u=a(t.data.confirmText,r);if("true"===document.documentElement.dataset.moduleOverlayMode){return{confirmed:(await g(window.parent,"confirmation-modal:show",{message:i,title:o,confirmText:u},"*")).confirmed}}return{confirmed:await n(i,o,u)}}return{confirmed:!1}},"set-variable":async(e,{node:t,localVariables:r})=>{let n=Object.keys(e).map(t=>({name:t,value:e[t]})),o={};for(const i of t.data.updateActions??[]){const e=r.value.find(e=>e.id===i.variableId),t=a(i.value,n);e&&("element"===e?.type?(e.value.value=t,o[e.name]={value:t}):(e.value=t,o[e.name]=t)),window.dispatchEvent(new CustomEvent("flow-update-form-variable",{detail:{id:i.variableId,value:t}}))}return{set:!0,...o}},"transform-data":async(e,{node:t})=>({transformed:!0,value:m(t.data.transform,e)}),"visit-url":async(e,{node:t})=>{let r=Object.keys(e).map(t=>({name:t,value:e[t]})),n=a(t.data.url,r);return t.data.newTab?window.open(n,"_blank"):window.location.href=n,{visited:!0}},"show-dialog":async(e,{node:t,flowBuilderExtensions:r})=>{const{$useCustomDialog:n}=u(),{openCustomDialog:o}=n();let i=Object.keys(e).map(t=>({name:t,value:e[t]}));if("true"===document.documentElement.dataset.moduleOverlayMode){window.parent.__pendingDialogExtensions={formBuilderExtensions:[],flowBuilderExtensions:r};return await g(window.parent,"dialog:show",{layout:t.data.layout,variables:i},"*")}return await o(t.data.layout,i,[],r)},"show-module":async(e,{node:t})=>{const{$useModuleOverlay:r}=u(),{openInOverlay:n}=r();let o=Object.keys(e).map(t=>({name:t,value:e[t]}));const i={};if(t.data.moduleData?.forEach(e=>{i[a(e.key,o)]=a(e.value,o)}),"true"===document.documentElement.dataset.moduleOverlayMode){return await g(window.parent,"module-overlay:show",{moduleId:t.data.moduleId,params:i},"*")}return await n(t.data.moduleId,i)},"wait-delay":async(e,{node:t})=>{let r=parseInt(t.data.delayMs)||0;return await new Promise(e=>setTimeout(e,r)),{waited:!0}},"ai-agent":async(e,{node:t})=>{const{$useAgentService:r}=u(),n=r(),o=Object.keys(e).map(t=>({name:t,value:e[t]})),i=t.data.projectSlug,s=t.data.agentId,c=t.data.method;if(!i)throw new Error("AI Agent node: missing project slug");if(!s)throw new Error("AI Agent node: no agent selected");if(!c)throw new Error("AI Agent node: no method selected");if("get-collaborators"===c){return{collaborators:await n.getAgentCollaborators(i,s)}}if("create-conversation"===c){const e=a(t.data.userId,o),r=a(t.data.message,o),u=await n.flowCreateConversation(i,s,{userId:e,message:r});return{conversationId:u.conversationId,messageId:u.messageId}}if("add-to-conversation"===c){const e=a(t.data.conversationId,o),r=a(t.data.message,o),u=await n.flowAddAgentMessage(i,s,{conversationId:e,message:r});return{messageId:u.messageId,conversationId:u.conversationId}}throw new Error(`AI Agent node: unknown method "${c}"`)}},m=(e,t={})=>{var r=document.createElement("iframe");document.body.appendChild(r);var n=r.contentWindow.Function;return document.body.removeChild(r),n(...Object.keys(t),"'use strict';"+e)(...Object.values(t))},b=e=>null==e?[]:Array.isArray(e)?e:"object"==typeof e?Object.entries(e).map(([e,t])=>({key:e,value:t})):[e],w={ERROR:"error",SKIPPED:"skipped",CANCELLED:"cancelled",FINISHED:"finished",RUNNING:"running"};function _({graph:n,cancelOnError:i=!0,nodes:u=[],edges:a=[],variables:s=[],computedVariables:c=[],onFinish:f,flowBuilderExtensions:d=[],maxIterations:l=100}){const{updateNodeData:h,getConnectedEdges:p,findNode:v}=o(),g=/* @__PURE__ */new Map;let m=!1;const b=(e,...t)=>(m=!0,f?.(e,...t)),_=new Map(u.map(e=>[e.id,e])),j=e(()=>t(n)),O=r(!1),k=/* @__PURE__ */new Map,N=/* @__PURE__ */new Map,I=/* @__PURE__ */new Set,x=/* @__PURE__ */new Map,C=r(s?JSON.parse(JSON.stringify(s.map(e=>({...e,value:Object.keys(e).includes("defaultValue")?e.defaultValue:e.value??null})))):[]);async function S(e,r=!1,n={}){const o=N.get(e)??0;if(r&&"START"!==e||o>=l)return;I.add(e);const u=p(e).filter(t=>t.target===e);if(await Promise.all(u.map(e=>async function(e){return new Promise(t=>{const r=setInterval(()=>{e()&&(clearInterval(r),t(!0))},100)})}(()=>!e.data?.isAnimating))),I.clear(),O.value)try{const t=j.value.predecessors(e)||[],r=Object.assign({},...t.map(e=>g.get(e)??{})),i={...Object.fromEntries(C.value.map(e=>[e.name,e.value])),...r},u=_?.size>0?_.get(e):v(e);if("merge-wait"===u.type&&!function(e,t){const r=new Set(a.filter(t=>t.target===e).map(e=>e.source));if(0===r.size)return!0;const n=x.get(e)??/* @__PURE__ */new Set;t&&n.add(t);return x.set(e,n),!(n.size<r.size)&&(x.set(e,/* @__PURE__ */new Set),!0)}(e,n.from))return void P(e,w.RUNNING);N.set(e,o+1),P(e,w.RUNNING);const s=function(e){const t={};return e.forEach(e=>{e.type?.value&&"function"==typeof e.processFunction&&(t[e.type.value]=e.processFunction)}),t}(d),c={...y,...s}[u.data.taskType??u.type],f=c?await c(i,{node:u,graph:j.value,onFinish:b,localVariables:C,flowBuilderExtensions:d}):{};g.set(e,f?JSON.parse(JSON.stringify(f)):{});const l=a.filter(t=>t.source===e);if("for-each"===u.type)return await async function(e,t,r){const n=Array.isArray(t?.items)?t.items:[],o=e.data.itemVariableName||"item",i=e.data.indexVariableName||"index",u=(a=[o,i,"items","itemCount","isFirst","isLast"],a.map(e=>{const t=C.value.findIndex(t=>t.name===e);return{name:e,index:t,variable:t>=0?JSON.parse(JSON.stringify(C.value[t])):null}}));var a;for(let s=0;s<n.length;s++){const u=n[s],a={...t,item:u,index:s,[o]:u,[i]:s,items:n,itemCount:n.length,isFirst:0===s,isLast:s===n.length-1};F(o,u,"any"),F(i,s,"number"),F("items",n,"array"),F("itemCount",n.length,"number"),F("isFirst",0===s,"boolean"),F("isLast",s===n.length-1,"boolean"),g.set(e.id,JSON.parse(JSON.stringify(a)));for(const t of r.filter(e=>"each"===e.sourceHandle))await S(t.target,!1,{from:e.id})}(function(e){for(const t of[...e].reverse()){const e=C.value.findIndex(e=>e.name===t.name);!t.variable&&e>=0?C.value.splice(e,1):t.variable&&e>=0?C.value[e]=t.variable:t.variable&&C.value.splice(t.index,0,t.variable)}})(u),g.set(e.id,JSON.parse(JSON.stringify({items:n,itemCount:n.length,completed:!0})));for(const s of r.filter(e=>"done"===e.sourceHandle))await S(s.target,!1,{from:e.id})}(u,f,l),void P(e,w.FINISHED);P(e,w.FINISHED);l.some(e=>e.sourceHandle);const h="switch"===u.type?l.filter(e=>!e.data?.switchDefault&&function(e,t){return E(t?.value)===E(e.data?.switchCase)}(e,f)):[];for(const n of l){const{source:t,sourceHandle:r}=n,o=_.get(t).type;("start"===o||"confirm"===o&&"success"===r&&!0===f.confirmed||"confirm"===o&&"error"===r&&!1===f.confirmed||"integration-action"===o&&"success"===r&&!0===f.result?.success||"integration-action"===o&&"error"===r&&!1===f.result?.success||"api-request"===o&&"success"===r&&!0===f.result?.success||"api-request"===o&&"error"===r&&!1===f.result?.success||"conditional"===o&&"success"===r&&!0===f.conditionMet||"conditional"===o&&"error"===r&&!1===f.conditionMet||"switch"===o&&"success"===r&&h.includes(n)||"switch"===o&&"success"===r&&n.data?.switchDefault&&0===h.length||!["confirm","integration-action","api-request","conditional","switch"].includes(o)&&"success"===r)&&await S(n.target,!1,{from:e})}}catch(s){console.error(`Error in node ${e}:`,s),P(e,w.ERROR),t(i)&&await A(e)}}function M(e){L();for(const t of e)P(t.id,null)}async function A(e){const t=j.value.successors(e)||[];for(const r of t)P(r,w.SKIPPED),await A(r)}function L(){O.value=!1,N.clear(),k.clear(),x.clear()}function P(e,t){h(e,{status:t})}function F(e,t,r){const n=C.value.find(t=>t.name===e);n?n.value=t:C.value.push({id:`__loop_${e}`,name:e,type:r,value:t,defaultValue:t})}return{run:async function(e){if(O.value)return;M(e),O.value=!0;const t=e.filter(e=>0===j.value.predecessors(e.id)?.length);await Promise.all(t.map(e=>S(e.id,!0))),0!==I.size||m||b(),L()},stop:async function(){O.value=!1;for(const e of I)clearTimeout(k.get(e)),k.delete(e),P(e,w.CANCELLED),await A(e);for(const[e,t]of k)clearTimeout(t),k.delete(e),P(e,w.CANCELLED),await A(e);N.clear(),I.clear()},reset:M,isRunning:O}}function E(e){if(null==e)return"";if("object"==typeof e)try{return JSON.stringify(e)}catch(t){return String(e)}return String(e)}var j,O,k,N,I,x,C,S,M,A,L,P,F,T,D,R,z,G,V,U,B,$,W,Y,J,q,H,K,Z,Q,X,ee,te,re,ne,oe,ie,ue,ae,se,ce,fe,de,le,he,pe,ve,ge,ye,me,be,we,_e,Ee,je,Oe,ke,Ne,Ie,xe,Ce,Se,Me,Ae,Le,Pe,Fe,Te,De,Re,ze,Ge,Ve,Ue,Be,$e,We,Ye,Je,qe,He,Ke,Ze,Qe,Xe,et,tt,rt,nt,ot,it,ut,at,st,ct="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dt(){if(O)return j;O=1;var e="\0";function t(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function n(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}return o+""+i+""+(void 0===n?"\0":n)}function o(e,t){return n(e,t.v,t.w,t.name)}return j=class{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(t){t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(t,r){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=e,this._children[t]={},this._children[e][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===r)r=e;else{for(var n=r+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==e)return r}}children(t=e){if(this._isCompound){var r=this._children[t];if(r)return Object.keys(r)}else{if(t===e)return this.nodes();if(this.hasNode(t))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){const n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};function o(e){var i=r.parent(e);return void 0===i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:o(i)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,o(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,r,o,i,u=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,r=a.w,o=a.name,2===arguments.length&&(i=arguments[1],u=!0)):(e=a,r=arguments[1],o=arguments[3],arguments.length>2&&(i=arguments[2],u=!0)),e=""+e,r=""+r,void 0!==o&&(o=""+o);var s=n(this._isDirected,e,r,o);if(Object.hasOwn(this._edgeLabels,s))return u&&(this._edgeLabels[s]=i),this;if(void 0!==o&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=u?i:this._defaultEdgeLabelFn(e,r,o);var c=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};n&&(a.name=n);return a}(this._isDirected,e,r,o);return e=c.v,r=c.w,Object.freeze(c),this._edgeObjs[s]=c,t(this._preds[r],e),t(this._sucs[e],r),this._in[r][s]=c,this._out[e][s]=c,this._edgeCount++,this}edge(e,t,r){var i=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,r);return this._edgeLabels[i]}edgeAsObj(){const e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var i=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,i)}removeEdge(e,t,i){var u=1===arguments.length?o(this._isDirected,arguments[0]):n(this._isDirected,e,t,i),a=this._edgeObjs[u];return a&&(e=a.v,t=a.w,delete this._edgeLabels[u],delete this._edgeObjs[u],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][u],delete this._out[e][u],this._edgeCount--),this}inEdges(e,t){var r=this._in[e];if(r){var n=Object.values(r);return t?n.filter(e=>e.v===t):n}}outEdges(e,t){var r=this._out[e];if(r){var n=Object.values(r);return t?n.filter(e=>e.w===t):n}}nodeEdges(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))}},j}function lt(){if(S)return C;S=1;var e=dt();function t(e){return e.nodes().map(function(t){var r=e.node(t),n=e.parent(t),o={v:t};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o})}function r(e){return e.edges().map(function(t){var r=e.edge(t),n={v:t.v,w:t.w};return void 0!==t.name&&(n.name=t.name),void 0!==r&&(n.value=r),n})}return C={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};void 0!==e.graph()&&(n.value=structuredClone(e.graph()));return n},read:function(t){var r=new e(t.options).setGraph(t.value);return t.nodes.forEach(function(e){r.setNode(e.v,e.value),e.parent&&r.setParent(e.v,e.parent)}),t.edges.forEach(function(e){r.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),r}}}function ht(){if(A)return M;return A=1,M=function(e){var t,r={},n=[];function o(n){Object.hasOwn(r,n)||(r[n]=!0,t.push(n),e.successors(n).forEach(o),e.predecessors(n).forEach(o))}return e.nodes().forEach(function(e){t=[],o(e),t.length&&n.push(t)}),n}}function pt(){if(P)return L;P=1;return L=class{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(e=String(e),!Object.hasOwn(r,e)){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t}}}function vt(){if(T)return F;T=1;var e=pt();F=function(r,n,o,i){return function(t,r,n,o){var i,u,a={},s=new e,c=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),c=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,s.decrease(t,c))};t.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;a[e]={distance:t},s.add(e,t)});for(;s.size()>0&&(i=s.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(c);return a}(r,String(n),o||t,i||function(e){return r.outEdges(e)})};var t=()=>1;return F}function gt(){if(R)return D;R=1;var e=vt();return D=function(t,r,n){return t.nodes().reduce(function(o,i){return o[i]=e(t,i,r,n),o},{})}}function yt(){if(G)return z;return G=1,z=function(e){var t=0,r=[],n={},o=[];function i(u){var a=n[u]={onStack:!0,lowlink:t,index:t++};if(r.push(u),e.successors(u).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(a.lowlink=Math.min(a.lowlink,n[e].index)):(i(e),a.lowlink=Math.min(a.lowlink,n[e].lowlink))}),a.lowlink===a.index){var s,c=[];do{s=r.pop(),n[s].onStack=!1,c.push(s)}while(u!==s);o.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(n,e)||i(e)}),o}}function mt(){if(U)return V;U=1;var e=yt();return V=function(t){return e(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})}}function bt(){if($)return B;$=1,B=function(t,r,n){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],u=i[r],a=n.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)})})}),n}(t,r||e,n||function(e){return t.outEdges(e)})};var e=()=>1;return B}function wt(){if(Y)return W;function e(e){var r={},n={},o=[];if(e.sinks().forEach(function i(u){if(Object.hasOwn(n,u))throw new t;Object.hasOwn(r,u)||(n[u]=!0,r[u]=!0,e.predecessors(u).forEach(i),delete n[u],o.push(u))}),Object.keys(r).length!==e.nodeCount())throw new t;return o}Y=1;class t extends Error{constructor(){super(...arguments)}}return W=e,e.CycleException=t,W}function _t(){if(q)return J;q=1;var e=wt();return J=function(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}}function Et(){if(K)return H;function e(e,t,n,o){for(var i=[[e,!1]];i.length>0;){var u=i.pop();u[1]?o.push(u[0]):Object.hasOwn(n,u[0])||(n[u[0]]=!0,i.push([u[0],!0]),r(t(u[0]),e=>i.push([e,!1])))}}function t(e,t,n,o){for(var i=[e];i.length>0;){var u=i.pop();Object.hasOwn(n,u)||(n[u]=!0,o.push(u),r(t(u),e=>i.push(e)))}}function r(e,t){for(var r=e.length;r--;)t(e[r],r,e);return e}return K=1,H=function(r,n,o){Array.isArray(n)||(n=[n]);var i=r.isDirected()?e=>r.successors(e):e=>r.neighbors(e),u="post"===o?e:t,a=[],s={};return n.forEach(e=>{if(!r.hasNode(e))throw new Error("Graph does not have node: "+e);u(e,i,s,a)}),a}}function jt(){if(Q)return Z;Q=1;var e=Et();return Z=function(t,r){return e(t,r,"post")}}function Ot(){if(ee)return X;ee=1;var e=Et();return X=function(t,r){return e(t,r,"pre")}}function kt(){if(re)return te;re=1;var e=dt(),t=pt();return te=function(r,n){var o,i=new e,u={},a=new t;function s(e){var t=e.v===o?e.w:e.v,r=a.priority(t);if(void 0!==r){var i=n(e);i<r&&(u[t]=o,a.decrease(t,i))}}if(0===r.nodeCount())return i;r.nodes().forEach(function(e){a.add(e,Number.POSITIVE_INFINITY),i.setNode(e)}),a.decrease(r.nodes()[0],0);var c=!1;for(;a.size()>0;){if(o=a.removeMin(),Object.hasOwn(u,o))i.setEdge(o,u[o]);else{if(c)throw new Error("Input graph is not connected: "+r);c=!0}r.nodeEdges(o).forEach(s)}return i}}function Nt(){if(ue)return ie;ue=1;var e=x?I:(x=1,I={Graph:dt(),version:N?k:(N=1,k="2.2.4")});return ie={Graph:e.Graph,json:lt(),alg:oe?ne:(oe=1,ne={components:ht(),dijkstra:vt(),dijkstraAll:gt(),findCycles:mt(),floydWarshall:bt(),isAcyclic:_t(),postorder:jt(),preorder:Ot(),prim:kt(),tarjan:yt(),topsort:wt()}),version:e.version}}function It(){if(fe)return ce;fe=1;let e=Nt().Graph,t=function(){if(se)return ae;function e(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function t(e,t){if("_next"!==e&&"_prev"!==e)return t}return se=1,ae=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let t=this._sentinel,r=t._prev;if(r!==t)return e(r),r}enqueue(t){let r=this._sentinel;t._prev&&t._next&&e(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){let e=[],r=this._sentinel,n=r._prev;for(;n!==r;)e.push(JSON.stringify(n,t)),n=n._prev;return"["+e.join(", ")+"]"}}}();ce=function(i,u){if(i.nodeCount()<=1)return[];let a=function(r,n){let i=new e,u=0,a=0;r.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),r.edges().forEach(e=>{let t=i.edge(e.v,e.w)||0,r=n(e),o=t+r;i.setEdge(e.v,e.w,o),a=Math.max(a,i.node(e.v).out+=r),u=Math.max(u,i.node(e.w).in+=r)});let s=function(e){const t=[];for(let r=0;r<e;r++)t.push(r);return t}(a+u+3).map(()=>new t),c=u+1;return i.nodes().forEach(e=>{o(s,c,i.node(e))}),{graph:i,buckets:s,zeroIdx:c}}(i,u||r);return function(e,t,r){let o,i=[],u=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;o=a.dequeue();)n(e,t,r,o);for(;o=u.dequeue();)n(e,t,r,o);if(e.nodeCount())for(let u=t.length-2;u>0;--u)if(o=t[u].dequeue(),o){i=i.concat(n(e,t,r,o,!0));break}}return i}(a.graph,a.buckets,a.zeroIdx).flatMap(e=>i.outEdges(e.v,e.w))};let r=()=>1;function n(e,t,r,n,i){let u=i?[]:void 0;return e.inEdges(n.v).forEach(n=>{let a=e.edge(n),s=e.node(n.v);i&&u.push({v:n.v,w:n.w}),s.out-=a,o(t,r,s)}),e.outEdges(n.v).forEach(n=>{let i=e.edge(n),u=n.w,a=e.node(u);a.in-=i,o(t,r,a)}),e.removeNode(n.v),u}function o(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}return ce}function xt(){if(le)return de;le=1;let e=Nt().Graph;function t(e,t,r,n){for(var o=n;e.hasNode(o);)o=u(n);return r.dummy=t,e.setNode(o,r),o}de={addBorderNode:function(e,r,n,o){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=o);return t(e,"border",i,r)},addDummyNode:t,applyWithChunking:n,asNonCompoundGraph:function(t){let r=new e({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(e=>{t.children(e).length||r.setNode(e,t.node(e))}),t.edges().forEach(e=>{r.setEdge(e,t.edge(e))}),r},buildLayerMatrix:function(e){let t=a(o(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,i=e.y,u=t.x-o,a=t.y-i,s=e.width/2,c=e.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(a)*s>Math.abs(u)*c?(a<0&&(c=-c),r=c*u/a,n=c):(u<0&&(s=-s),r=s,n=s*a/u);return{x:o+r,y:i+n}},mapValues:function(e,t){let r=t;"string"==typeof t&&(r=e=>e[t]);return Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:o,normalizeRanks:function(e){let t=e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}),r=n(Math.min,t);e.nodes().forEach(t=>{let n=e.node(t);Object.hasOwn(n,"rank")&&(n.rank-=r)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){const r={};for(const n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return s(e.nodes(),t)},range:a,removeEmptyRanks:function(e){let t=e.nodes().map(t=>e.node(t).rank),r=n(Math.min,t),o=[];e.nodes().forEach(t=>{let n=e.node(t).rank-r;o[n]||(o[n]=[]),o[n].push(t)});let i=0,u=e.graph().nodeRankFactor;Array.from(o).forEach((t,r)=>{void 0===t&&r%u!==0?--i:void 0!==t&&i&&t.forEach(t=>e.node(t).rank+=i)})},simplify:function(t){let r=(new e).setGraph(t.graph());return t.nodes().forEach(e=>r.setNode(e,t.node(e))),t.edges().forEach(e=>{let n=r.edge(e.v,e.w)||{weight:0,minlen:1},o=t.edge(e);r.setEdge(e.v,e.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),r},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return s(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:u,zipObject:s};const r=65535;function n(e,t){if(t.length>r){const n=function(e,t=r){const n=[];for(let r=0;r<e.length;r+=t){const o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function o(e){const t=e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MIN_VALUE:r});return n(Math.max,t)}let i=0;function u(e){return e+""+ ++i}function a(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);const o=[];for(let i=e;n(i);i+=r)o.push(i);return o}function s(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}return de}function Ct(){if(pe)return he;pe=1;let e=It(),t=xt().uniqueId;return he={run:function(r){("greedy"===r.graph().acyclicer?e(r,(n=r,e=>n.edge(e).weight)):function(e){let t=[],r={},n={};function o(i){Object.hasOwn(n,i)||(n[i]=!0,r[i]=!0,e.outEdges(i).forEach(e=>{Object.hasOwn(r,e.w)?t.push(e):o(e.w)}),delete r[i])}return e.nodes().forEach(o),t}(r)).forEach(e=>{let n=r.edge(e);r.removeEdge(e),n.forwardName=e.name,n.reversed=!0,r.setEdge(e.w,e.v,n,t("rev"))});var n},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}function St(){if(ge)return ve;ge=1;let e=xt();return ve={run:function(t){t.graph().dummyChains=[],t.edges().forEach(r=>function(t,r){let n,o,i,u=r.v,a=t.node(u).rank,s=r.w,c=t.node(s).rank,f=r.name,d=t.edge(r),l=d.labelRank;if(c===a+1)return;for(t.removeEdge(r),i=0,++a;a<c;++i,++a)d.points=[],o={width:0,height:0,edgeLabel:d,edgeObj:r,rank:a},n=e.addDummyNode(t,"edge",o,"_d"),a===l&&(o.width=d.width,o.height=d.height,o.dummy="edge-label",o.labelpos=d.labelpos),t.setEdge(u,n,{weight:d.weight},f),0===i&&t.graph().dummyChains.push(n),u=n;t.setEdge(u,s,{weight:d.weight},f)}(t,r))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r,n=e.node(t),o=n.edgeLabel;for(e.setEdge(n.edgeObj,o);n.dummy;)r=e.successors(t)[0],e.removeNode(t),o.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height),t=r,n=e.node(t)})}}}function Mt(){if(me)return ye;me=1;const{applyWithChunking:e}=xt();return ye={longestPath:function(t){var r={};t.sources().forEach(function n(o){var i=t.node(o);if(Object.hasOwn(r,o))return i.rank;r[o]=!0;let u=t.outEdges(o).map(e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen);var a=e(Math.min,u);return a===Number.POSITIVE_INFINITY&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}function At(){if(we)return be;we=1;var e=Nt().Graph,t=Mt().slack;function r(e,r){return e.nodes().forEach(function n(o){r.nodeEdges(o).forEach(i=>{var u=i.v,a=o===u?i.w:u;e.hasNode(a)||t(r,i)||(e.setNode(a,{}),e.setEdge(o,a,{}),n(a))})}),e.nodeCount()}function n(e,r){return r.edges().reduce((n,o)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=t(r,o)),i<n[0]?[i,o]:n},[Number.POSITIVE_INFINITY,null])[1]}function o(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}return be=function(i){var u,a,s=new e({directed:!1}),c=i.nodes()[0],f=i.nodeCount();s.setNode(c,{});for(;r(s,i)<f;)u=n(s,i),a=s.hasNode(u.v)?t(i,u):-t(i,u),o(s,i,a);return s}}function Lt(){if(Ee)return _e;Ee=1;var e=At(),t=Mt().slack,r=Mt().longestPath,n=Nt().alg.preorder,o=Nt().alg.postorder,i=xt().simplify;function u(t){t=i(t),r(t);var n,o=e(t);for(c(o),a(o,t);n=d(o);)h(o,t,n,l(o,t,n))}function a(e,t){var r=o(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>function(e,t,r){var n=e.node(r),o=n.parent;e.edge(r,o).cutvalue=s(e,t,r)}(e,t,r))}function s(e,t,r){var n=e.node(r).parent,o=!0,i=t.edge(r,n),u=0;return i||(o=!1,i=t.edge(n,r)),u=i.weight,t.nodeEdges(r).forEach(i=>{var a,s,c=i.v===r,f=c?i.w:i.v;if(f!==n){var d=c===o,l=t.edge(i).weight;if(u+=d?l:-l,a=r,s=f,e.hasEdge(a,s)){var h=e.edge(r,f).cutvalue;u+=d?-h:h}}}),u}function c(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,r,n,o){var i=r,u=e.node(n);return t[n]=!0,e.neighbors(n).forEach(o=>{Object.hasOwn(t,o)||(r=f(e,t,r,o,n))}),u.low=i,u.lim=r++,o?u.parent=o:delete u.parent,r}function d(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function l(e,r,n){var o=n.v,i=n.w;r.hasEdge(o,i)||(o=n.w,i=n.v);var u=e.node(o),a=e.node(i),s=u,c=!1;return u.lim>a.lim&&(s=a,c=!0),r.edges().filter(t=>c===p(e,e.node(t.v),s)&&c!==p(e,e.node(t.w),s)).reduce((e,n)=>t(r,n)<t(r,e)?n:e)}function h(e,t,r,o){var i=r.v,u=r.w;e.removeEdge(i,u),e.setEdge(o.v,o.w,{}),c(e),a(e,t),function(e,t){var r=e.nodes().find(e=>!t.node(e).parent),o=n(e,r);(o=o.slice(1)).forEach(r=>{var n=e.node(r).parent,o=t.edge(r,n),i=!1;o||(o=t.edge(n,r),i=!0),t.node(r).rank=t.node(n).rank+(i?o.minlen:-o.minlen)})}(e,t)}function p(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}return _e=u,u.initLowLimValues=c,u.initCutValues=a,u.calcCutValue=s,u.leaveEdge=d,u.enterEdge=l,u.exchangeEdges=h,_e}function Pt(){if(Oe)return je;Oe=1;var e=Mt().longestPath,t=At(),r=Lt();je=function(r){var i=r.graph().ranker;if(i instanceof Function)return i(r);switch(r.graph().ranker){case"network-simplex":default:o(r);break;case"tight-tree":!function(r){e(r),t(r)}(r);break;case"longest-path":n(r);case"none":}};var n=e;function o(e){r(e)}return je}function Ft(){if(Ne)return ke;return Ne=1,ke=function(e){let t=function(e){let t={},r=0;function n(o){let i=r;e.children(o).forEach(n),t[o]={low:i,lim:r++}}return e.children().forEach(n),t}(e);e.graph().dummyChains.forEach(r=>{let n=e.node(r),o=n.edgeObj,i=function(e,t,r,n){let o,i,u=[],a=[],s=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);o=r;do{o=e.parent(o),u.push(o)}while(o&&(t[o].low>s||c>t[o].lim));i=o,o=n;for(;(o=e.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(e,t,o.v,o.w),u=i.path,a=i.lca,s=0,c=u[s],f=!0;for(;r!==o.w;){if(n=e.node(r),f){for(;(c=u[s])!==a&&e.node(c).maxRank<n.rank;)s++;c===a&&(f=!1)}if(!f){for(;s<u.length-1&&e.node(c=u[s+1]).minRank<=n.rank;)s++;c=u[s]}e.setParent(r,c),r=e.successors(r)[0]}})}}function Tt(){if(xe)return Ie;xe=1;let e=xt();function t(r,n,o,i,u,a,s){let c=r.children(s);if(!c.length)return void(s!==n&&r.setEdge(n,s,{weight:0,minlen:o}));let f=e.addBorderNode(r,"_bt"),d=e.addBorderNode(r,"_bb"),l=r.node(s);r.setParent(f,s),l.borderTop=f,r.setParent(d,s),l.borderBottom=d,c.forEach(e=>{t(r,n,o,i,u,a,e);let c=r.node(e),l=c.borderTop?c.borderTop:e,h=c.borderBottom?c.borderBottom:e,p=c.borderTop?i:2*i,v=l!==h?1:u-a[s]+1;r.setEdge(f,l,{weight:p,minlen:v,nestingEdge:!0}),r.setEdge(h,d,{weight:p,minlen:v,nestingEdge:!0})}),r.parent(s)||r.setEdge(n,f,{weight:0,minlen:u+a[s]})}return Ie={run:function(r){let n=e.addDummyNode(r,"root",{},"_root"),o=function(e){var t={};function r(n,o){var i=e.children(n);i&&i.length&&i.forEach(e=>r(e,o+1)),t[n]=o}return e.children().forEach(e=>r(e,1)),t}(r),i=Object.values(o),u=e.applyWithChunking(Math.max,i)-1,a=2*u+1;r.graph().nestingRoot=n,r.edges().forEach(e=>r.edge(e).minlen*=a);let s=function(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}(r)+1;r.children().forEach(e=>t(r,n,a,s,u,o,e)),r.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}function Dt(){if(Ae)return Me;function e(e){e.nodes().forEach(r=>t(e.node(r))),e.edges().forEach(r=>t(e.edge(r)))}function t(e){let t=e.width;e.width=e.height,e.height=t}function r(e){e.y=-e.y}function n(e){let t=e.x;e.x=e.y,e.y=t}return Ae=1,Me={adjust:function(t){let r=t.graph().rankdir.toLowerCase();"lr"!==r&&"rl"!==r||e(t)},undo:function(t){let o=t.graph().rankdir.toLowerCase();"bt"!==o&&"rl"!==o||function(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(r),Object.hasOwn(n,"y")&&r(n)})}(t);"lr"!==o&&"rl"!==o||(!function(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(n),Object.hasOwn(r,"x")&&n(r)})}(t),e(t))}}}function Rt(){if(Ge)return ze;Ge=1;let e=xt();return ze=function(t,r){let n={};return t.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),r.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(t){let r=[];function n(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight);t.weight&&(r+=t.barycenter*t.weight,n+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function o(e){return r=>{r.in.push(e),0===--r.indegree&&t.push(r)}}for(;t.length;){let e=t.pop();r.push(e),e.in.reverse().forEach(n(e)),e.out.forEach(o(e))}return r.filter(e=>!e.merged).map(t=>e.pick(t,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}function zt(){if($e)return Be;$e=1;let e=Re?De:(Re=1,De=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(r.length){let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}return{v:t}})}),t=Rt(),r=function(){if(Ue)return Ve;Ue=1;let e=xt();function t(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}return Ve=function(r,n){let o=e.partition(r,e=>Object.hasOwn(e,"barycenter")),i=o.lhs,u=o.rhs.sort((e,t)=>t.i-e.i),a=[],s=0,c=0,f=0;var d;i.sort((d=!!n,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:d?t.i-e.i:e.i-t.i)),f=t(a,u,f),i.forEach(e=>{f+=e.vs.length,a.push(e.vs),s+=e.barycenter*e.weight,c+=e.weight,f=t(a,u,f)});let l={vs:a.flat(!0)};return c&&(l.barycenter=s/c,l.weight=c),l}}();return Be=function n(o,i,u,a){let s=o.children(i),c=o.node(i),f=c?c.borderLeft:void 0,d=c?c.borderRight:void 0,l={};f&&(s=s.filter(e=>e!==f&&e!==d));let h=e(o,s);h.forEach(e=>{if(o.children(e.v).length){let i=n(o,e.v,u,a);l[e.v]=i,Object.hasOwn(i,"barycenter")&&(r=i,void 0!==(t=e).barycenter?(t.barycenter=(t.barycenter*t.weight+r.barycenter*r.weight)/(t.weight+r.weight),t.weight+=r.weight):(t.barycenter=r.barycenter,t.weight=r.weight))}var t,r});let p=t(h,u);!function(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}(p,l);let v=r(p,a);if(f&&(v.vs=[f,v.vs,d].flat(!0),o.predecessors(f).length)){let e=o.node(o.predecessors(f)[0]),t=o.node(o.predecessors(d)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+t.order)/(v.weight+2),v.weight+=2}return v},Be}function Gt(){if(Ye)return We;Ye=1;let e=Nt().Graph,t=xt();return We=function(r,n,o,i){i||(i=r.nodes());let u=function(e){var r;for(;e.hasNode(r=t.uniqueId("_root")););return r}(r),a=new e({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(e=>r.node(e));return i.forEach(e=>{let t=r.node(e),i=r.parent(e);(t.rank===n||t.minRank<=n&&n<=t.maxRank)&&(a.setNode(e),a.setParent(e,i||u),r[o](e).forEach(t=>{let n=t.v===e?t.w:t.v,o=a.edge(n,e),i=void 0!==o?o.weight:0;a.setEdge(n,e,{weight:r.edge(t).weight+i})}),Object.hasOwn(t,"minRank")&&a.setNode(e,{borderLeft:t.borderLeft[n],borderRight:t.borderRight[n]}))}),a}}function Vt(){if(Ke)return He;Ke=1;let e=function(){if(Pe)return Le;Pe=1;let e=xt();return Le=function(t){let r={},n=t.nodes().filter(e=>!t.children(e).length),o=n.map(e=>t.node(e).rank),i=e.applyWithChunking(Math.max,o),u=e.range(i+1).map(()=>[]);return n.sort((e,r)=>t.node(e).rank-t.node(r).rank).forEach(function e(n){if(r[n])return;r[n]=!0;let o=t.node(n);u[o.rank].push(n),t.successors(n).forEach(e)}),u}}(),t=function(){if(Te)return Fe;Te=1;let e=xt().zipObject;function t(t,r,n){let o=e(n,n.map((e,t)=>t)),i=r.flatMap(e=>t.outEdges(e).map(e=>({pos:o[e.w],weight:t.edge(e).weight})).sort((e,t)=>e.pos-t.pos)),u=1;for(;u<n.length;)u<<=1;let a=2*u-1;u-=1;let s=new Array(a).fill(0),c=0;return i.forEach(e=>{let t=e.pos+u;s[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*r}),c}return Fe=function(e,r){let n=0;for(let o=1;o<r.length;++o)n+=t(e,r[o-1],r[o]);return n}}(),r=zt(),n=Gt(),o=qe?Je:(qe=1,Je=function(e,t,r){let n,o={};r.forEach(r=>{let i,u,a=e.parent(r);for(;a;){if(i=e.parent(a),i?(u=o[i],o[i]=a):(u=n,n=a),u&&u!==a)return void t.setEdge(u,a);a=i}})}),i=Nt().Graph,u=xt();function a(e,t,r){const o=/* @__PURE__ */new Map,i=(e,t)=>{o.has(e)||o.set(e,[]),o.get(e).push(t)};for(const n of e.nodes()){const t=e.node(n);if("number"==typeof t.rank&&i(t.rank,n),"number"==typeof t.minRank&&"number"==typeof t.maxRank)for(let e=t.minRank;e<=t.maxRank;e++)e!==t.rank&&i(e,n)}return t.map(function(t){return n(e,t,r,o.get(t)||[])})}function s(e,t){let n=new i;e.forEach(function(e){let i=e.graph().root,u=r(e,i,n,t);u.vs.forEach((t,r)=>e.node(t).order=r),o(e,n,u.vs)})}function c(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}return He=function r(n,o){if(o&&"function"==typeof o.customOrder)return void o.customOrder(n,r);let i=u.maxRank(n),f=a(n,u.range(1,i+1),"inEdges"),d=a(n,u.range(i-1,-1,-1),"outEdges"),l=e(n);if(c(n,l),o&&o.disableOptimalOrderHeuristic)return;let h,p=Number.POSITIVE_INFINITY;for(let e=0,a=0;a<4;++e,++a){s(e%2?f:d,e%4>=2),l=u.buildLayerMatrix(n);let r=t(n,l);r<p&&(a=0,h=Object.assign({},l),p=r)}c(n,h)},He}function Ut(){if(Qe)return Ze;Qe=1;let e=Nt().Graph,t=xt();function r(e,t){let r={};return t.length&&t.reduce(function(t,n){let i=0,u=0,a=t.length,s=n[n.length-1];return n.forEach((t,c)=>{let f=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),d=f?e.node(f).order:a;(f||t===s)&&(n.slice(u,c+1).forEach(t=>{e.predecessors(t).forEach(n=>{let u=e.node(n),a=u.order;!(a<i||d<a)||u.dummy&&e.node(t).dummy||o(r,n,t)})}),u=c+1,i=d)}),n}),r}function n(e,r){let n={};function i(r,i,u,a,s){let c;t.range(i,u).forEach(t=>{c=r[t],e.node(c).dummy&&e.predecessors(c).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&o(n,t,c)})})}return r.length&&r.reduce(function(t,r){let n,o=-1,u=0;return r.forEach((a,s)=>{if("border"===e.node(a).dummy){let t=e.predecessors(a);t.length&&(n=e.node(t[0]).order,i(r,u,s,o,n),u=s,o=n)}i(r,u,r.length,n,t.length)}),r}),n}function o(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function i(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function u(e,t,r,n){let o={},u={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,u[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=n(e);if(s.length){s=s.sort((e,t)=>a[e]-a[t]);let n=(s.length-1)/2;for(let c=Math.floor(n),f=Math.ceil(n);c<=f;++c){let n=s[c];u[e]===e&&t<a[n]&&!i(r,e,n)&&(u[n]=e,u[e]=o[e]=o[n],t=a[n])}}})}),{root:o,align:u}}function a(t,r,n,o,i){let u={},a=function(t,r,n,o){let i=new e,u=t.graph(),a=function(e,t,r){return(n,o,i)=>{let u,a=n.node(o),s=n.node(i),c=0;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=r?u:-u),u=0,c+=(a.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2}return u&&(c+=r?u:-u),u=0,c}}(u.nodesep,u.edgesep,o);return r.forEach(e=>{let r;e.forEach(e=>{let o=n[e];if(i.setNode(o),r){var u=n[r],s=i.edge(u,o);i.setEdge(u,o,Math.max(a(t,e,r),s||0))}r=e})}),i}(t,r,n,i),s=i?"borderLeft":"borderRight";function c(e,t){let r=a.nodes(),n=r.pop(),o={};for(;n;)o[n]?e(n):(o[n]=!0,r.push(n),r=r.concat(t(n))),n=r.pop()}return c(function(e){u[e]=a.inEdges(e).reduce((e,t)=>Math.max(e,u[t.v]+a.edge(t)),0)},a.predecessors.bind(a)),c(function(e){let r=a.outEdges(e).reduce((e,t)=>Math.min(e,u[t.w]-a.edge(t)),Number.POSITIVE_INFINITY),n=t.node(e);r!==Number.POSITIVE_INFINITY&&n.borderType!==s&&(u[e]=Math.max(u[e],r))},a.successors.bind(a)),Object.keys(o).forEach(e=>u[e]=u[n[e]]),u}function s(e,t){return Object.values(t).reduce((t,r)=>{let n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([t,r])=>{let i=function(e,t){return e.node(t).width}(e,t)/2;n=Math.max(r+i,n),o=Math.min(r-i,o)});const i=n-o;return i<t[0]&&(t=[i,r]),t},[Number.POSITIVE_INFINITY,null])[1]}function c(e,r){let n=Object.values(r),o=t.applyWithChunking(Math.min,n),i=t.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(u=>{let a=n+u,s=e[a];if(s===r)return;let c=Object.values(s),f=o-t.applyWithChunking(Math.min,c);"l"!==u&&(f=i-t.applyWithChunking(Math.max,c)),f&&(e[a]=t.mapValues(s,e=>e+f))})})}function f(e,r){return t.mapValues(e.ul,(t,n)=>{if(r)return e[r.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}return Ze={positionX:function(e){let o,i=t.buildLayerMatrix(e),d=Object.assign(r(e,i),n(e,i)),l={};["u","d"].forEach(r=>{o="u"===r?i:Object.values(i).reverse(),["l","r"].forEach(n=>{"r"===n&&(o=o.map(e=>Object.values(e).reverse()));let i=("u"===r?e.predecessors:e.successors).bind(e),s=u(e,o,d,i),c=a(e,o,s.root,s.align,"r"===n);"r"===n&&(c=t.mapValues(c,e=>-e)),l[r+n]=c})});let h=s(e,l);return c(l,h),f(l,e.graph().align)},findType1Conflicts:r,findType2Conflicts:n,addConflict:o,hasConflict:i,verticalAlignment:u,horizontalCompaction:a,alignCoordinates:c,findSmallestWidthAlignment:s,balance:f}}function Bt(){if(et)return Xe;et=1;let e=xt(),t=Ut().positionX;return Xe=function(r){(function(t){let r=e.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e=>{const r=e.reduce((e,r)=>{const n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>t.node(e).y=o+r/2),o+=r+n})})(r=e.asNonCompoundGraph(r)),Object.entries(t(r)).forEach(([e,t])=>r.node(e).x=t)}}function $t(){if(rt)return tt;rt=1;let e=Ct(),t=St(),r=Pt(),n=xt().normalizeRanks,o=Ft(),i=xt().removeEmptyRanks,u=Tt(),a=function(){if(Se)return Ce;Se=1;let e=xt();function t(t,r,n,o,i,u){let a={width:0,height:0,rank:u,borderType:r},s=i[r][u-1],c=e.addDummyNode(t,"border",a,n);i[r][u]=c,t.setParent(c,o),s&&t.setEdge(s,c,{weight:1})}return Ce=function(e){e.children().forEach(function r(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(r),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let r=i.minRank,o=i.maxRank+1;r<o;++r)t(e,"borderLeft","_bl",n,i,r),t(e,"borderRight","_br",n,i,r)}})}}(),s=Dt(),c=Vt(),f=Bt(),d=xt(),l=Nt().Graph;tt=function(j,O){let k=O&&O.debugTiming?d.time:d.notime;k("layout",()=>{let N=k(" buildLayoutGraph",()=>function(e){let t=new l({multigraph:!0,compound:!0}),r=E(e.graph());return t.setGraph(Object.assign({},p,_(r,h),d.pick(r,v))),e.nodes().forEach(r=>{const n=_(E(e.node(r)),g);Object.keys(y).forEach(e=>{void 0===n[e]&&(n[e]=y[e])}),t.setNode(r,n),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{let n=E(e.edge(r));t.setEdge(r,Object.assign({},b,_(n,m),d.pick(n,w)))}),t}(j));k(" runLayout",()=>function(l,h,p){h(" makeSpaceForEdgeLabels",()=>function(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{let n=e.edge(r);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)})}(l)),h(" removeSelfEdges",()=>function(e){e.edges().forEach(t=>{if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(l)),h(" acyclic",()=>e.run(l)),h(" nestingGraph.run",()=>u.run(l)),h(" rank",()=>r(d.asNonCompoundGraph(l))),h(" injectEdgeLabelProxies",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let r=e.node(t.v),n={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};d.addDummyNode(e,"edge-proxy",n,"_ep")}})}(l)),h(" removeEmptyRanks",()=>i(l)),h(" nestingGraph.cleanup",()=>u.cleanup(l)),h(" normalizeRanks",()=>n(l)),h(" assignRankMinMax",()=>function(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}(l)),h(" removeEdgeLabelProxies",()=>function(e){e.nodes().forEach(t=>{let r=e.node(t);"edge-proxy"===r.dummy&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}(l)),h(" normalize.run",()=>t.run(l)),h(" parentDummyChains",()=>o(l)),h(" addBorderSegments",()=>a(l)),h(" order",()=>c(l,p)),h(" insertSelfEdges",()=>function(e){var t=d.buildLayerMatrix(e);t.forEach(t=>{var r=0;t.forEach((t,n)=>{var o=e.node(t);o.order=n+r,(o.selfEdges||[]).forEach(t=>{d.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:n+ ++r,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(l)),h(" adjustCoordinateSystem",()=>s.adjust(l)),h(" position",()=>f(l)),h(" positionSelfEdges",()=>function(e){e.nodes().forEach(t=>{var r=e.node(t);if("selfedge"===r.dummy){var n=e.node(r.e.v),o=n.x+n.width/2,i=n.y,u=r.x-o,a=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}(l)),h(" removeBorderNodes",()=>function(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),i=e.node(r.borderLeft[r.borderLeft.length-1]),u=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(u.x-i.x),r.height=Math.abs(o.y-n.y),r.x=i.x+r.width/2,r.y=n.y+r.height/2}}),e.nodes().forEach(t=>{"border"===e.node(t).dummy&&e.removeNode(t)})}(l)),h(" normalize.undo",()=>t.undo(l)),h(" fixupEdgeLabelCoords",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(l)),h(" undoCoordinateSystem",()=>s.undo(l)),h(" translateGraph",()=>function(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,i=e.graph(),u=i.marginx||0,a=i.marginy||0;function s(e){let i=e.x,u=e.y,a=e.width,s=e.height;t=Math.min(t,i-a/2),r=Math.max(r,i+a/2),n=Math.min(n,u-s/2),o=Math.max(o,u+s/2)}e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&s(r)}),t-=u,n-=a,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),i.width=r-t+u,i.height=o-n+a}(l)),h(" assignNodeIntersects",()=>function(e){e.edges().forEach(t=>{let r,n,o=e.edge(t),i=e.node(t.v),u=e.node(t.w);o.points?(r=o.points[0],n=o.points[o.points.length-1]):(o.points=[],r=u,n=i),o.points.unshift(d.intersectRect(i,r)),o.points.push(d.intersectRect(u,n))})}(l)),h(" reversePoints",()=>function(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse()})}(l)),h(" acyclic.undo",()=>e.undo(l))}(N,k,O)),k(" updateInputGraph",()=>function(e,t){e.nodes().forEach(r=>{let n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,n.rank=o.rank,t.children(r).length&&(n.width=o.width,n.height=o.height))}),e.edges().forEach(r=>{let n=e.edge(r),o=t.edge(r);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(j,N))})};let h=["nodesep","edgesep","ranksep","marginx","marginy"],p={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},v=["acyclicer","ranker","rankdir","align"],g=["width","height","rank"],y={width:0,height:0},m=["minlen","weight","width","height","labeloffset"],b={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},w=["labelpos"];function _(e,t){return d.mapValues(d.pick(e,t),Number)}function E(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}return tt}function Wt(){if(ot)return nt;ot=1;let e=xt(),t=Nt().Graph;return nt={debugOrdering:function(r){let n=e.buildLayerMatrix(r),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(e=>{o.setNode(e,{label:e}),o.setParent(e,"layer"+r.node(e).rank)}),r.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),n.forEach((e,t)=>{let r="layer"+t;o.setNode(r,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}const Yt=/* @__PURE__ */ft(st?at:(st=1,at={graphlib:Nt(),layout:$t(),debug:Wt(),util:{time:xt().time,notime:xt().notime},version:ut?it:(ut=1,it="1.1.8")}));var Jt,qt,Ht,Kt,Zt,Qt,Xt,er,tr,rr,nr,or,ir,ur,ar,sr,cr,fr,dr,lr,hr,pr,vr,gr,yr,mr,br,wr,_r,Er,jr,Or,kr,Nr,Ir,xr,Cr,Sr,Mr,Ar,Lr,Pr,Fr,Tr,Dr,Rr,zr,Gr,Vr,Ur,Br,$r,Wr,Yr,Jr,qr,Hr,Kr,Zr,Qr,Xr,en,tn,rn,nn,on,un,an,sn,cn,fn,dn,ln,hn,pn,vn,gn,yn,mn,bn,wn,_n,En,jn,On,kn,Nn,In,xn,Cn,Sn,Mn,An,Ln,Pn,Fn,Tn,Dn,Rn,zn,Gn,Vn,Un,Bn,$n,Wn,Yn,Jn;function qn(){if(Kt)return Ht;return Kt=1,Ht=function(e,t){return e===t||e!=e&&t!=t}}function Hn(){if(Qt)return Zt;Qt=1;var e=qn();return Zt=function(t,r){for(var n=t.length;n--;)if(e(t[n][0],r))return n;return-1}}function Kn(){if(sr)return ar;sr=1;var e=qt?Jt:(qt=1,Jt=function(){this.__data__=[],this.size=0}),t=function(){if(er)return Xt;er=1;var e=Hn(),t=Array.prototype.splice;return Xt=function(r){var n=this.__data__,o=e(n,r);return!(o<0||(o==n.length-1?n.pop():t.call(n,o,1),--this.size,0))}}(),r=function(){if(rr)return tr;rr=1;var e=Hn();return tr=function(t){var r=this.__data__,n=e(r,t);return n<0?void 0:r[n][1]}}(),n=function(){if(or)return nr;or=1;var e=Hn();return nr=function(t){return e(this.__data__,t)>-1}}(),o=function(){if(ur)return ir;ur=1;var e=Hn();return ir=function(t,r){var n=this.__data__,o=e(n,t);return o<0?(++this.size,n.push([t,r])):n[o][1]=r,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,ar=i}function Zn(){if(mr)return yr;mr=1;var e="object"==typeof ct&&ct&&ct.Object===Object&&ct;return yr=e}function Qn(){if(wr)return br;wr=1;var e=Zn(),t="object"==typeof self&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return br=r}function Xn(){if(Er)return _r;Er=1;var e=Qn().Symbol;return _r=e}function eo(){if(xr)return Ir;xr=1;var e=Xn(),t=function(){if(Or)return jr;Or=1;var e=Xn(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;return jr=function(e){var t=r.call(e,o),i=e[o];try{e[o]=void 0;var u=!0}catch(s){}var a=n.call(e);return u&&(t?e[o]=i:delete e[o]),a}}(),r=function(){if(Nr)return kr;Nr=1;var e=Object.prototype.toString;return kr=function(t){return e.call(t)}}(),n=e?e.toStringTag:void 0;return Ir=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?t(e):r(e)}}function to(){if(Sr)return Cr;return Sr=1,Cr=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function ro(){if(Ar)return Mr;Ar=1;var e=eo(),t=to();return Mr=function(r){if(!t(r))return!1;var n=e(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function no(){if(Tr)return Fr;Tr=1;var e,t=function(){if(Pr)return Lr;Pr=1;var e=Qn()["__core-js_shared__"];return Lr=e}(),r=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return Fr=function(e){return!!r&&r in e}}function oo(){if(Rr)return Dr;Rr=1;var e=Function.prototype.toString;return Dr=function(t){if(null!=t){try{return e.call(t)}catch(r){}try{return t+""}catch(r){}}return""}}function io(){if($r)return Br;$r=1;var e=function(){if(Gr)return zr;Gr=1;var e=ro(),t=no(),r=to(),n=oo(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,s=u.hasOwnProperty,c=RegExp("^"+a.call(s).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return zr=function(i){return!(!r(i)||t(i))&&(e(i)?c:o).test(n(i))}}(),t=Ur?Vr:(Ur=1,Vr=function(e,t){return null==e?void 0:e[t]});return Br=function(r,n){var o=t(r,n);return e(o)?o:void 0}}function uo(){if(Yr)return Wr;Yr=1;var e=io()(Qn(),"Map");return Wr=e}function ao(){if(qr)return Jr;qr=1;var e=io()(Object,"create");return Jr=e}function so(){if(an)return un;an=1;var e=function(){if(Kr)return Hr;Kr=1;var e=ao();return Hr=function(){this.__data__=e?e(null):{},this.size=0}}(),t=Qr?Zr:(Qr=1,Zr=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}),r=function(){if(en)return Xr;en=1;var e=ao(),t=Object.prototype.hasOwnProperty;return Xr=function(r){var n=this.__data__;if(e){var o=n[r];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(n,r)?n[r]:void 0}}(),n=function(){if(rn)return tn;rn=1;var e=ao(),t=Object.prototype.hasOwnProperty;return tn=function(r){var n=this.__data__;return e?void 0!==n[r]:t.call(n,r)}}(),o=function(){if(on)return nn;on=1;var e=ao();return nn=function(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=e&&void 0===r?"__lodash_hash_undefined__":r,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,un=i}function co(){if(hn)return ln;hn=1;var e=dn?fn:(dn=1,fn=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e});return ln=function(t,r){var n=t.__data__;return e(r)?n["string"==typeof r?"string":"hash"]:n.map}}function fo(){if(jn)return En;jn=1;var e=function(){if(cn)return sn;cn=1;var e=so(),t=Kn(),r=uo();return sn=function(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}}(),t=function(){if(vn)return pn;vn=1;var e=co();return pn=function(t){var r=e(this,t).delete(t);return this.size-=r?1:0,r}}(),r=function(){if(yn)return gn;yn=1;var e=co();return gn=function(t){return e(this,t).get(t)}}(),n=function(){if(bn)return mn;bn=1;var e=co();return mn=function(t){return e(this,t).has(t)}}(),o=function(){if(_n)return wn;_n=1;var e=co();return wn=function(t,r){var n=e(this,t),o=n.size;return n.set(t,r),this.size+=n.size==o?0:1,this}}();function i(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=n,i.prototype.set=o,En=i}function lo(){if(In)return Nn;In=1;var e=Kn(),t=function(){if(fr)return cr;fr=1;var e=Kn();return cr=function(){this.__data__=new e,this.size=0}}(),r=lr?dr:(lr=1,dr=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}),n=pr?hr:(pr=1,hr=function(e){return this.__data__.get(e)}),o=gr?vr:(gr=1,vr=function(e){return this.__data__.has(e)}),i=function(){if(kn)return On;kn=1;var e=Kn(),t=uo(),r=fo();return On=function(n,o){var i=this.__data__;if(i instanceof e){var u=i.__data__;if(!t||u.length<199)return u.push([n,o]),this.size=++i.size,this;i=this.__data__=new r(u)}return i.set(n,o),this.size=i.size,this}}();function u(t){var r=this.__data__=new e(t);this.size=r.size}return u.prototype.clear=t,u.prototype.delete=r,u.prototype.get=n,u.prototype.has=o,u.prototype.set=i,Nn=u}function ho(){if(Cn)return xn;return Cn=1,xn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}}function po(){if(Mn)return Sn;Mn=1;var e=io(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(r){}}();return Sn=t}function vo(){if(Ln)return An;Ln=1;var e=po();return An=function(t,r,n){"__proto__"==r&&e?e(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}}function go(){if(Fn)return Pn;Fn=1;var e=vo(),t=qn(),r=Object.prototype.hasOwnProperty;return Pn=function(n,o,i){var u=n[o];r.call(n,o)&&t(u,i)&&(void 0!==i||o in n)||e(n,o,i)}}function yo(){if(Dn)return Tn;Dn=1;var e=go(),t=vo();return Tn=function(r,n,o,i){var u=!o;o||(o={});for(var a=-1,s=n.length;++a<s;){var c=n[a],f=i?i(o[c],r[c],c,o,r):void 0;void 0===f&&(f=r[c]),u?t(o,c,f):e(o,c,f)}return o}}function mo(){if(Vn)return Gn;return Vn=1,Gn=function(e){return null!=e&&"object"==typeof e}}function bo(){if(Wn)return $n;Wn=1;var e=function(){if(Bn)return Un;Bn=1;var e=eo(),t=mo();return Un=function(r){return t(r)&&"[object Arguments]"==e(r)}}(),t=mo(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,i=e(/* @__PURE__ */function(){return arguments}())?e:function(e){return t(e)&&n.call(e,"callee")&&!o.call(e,"callee")};return $n=i}function wo(){if(Jn)return Yn;Jn=1;var e=Array.isArray;return Yn=e}var _o,Eo,jo,Oo,ko,No,Io,xo,Co,So,Mo,Ao={exports:{}};function Lo(){return jo||(jo=1,e=Ao,t=Ao.exports,r=Qn(),n=Eo?_o:(Eo=1,_o=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,u=i&&i.exports===o?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n,e.exports=a),Ao.exports;var e,t,r,n,o,i,u,a}function Po(){if(ko)return Oo;ko=1;var e=/^(?:0|[1-9]\d*)$/;return Oo=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}}function Fo(){if(Io)return No;Io=1;return No=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}function To(){if(Mo)return So;return Mo=1,So=function(e){return function(t){return e(t)}}}var Do,Ro,zo,Go,Vo,Uo,Bo,$o,Wo,Yo,Jo,qo,Ho,Ko,Zo,Qo,Xo,ei,ti,ri,ni,oi,ii,ui,ai,si,ci,fi={exports:{}};function di(){return Do||(Do=1,e=fi,t=fi.exports,r=Zn(),n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n&&r.process,u=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(t){}}(),e.exports=u),fi.exports;var e,t,r,n,o,i,u}function li(){if(zo)return Ro;zo=1;var e=function(){if(Co)return xo;Co=1;var e=eo(),t=Fo(),r=mo(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,xo=function(o){return r(o)&&t(o.length)&&!!n[e(o)]}}(),t=To(),r=di(),n=r&&r.isTypedArray,o=n?t(n):e;return Ro=o}function hi(){if(Vo)return Go;Vo=1;var e=zn?Rn:(zn=1,Rn=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}),t=bo(),r=wo(),n=Lo(),o=Po(),i=li(),u=Object.prototype.hasOwnProperty;return Go=function(a,s){var c=r(a),f=!c&&t(a),d=!c&&!f&&n(a),l=!c&&!f&&!d&&i(a),h=c||f||d||l,p=h?e(a.length,String):[],v=p.length;for(var g in a)!s&&!u.call(a,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||l&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,v))||p.push(g);return p}}function pi(){if(Bo)return Uo;Bo=1;var e=Object.prototype;return Uo=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||e)}}function vi(){if(Wo)return $o;return Wo=1,$o=function(e,t){return function(r){return e(t(r))}}}function gi(){if(Ho)return qo;Ho=1;var e=pi(),t=function(){if(Jo)return Yo;Jo=1;var e=vi()(Object.keys,Object);return Yo=e}(),r=Object.prototype.hasOwnProperty;return qo=function(n){if(!e(n))return t(n);var o=[];for(var i in Object(n))r.call(n,i)&&"constructor"!=i&&o.push(i);return o}}function yi(){if(Zo)return Ko;Zo=1;var e=ro(),t=Fo();return Ko=function(r){return null!=r&&t(r.length)&&!e(r)}}function mi(){if(Xo)return Qo;Xo=1;var e=hi(),t=gi(),r=yi();return Qo=function(n){return r(n)?e(n):t(n)}}function bi(){if(ii)return oi;ii=1;var e=to(),t=pi(),r=ni?ri:(ni=1,ri=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}),n=Object.prototype.hasOwnProperty;return oi=function(o){if(!e(o))return r(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&n.call(o,a))&&u.push(a);return u}}function wi(){if(ai)return ui;ai=1;var e=hi(),t=bi(),r=yi();return ui=function(n){return r(n)?e(n,!0):t(n)}}var _i,Ei,ji,Oi,ki,Ni,Ii,xi,Ci,Si,Mi,Ai,Li,Pi,Fi,Ti,Di,Ri,zi,Gi,Vi,Ui,Bi,$i,Wi,Yi,Ji,qi,Hi,Ki,Zi,Qi,Xi,eu,tu,ru,nu,ou,iu,uu,au,su,cu,fu,du,lu,hu,pu,vu,gu,yu,mu,bu,wu,_u,Eu,ju,Ou,ku,Nu,Iu,xu,Cu,Su,Mu,Au,Lu,Pu,Fu,Tu,Du,Ru,zu,Gu,Vu,Uu,Bu,$u,Wu,Yu,Ju,qu,Hu,Ku,Zu,Qu,Xu,ea,ta,ra,na,oa,ia,ua,aa,sa,ca,fa,da,la,ha,pa,va,ga,ya,ma,ba,wa,_a,Ea,ja,Oa,ka,Na,Ia,xa,Ca,Sa,Ma,Aa,La,Pa,Fa,Ta,Da,Ra,za,Ga,Va,Ua,Ba,$a,Wa,Ya,Ja,qa,Ha,Ka,Za,Qa,Xa,es,ts,rs,ns,os,is,us,as,ss,cs,fs,ds,ls,hs,ps,vs,gs,ys,ms,bs,ws,_s,Es,js,Os,ks,Ns,Is,xs,Cs,Ss,Ms,As,Ls,Ps,Fs,Ts,Ds,Rs,zs,Gs,Vs,Us,Bs,$s,Ws,Ys,Js,qs,Hs,Ks,Zs,Qs,Xs,ec,tc,rc,nc,oc,ic,uc,ac,sc,cc,fc,dc,lc,hc,pc,vc,gc,yc,mc,bc,wc,_c,Ec,jc,Oc,kc,Nc,Ic,xc,Cc,Sc,Mc,Ac,Lc,Pc,Fc,Tc,Dc,Rc,zc,Gc,Vc,Uc,Bc,$c,Wc,Yc,Jc,qc,Hc,Kc,Zc,Qc,Xc,ef,tf,rf,nf,of,uf,af,sf,cf,ff,df,lf,hf,pf,vf,gf,yf,mf,bf,wf,_f,Ef,jf,Of,kf,Nf,If,xf,Cf,Sf,Mf={exports:{}};function Af(){if(ki)return Oi;return ki=1,Oi=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var u=e[r];t(u,r,e)&&(i[o++]=u)}return i}}function Lf(){if(Ii)return Ni;return Ii=1,Ni=function(){return[]}}function Pf(){if(Ci)return xi;Ci=1;var e=Af(),t=Lf(),r=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols;return xi=n?function(t){return null==t?[]:(t=Object(t),e(n(t),function(e){return r.call(t,e)}))}:t}function Ff(){if(Li)return Ai;return Li=1,Ai=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}}function Tf(){if(Fi)return Pi;Fi=1;var e=vi()(Object.getPrototypeOf,Object);return Pi=e}function Df(){if(Di)return Ti;Di=1;var e=Ff(),t=Tf(),r=Pf(),n=Lf(),o=Object.getOwnPropertySymbols;return Ti=o?function(n){for(var o=[];n;)e(o,r(n)),n=t(n);return o}:n}function Rf(){if(Vi)return Gi;Vi=1;var e=Ff(),t=wo();return Gi=function(r,n,o){var i=n(r);return t(r)?i:e(i,o(r))}}function zf(){if(Bi)return Ui;Bi=1;var e=Rf(),t=Pf(),r=mi();return Ui=function(n){return e(n,r,t)}}function Gf(){if(Zi)return Ki;Zi=1;var e=io()(Qn(),"Set");return Ki=e}function Vf(){if(tu)return eu;tu=1;var e=function(){if(Ji)return Yi;Ji=1;var e=io()(Qn(),"DataView");return Yi=e}(),t=uo(),r=function(){if(Hi)return qi;Hi=1;var e=io()(Qn(),"Promise");return qi=e}(),n=Gf(),o=function(){if(Xi)return Qi;Xi=1;var e=io()(Qn(),"WeakMap");return Qi=e}(),i=eo(),u=oo(),a="[object Map]",s="[object Promise]",c="[object Set]",f="[object WeakMap]",d="[object DataView]",l=u(e),h=u(t),p=u(r),v=u(n),g=u(o),y=i;return(e&&y(new e(new ArrayBuffer(1)))!=d||t&&y(new t)!=a||r&&y(r.resolve())!=s||n&&y(new n)!=c||o&&y(new o)!=f)&&(y=function(e){var t=i(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case l:return d;case h:return a;case p:return s;case v:return c;case g:return f}return t}),eu=y}function Uf(){if(iu)return ou;iu=1;var e=Qn().Uint8Array;return ou=e}function Bf(){if(au)return uu;au=1;var e=Uf();return uu=function(t){var r=new t.constructor(t.byteLength);return new e(r).set(new e(t)),r}}function $f(){if(yu)return gu;yu=1;var e=Bf(),t=function(){if(cu)return su;cu=1;var e=Bf();return su=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}}(),r=function(){if(du)return fu;du=1;var e=/\w*$/;return fu=function(t){var r=new t.constructor(t.source,e.exec(t));return r.lastIndex=t.lastIndex,r}}(),n=function(){if(hu)return lu;hu=1;var e=Xn(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;return lu=function(e){return r?Object(r.call(e)):{}}}(),o=function(){if(vu)return pu;vu=1;var e=Bf();return pu=function(t,r){var n=r?e(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}}();return gu=function(i,u,a){var s=i.constructor;switch(u){case"[object ArrayBuffer]":return e(i);case"[object Boolean]":case"[object Date]":return new s(+i);case"[object DataView]":return t(i,a);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,a);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(i);case"[object RegExp]":return r(i);case"[object Symbol]":return n(i)}}}function Wf(){if(bu)return mu;bu=1;var e=to(),t=Object.create;return mu=/* @__PURE__ */function(){function r(){}return function(n){if(!e(n))return{};if(t)return t(n);r.prototype=n;var o=new r;return r.prototype=void 0,o}}()}function Yf(){if(ku)return Ou;ku=1;var e=function(){if(ju)return Eu;ju=1;var e=Vf(),t=mo();return Eu=function(r){return t(r)&&"[object Map]"==e(r)}}(),t=To(),r=di(),n=r&&r.isMap,o=n?t(n):e;return Ou=o}function Jf(){if(Cu)return xu;Cu=1;var e=function(){if(Iu)return Nu;Iu=1;var e=Vf(),t=mo();return Nu=function(r){return t(r)&&"[object Set]"==e(r)}}(),t=To(),r=di(),n=r&&r.isSet,o=n?t(n):e;return xu=o}function qf(){if(Mu)return Su;Mu=1;var e,t,r,n,o,i,u,a=lo(),s=ho(),c=go(),f=function(){if(ti)return ei;ti=1;var e=yo(),t=mi();return ei=function(r,n){return r&&e(n,t(n),r)}}(),d=function(){if(ci)return si;ci=1;var e=yo(),t=wi();return si=function(r,n){return r&&e(n,t(n),r)}}(),l=(_i||(_i=1,e=Mf,t=Mf.exports,r=Qn(),n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n?r.Buffer:void 0,u=i?i.allocUnsafe:void 0,e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=u?u(r):new e.constructor(r);return e.copy(n),n}),Mf.exports),h=ji?Ei:(ji=1,Ei=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}),p=function(){if(Mi)return Si;Mi=1;var e=yo(),t=Pf();return Si=function(r,n){return e(r,t(r),n)}}(),v=function(){if(zi)return Ri;zi=1;var e=yo(),t=Df();return Ri=function(r,n){return e(r,t(r),n)}}(),g=zf(),y=function(){if(Wi)return $i;Wi=1;var e=Rf(),t=Df(),r=wi();return $i=function(n){return e(n,r,t)}}(),m=Vf(),b=function(){if(nu)return ru;nu=1;var e=Object.prototype.hasOwnProperty;return ru=function(t){var r=t.length,n=new t.constructor(r);return r&&"string"==typeof t[0]&&e.call(t,"index")&&(n.index=t.index,n.input=t.input),n}}(),w=$f(),_=function(){if(_u)return wu;_u=1;var e=Wf(),t=Tf(),r=pi();return wu=function(n){return"function"!=typeof n.constructor||r(n)?{}:e(t(n))}}(),E=wo(),j=Lo(),O=Yf(),k=to(),N=Jf(),I=mi(),x=wi(),C="[object Arguments]",S="[object Function]",M="[object Object]",A={};return A[C]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[S]=A["[object WeakMap]"]=!1,Su=function e(t,r,n,o,i,u){var L,P=1&r,F=2&r,T=4&r;if(n&&(L=i?n(t,o,i,u):n(t)),void 0!==L)return L;if(!k(t))return t;var D=E(t);if(D){if(L=b(t),!P)return h(t,L)}else{var R=m(t),z=R==S||"[object GeneratorFunction]"==R;if(j(t))return l(t,P);if(R==M||R==C||z&&!i){if(L=F||z?{}:_(t),!P)return F?v(t,d(L,t)):p(t,f(L,t))}else{if(!A[R])return i?t:{};L=w(t,R,P)}}u||(u=new a);var G=u.get(t);if(G)return G;u.set(t,L),N(t)?t.forEach(function(o){L.add(e(o,r,n,o,t,u))}):O(t)&&t.forEach(function(o,i){L.set(i,e(o,r,n,i,t,u))});var V=D?void 0:(T?F?y:g:F?x:I)(t);return s(V||t,function(o,i){V&&(o=t[i=o]),c(L,i,e(o,r,n,i,t,u))}),L},Su}function Hf(){if(Lu)return Au;Lu=1;var e=qf();return Au=function(t){return e(t,4)}}function Kf(){if(Fu)return Pu;return Fu=1,Pu=function(e){return function(){return e}}}function Zf(){if(zu)return Ru;zu=1;var e=(Du?Tu:(Du=1,Tu=function(e){return function(t,r,n){for(var o=-1,i=Object(t),u=n(t),a=u.length;a--;){var s=u[e?a:++o];if(!1===r(i[s],s,i))break}return t}}))();return Ru=e}function Qf(){if(Vu)return Gu;Vu=1;var e=Zf(),t=mi();return Gu=function(r,n){return r&&e(r,n,t)}}function Xf(){if(Wu)return $u;Wu=1;var e=Qf(),t=function(){if(Bu)return Uu;Bu=1;var e=yi();return Uu=function(t,r){return function(n,o){if(null==n)return n;if(!e(n))return t(n,o);for(var i=n.length,u=r?i:-1,a=Object(n);(r?u--:++u<i)&&!1!==o(a[u],u,a););return n}}}()(e);return $u=t}function ed(){if(Ju)return Yu;return Ju=1,Yu=function(e){return e}}function td(){if(Zu)return Ku;Zu=1;var e=ho(),t=Xf(),r=function(){if(Hu)return qu;Hu=1;var e=ed();return qu=function(t){return"function"==typeof t?t:e}}(),n=wo();return Ku=function(o,i){return(n(o)?e:t)(o,r(i))}}function rd(){if(aa)return ua;aa=1;var e=fo(),t=na?ra:(na=1,ra=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),r=ia?oa:(ia=1,oa=function(e){return this.__data__.has(e)});function n(t){var r=-1,n=null==t?0:t.length;for(this.__data__=new e;++r<n;)this.add(t[r])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,ua=n}function nd(){if(da)return fa;return da=1,fa=function(e,t){return e.has(t)}}function od(){if(ha)return la;ha=1;var e=rd(),t=ca?sa:(ca=1,sa=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}),r=nd();return la=function(n,o,i,u,a,s){var c=1&i,f=n.length,d=o.length;if(f!=d&&!(c&&d>f))return!1;var l=s.get(n),h=s.get(o);if(l&&h)return l==o&&h==n;var p=-1,v=!0,g=2&i?new e:void 0;for(s.set(n,o),s.set(o,n);++p<f;){var y=n[p],m=o[p];if(u)var b=c?u(m,y,p,o,n,s):u(y,m,p,n,o,s);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!t(o,function(e,t){if(!r(g,t)&&(y===e||a(y,e,i,u,s)))return g.push(t)})){v=!1;break}}else if(y!==m&&!a(y,m,i,u,s)){v=!1;break}}return s.delete(n),s.delete(o),v}}function id(){if(ya)return ga;return ya=1,ga=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}}function ud(){if(ba)return ma;ba=1;var e=Xn(),t=Uf(),r=qn(),n=od(),o=va?pa:(va=1,pa=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}),i=id(),u=e?e.prototype:void 0,a=u?u.valueOf:void 0;return ma=function(e,u,s,c,f,d,l){switch(s){case"[object DataView]":if(e.byteLength!=u.byteLength||e.byteOffset!=u.byteOffset)return!1;e=e.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=u.byteLength||!d(new t(e),new t(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+e,+u);case"[object Error]":return e.name==u.name&&e.message==u.message;case"[object RegExp]":case"[object String]":return e==u+"";case"[object Map]":var h=o;case"[object Set]":var p=1&c;if(h||(h=i),e.size!=u.size&&!p)return!1;var v=l.get(e);if(v)return v==u;c|=2,l.set(e,u);var g=n(h(e),h(u),c,f,d,l);return l.delete(e),g;case"[object Symbol]":if(a)return a.call(e)==a.call(u)}return!1}}function ad(){if(ja)return Ea;ja=1;var e=lo(),t=od(),r=ud(),n=function(){if(_a)return wa;_a=1;var e=zf(),t=Object.prototype.hasOwnProperty;return wa=function(r,n,o,i,u,a){var s=1&o,c=e(r),f=c.length;if(f!=e(n).length&&!s)return!1;for(var d=f;d--;){var l=c[d];if(!(s?l in n:t.call(n,l)))return!1}var h=a.get(r),p=a.get(n);if(h&&p)return h==n&&p==r;var v=!0;a.set(r,n),a.set(n,r);for(var g=s;++d<f;){var y=r[l=c[d]],m=n[l];if(i)var b=s?i(m,y,l,n,r,a):i(y,m,l,r,n,a);if(!(void 0===b?y===m||u(y,m,o,i,a):b)){v=!1;break}g||(g="constructor"==l)}if(v&&!g){var w=r.constructor,_=n.constructor;w==_||!("constructor"in r)||!("constructor"in n)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(v=!1)}return a.delete(r),a.delete(n),v}}(),o=Vf(),i=wo(),u=Lo(),a=li(),s="[object Arguments]",c="[object Array]",f="[object Object]",d=Object.prototype.hasOwnProperty;return Ea=function(l,h,p,v,g,y){var m=i(l),b=i(h),w=m?c:o(l),_=b?c:o(h),E=(w=w==s?f:w)==f,j=(_=_==s?f:_)==f,O=w==_;if(O&&u(l)){if(!u(h))return!1;m=!0,E=!1}if(O&&!E)return y||(y=new e),m||a(l)?t(l,h,p,v,g,y):r(l,h,w,p,v,g,y);if(!(1&p)){var k=E&&d.call(l,"__wrapped__"),N=j&&d.call(h,"__wrapped__");if(k||N){var I=k?l.value():l,x=N?h.value():h;return y||(y=new e),g(I,x,p,v,y)}}return!!O&&(y||(y=new e),n(l,h,p,v,g,y))}}function sd(){if(ka)return Oa;ka=1;var e=ad(),t=mo();return Oa=function r(n,o,i,u,a){return n===o||(null==n||null==o||!t(n)&&!t(o)?n!=n&&o!=o:e(n,o,i,u,r,a))},Oa}function cd(){if(Ca)return xa;Ca=1;var e=to();return xa=function(t){return t==t&&!e(t)}}function fd(){if(La)return Aa;return La=1,Aa=function(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}}function dd(){if(Fa)return Pa;Fa=1;var e=function(){if(Ia)return Na;Ia=1;var e=lo(),t=sd();return Na=function(r,n,o,i){var u=o.length,a=u,s=!i;if(null==r)return!a;for(r=Object(r);u--;){var c=o[u];if(s&&c[2]?c[1]!==r[c[0]]:!(c[0]in r))return!1}for(;++u<a;){var f=(c=o[u])[0],d=r[f],l=c[1];if(s&&c[2]){if(void 0===d&&!(f in r))return!1}else{var h=new e;if(i)var p=i(d,l,f,r,n,h);if(!(void 0===p?t(l,d,3,i,h):p))return!1}}return!0}}(),t=function(){if(Ma)return Sa;Ma=1;var e=cd(),t=mi();return Sa=function(r){for(var n=t(r),o=n.length;o--;){var i=n[o],u=r[i];n[o]=[i,u,e(u)]}return n}}(),r=fd();return Pa=function(n){var o=t(n);return 1==o.length&&o[0][2]?r(o[0][0],o[0][1]):function(t){return t===n||e(t,n,o)}}}function ld(){if(Da)return Ta;Da=1;var e=eo(),t=mo();return Ta=function(r){return"symbol"==typeof r||t(r)&&"[object Symbol]"==e(r)}}function hd(){if(za)return Ra;za=1;var e=wo(),t=ld(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Ra=function(o,i){if(e(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||(n.test(o)||!r.test(o)||null!=i&&o in Object(i))}}function pd(){if(Ba)return Ua;Ba=1;var e=function(){if(Va)return Ga;Va=1;var e=fo();function t(r,n){if("function"!=typeof r||null!=n&&"function"!=typeof n)throw new TypeError("Expected a function");var o=function(){var e=arguments,t=n?n.apply(this,e):e[0],i=o.cache;if(i.has(t))return i.get(t);var u=r.apply(this,e);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||e),o}return t.Cache=e,Ga=t}();return Ua=function(t){var r=e(t,function(e){return 500===n.size&&n.clear(),e}),n=r.cache;return r}}function vd(){if(Ja)return Ya;return Ja=1,Ya=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}}function gd(){if(Za)return Ka;Za=1;var e=function(){if(Ha)return qa;Ha=1;var e=Xn(),t=vd(),r=wo(),n=ld(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return qa=function e(o){if("string"==typeof o)return o;if(r(o))return t(o,e)+"";if(n(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},qa}();return Ka=function(t){return null==t?"":e(t)}}function yd(){if(Xa)return Qa;Xa=1;var e=wo(),t=hd(),r=function(){if(Wa)return $a;Wa=1;var e=pd(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(e){var n=[];return 46===e.charCodeAt(0)&&n.push(""),e.replace(t,function(e,t,o,i){n.push(o?i.replace(r,"$1"):t||e)}),n});return $a=n}(),n=gd();return Qa=function(o,i){return e(o)?o:t(o,i)?[o]:r(n(o))}}function md(){if(ts)return es;ts=1;var e=ld();return es=function(t){if("string"==typeof t||e(t))return t;var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}}function bd(){if(ns)return rs;ns=1;var e=yd(),t=md();return rs=function(r,n){for(var o=0,i=(n=e(n,r)).length;null!=r&&o<i;)r=r[t(n[o++])];return o&&o==i?r:void 0}}function wd(){if(cs)return ss;cs=1;var e=yd(),t=bo(),r=wo(),n=Po(),o=Fo(),i=md();return ss=function(u,a,s){for(var c=-1,f=(a=e(a,u)).length,d=!1;++c<f;){var l=i(a[c]);if(!(d=null!=u&&s(u,l)))break;u=u[l]}return d||++c!=f?d:!!(f=null==u?0:u.length)&&o(f)&&n(l,f)&&(r(u)||t(u))}}function _d(){if(ds)return fs;ds=1;var e=as?us:(as=1,us=function(e,t){return null!=e&&t in Object(e)}),t=wd();return fs=function(r,n){return null!=r&&t(r,n,e)}}function Ed(){if(hs)return ls;hs=1;var e=sd(),t=function(){if(is)return os;is=1;var e=bd();return os=function(t,r,n){var o=null==t?void 0:e(t,r);return void 0===o?n:o}}(),r=_d(),n=hd(),o=cd(),i=fd(),u=md();return ls=function(a,s){return n(a)&&o(s)?i(u(a),s):function(n){var o=t(n,a);return void 0===o&&o===s?r(n,a):e(s,o,3)}}}function jd(){if(vs)return ps;return vs=1,ps=function(e){return function(t){return null==t?void 0:t[e]}}}function Od(){if(bs)return ms;bs=1;var e=jd(),t=function(){if(ys)return gs;ys=1;var e=bd();return gs=function(t){return function(r){return e(r,t)}}}(),r=hd(),n=md();return ms=function(o){return r(o)?e(n(o)):t(o)}}function kd(){if(_s)return ws;_s=1;var e=dd(),t=Ed(),r=ed(),n=wo(),o=Od();return ws=function(i){return"function"==typeof i?i:null==i?r:"object"==typeof i?n(i)?t(i[0],i[1]):e(i):o(i)}}function Nd(){if(js)return Es;js=1;var e=Af(),t=function(){if(ta)return ea;ta=1;var e=Xf();return ea=function(t,r){var n=[];return e(t,function(e,t,o){r(e,t,o)&&n.push(e)}),n}}(),r=kd(),n=wo();return Es=function(o,i){return(n(o)?e:t)(o,r(i,3))}}function Id(){if(Is)return Ns;Is=1;var e=function(){if(ks)return Os;ks=1;var e=Object.prototype.hasOwnProperty;return Os=function(t,r){return null!=t&&e.call(t,r)}}(),t=wd();return Ns=function(r,n){return null!=r&&t(r,n,e)}}function xd(){if(Cs)return xs;Cs=1;var e=gi(),t=Vf(),r=bo(),n=wo(),o=yi(),i=Lo(),u=pi(),a=li(),s=Object.prototype.hasOwnProperty;return xs=function(c){if(null==c)return!0;if(o(c)&&(n(c)||"string"==typeof c||"function"==typeof c.splice||i(c)||a(c)||r(c)))return!c.length;var f=t(c);if("[object Map]"==f||"[object Set]"==f)return!c.size;if(u(c))return!e(c).length;for(var d in c)if(s.call(c,d))return!1;return!0}}function Cd(){if(Ms)return Ss;return Ms=1,Ss=function(e){return void 0===e}}function Sd(){if(Fs)return Ps;Fs=1;var e=vd(),t=kd(),r=function(){if(Ls)return As;Ls=1;var e=Xf(),t=yi();return As=function(r,n){var o=-1,i=t(r)?Array(r.length):[];return e(r,function(e,t,r){i[++o]=n(e,t,r)}),i}}(),n=wo();return Ps=function(o,i){return(n(o)?e:r)(o,t(i,3))}}function Md(){if(Vs)return Gs;Vs=1;var e=Ds?Ts:(Ds=1,Ts=function(e,t,r,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}),t=Xf(),r=kd(),n=zs?Rs:(zs=1,Rs=function(e,t,r,n,o){return o(e,function(e,o,i){r=n?(n=!1,e):t(r,e,o,i)}),r}),o=wo();return Gs=function(i,u,a){var s=o(i)?e:n,c=arguments.length<3;return s(i,r(u,4),a,c,t)},Gs}function Ad(){if(Zs)return Ks;Zs=1;var e=function(){if(Ws)return $s;Ws=1;var e=jd()("length");return $s=e}(),t=function(){if(Js)return Ys;Js=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Ys=function(t){return e.test(t)}}(),r=function(){if(Hs)return qs;Hs=1;var e="\\ud800-\\udfff",t="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+r+"|"+n+")?",s="[\\ufe0e\\ufe0f]?",c=s+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+s+a+")*",f="(?:"+[o+r+"?",r,i,u,t].join("|")+")",d=RegExp(n+"(?="+n+")|"+f+c,"g");return qs=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t}}();return Ks=function(n){return t(n)?r(n):e(n)}}function Ld(){if(Xs)return Qs;Xs=1;var e=gi(),t=Vf(),r=yi(),n=function(){if(Bs)return Us;Bs=1;var e=eo(),t=wo(),r=mo();return Us=function(n){return"string"==typeof n||!t(n)&&r(n)&&"[object String]"==e(n)}}(),o=Ad();return Qs=function(i){if(null==i)return 0;if(r(i))return n(i)?o(i):i.length;var u=t(i);return"[object Map]"==u||"[object Set]"==u?i.size:e(i).length}}function Pd(){if(tc)return ec;tc=1;var e=ho(),t=Wf(),r=Qf(),n=kd(),o=Tf(),i=wo(),u=Lo(),a=ro(),s=to(),c=li();return ec=function(f,d,l){var h=i(f),p=h||u(f)||c(f);if(d=n(d,4),null==l){var v=f&&f.constructor;l=p?h?new v:[]:s(f)&&a(v)?t(o(f)):{}}return(p?e:r)(f,function(e,t,r){return d(l,e,t,r)}),l}}function Fd(){if(ic)return oc;ic=1;var e=Ff(),t=function(){if(nc)return rc;nc=1;var e=Xn(),t=bo(),r=wo(),n=e?e.isConcatSpreadable:void 0;return rc=function(e){return r(e)||t(e)||!!(n&&e&&e[n])}}();return oc=function r(n,o,i,u,a){var s=-1,c=n.length;for(i||(i=t),a||(a=[]);++s<c;){var f=n[s];o>0&&i(f)?o>1?r(f,o-1,i,u,a):e(a,f):u||(a[a.length]=f)}return a},oc}function Td(){if(cc)return sc;cc=1;var e=ac?uc:(ac=1,uc=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}),t=Math.max;return sc=function(r,n,o){return n=t(void 0===n?r.length-1:n,0),function(){for(var i=arguments,u=-1,a=t(i.length-n,0),s=Array(a);++u<a;)s[u]=i[n+u];u=-1;for(var c=Array(n+1);++u<n;)c[u]=i[u];return c[n]=o(s),e(r,this,c)}},sc}function Dd(){if(vc)return pc;vc=1;var e=function(){if(dc)return fc;dc=1;var e=Kf(),t=po(),r=ed();return fc=t?function(r,n){return t(r,"toString",{configurable:!0,enumerable:!1,value:e(n),writable:!0})}:r}(),t=function(){if(hc)return lc;hc=1;var e=Date.now;return lc=function(t){var r=0,n=0;return function(){var o=e(),i=16-(o-n);if(n=o,i>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},lc}(),r=t(e);return pc=r}function Rd(){if(kc)return Oc;kc=1;var e=bc?mc:(bc=1,mc=function(e,t,r,n){for(var o=e.length,i=r+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}),t=_c?wc:(_c=1,wc=function(e){return e!=e}),r=jc?Ec:(jc=1,Ec=function(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1});return Oc=function(n,o,i){return o==o?r(n,o,i):e(n,t,i)}}function zd(){if(Lc)return Ac;Lc=1;var e=Gf(),t=Mc?Sc:(Mc=1,Sc=function(){}),r=id(),n=e&&1/r(new e([,-0]))[1]==1/0?function(t){return new e(t)}:t;return Ac=n}function Gd(){if(Fc)return Pc;Fc=1;var e=rd(),t=function(){if(Ic)return Nc;Ic=1;var e=Rd();return Nc=function(t,r){return!(null==t||!t.length)&&e(t,r,0)>-1}}(),r=Cc?xc:(Cc=1,xc=function(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}),n=nd(),o=zd(),i=id();return Pc=function(u,a,s){var c=-1,f=t,d=u.length,l=!0,h=[],p=h;if(s)l=!1,f=r;else if(d>=200){var v=a?null:o(u);if(v)return i(v);l=!1,f=n,p=new e}else p=a?[]:h;e:for(;++c<d;){var g=u[c],y=a?a(g):g;if(g=s||0!==g?g:0,l&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue e;a&&p.push(y),h.push(g)}else f(p,y,s)||(p!==h&&p.push(y),h.push(g))}return h}}function Vd(){if(zc)return Rc;zc=1;var e=Fd(),t=function(){if(yc)return gc;yc=1;var e=ed(),t=Td(),r=Dd();return gc=function(n,o){return r(t(n,o,e),n+"")}}(),r=Gd(),n=function(){if(Dc)return Tc;Dc=1;var e=yi(),t=mo();return Tc=function(r){return t(r)&&e(r)}}(),o=t(function(t){return r(e(t,1,n,!0))});return Rc=o}function Ud(){if(Bc)return Uc;Bc=1;var e=function(){if(Vc)return Gc;Vc=1;var e=vd();return Gc=function(t,r){return e(r,function(e){return t[e]})}}(),t=mi();return Uc=function(r){return null==r?[]:e(r,t(r))}}function Bd(){if(Wc)return $c;var e;Wc=1;try{e={clone:Hf(),constant:Kf(),each:Xu?Qu:(Xu=1,Qu=td()),filter:Nd(),has:Id(),isArray:wo(),isEmpty:xd(),isFunction:ro(),isUndefined:Cd(),keys:mi(),map:Sd(),reduce:Md(),size:Ld(),transform:Pd(),union:Vd(),values:Ud()}}catch(t){}return e||(e=window._),$c=e}function $d(){if(Jc)return Yc;Jc=1;var e=Bd();Yc=r;var t="\0";function r(r){this._isDirected=!e.has(r,"directed")||r.directed,this._isMultigraph=!!e.has(r,"multigraph")&&r.multigraph,this._isCompound=!!e.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function n(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function i(t,r,n,o){var i=""+r,u=""+n;if(!t&&i>u){var a=i;i=u,u=a}return i+""+u+""+(e.isUndefined(o)?"\0":o)}function u(e,t){return i(e,t.v,t.w,t.name)}return r.prototype._nodeCount=0,r.prototype._edgeCount=0,r.prototype.isDirected=function(){return this._isDirected},r.prototype.isMultigraph=function(){return this._isMultigraph},r.prototype.isCompound=function(){return this._isCompound},r.prototype.setGraph=function(e){return this._label=e,this},r.prototype.graph=function(){return this._label},r.prototype.setDefaultNodeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultNodeLabelFn=t,this},r.prototype.nodeCount=function(){return this._nodeCount},r.prototype.nodes=function(){return e.keys(this._nodes)},r.prototype.sources=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._in[r])})},r.prototype.sinks=function(){var t=this;return e.filter(this.nodes(),function(r){return e.isEmpty(t._out[r])})},r.prototype.setNodes=function(t,r){var n=arguments,o=this;return e.each(t,function(e){n.length>1?o.setNode(e,r):o.setNode(e)}),this},r.prototype.setNode=function(r,n){return e.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=n),this):(this._nodes[r]=arguments.length>1?n:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=t,this._children[r]={},this._children[t][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},r.prototype.node=function(e){return this._nodes[e]},r.prototype.hasNode=function(t){return e.has(this._nodes,t)},r.prototype.removeNode=function(t){var r=this;if(e.has(this._nodes,t)){var n=function(e){r.removeEdge(r._edgeObjs[e])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],e.each(this.children(t),function(e){r.setParent(e)}),delete this._children[t]),e.each(e.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],e.each(e.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},r.prototype.setParent=function(r,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(n))n=t;else{for(var o=n+="";!e.isUndefined(o);o=this.parent(o))if(o===r)throw new Error("Setting "+n+" as parent of "+r+" would create a cycle");this.setNode(n)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=n,this._children[n][r]=!0,this},r.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},r.prototype.parent=function(e){if(this._isCompound){var r=this._parent[e];if(r!==t)return r}},r.prototype.children=function(r){if(e.isUndefined(r)&&(r=t),this._isCompound){var n=this._children[r];if(n)return e.keys(n)}else{if(r===t)return this.nodes();if(this.hasNode(r))return[]}},r.prototype.predecessors=function(t){var r=this._preds[t];if(r)return e.keys(r)},r.prototype.successors=function(t){var r=this._sucs[t];if(r)return e.keys(r)},r.prototype.neighbors=function(t){var r=this.predecessors(t);if(r)return e.union(r,this.successors(t))},r.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},r.prototype.filterNodes=function(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;e.each(this._nodes,function(e,n){t(n)&&r.setNode(n,e)}),e.each(this._edgeObjs,function(e){r.hasNode(e.v)&&r.hasNode(e.w)&&r.setEdge(e,n.edge(e))});var o={};function i(e){var t=n.parent(e);return void 0===t||r.hasNode(t)?(o[e]=t,t):t in o?o[t]:i(t)}return this._isCompound&&e.each(r.nodes(),function(e){r.setParent(e,i(e))}),r},r.prototype.setDefaultEdgeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultEdgeLabelFn=t,this},r.prototype.edgeCount=function(){return this._edgeCount},r.prototype.edges=function(){return e.values(this._edgeObjs)},r.prototype.setPath=function(t,r){var n=this,o=arguments;return e.reduce(t,function(e,t){return o.length>1?n.setEdge(e,t,r):n.setEdge(e,t),t}),this},r.prototype.setEdge=function(){var t,r,o,u,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,r=s.w,o=s.name,2===arguments.length&&(u=arguments[1],a=!0)):(t=s,r=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),t=""+t,r=""+r,e.isUndefined(o)||(o=""+o);var c=i(this._isDirected,t,r,o);if(e.has(this._edgeLabels,c))return a&&(this._edgeLabels[c]=u),this;if(!e.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[c]=a?u:this._defaultEdgeLabelFn(t,r,o);var f=function(e,t,r,n){var o=""+t,i=""+r;if(!e&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};n&&(a.name=n);return a}(this._isDirected,t,r,o);return t=f.v,r=f.w,Object.freeze(f),this._edgeObjs[c]=f,n(this._preds[r],t),n(this._sucs[t],r),this._in[r][c]=f,this._out[t][c]=f,this._edgeCount++,this},r.prototype.edge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return this._edgeLabels[n]},r.prototype.hasEdge=function(t,r,n){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,t,r,n);return e.has(this._edgeLabels,o)},r.prototype.removeEdge=function(e,t,r){var n=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r),a=this._edgeObjs[n];return a&&(e=a.v,t=a.w,delete this._edgeLabels[n],delete this._edgeObjs[n],o(this._preds[t],e),o(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(t,r){var n=this._in[t];if(n){var o=e.values(n);return r?e.filter(o,function(e){return e.v===r}):o}},r.prototype.outEdges=function(t,r){var n=this._out[t];if(n){var o=e.values(n);return r?e.filter(o,function(e){return e.w===r}):o}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);if(r)return r.concat(this.outEdges(e,t))},Yc}function Wd(){if(Xc)return Qc;Xc=1;var e=Bd(),t=$d();function r(t){return e.map(t.nodes(),function(r){var n=t.node(r),o=t.parent(r),i={v:r};return e.isUndefined(n)||(i.value=n),e.isUndefined(o)||(i.parent=o),i})}function n(t){return e.map(t.edges(),function(r){var n=t.edge(r),o={v:r.v,w:r.w};return e.isUndefined(r.name)||(o.name=r.name),e.isUndefined(n)||(o.value=n),o})}return Qc={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:r(t),edges:n(t)};e.isUndefined(t.graph())||(o.value=e.clone(t.graph()));return o},read:function(r){var n=new t(r.options).setGraph(r.value);return e.each(r.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),e.each(r.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}}}function Yd(){if(tf)return ef;tf=1;var e=Bd();return ef=function(t){var r,n={},o=[];function i(o){e.has(n,o)||(n[o]=!0,r.push(o),e.each(t.successors(o),i),e.each(t.predecessors(o),i))}return e.each(t.nodes(),function(e){r=[],i(e),r.length&&o.push(r)}),o}}function Jd(){if(nf)return rf;nf=1;var e=Bd();function t(){this._arr=[],this._keyIndices={}}return rf=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(t){return e.has(this._keyIndices,t)},t.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,r){var n=this._keyIndices;if(t=String(t),!e.has(n,t)){var o=this._arr,i=o.length;return n[t]=i,o.push({key:t,priority:r}),this._decrease(i),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)},t.prototype._heapify=function(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))},t.prototype._decrease=function(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t},t.prototype._swap=function(e,t){var r=this._arr,n=this._keyIndices,o=r[e],i=r[t];r[e]=i,r[t]=o,n[i.key]=e,n[o.key]=t},rf}function qd(){if(uf)return of;uf=1;var e=Bd(),t=Jd();of=function(e,n,o,i){return function(e,r,n,o){var i,u,a={},s=new t,c=function(e){var t=e.v!==i?e.v:e.w,r=a[t],o=n(e),c=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<r.distance&&(r.distance=c,r.predecessor=i,s.decrease(t,c))};e.nodes().forEach(function(e){var t=e===r?0:Number.POSITIVE_INFINITY;a[e]={distance:t},s.add(e,t)});for(;s.size()>0&&(i=s.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(c);return a}(e,String(n),o||r,i||function(t){return e.outEdges(t)})};var r=e.constant(1);return of}function Hd(){if(sf)return af;sf=1;var e=qd(),t=Bd();return af=function(r,n,o){return t.transform(r.nodes(),function(t,i){t[i]=e(r,i,n,o)},{})}}function Kd(){if(ff)return cf;ff=1;var e=Bd();return cf=function(t){var r=0,n=[],o={},i=[];function u(a){var s=o[a]={onStack:!0,lowlink:r,index:r++};if(n.push(a),t.successors(a).forEach(function(t){e.has(o,t)?o[t].onStack&&(s.lowlink=Math.min(s.lowlink,o[t].index)):(u(t),s.lowlink=Math.min(s.lowlink,o[t].lowlink))}),s.lowlink===s.index){var c,f=[];do{c=n.pop(),o[c].onStack=!1,f.push(c)}while(a!==c);i.push(f)}}return t.nodes().forEach(function(t){e.has(o,t)||u(t)}),i}}function Zd(){if(lf)return df;lf=1;var e=Bd(),t=Kd();return df=function(r){return e.filter(t(r),function(e){return e.length>1||1===e.length&&r.hasEdge(e[0],e[0])})}}function Qd(){if(pf)return hf;pf=1;var e=Bd();hf=function(e,r,n){return function(e,t,r){var n={},o=e.nodes();return o.forEach(function(e){n[e]={},n[e][e]={distance:0},o.forEach(function(t){e!==t&&(n[e][t]={distance:Number.POSITIVE_INFINITY})}),r(e).forEach(function(r){var o=r.v===e?r.w:r.v,i=t(r);n[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=n[e];o.forEach(function(r){var i=n[r];o.forEach(function(r){var n=i[e],o=t[r],u=i[r],a=n.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)})})}),n}(e,r||t,n||function(t){return e.outEdges(t)})};var t=e.constant(1);return hf}function Xd(){if(gf)return vf;gf=1;var e=Bd();function t(t){var n={},o={},i=[];if(e.each(t.sinks(),function u(a){if(e.has(o,a))throw new r;e.has(n,a)||(o[a]=!0,n[a]=!0,e.each(t.predecessors(a),u),delete o[a],i.push(a))}),e.size(n)!==t.nodeCount())throw new r;return i}function r(){}return vf=t,t.CycleException=r,r.prototype=new Error,vf}function el(){if(mf)return yf;mf=1;var e=Xd();return yf=function(t){try{e(t)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}}function tl(){if(wf)return bf;wf=1;var e=Bd();function t(r,n,o,i,u,a){e.has(i,n)||(i[n]=!0,o||a.push(n),e.each(u(n),function(e){t(r,e,o,i,u,a)}),o&&a.push(n))}return bf=function(r,n,o){e.isArray(n)||(n=[n]);var i=(r.isDirected()?r.successors:r.neighbors).bind(r),u=[],a={};return e.each(n,function(e){if(!r.hasNode(e))throw new Error("Graph does not have node: "+e);t(r,e,"post"===o,a,i,u)}),u}}function rl(){if(Ef)return _f;Ef=1;var e=tl();return _f=function(t,r){return e(t,r,"post")}}function nl(){if(Of)return jf;Of=1;var e=tl();return jf=function(t,r){return e(t,r,"pre")}}function ol(){if(Nf)return kf;Nf=1;var e=Bd(),t=$d(),r=Jd();return kf=function(n,o){var i,u=new t,a={},s=new r;function c(e){var t=e.v===i?e.w:e.v,r=s.priority(t);if(void 0!==r){var n=o(e);n<r&&(a[t]=i,s.decrease(t,n))}}if(0===n.nodeCount())return u;e.each(n.nodes(),function(e){s.add(e,Number.POSITIVE_INFINITY),u.setNode(e)}),s.decrease(n.nodes()[0],0);var f=!1;for(;s.size()>0;){if(i=s.removeMin(),e.has(a,i))u.setEdge(i,a[i]);else{if(f)throw new Error("Input graph is not connected: "+n);f=!0}n.nodeEdges(i).forEach(c)}return u}}var il=function(){if(Sf)return Cf;Sf=1;var e=Zc?Kc:(Zc=1,Kc={Graph:$d(),version:Hc?qc:(Hc=1,qc="2.1.8")});return Cf={Graph:e.Graph,json:Wd(),alg:xf?If:(xf=1,If={components:Yd(),dijkstra:qd(),dijkstraAll:Hd(),findCycles:Zd(),floydWarshall:Qd(),isAcyclic:el(),postorder:rl(),preorder:nl(),prim:ol(),tarjan:Kd(),topsort:Xd()}),version:e.version}}();function ul(){const{findNode:e}=o(),t=r(new il.Graph({directed:!0}));return{graph:t,layout:function(r,n,o="TB"){const u=new Yt.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:o});const a="LR"===o;for(const t of r){const r=e(t.id);u.setNode(t.id,{width:r?.dimensions.width||150,height:r?.dimensions.height||50})}for(const e of n)u.setEdge(e.source,e.target);Yt.layout(u);const s=new il.Graph({directed:!0});for(const e of r)s.setNode(e.id);for(const e of n)s.setEdge(e.source,e.target);return t.value=s,r.map(e=>{const t=u.node(e.id);return{...e,targetPosition:a?i.Left:i.Top,sourcePosition:a?i.Right:i.Bottom,position:{x:t.x,y:t.y}}})}}}const al={};function sl(e){if(al[e])return al[e];const t=n(e,null);if(!t){console.warn(`[whitelabel-modules] Missing injected composable: ${e}. Will retry on next call.`);const t=(...t)=>{const r=n(e,null);if(!r)throw new Error(`[whitelabel-modules] ${e} still not provided.`);return al[e]=r,r(...t)};return al[e]=t,t}return al[e]=t,t}const cl=()=>sl("cms-useIntegrationActionBuilder")(),fl=()=>sl("cms-useIntegrations")(),dl=()=>sl("cms-useAgencyIntegrations")(),ll=e=>sl("cms-useIntegrationActions")(e),hl=()=>sl("cms-useMediaLibrary")(),pl=()=>sl("cms-useProjectService")(),vl=()=>sl("cms-useAgentService")(),gl=e=>sl("cms-useModuleBreadcrumbs")(e),yl=()=>sl("cms-useQueryBuilder")(),ml=()=>sl("cms-useModule")(),bl=()=>sl("cms-useModulePermissions")(),wl=()=>sl("cms-useModuleRoute")(),_l=()=>sl("cms-useModuleStorage")(),El=()=>sl("cms-useLogs")(),jl=()=>sl("cms-useUtilsService")(),Ol=()=>sl("cms-useFormBuilder")(),kl=()=>sl("cms-useFlowBuilder")(),Nl=()=>sl("cms-useConfirmation")(),Il=e=>sl("cms-useFirebaseIntegration")(e),xl=e=>sl("cms-useMailer")(e),Cl=e=>sl("cms-useAI")(e),Sl=()=>sl("cms-useProjectSettings")(),Ml=()=>sl("cms-useCustomDialog")(),Al=()=>sl("cms-useModuleOverlay")(),Ll=()=>sl("cms-useModuleApi")(),Pl=e=>sl("cms-useGoogleServiceAccountIntegration")(e),Fl=()=>sl("cms-useOverlayParams")(),Tl=()=>sl("cms-useRoute")(),Dl=()=>sl("cms-useRouter")(),Rl=()=>sl("cms-useOverlayStack")();export{Fl as A,Rl as B,pl as C,Sl as D,yl as E,Tl as F,Dl as G,_ as H,jl as I,w as P,dl as a,vl as b,Nl as c,Ml as d,Il as e,d as f,ft as g,kl as h,a as i,Ol as j,Pl as k,cl as l,ll as m,fl as n,ul as o,El as p,xl as q,hl as r,ml as s,Ll as t,Cl as u,gl as v,Al as w,bl as x,wl as y,_l as z};
package/dist/index.d.ts CHANGED
@@ -229,6 +229,32 @@ export declare const useAgencyIntegrations: () => {
229
229
  getAgencyIntegration: (integrationId: string) => Promise<any>;
230
230
  };
231
231
 
232
+ export declare type UseAgentService = () => {
233
+ getProjectAgents: (projectId: string) => Promise<Array<{
234
+ id: string;
235
+ name: string;
236
+ [key: string]: any;
237
+ }>>;
238
+ getAgentCollaborators: (projectSlug: string, agentId: string) => Promise<string[]>;
239
+ flowCreateConversation: (projectSlug: string, agentId: string, payload: {
240
+ userId: string;
241
+ message: string;
242
+ title?: string;
243
+ }) => Promise<{
244
+ conversationId: string;
245
+ messageId: string | null;
246
+ }>;
247
+ flowAddAgentMessage: (projectSlug: string, agentId: string, payload: {
248
+ conversationId: string;
249
+ message: string;
250
+ }) => Promise<{
251
+ conversationId: string;
252
+ messageId: string | null;
253
+ }>;
254
+ };
255
+
256
+ export declare const useAgentService: () => ReturnType<UseAgentService>;
257
+
232
258
  export declare type UseAI = (integrationId: string) => {
233
259
  generateObject: (schema: any, prompt: string, options?: any) => Promise<any>;
234
260
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneclick.dev/cms-kit",
3
- "version": "0.0.132",
3
+ "version": "0.0.133",
4
4
  "type": "module",
5
5
  "main": "./dist/cms-kit.cjs",
6
6
  "module": "./dist/cms-kit.js",